From 9f4d870fa514a90b51c5871f8cc9122c2ca58a24 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Tue, 16 Jan 2024 20:23:09 +0100 Subject: [PATCH 01/52] [java] SingletonClassReturningNewInstance - fix double assignment case Fixes #932 --- docs/pages/release_notes.md | 2 + ...ingletonClassReturningNewInstanceRule.java | 37 ++++++++++++++++++- .../SingletonClassReturningNewInstance.xml | 22 +++++++++++ 3 files changed, 60 insertions(+), 1 deletion(-) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index cbf09dab12..2089fa1c28 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -141,6 +141,7 @@ in the Migration Guide. * [#174](https://github.com/pmd/pmd/issues/174): \[java] SingularField false positive with switch in method that both assigns and reads field * java-errorprone * [#718](https://github.com/pmd/pmd/issues/718): \[java] BrokenNullCheck false positive with parameter/field confusion + * [#932](https://github.com/pmd/pmd/issues/932): \[java] SingletonClassReturningNewInstance false positive with double assignment * [#1831](https://github.com/pmd/pmd/issues/1831): \[java] DetachedTestCase reports abstract methods * [#4719](https://github.com/pmd/pmd/pull/4719): \[java] UnnecessaryCaseChange: example doc toUpperCase() should compare to a capitalized string * javascript @@ -765,6 +766,7 @@ Language specific fixes: * java-errorprone * [#659](https://github.com/pmd/pmd/issues/659): \[java] MissingBreakInSwitch - last default case does not contain a break * [#718](https://github.com/pmd/pmd/issues/718): \[java] BrokenNullCheck false positive with parameter/field confusion + * [#932](https://github.com/pmd/pmd/issues/932): \[java] SingletonClassReturningNewInstance false positive with double assignment * [#1005](https://github.com/pmd/pmd/issues/1005): \[java] CloneMethodMustImplementCloneable triggers for interfaces * [#1669](https://github.com/pmd/pmd/issues/1669): \[java] NullAssignment - FP with ternay and null as constructor argument * [#1831](https://github.com/pmd/pmd/issues/1831): \[java] DetachedTestCase reports abstract methods diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/SingletonClassReturningNewInstanceRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/SingletonClassReturningNewInstanceRule.java index 7975519f17..a4ebc7e775 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/SingletonClassReturningNewInstanceRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/SingletonClassReturningNewInstanceRule.java @@ -6,12 +6,15 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; import net.sourceforge.pmd.lang.ast.NodeStream; import net.sourceforge.pmd.lang.ast.NodeStream.DescendantNodeStream; +import net.sourceforge.pmd.lang.java.ast.ASTAssignableExpr; +import net.sourceforge.pmd.lang.java.ast.ASTAssignmentExpression; import net.sourceforge.pmd.lang.java.ast.ASTConstructorCall; import net.sourceforge.pmd.lang.java.ast.ASTMethodDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTReturnStatement; import net.sourceforge.pmd.lang.java.ast.ASTVariableAccess; import net.sourceforge.pmd.lang.java.ast.internal.JavaAstUtils; import net.sourceforge.pmd.lang.java.rule.AbstractJavaRulechainRule; +import net.sourceforge.pmd.lang.java.symbols.JVariableSymbol; public class SingletonClassReturningNewInstanceRule extends AbstractJavaRulechainRule { @@ -37,6 +40,38 @@ public class SingletonClassReturningNewInstanceRule extends AbstractJavaRulechai } private boolean returnsLocalVariables(NodeStream returns) { - return returns.children(ASTVariableAccess.class).filter(JavaAstUtils::isReferenceToLocal).nonEmpty(); + return returns.children(ASTVariableAccess.class) + .filter(JavaAstUtils::isReferenceToLocal) + .filterNot(this::isDoubleAssignment) + .nonEmpty(); } + + private boolean isDoubleAssignment(ASTVariableAccess variableAccess) { + // search in the whole method + return variableAccess.ancestors(ASTMethodDeclaration.class) + .descendants(ASTVariableAccess.class) + // for any writes + .filter(v -> v.getAccessType() == ASTAssignableExpr.AccessType.WRITE) + // to the same variable + .filter(v -> JavaAstUtils.isReferenceToSameVar(variableAccess, v)) + // assignment from a constructor call (next sibling = right hand side) + .filter(v -> v.getNextSibling() instanceof ASTConstructorCall) + // and double assignment + .filter(v -> v.getParent() instanceof ASTAssignmentExpression && v.getParent().getParent() instanceof ASTAssignmentExpression) + .filter(v -> { + ASTAssignmentExpression rightAssignment = (ASTAssignmentExpression) v.getParent(); + ASTAssignmentExpression leftAssignment = (ASTAssignmentExpression) v.getParent().getParent(); + + boolean fromConstructor = rightAssignment.getRightOperand() instanceof ASTConstructorCall; + boolean fromRightToLeft = leftAssignment.getRightOperand() == rightAssignment; + boolean leftIsField = false; + if (leftAssignment.getLeftOperand() instanceof ASTAssignableExpr.ASTNamedReferenceExpr) { + JVariableSymbol symbol = ((ASTAssignableExpr.ASTNamedReferenceExpr) leftAssignment.getLeftOperand()).getReferencedSym(); + leftIsField = symbol.isField(); + } + return fromConstructor && fromRightToLeft && leftIsField; + }) + .nonEmpty(); + } + } diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/SingletonClassReturningNewInstance.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/SingletonClassReturningNewInstance.xml index df702066b5..5fa7a23d17 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/SingletonClassReturningNewInstance.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/SingletonClassReturningNewInstance.xml @@ -57,4 +57,26 @@ public class Singleton { } ]]> + + + [java] SingletonClassReturningNewInstance false positive with double assignment #932 + 0 + + From 023e51e67fe3f02136fab1fbdc57f98038e39a9c Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Wed, 17 Jan 2024 18:02:45 +0100 Subject: [PATCH 02/52] [java] SingletonClassReturningNewInstance - variant 2 (#932) --- ...ingletonClassReturningNewInstanceRule.java | 50 ++++++++++++++----- .../SingletonClassReturningNewInstance.xml | 28 +++++++++-- 2 files changed, 62 insertions(+), 16 deletions(-) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/SingletonClassReturningNewInstanceRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/SingletonClassReturningNewInstanceRule.java index a4ebc7e775..52921f547d 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/SingletonClassReturningNewInstanceRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/SingletonClassReturningNewInstanceRule.java @@ -54,22 +54,46 @@ public class SingletonClassReturningNewInstanceRule extends AbstractJavaRulechai .filter(v -> v.getAccessType() == ASTAssignableExpr.AccessType.WRITE) // to the same variable .filter(v -> JavaAstUtils.isReferenceToSameVar(variableAccess, v)) - // assignment from a constructor call (next sibling = right hand side) - .filter(v -> v.getNextSibling() instanceof ASTConstructorCall) - // and double assignment - .filter(v -> v.getParent() instanceof ASTAssignmentExpression && v.getParent().getParent() instanceof ASTAssignmentExpression) + // assignment from a constructor call (next sibling = right hand side) or another Assignment + .filter(v -> v.getNextSibling() instanceof ASTConstructorCall || v.getNextSibling() instanceof ASTAssignmentExpression) + // check for both variants .filter(v -> { - ASTAssignmentExpression rightAssignment = (ASTAssignmentExpression) v.getParent(); - ASTAssignmentExpression leftAssignment = (ASTAssignmentExpression) v.getParent().getParent(); + boolean variant1 = false; + boolean variant2 = false; - boolean fromConstructor = rightAssignment.getRightOperand() instanceof ASTConstructorCall; - boolean fromRightToLeft = leftAssignment.getRightOperand() == rightAssignment; - boolean leftIsField = false; - if (leftAssignment.getLeftOperand() instanceof ASTAssignableExpr.ASTNamedReferenceExpr) { - JVariableSymbol symbol = ((ASTAssignableExpr.ASTNamedReferenceExpr) leftAssignment.getLeftOperand()).getReferencedSym(); - leftIsField = symbol.isField(); + // check variant 1: field = localVar = new Singleton() + if (v.getNextSibling() instanceof ASTConstructorCall) { + if (v.getParent() instanceof ASTAssignmentExpression && v.getParent().getParent() instanceof ASTAssignmentExpression) { + ASTAssignmentExpression leftAssignment = (ASTAssignmentExpression) v.getParent().getParent(); + ASTAssignmentExpression rightAssignment = (ASTAssignmentExpression) v.getParent(); + + boolean fromConstructor = rightAssignment.getRightOperand() instanceof ASTConstructorCall; + boolean fromRightToLeft = leftAssignment.getRightOperand() == rightAssignment; + boolean leftIsField = false; + if (leftAssignment.getLeftOperand() instanceof ASTAssignableExpr.ASTNamedReferenceExpr) { + JVariableSymbol symbol = ((ASTAssignableExpr.ASTNamedReferenceExpr) leftAssignment.getLeftOperand()).getReferencedSym(); + leftIsField = symbol != null && symbol.isField(); + } + variant1 = fromConstructor && fromRightToLeft && leftIsField; + } + + // check variant 2: localVar = field = new Singleton() + } else if (v.getNextSibling() instanceof ASTAssignmentExpression) { + if (v.getParent() instanceof ASTAssignmentExpression) { + ASTAssignmentExpression leftAssignment = (ASTAssignmentExpression) v.getParent(); + ASTAssignmentExpression rightAssignment = (ASTAssignmentExpression) v.getNextSibling(); + + boolean fromConstructor = rightAssignment.getRightOperand() instanceof ASTConstructorCall; + boolean fromRightToLeft = leftAssignment.getRightOperand() == rightAssignment; + boolean rightIsField = false; + if (rightAssignment.getLeftOperand() instanceof ASTAssignableExpr.ASTNamedReferenceExpr) { + JVariableSymbol symbol = ((ASTAssignableExpr.ASTNamedReferenceExpr) rightAssignment.getLeftOperand()).getReferencedSym(); + rightIsField = symbol != null && symbol.isField(); + } + variant2 = fromConstructor && fromRightToLeft && rightIsField; + } } - return fromConstructor && fromRightToLeft && leftIsField; + return variant1 || variant2; }) .nonEmpty(); } diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/SingletonClassReturningNewInstance.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/SingletonClassReturningNewInstance.xml index 5fa7a23d17..fb8ac71d02 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/SingletonClassReturningNewInstance.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/SingletonClassReturningNewInstance.xml @@ -59,7 +59,7 @@ public class Singleton { - [java] SingletonClassReturningNewInstance false positive with double assignment #932 + [java] SingletonClassReturningNewInstance false positive with double assignment #932 - variant 1 0 + + + + [java] SingletonClassReturningNewInstance false positive with double assignment #932 - variant 2 + 0 + Date: Thu, 15 Feb 2024 09:12:47 +0100 Subject: [PATCH 03/52] [java] Add new java language versions 22 and 22-preview --- docs/pages/pmd/languages/java.md | 8 +++++--- docs/pages/pmd/userdocs/tools/ant.md | 2 +- .../java/net/sourceforge/pmd/it/BinaryDistributionIT.java | 1 + .../net/sourceforge/pmd/lang/java/JavaLanguageModule.java | 6 ++++-- .../sourceforge/pmd/lang/java/JavaLanguageModuleTest.java | 6 +++--- .../sourceforge/pmd/lang/java/LanguageVersionTest.java | 4 +++- .../net/sourceforge/pmd/lang/java/ast/KotlinTestingDsl.kt | 3 ++- 7 files changed, 19 insertions(+), 11 deletions(-) diff --git a/docs/pages/pmd/languages/java.md b/docs/pages/pmd/languages/java.md index 6354280cae..fd6397eb45 100644 --- a/docs/pages/pmd/languages/java.md +++ b/docs/pages/pmd/languages/java.md @@ -15,8 +15,10 @@ Usually the latest non-preview Java Version is the default version. | Java Version | Alias | Supported by PMD since | |--------------|-------|------------------------| +| 22-preview | | 7.0.0 | +| 22 (default) | | 7.0.0 | | 21-preview | | 7.0.0 | -| 21 (default) | | 7.0.0 | +| 21 | | 7.0.0 | | 20-preview | | 6.55.0 | | 20 | | 6.55.0 | | 19 | | 6.48.0 | @@ -40,10 +42,10 @@ Usually the latest non-preview Java Version is the default version. ## Using Java preview features In order to analyze a project with PMD that uses preview language features, you'll need to enable -it via the environment variable `PMD_JAVA_OPTS` and select the new language version, e.g. `21-preview`: +it via the environment variable `PMD_JAVA_OPTS` and select the new language version, e.g. `22-preview`: export PMD_JAVA_OPTS=--enable-preview - pmd check --use-version java-21-preview ... + pmd check --use-version java-22-preview ... Note: we only support preview language features for the latest two java versions. diff --git a/docs/pages/pmd/userdocs/tools/ant.md b/docs/pages/pmd/userdocs/tools/ant.md index f259bc7149..4c81ff7daf 100644 --- a/docs/pages/pmd/userdocs/tools/ant.md +++ b/docs/pages/pmd/userdocs/tools/ant.md @@ -212,7 +212,7 @@ accordingly and this rule won't be executed. The specific version of a language to be used is selected via the `sourceLanguage` nested element. Example: - + The available versions depend on the language. You can get a list of the currently supported language versions via the CLI option `--help`. diff --git a/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java b/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java index 57c5de0638..f77532acb4 100644 --- a/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java +++ b/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java @@ -51,6 +51,7 @@ class BinaryDistributionIT extends AbstractBinaryDistributionTest { "java-16", "java-17", "java-18", "java-19", "java-20", "java-20-preview", "java-21", "java-21-preview", + "java-22", "java-22-preview", "java-5", "java-6", "java-7", "java-8", "java-9", "jsp-2", "jsp-3", "kotlin-1.6", "kotlin-1.7", "kotlin-1.8", "modelica-3.4", "modelica-3.5", diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/JavaLanguageModule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/JavaLanguageModule.java index 562b6365e6..fc7a738088 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/JavaLanguageModule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/JavaLanguageModule.java @@ -43,8 +43,10 @@ public class JavaLanguageModule extends LanguageModuleBase implements PmdCapable .addVersion("19") .addVersion("20") .addVersion("20-preview") - .addDefaultVersion("21") // 21 is the default - .addVersion("21-preview")); + .addVersion("21") + .addVersion("21-preview") + .addDefaultVersion("22") // 22 is the default + .addVersion("22-preview")); } public static JavaLanguageModule getInstance() { diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/JavaLanguageModuleTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/JavaLanguageModuleTest.java index 4655032327..cdf292b34f 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/JavaLanguageModuleTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/JavaLanguageModuleTest.java @@ -24,10 +24,10 @@ class JavaLanguageModuleTest { @Test void previewVersionShouldBeGreaterThanNonPreview() { - LanguageVersion java20 = JavaLanguageModule.getInstance().getVersion("20"); - LanguageVersion java20p = JavaLanguageModule.getInstance().getVersion("20-preview"); + LanguageVersion java = JavaLanguageModule.getInstance().getVersion("22"); + LanguageVersion javaPreview = JavaLanguageModule.getInstance().getVersion("22-preview"); - assertTrue(java20p.compareTo(java20) > 0, "java20-preview should be greater than java20"); + assertTrue(javaPreview.compareTo(java) > 0, "java-preview should be greater than java"); } @Test diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/LanguageVersionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/LanguageVersionTest.java index 47f1619085..eea0472371 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/LanguageVersionTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/LanguageVersionTest.java @@ -40,8 +40,10 @@ class LanguageVersionTest extends AbstractLanguageVersionTest { new TestDescriptor(java, "20-preview"), new TestDescriptor(java, "21"), new TestDescriptor(java, "21-preview"), + new TestDescriptor(java, "22"), + new TestDescriptor(java, "22-preview"), - defaultVersionIs(java, "21"), + defaultVersionIs(java, "22"), // this one won't be found: case-sensitive! versionDoesNotExist("JAVA", "JAVA", "1.7"), diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/KotlinTestingDsl.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/KotlinTestingDsl.kt index 791df7c2a3..638f2d35bb 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 @@ -35,7 +35,8 @@ enum class JavaVersion : Comparable { J18, J19, J20, J20__PREVIEW, - J21, J21__PREVIEW; + J21, J21__PREVIEW, + J22, J22__PREVIEW; /** Name suitable for use with e.g. [JavaParsingHelper.parse] */ val pmdName: String = name.removePrefix("J").replaceFirst("__", "-").replace('_', '.').lowercase() From c4620635ee7d2bb741ade27bf1c1c96c7ae518cf Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 15 Feb 2024 09:15:20 +0100 Subject: [PATCH 04/52] Update asm dependency to 9.6 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8704c34564..e7de1314a5 100644 --- a/pom.xml +++ b/pom.xml @@ -679,7 +679,7 @@ org.ow2.asm asm - 9.5 + 9.6 org.pcollections From 2a53ebaa55a0ab048c5ff1cc360b827bbb64e127 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 15 Feb 2024 09:17:40 +0100 Subject: [PATCH 05/52] [java] Remove java language version 20-preview --- docs/pages/pmd/languages/java.md | 1 - docs/pages/release_notes.md | 4 + .../pmd/it/BinaryDistributionIT.java | 2 +- .../pmd/lang/java/JavaLanguageModule.java | 1 - .../pmd/lang/java/LanguageVersionTest.java | 3 +- .../lang/java/ast/AllJavaAstTreeDumpTest.java | 1 - .../java/ast/Java20PreviewTreeDumpTest.java | 112 ---- .../java/rule/internal/DataflowPassTest.java | 6 +- .../pmd/lang/java/ast/KotlinTestingDsl.kt | 2 +- .../java20p/DealingWithNull.java | 93 --- .../java20p/DealingWithNull.txt | 347 ----------- .../java20p/EnhancedTypeCheckingSwitch.java | 39 -- .../java20p/EnhancedTypeCheckingSwitch.txt | 188 ------ .../java20p/ExhaustiveSwitch.java | 87 --- .../java20p/ExhaustiveSwitch.txt | 365 ------------ .../GuardedAndParenthesizedPatterns.java | 90 --- .../GuardedAndParenthesizedPatterns.txt | 422 ------------- .../java20p/PatternsInSwitchLabels.java | 22 - .../java20p/PatternsInSwitchLabels.txt | 89 --- .../java20p/RecordPatterns.java | 100 ---- .../java20p/RecordPatterns.txt | 557 ------------------ .../RecordPatternsExhaustiveSwitch.java | 37 -- .../RecordPatternsExhaustiveSwitch.txt | 237 -------- .../java20p/RecordPatternsInEnhancedFor.java | 43 -- .../java20p/RecordPatternsInEnhancedFor.txt | 215 ------- .../java20p/RefiningPatternsInSwitch.java | 77 --- .../java20p/RefiningPatternsInSwitch.txt | 257 -------- .../ScopeOfPatternVariableDeclarations.java | 64 -- .../ScopeOfPatternVariableDeclarations.txt | 200 ------- 29 files changed, 10 insertions(+), 3651 deletions(-) delete mode 100644 pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java20PreviewTreeDumpTest.java delete mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/DealingWithNull.java delete mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/DealingWithNull.txt delete mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/EnhancedTypeCheckingSwitch.java delete mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/EnhancedTypeCheckingSwitch.txt delete mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ExhaustiveSwitch.java delete mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ExhaustiveSwitch.txt delete mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/GuardedAndParenthesizedPatterns.java delete mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/GuardedAndParenthesizedPatterns.txt delete mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/PatternsInSwitchLabels.java delete mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/PatternsInSwitchLabels.txt delete mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatterns.java delete mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatterns.txt delete mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsExhaustiveSwitch.java delete mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsExhaustiveSwitch.txt delete mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsInEnhancedFor.java delete mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsInEnhancedFor.txt delete mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RefiningPatternsInSwitch.java delete mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RefiningPatternsInSwitch.txt delete mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ScopeOfPatternVariableDeclarations.java delete mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ScopeOfPatternVariableDeclarations.txt diff --git a/docs/pages/pmd/languages/java.md b/docs/pages/pmd/languages/java.md index fd6397eb45..83717461d5 100644 --- a/docs/pages/pmd/languages/java.md +++ b/docs/pages/pmd/languages/java.md @@ -19,7 +19,6 @@ Usually the latest non-preview Java Version is the default version. | 22 (default) | | 7.0.0 | | 21-preview | | 7.0.0 | | 21 | | 7.0.0 | -| 20-preview | | 6.55.0 | | 20 | | 6.55.0 | | 19 | | 6.48.0 | | 18 | | 6.44.0 | diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 7febf0e6ee..510d9a5fbf 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -232,6 +232,10 @@ The rules have been moved into categories with PMD 6. #### API Changes +**pmd-java** + +* Support for Java 20 preview language features have been removed. The version "20-preview" is no longer available. + **New API** The API around {%jdoc core::util.treeexport.TreeRenderer %} has been declared as stable. It was previously diff --git a/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java b/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java index f77532acb4..360d01d204 100644 --- a/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java +++ b/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java @@ -49,7 +49,7 @@ class BinaryDistributionIT extends AbstractBinaryDistributionTest { "java-1.6", "java-1.7", "java-1.8", "java-1.9", "java-10", "java-11", "java-12", "java-13", "java-14", "java-15", "java-16", "java-17", "java-18", "java-19", - "java-20", "java-20-preview", + "java-20", "java-21", "java-21-preview", "java-22", "java-22-preview", "java-5", "java-6", "java-7", diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/JavaLanguageModule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/JavaLanguageModule.java index fc7a738088..393a5983ef 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/JavaLanguageModule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/JavaLanguageModule.java @@ -42,7 +42,6 @@ public class JavaLanguageModule extends LanguageModuleBase implements PmdCapable .addVersion("18") .addVersion("19") .addVersion("20") - .addVersion("20-preview") .addVersion("21") .addVersion("21-preview") .addDefaultVersion("22") // 22 is the default diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/LanguageVersionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/LanguageVersionTest.java index eea0472371..ce23b99db0 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/LanguageVersionTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/LanguageVersionTest.java @@ -37,7 +37,6 @@ class LanguageVersionTest extends AbstractLanguageVersionTest { new TestDescriptor(java, "18"), new TestDescriptor(java, "19"), new TestDescriptor(java, "20"), - new TestDescriptor(java, "20-preview"), new TestDescriptor(java, "21"), new TestDescriptor(java, "21-preview"), new TestDescriptor(java, "22"), @@ -48,7 +47,7 @@ class LanguageVersionTest extends AbstractLanguageVersionTest { // this one won't be found: case-sensitive! versionDoesNotExist("JAVA", "JAVA", "1.7"), // not supported anymore - versionDoesNotExist(java, "19-preview") + versionDoesNotExist(java, "20-preview") ); } } diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/AllJavaAstTreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/AllJavaAstTreeDumpTest.java index 850d2d5f90..42794be992 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/AllJavaAstTreeDumpTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/AllJavaAstTreeDumpTest.java @@ -15,7 +15,6 @@ import org.junit.platform.suite.api.Suite; Java15TreeDumpTest.class, Java16TreeDumpTest.class, Java17TreeDumpTest.class, - Java20PreviewTreeDumpTest.class, Java21TreeDumpTest.class, Java21PreviewTreeDumpTest.class }) diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java20PreviewTreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java20PreviewTreeDumpTest.java deleted file mode 100644 index fec894662d..0000000000 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java20PreviewTreeDumpTest.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -package net.sourceforge.pmd.lang.java.ast; - -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.junit.jupiter.api.Assertions.assertTrue; - -import org.junit.jupiter.api.Test; - -import net.sourceforge.pmd.lang.ast.ParseException; -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; -import net.sourceforge.pmd.lang.java.BaseJavaTreeDumpTest; -import net.sourceforge.pmd.lang.java.JavaParsingHelper; - -class Java20PreviewTreeDumpTest extends BaseJavaTreeDumpTest { - private final JavaParsingHelper java20p = - JavaParsingHelper.DEFAULT.withDefaultVersion("20-preview") - .withResourceContext(Java20PreviewTreeDumpTest.class, "jdkversiontests/java20p/"); - private final JavaParsingHelper java20 = java20p.withDefaultVersion("20"); - - @Override - public BaseParsingHelper getParser() { - return java20p; - } - - @Test - void dealingWithNullBeforeJava20Preview() { - ParseException thrown = assertThrows(ParseException.class, () -> java20.parseResource("DealingWithNull.java")); - assertTrue(thrown.getMessage().contains("Null in switch cases is a preview feature of JDK 20, you should select your language version accordingly"), - "Unexpected message: " + thrown.getMessage()); - } - - @Test - void dealingWithNull() { - doTest("DealingWithNull"); - } - - @Test - void enhancedTypeCheckingSwitch() { - doTest("EnhancedTypeCheckingSwitch"); - } - - @Test - void exhaustiveSwitch() { - doTest("ExhaustiveSwitch"); - } - - @Test - void guardedAndParenthesizedPatternsBeforeJava20Preview() { - ParseException thrown = assertThrows(ParseException.class, () -> java20.parseResource("GuardedAndParenthesizedPatterns.java")); - assertTrue(thrown.getMessage().contains("Patterns in switch statements is a preview feature of JDK 20, you should select your language version accordingly"), - "Unexpected message: " + thrown.getMessage()); - } - - @Test - void guardedAndParenthesizedPatterns() { - doTest("GuardedAndParenthesizedPatterns"); - } - - @Test - void patternsInSwitchLabelsBeforeJava20Preview() { - ParseException thrown = assertThrows(ParseException.class, () -> java20.parseResource("PatternsInSwitchLabels.java")); - assertTrue(thrown.getMessage().contains("Patterns in switch statements is a preview feature of JDK 20, you should select your language version accordingly"), - "Unexpected message: " + thrown.getMessage()); - } - - @Test - void patternsInSwitchLabels() { - doTest("PatternsInSwitchLabels"); - } - - @Test - void refiningPatternsInSwitch() { - doTest("RefiningPatternsInSwitch"); - } - - @Test - void scopeOfPatternVariableDeclarations() { - doTest("ScopeOfPatternVariableDeclarations"); - } - - @Test - void recordPatterns() { - doTest("RecordPatterns"); - } - - @Test - void recordPatternsBeforeJava20Preview() { - ParseException thrown = assertThrows(ParseException.class, () -> java20.parseResource("RecordPatterns.java")); - assertTrue(thrown.getMessage().contains("Record patterns is a preview feature of JDK 20, you should select your language version accordingly"), - "Unexpected message: " + thrown.getMessage()); - } - - @Test - void recordPatternsInEnhancedFor() { - doTest("RecordPatternsInEnhancedFor"); - } - - @Test - void recordPatternsInEnhancedForBeforeJava20Preview() { - ParseException thrown = assertThrows(ParseException.class, () -> java20.parseResource("RecordPatternsInEnhancedFor.java")); - assertTrue(thrown.getMessage().contains("Deconstruction patterns in enhanced for statement is a preview feature of JDK 20, you should select your language version accordingly"), - "Unexpected message: " + thrown.getMessage()); - } - - @Test - void recordPatternsExhaustiveSwitch() { - doTest("RecordPatternsExhaustiveSwitch"); - } -} diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/internal/DataflowPassTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/internal/DataflowPassTest.java index 131e1de98e..3fb0c5506d 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/internal/DataflowPassTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/internal/DataflowPassTest.java @@ -23,12 +23,12 @@ class DataflowPassTest extends BaseParserTest { void testSimple() { ASTCompilationUnit ast = java.parseResource( - "/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsInEnhancedFor.java", - "20-preview" + "/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatterns.java", + "21" ); DataflowResult dataflow = DataflowPass.getDataflowResult(ast); - assertThat(dataflow.getUnusedAssignments(), Matchers.hasSize(2)); + assertThat(dataflow.getUnusedAssignments(), Matchers.hasSize(0)); } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/KotlinTestingDsl.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/KotlinTestingDsl.kt index 638f2d35bb..4d6c6830fb 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 @@ -34,7 +34,7 @@ enum class JavaVersion : Comparable { J17, J18, J19, - J20, J20__PREVIEW, + J20, J21, J21__PREVIEW, J22, J22__PREVIEW; diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/DealingWithNull.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/DealingWithNull.java deleted file mode 100644 index 69c05218b9..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/DealingWithNull.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -/** - * @see JEP 433: Pattern Matching for switch (Fourth Preview) - */ -public class DealingWithNull { - - static void testFooBar(String s) { - switch (s) { - case null -> System.out.println("Oops"); - case "Foo", "Bar" -> System.out.println("Great"); // CaseConstant - default -> System.out.println("Ok"); - } - } - - static void testStringOrNull(Object o) { - switch (o) { - case String s -> System.out.println("String: " + s); // CasePattern - case null -> System.out.println("null"); - default -> System.out.println("default case"); - } - } - - static void testStringOrDefaultNull(Object o) { - switch (o) { - case String s -> System.out.println("String: " + s); - case null, default -> System.out.println("null or default case"); - } - } - - static void test2(Object o) { - switch (o) { - case null -> throw new NullPointerException(); - case String s -> System.out.println("String: "+s); - case Integer i -> System.out.println("Integer"); - default -> System.out.println("default"); - } - } - - - static void test3(Object o) { - switch(o) { - case null: - System.out.println("null"); - break; // note: fall-through to a CasePattern is not allowed, as the pattern variable is not initialized - case String s: - System.out.println("String"); - break; - default: - System.out.println("default case"); - break; - } - - switch(o) { - case null -> System.out.println("null"); - case String s -> System.out.println("String"); - default -> System.out.println("default case"); - } - - switch(o) { - case null: default: - System.out.println("The rest (including null)"); - } - - switch(o) { - case null, default -> - System.out.println("The rest (including null)"); - } - } - - public static void main(String[] args) { - testStringOrDefaultNull("test"); - test2(2); - try { - test2(null); - } catch (NullPointerException e) { - System.out.println(e); - } - test3(3); - test3("test"); - test3(null); - - testFooBar(null); - testFooBar("Foo"); - testFooBar("Bar"); - testFooBar("baz"); - - testStringOrNull(null); - testStringOrNull("some string"); - } -} diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/DealingWithNull.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/DealingWithNull.txt deleted file mode 100644 index b8bf1c9fc8..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/DealingWithNull.txt +++ /dev/null @@ -1,347 +0,0 @@ -+- CompilationUnit[@PackageName = ""] - +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "DealingWithNull", @CanonicalName = "DealingWithNull", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "DealingWithNull", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] - +- ClassBody[@Empty = false, @Size = 6] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "testFooBar", @Name = "testFooBar", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Oops", @Empty = false, @Image = "\"Oops\"", @Length = 4, @LiteralText = "\"Oops\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Foo", @Empty = false, @Image = "\"Foo\"", @Length = 3, @LiteralText = "\"Foo\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Bar", @Empty = false, @Image = "\"Bar\"", @Length = 3, @LiteralText = "\"Bar\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Great", @Empty = false, @Image = "\"Great\"", @Length = 5, @LiteralText = "\"Great\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- SwitchArrowBranch[@Default = true] - | +- SwitchLabel[@Default = true] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Ok", @Empty = false, @Image = "\"Ok\"", @Length = 2, @LiteralText = "\"Ok\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "testStringOrNull", @Name = "testStringOrNull", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String: ", @Empty = false, @Image = "\"String: \"", @Length = 8, @LiteralText = "\"String: \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "null", @Empty = false, @Image = "\"null\"", @Length = 4, @LiteralText = "\"null\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- SwitchArrowBranch[@Default = true] - | +- SwitchLabel[@Default = true] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "default case", @Empty = false, @Image = "\"default case\"", @Length = 12, @LiteralText = "\"default case\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "testStringOrDefaultNull", @Name = "testStringOrDefaultNull", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String: ", @Empty = false, @Image = "\"String: \"", @Length = 8, @LiteralText = "\"String: \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchArrowBranch[@Default = true] - | +- SwitchLabel[@Default = true] - | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "null or default case", @Empty = false, @Image = "\"null or default case\"", @Length = 20, @LiteralText = "\"null or default case\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "test2", @Name = "test2", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ThrowStatement[] - | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "NullPointerException"] - | | +- ArgumentList[@Empty = true, @Size = 0] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String: ", @Empty = false, @Image = "\"String: \"", @Length = 8, @LiteralText = "\"String: \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Integer", @Empty = false, @Image = "\"Integer\"", @Length = 7, @LiteralText = "\"Integer\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- SwitchArrowBranch[@Default = true] - | +- SwitchLabel[@Default = true] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "default", @Empty = false, @Image = "\"default\"", @Length = 7, @LiteralText = "\"default\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "test3", @Name = "test3", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 4, @containsComment = false] - | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- SwitchFallthroughBranch[@Default = false] - | | | +- SwitchLabel[@Default = false] - | | | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ExpressionStatement[] - | | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "null", @Empty = false, @Image = "\"null\"", @Length = 4, @LiteralText = "\"null\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | | +- BreakStatement[@Label = null] - | | +- SwitchFallthroughBranch[@Default = false] - | | | +- SwitchLabel[@Default = false] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ExpressionStatement[] - | | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String", @Empty = false, @Image = "\"String\"", @Length = 6, @LiteralText = "\"String\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | | +- BreakStatement[@Label = null] - | | +- SwitchFallthroughBranch[@Default = true] - | | +- SwitchLabel[@Default = true] - | | +- ExpressionStatement[] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "default case", @Empty = false, @Image = "\"default case\"", @Length = 12, @LiteralText = "\"default case\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- BreakStatement[@Label = null] - | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- SwitchArrowBranch[@Default = false] - | | | +- SwitchLabel[@Default = false] - | | | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "null", @Empty = false, @Image = "\"null\"", @Length = 4, @LiteralText = "\"null\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- SwitchArrowBranch[@Default = false] - | | | +- SwitchLabel[@Default = false] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String", @Empty = false, @Image = "\"String\"", @Length = 6, @LiteralText = "\"String\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- SwitchArrowBranch[@Default = true] - | | +- SwitchLabel[@Default = true] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "default case", @Empty = false, @Image = "\"default case\"", @Length = 12, @LiteralText = "\"default case\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- SwitchFallthroughBranch[@Default = false] - | | | +- SwitchLabel[@Default = false] - | | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- SwitchFallthroughBranch[@Default = true] - | | +- SwitchLabel[@Default = true] - | | +- ExpressionStatement[] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "The rest (including null)", @Empty = false, @Image = "\"The rest (including null)\"", @Length = 25, @LiteralText = "\"The rest (including null)\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchArrowBranch[@Default = true] - | +- SwitchLabel[@Default = true] - | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "The rest (including null)", @Empty = false, @Image = "\"The rest (including null)\"", @Length = 25, @LiteralText = "\"The rest (including null)\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "main", @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] - +- VoidType[] - +- FormalParameters[@Empty = false, @Size = 1] - | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- ArrayType[@ArrayDepth = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- ArrayDimensions[@Empty = false, @Size = 1] - | | +- ArrayTypeDim[@Varargs = false] - | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - +- Block[@Empty = false, @Size = 12, @containsComment = false] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "testStringOrDefaultNull", @MethodName = "testStringOrDefaultNull", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "test", @Empty = false, @Image = "\"test\"", @Length = 4, @LiteralText = "\"test\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "test2", @MethodName = "test2", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] - +- TryStatement[@TryWithResources = false] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | | +- ExpressionStatement[] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "test2", @MethodName = "test2", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] - | +- CatchClause[] - | +- CatchParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Multicatch = false, @Name = "e", @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "NullPointerException"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "e", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "e", @Name = "e", @ParenthesisDepth = 0, @Parenthesized = false] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "test3", @MethodName = "test3", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LiteralText = "3", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "test3", @MethodName = "test3", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "test", @Empty = false, @Image = "\"test\"", @Length = 4, @LiteralText = "\"test\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "test3", @MethodName = "test3", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "testFooBar", @MethodName = "testFooBar", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "testFooBar", @MethodName = "testFooBar", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Foo", @Empty = false, @Image = "\"Foo\"", @Length = 3, @LiteralText = "\"Foo\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "testFooBar", @MethodName = "testFooBar", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Bar", @Empty = false, @Image = "\"Bar\"", @Length = 3, @LiteralText = "\"Bar\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "testFooBar", @MethodName = "testFooBar", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "baz", @Empty = false, @Image = "\"baz\"", @Length = 3, @LiteralText = "\"baz\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "testStringOrNull", @MethodName = "testStringOrNull", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] - +- ExpressionStatement[] - +- MethodCall[@CompileTimeConstant = false, @Image = "testStringOrNull", @MethodName = "testStringOrNull", @ParenthesisDepth = 0, @Parenthesized = false] - +- ArgumentList[@Empty = false, @Size = 1] - +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "some string", @Empty = false, @Image = "\"some string\"", @Length = 11, @LiteralText = "\"some string\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/EnhancedTypeCheckingSwitch.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/EnhancedTypeCheckingSwitch.java deleted file mode 100644 index ed3951e62e..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/EnhancedTypeCheckingSwitch.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -/** - * @see JEP 433: Pattern Matching for switch (Fourth Preview) - */ -public class EnhancedTypeCheckingSwitch { - - - static void typeTester(Object o) { - switch (o) { - case null -> System.out.println("null"); - case String s -> System.out.println("String"); - case Color c -> System.out.println("Color with " + c.values().length + " values"); - case Point p -> System.out.println("Record class: " + p.toString()); - case int[] ia -> System.out.println("Array of ints of length " + ia.length); - default -> System.out.println("Something else"); - } - } - - public static void main(String[] args) { - Object o = "test"; - typeTester(o); - typeTester(Color.BLUE); - - o = new int[] {1, 2, 3, 4}; - typeTester(o); - - o = new Point(7, 8); - typeTester(o); - - o = new Object(); - typeTester(o); - } -} - -record Point(int i, int j) {} -enum Color { RED, GREEN, BLUE; } diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/EnhancedTypeCheckingSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/EnhancedTypeCheckingSwitch.txt deleted file mode 100644 index 8279481824..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/EnhancedTypeCheckingSwitch.txt +++ /dev/null @@ -1,188 +0,0 @@ -+- CompilationUnit[@PackageName = ""] - +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "EnhancedTypeCheckingSwitch", @CanonicalName = "EnhancedTypeCheckingSwitch", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "EnhancedTypeCheckingSwitch", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] - | +- ClassBody[@Empty = false, @Size = 2] - | +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "typeTester", @Name = "typeTester", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | | +- VoidType[] - | | +- FormalParameters[@Empty = false, @Size = 1] - | | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- SwitchArrowBranch[@Default = false] - | | | +- SwitchLabel[@Default = false] - | | | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "null", @Empty = false, @Image = "\"null\"", @Length = 4, @LiteralText = "\"null\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- SwitchArrowBranch[@Default = false] - | | | +- SwitchLabel[@Default = false] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String", @Empty = false, @Image = "\"String\"", @Length = 6, @LiteralText = "\"String\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- SwitchArrowBranch[@Default = false] - | | | +- SwitchLabel[@Default = false] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Color with ", @Empty = false, @Image = "\"Color with \"", @Length = 11, @LiteralText = "\"Color with \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "length", @Name = "length", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- MethodCall[@CompileTimeConstant = false, @Image = "values", @MethodName = "values", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ArgumentList[@Empty = true, @Size = 0] - | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = " values", @Empty = false, @Image = "\" values\"", @Length = 7, @LiteralText = "\" values\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- SwitchArrowBranch[@Default = false] - | | | +- SwitchLabel[@Default = false] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Record class: ", @Empty = false, @Image = "\"Record class: \"", @Length = 14, @LiteralText = "\"Record class: \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "toString", @MethodName = "toString", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "p", @Name = "p", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ArgumentList[@Empty = true, @Size = 0] - | | +- SwitchArrowBranch[@Default = false] - | | | +- SwitchLabel[@Default = false] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | | +- ArrayType[@ArrayDepth = 1] - | | | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | | | | +- ArrayDimensions[@Empty = false, @Size = 1] - | | | | | +- ArrayTypeDim[@Varargs = false] - | | | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "ia", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Array of ints of length ", @Empty = false, @Image = "\"Array of ints of length \"", @Length = 24, @LiteralText = "\"Array of ints of length \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "length", @Name = "length", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "ia", @Name = "ia", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- SwitchArrowBranch[@Default = true] - | | +- SwitchLabel[@Default = true] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Something else", @Empty = false, @Image = "\"Something else\"", @Length = 14, @LiteralText = "\"Something else\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "main", @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ArrayType[@ArrayDepth = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- ArrayDimensions[@Empty = false, @Size = 1] - | | | +- ArrayTypeDim[@Varargs = false] - | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 9, @containsComment = false] - | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableDeclarator[@Initializer = true, @Name = "o"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "test", @Empty = false, @Image = "\"test\"", @Length = 4, @LiteralText = "\"test\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- ExpressionStatement[] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "typeTester", @MethodName = "typeTester", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ExpressionStatement[] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "typeTester", @MethodName = "typeTester", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "BLUE", @Name = "BLUE", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] - | +- ExpressionStatement[] - | | +- AssignmentExpression[@CompileTimeConstant = false, @Compound = false, @Operator = AssignmentOp.ASSIGN, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ArrayAllocation[@ArrayDepth = 1, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ArrayType[@ArrayDepth = 1] - | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | | +- ArrayDimensions[@Empty = false, @Size = 1] - | | | +- ArrayTypeDim[@Varargs = false] - | | +- ArrayInitializer[@CompileTimeConstant = false, @Length = 4, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] - | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] - | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LiteralText = "3", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3] - | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "4", @IntLiteral = true, @Integral = true, @LiteralText = "4", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 4.0, @ValueAsFloat = 4.0, @ValueAsInt = 4, @ValueAsLong = 4] - | +- ExpressionStatement[] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "typeTester", @MethodName = "typeTester", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ExpressionStatement[] - | | +- AssignmentExpression[@CompileTimeConstant = false, @Compound = false, @Operator = AssignmentOp.ASSIGN, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] - | | +- ArgumentList[@Empty = false, @Size = 2] - | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "7", @IntLiteral = true, @Integral = true, @LiteralText = "7", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 7.0, @ValueAsFloat = 7.0, @ValueAsInt = 7, @ValueAsLong = 7] - | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "8", @IntLiteral = true, @Integral = true, @LiteralText = "8", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 8.0, @ValueAsFloat = 8.0, @ValueAsInt = 8, @ValueAsLong = 8] - | +- ExpressionStatement[] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "typeTester", @MethodName = "typeTester", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ExpressionStatement[] - | | +- AssignmentExpression[@CompileTimeConstant = false, @Compound = false, @Operator = AssignmentOp.ASSIGN, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- ArgumentList[@Empty = true, @Size = 0] - | +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "typeTester", @MethodName = "typeTester", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Point", @CanonicalName = "Point", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Point", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{}"] - | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] - | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] - | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] - | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] - | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "j", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] - | +- RecordBody[@Empty = true, @Size = 0] - +- EnumDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Color", @CanonicalName = "Color", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = true, @Final = true, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Color", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE] - +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{}"] - +- EnumBody[@Empty = false, @SeparatorSemi = true, @Size = 3, @TrailingComma = false] - +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "RED", @MethodName = "new", @Name = "RED", @Visibility = Visibility.V_PUBLIC] - | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "RED", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] - +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "GREEN", @MethodName = "new", @Name = "GREEN", @Visibility = Visibility.V_PUBLIC] - | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "GREEN", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] - +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "BLUE", @MethodName = "new", @Name = "BLUE", @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] - +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "BLUE", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ExhaustiveSwitch.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ExhaustiveSwitch.java deleted file mode 100644 index 3918654e57..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ExhaustiveSwitch.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -/** - * @see JEP 433: Pattern Matching for switch (Fourth Preview) - */ -public class ExhaustiveSwitch { - - static int coverage(Object o) { - return switch (o) { - case String s -> s.length(); - case Integer i -> i; - default -> 0; - }; - } - - static void coverageStatement(Object o) { - switch (o) { - case String s: - System.out.println(s); - break; - case Integer i: - System.out.println("Integer"); - break; - default: // Now exhaustive! - break; - } - } - - sealed interface S permits A, B, C {} - final static class A implements S {} - final static class B implements S {} - record C(int i) implements S {} // Implicitly final - - static int testSealedExhaustive(S s) { - return switch (s) { - case A a -> 1; - case B b -> 2; - case C c -> 3; - }; - } - - static void switchStatementExhaustive(S s) { - switch (s) { - case A a : - System.out.println("A"); - break; - case C c : - System.out.println("C"); - break; - default: - System.out.println("default case, should be B"); - break; - }; - } - sealed interface I permits E, F {} - final static class E implements I {} - final static class F implements I {} - - static int testGenericSealedExhaustive(I i) { - return switch (i) { - // Exhaustive as no E case possible! - case F bi -> 42; - }; - } - - public static void main(String[] args) { - System.out.println(coverage("a string")); - System.out.println(coverage(42)); - System.out.println(coverage(new Object())); - - coverageStatement("a string"); - coverageStatement(21); - coverageStatement(new Object()); - - System.out.println("A:" + testSealedExhaustive(new A())); - System.out.println("B:" + testSealedExhaustive(new B())); - System.out.println("C:" + testSealedExhaustive(new C(1))); - - switchStatementExhaustive(new A()); - switchStatementExhaustive(new B()); - switchStatementExhaustive(new C(2)); - - System.out.println("F:" + testGenericSealedExhaustive(new F())); - } -} diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ExhaustiveSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ExhaustiveSwitch.txt deleted file mode 100644 index 95eb002031..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ExhaustiveSwitch.txt +++ /dev/null @@ -1,365 +0,0 @@ -+- CompilationUnit[@PackageName = ""] - +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ExhaustiveSwitch", @CanonicalName = "ExhaustiveSwitch", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "ExhaustiveSwitch", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] - +- ClassBody[@Empty = false, @Size = 13] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "coverage", @Name = "coverage", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- ReturnStatement[] - | +- SwitchExpression[@CompileTimeConstant = false, @DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ArgumentList[@Empty = true, @Size = 0] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchArrowBranch[@Default = true] - | +- SwitchLabel[@Default = true] - | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "coverageStatement", @Name = "coverageStatement", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchFallthroughBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ExpressionStatement[] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- BreakStatement[@Label = null] - | +- SwitchFallthroughBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ExpressionStatement[] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Integer", @Empty = false, @Image = "\"Integer\"", @Length = 7, @LiteralText = "\"Integer\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- BreakStatement[@Label = null] - | +- SwitchFallthroughBranch[@Default = true] - | +- SwitchLabel[@Default = true] - | +- BreakStatement[@Label = null] - +- ClassDeclaration[@Abstract = true, @Annotation = false, @Anonymous = false, @BinaryName = "ExhaustiveSwitch$S", @CanonicalName = "ExhaustiveSwitch.S", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = true, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = true, @SimpleName = "S", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{sealed, abstract, static}", @ExplicitModifiers = "{sealed}"] - | +- PermitsList[@Empty = false, @Size = 3] - | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "B"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "C"] - | +- ClassBody[@Empty = true, @Size = 0] - +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ExhaustiveSwitch$A", @CanonicalName = "ExhaustiveSwitch.A", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "A", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{static, final}"] - | +- ImplementsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "S"] - | +- ClassBody[@Empty = true, @Size = 0] - +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ExhaustiveSwitch$B", @CanonicalName = "ExhaustiveSwitch.B", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "B", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{static, final}"] - | +- ImplementsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "S"] - | +- ClassBody[@Empty = true, @Size = 0] - +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ExhaustiveSwitch$C", @CanonicalName = "ExhaustiveSwitch.C", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "C", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] - | +- RecordComponentList[@Empty = false, @Size = 1, @Varargs = false] - | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] - | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] - | +- ImplementsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "S"] - | +- RecordBody[@Empty = true, @Size = 0] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "testSealedExhaustive", @Name = "testSealedExhaustive", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "S"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- ReturnStatement[] - | +- SwitchExpression[@CompileTimeConstant = false, @DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "B"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] - | +- SwitchArrowBranch[@Default = false] - | +- SwitchLabel[@Default = false] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "C"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LiteralText = "3", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "switchStatementExhaustive", @Name = "switchStatementExhaustive", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "S"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 2, @containsComment = false] - | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- SwitchFallthroughBranch[@Default = false] - | | | +- SwitchLabel[@Default = false] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ExpressionStatement[] - | | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "A", @Empty = false, @Image = "\"A\"", @Length = 1, @LiteralText = "\"A\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | | +- BreakStatement[@Label = null] - | | +- SwitchFallthroughBranch[@Default = false] - | | | +- SwitchLabel[@Default = false] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "C"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ExpressionStatement[] - | | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "C", @Empty = false, @Image = "\"C\"", @Length = 1, @LiteralText = "\"C\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | | +- BreakStatement[@Label = null] - | | +- SwitchFallthroughBranch[@Default = true] - | | +- SwitchLabel[@Default = true] - | | +- ExpressionStatement[] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "default case, should be B", @Empty = false, @Image = "\"default case, should be B\"", @Length = 25, @LiteralText = "\"default case, should be B\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- BreakStatement[@Label = null] - | +- EmptyStatement[] - +- ClassDeclaration[@Abstract = true, @Annotation = false, @Anonymous = false, @BinaryName = "ExhaustiveSwitch$I", @CanonicalName = "ExhaustiveSwitch.I", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = true, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = true, @SimpleName = "I", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{sealed, abstract, static}", @ExplicitModifiers = "{sealed}"] - | +- TypeParameters[@Empty = false, @Size = 1] - | | +- TypeParameter[@Image = "T", @Name = "T", @TypeBound = false] - | +- PermitsList[@Empty = false, @Size = 2] - | | +- ClassType[@FullyQualified = false, @SimpleName = "E"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "F"] - | +- ClassBody[@Empty = true, @Size = 0] - +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ExhaustiveSwitch$E", @CanonicalName = "ExhaustiveSwitch.E", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "E", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{static, final}"] - | +- TypeParameters[@Empty = false, @Size = 1] - | | +- TypeParameter[@Image = "X", @Name = "X", @TypeBound = false] - | +- ImplementsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] - | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | +- ClassBody[@Empty = true, @Size = 0] - +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ExhaustiveSwitch$F", @CanonicalName = "ExhaustiveSwitch.F", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "F", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{static, final}"] - | +- TypeParameters[@Empty = false, @Size = 1] - | | +- TypeParameter[@Image = "Y", @Name = "Y", @TypeBound = false] - | +- ImplementsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] - | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Y"] - | +- ClassBody[@Empty = true, @Size = 0] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "testGenericSealedExhaustive", @Name = "testGenericSealedExhaustive", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] - | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- ReturnStatement[] - | +- SwitchExpression[@CompileTimeConstant = false, @DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchArrowBranch[@Default = false] - | +- SwitchLabel[@Default = false] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "F"] - | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "bi", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "42", @IntLiteral = true, @Integral = true, @LiteralText = "42", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "main", @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] - +- VoidType[] - +- FormalParameters[@Empty = false, @Size = 1] - | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- ArrayType[@ArrayDepth = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- ArrayDimensions[@Empty = false, @Size = 1] - | | +- ArrayTypeDim[@Varargs = false] - | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - +- Block[@Empty = false, @Size = 13, @containsComment = false] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- MethodCall[@CompileTimeConstant = false, @Image = "coverage", @MethodName = "coverage", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a string", @Empty = false, @Image = "\"a string\"", @Length = 8, @LiteralText = "\"a string\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- MethodCall[@CompileTimeConstant = false, @Image = "coverage", @MethodName = "coverage", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "42", @IntLiteral = true, @Integral = true, @LiteralText = "42", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- MethodCall[@CompileTimeConstant = false, @Image = "coverage", @MethodName = "coverage", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | +- ArgumentList[@Empty = true, @Size = 0] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "coverageStatement", @MethodName = "coverageStatement", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a string", @Empty = false, @Image = "\"a string\"", @Length = 8, @LiteralText = "\"a string\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "coverageStatement", @MethodName = "coverageStatement", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "21", @IntLiteral = true, @Integral = true, @LiteralText = "21", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 21.0, @ValueAsFloat = 21.0, @ValueAsInt = 21, @ValueAsLong = 21] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "coverageStatement", @MethodName = "coverageStatement", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | +- ArgumentList[@Empty = true, @Size = 0] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "A:", @Empty = false, @Image = "\"A:\"", @Length = 2, @LiteralText = "\"A:\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- MethodCall[@CompileTimeConstant = false, @Image = "testSealedExhaustive", @MethodName = "testSealedExhaustive", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "A"] - | +- ArgumentList[@Empty = true, @Size = 0] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "B:", @Empty = false, @Image = "\"B:\"", @Length = 2, @LiteralText = "\"B:\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- MethodCall[@CompileTimeConstant = false, @Image = "testSealedExhaustive", @MethodName = "testSealedExhaustive", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "B"] - | +- ArgumentList[@Empty = true, @Size = 0] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "C:", @Empty = false, @Image = "\"C:\"", @Length = 2, @LiteralText = "\"C:\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- MethodCall[@CompileTimeConstant = false, @Image = "testSealedExhaustive", @MethodName = "testSealedExhaustive", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "C"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "switchStatementExhaustive", @MethodName = "switchStatementExhaustive", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "A"] - | +- ArgumentList[@Empty = true, @Size = 0] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "switchStatementExhaustive", @MethodName = "switchStatementExhaustive", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "B"] - | +- ArgumentList[@Empty = true, @Size = 0] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "switchStatementExhaustive", @MethodName = "switchStatementExhaustive", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "C"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] - +- ExpressionStatement[] - +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - +- ArgumentList[@Empty = false, @Size = 1] - +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "F:", @Empty = false, @Image = "\"F:\"", @Length = 2, @LiteralText = "\"F:\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- MethodCall[@CompileTimeConstant = false, @Image = "testGenericSealedExhaustive", @MethodName = "testGenericSealedExhaustive", @ParenthesisDepth = 0, @Parenthesized = false] - +- ArgumentList[@Empty = false, @Size = 1] - +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - +- ClassType[@FullyQualified = false, @SimpleName = "F"] - | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] - +- ArgumentList[@Empty = true, @Size = 0] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/GuardedAndParenthesizedPatterns.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/GuardedAndParenthesizedPatterns.java deleted file mode 100644 index 41e2a343fe..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/GuardedAndParenthesizedPatterns.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -/** - * @see JEP 433: Pattern Matching for switch (Fourth Preview) - */ -public class GuardedAndParenthesizedPatterns { - - - static void test(Object o) { - switch (o) { - case String s when s.length() == 1 -> System.out.println("single char string"); - case String s -> System.out.println("string"); - case Integer i when i.intValue() == 1 -> System.out.println("integer 1"); - case (Long l) when l.longValue() == 1L -> System.out.println("long 1 with parens"); - case (((Double d))) -> System.out.println("double with parens"); - default -> System.out.println("default case"); - } - } - - // verify that "when" can still be used as an identifier -> formal parameter - void testIdentifierWhen(String when) { - System.out.println(when); - } - - // verify that "when" can still be used as an identifier -> local variable - void testIdentifierWhen() { - int when = 1; - System.out.println(when); - } - - // verify that "when" can still be used as a type name - private static class when {} - - static void testWithNull(Object o) { - switch (o) { - case String s when (s.length() == 1) -> System.out.println("single char string"); - case String s -> System.out.println("string"); - case (Integer i) when i.intValue() == 1 -> System.out.println("integer 1"); - case ((Long l)) when ((l.longValue() == 1L)) -> System.out.println("long 1 with parens"); - case (((Double d))) -> System.out.println("double with parens"); - case null -> System.out.println("null!"); - default -> System.out.println("default case"); - } - } - - - static void instanceOfPattern(Object o) { - if (o instanceof String s && s.length() > 2) { - System.out.println("A string containing at least two characters"); - } - if (o != null && (o instanceof String s && s.length() > 3)) { - System.out.println("A string containing at least three characters"); - } - - // note: with this 3rd preview, the following is not allowed anymore: - // if (o instanceof (String s && s.length() > 4)) { - // > An alternative to guarded pattern labels is to support guarded patterns directly as a special pattern form, - // > e.g. p && e. Having experimented with this in previous previews, the resulting ambiguity with boolean - // > expressions have lead us to prefer when clauses in pattern switches. - if ((o instanceof String s) && (s.length() > 4)) { - System.out.println("A string containing at least four characters"); - } - } - - static void testScopeOfPatternVariableDeclarations(Object obj) { - if ((obj instanceof String s) && s.length() > 3) { - System.out.println(s); - } else { - System.out.println("Not a string"); - } - } - - public static void main(String[] args) { - test("a"); - test("fooo"); - test(1); - test(1L); - instanceOfPattern("abcde"); - try { - test(null); // throws NPE - } catch (NullPointerException e) { - e.printStackTrace(); - } - testWithNull(null); - testScopeOfPatternVariableDeclarations("a"); - testScopeOfPatternVariableDeclarations("long enough"); - } -} diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/GuardedAndParenthesizedPatterns.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/GuardedAndParenthesizedPatterns.txt deleted file mode 100644 index 082bb7295f..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/GuardedAndParenthesizedPatterns.txt +++ /dev/null @@ -1,422 +0,0 @@ -+- CompilationUnit[@PackageName = ""] - +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "GuardedAndParenthesizedPatterns", @CanonicalName = "GuardedAndParenthesizedPatterns", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "GuardedAndParenthesizedPatterns", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] - +- ClassBody[@Empty = false, @Size = 8] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "test", @Name = "test", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- Guard[] - | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ArgumentList[@Empty = true, @Size = 0] - | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "single char string", @Empty = false, @Image = "\"single char string\"", @Length = 18, @LiteralText = "\"single char string\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "string", @Empty = false, @Image = "\"string\"", @Length = 6, @LiteralText = "\"string\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- Guard[] - | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "intValue", @MethodName = "intValue", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ArgumentList[@Empty = true, @Size = 0] - | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "integer 1", @Empty = false, @Image = "\"integer 1\"", @Length = 9, @LiteralText = "\"integer 1\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 1, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Long"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "l", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- Guard[] - | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "longValue", @MethodName = "longValue", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "l", @Name = "l", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ArgumentList[@Empty = true, @Size = 0] - | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1L", @IntLiteral = false, @Integral = true, @LiteralText = "1L", @LongLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "long 1 with parens", @Empty = false, @Image = "\"long 1 with parens\"", @Length = 18, @LiteralText = "\"long 1 with parens\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 3, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Double"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "double with parens", @Empty = false, @Image = "\"double with parens\"", @Length = 18, @LiteralText = "\"double with parens\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- SwitchArrowBranch[@Default = true] - | +- SwitchLabel[@Default = true] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "default case", @Empty = false, @Image = "\"default case\"", @Length = 12, @LiteralText = "\"default case\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "testIdentifierWhen", @Name = "testIdentifierWhen", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "when", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "when", @Name = "when", @ParenthesisDepth = 0, @Parenthesized = false] - +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "testIdentifierWhen", @Name = "testIdentifierWhen", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- VoidType[] - | +- FormalParameters[@Empty = true, @Size = 0] - | +- Block[@Empty = false, @Size = 2, @containsComment = false] - | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | +- VariableDeclarator[@Initializer = true, @Name = "when"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "when", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] - | +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "when", @Name = "when", @ParenthesisDepth = 0, @Parenthesized = false] - +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "GuardedAndParenthesizedPatterns$when", @CanonicalName = "GuardedAndParenthesizedPatterns.when", @EffectiveVisibility = Visibility.V_PRIVATE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "when", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PRIVATE] - | +- ModifierList[@EffectiveModifiers = "{private, static}", @ExplicitModifiers = "{private, static}"] - | +- ClassBody[@Empty = true, @Size = 0] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "testWithNull", @Name = "testWithNull", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- Guard[] - | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 1, @Parenthesized = true] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ArgumentList[@Empty = true, @Size = 0] - | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "single char string", @Empty = false, @Image = "\"single char string\"", @Length = 18, @LiteralText = "\"single char string\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "string", @Empty = false, @Image = "\"string\"", @Length = 6, @LiteralText = "\"string\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 1, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- Guard[] - | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "intValue", @MethodName = "intValue", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ArgumentList[@Empty = true, @Size = 0] - | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "integer 1", @Empty = false, @Image = "\"integer 1\"", @Length = 9, @LiteralText = "\"integer 1\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 2, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Long"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "l", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- Guard[] - | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 2, @Parenthesized = true] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "longValue", @MethodName = "longValue", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "l", @Name = "l", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ArgumentList[@Empty = true, @Size = 0] - | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1L", @IntLiteral = false, @Integral = true, @LiteralText = "1L", @LongLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "long 1 with parens", @Empty = false, @Image = "\"long 1 with parens\"", @Length = 18, @LiteralText = "\"long 1 with parens\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 3, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Double"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "double with parens", @Empty = false, @Image = "\"double with parens\"", @Length = 18, @LiteralText = "\"double with parens\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "null!", @Empty = false, @Image = "\"null!\"", @Length = 5, @LiteralText = "\"null!\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- SwitchArrowBranch[@Default = true] - | +- SwitchLabel[@Default = true] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "default case", @Empty = false, @Image = "\"default case\"", @Length = 12, @LiteralText = "\"default case\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "instanceOfPattern", @Name = "instanceOfPattern", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 3, @containsComment = false] - | +- IfStatement[@Else = false] - | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.CONDITIONAL_AND, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ArgumentList[@Empty = true, @Size = 0] - | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] - | | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | | +- ExpressionStatement[] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "A string containing at least two characters", @Empty = false, @Image = "\"A string containing at least two characters\"", @Length = 43, @LiteralText = "\"A string containing at least two characters\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- IfStatement[@Else = false] - | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.CONDITIONAL_AND, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.NE, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.CONDITIONAL_AND, @ParenthesisDepth = 1, @Parenthesized = true] - | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ArgumentList[@Empty = true, @Size = 0] - | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LiteralText = "3", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3] - | | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | | +- ExpressionStatement[] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "A string containing at least three characters", @Empty = false, @Image = "\"A string containing at least three characters\"", @Length = 45, @LiteralText = "\"A string containing at least three characters\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- IfStatement[@Else = false] - | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.CONDITIONAL_AND, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 1, @Parenthesized = true] - | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 1, @Parenthesized = true] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ArgumentList[@Empty = true, @Size = 0] - | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "4", @IntLiteral = true, @Integral = true, @LiteralText = "4", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 4.0, @ValueAsFloat = 4.0, @ValueAsInt = 4, @ValueAsLong = 4] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "A string containing at least four characters", @Empty = false, @Image = "\"A string containing at least four characters\"", @Length = 44, @LiteralText = "\"A string containing at least four characters\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "testScopeOfPatternVariableDeclarations", @Name = "testScopeOfPatternVariableDeclarations", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "obj", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- IfStatement[@Else = true] - | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.CONDITIONAL_AND, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 1, @Parenthesized = true] - | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ArgumentList[@Empty = true, @Size = 0] - | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LiteralText = "3", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | | +- ExpressionStatement[] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Not a string", @Empty = false, @Image = "\"Not a string\"", @Length = 12, @LiteralText = "\"Not a string\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "main", @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] - +- VoidType[] - +- FormalParameters[@Empty = false, @Size = 1] - | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- ArrayType[@ArrayDepth = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- ArrayDimensions[@Empty = false, @Size = 1] - | | +- ArrayTypeDim[@Varargs = false] - | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - +- Block[@Empty = false, @Size = 9, @containsComment = false] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "test", @MethodName = "test", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "test", @MethodName = "test", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "fooo", @Empty = false, @Image = "\"fooo\"", @Length = 4, @LiteralText = "\"fooo\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "test", @MethodName = "test", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "test", @MethodName = "test", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1L", @IntLiteral = false, @Integral = true, @LiteralText = "1L", @LongLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "instanceOfPattern", @MethodName = "instanceOfPattern", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "abcde", @Empty = false, @Image = "\"abcde\"", @Length = 5, @LiteralText = "\"abcde\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- TryStatement[@TryWithResources = false] - | +- Block[@Empty = false, @Size = 1, @containsComment = true] - | | +- ExpressionStatement[] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "test", @MethodName = "test", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] - | +- CatchClause[] - | +- CatchParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Multicatch = false, @Name = "e", @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "NullPointerException"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "e", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "printStackTrace", @MethodName = "printStackTrace", @ParenthesisDepth = 0, @Parenthesized = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "e", @Name = "e", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = true, @Size = 0] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "testWithNull", @MethodName = "testWithNull", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "testScopeOfPatternVariableDeclarations", @MethodName = "testScopeOfPatternVariableDeclarations", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- ExpressionStatement[] - +- MethodCall[@CompileTimeConstant = false, @Image = "testScopeOfPatternVariableDeclarations", @MethodName = "testScopeOfPatternVariableDeclarations", @ParenthesisDepth = 0, @Parenthesized = false] - +- ArgumentList[@Empty = false, @Size = 1] - +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "long enough", @Empty = false, @Image = "\"long enough\"", @Length = 11, @LiteralText = "\"long enough\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/PatternsInSwitchLabels.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/PatternsInSwitchLabels.java deleted file mode 100644 index 210c03f066..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/PatternsInSwitchLabels.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -/** - * @see JEP 433: Pattern Matching for switch (Fourth Preview) - */ -public class PatternsInSwitchLabels { - - - public static void main(String[] args) { - Object o = 123L; - String formatted = switch (o) { - case Integer i -> String.format("int %d", i); - case Long l -> String.format("long %d", l); - case Double d -> String.format("double %f", d); - case String s -> String.format("String %s", s); - default -> o.toString(); - }; - System.out.println(formatted); - } -} diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/PatternsInSwitchLabels.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/PatternsInSwitchLabels.txt deleted file mode 100644 index d9f95d947e..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/PatternsInSwitchLabels.txt +++ /dev/null @@ -1,89 +0,0 @@ -+- CompilationUnit[@PackageName = ""] - +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "PatternsInSwitchLabels", @CanonicalName = "PatternsInSwitchLabels", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "PatternsInSwitchLabels", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] - +- ClassBody[@Empty = false, @Size = 1] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "main", @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] - +- VoidType[] - +- FormalParameters[@Empty = false, @Size = 1] - | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- ArrayType[@ArrayDepth = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- ArrayDimensions[@Empty = false, @Size = 1] - | | +- ArrayTypeDim[@Varargs = false] - | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - +- Block[@Empty = false, @Size = 3, @containsComment = false] - +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | +- VariableDeclarator[@Initializer = true, @Name = "o"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "123L", @IntLiteral = false, @Integral = true, @LiteralText = "123L", @LongLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 123.0, @ValueAsFloat = 123.0, @ValueAsInt = 123, @ValueAsLong = 123] - +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | +- VariableDeclarator[@Initializer = true, @Name = "formatted"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "formatted", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- SwitchExpression[@CompileTimeConstant = false, @DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- ArgumentList[@Empty = false, @Size = 2] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "int %d", @Empty = false, @Image = "\"int %d\"", @Length = 6, @LiteralText = "\"int %d\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Long"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "l", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- ArgumentList[@Empty = false, @Size = 2] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "long %d", @Empty = false, @Image = "\"long %d\"", @Length = 7, @LiteralText = "\"long %d\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "l", @Name = "l", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Double"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- ArgumentList[@Empty = false, @Size = 2] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "double %f", @Empty = false, @Image = "\"double %f\"", @Length = 9, @LiteralText = "\"double %f\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "d", @Name = "d", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- ArgumentList[@Empty = false, @Size = 2] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String %s", @Empty = false, @Image = "\"String %s\"", @Length = 9, @LiteralText = "\"String %s\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchArrowBranch[@Default = true] - | +- SwitchLabel[@Default = true] - | +- MethodCall[@CompileTimeConstant = false, @Image = "toString", @MethodName = "toString", @ParenthesisDepth = 0, @Parenthesized = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = true, @Size = 0] - +- ExpressionStatement[] - +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - +- ArgumentList[@Empty = false, @Size = 1] - +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "formatted", @Name = "formatted", @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatterns.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatterns.java deleted file mode 100644 index 2ae278af1e..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatterns.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -/** - * @see JEP 432: Record Patterns (Second Preview) - */ -public class RecordPatterns { - - record Point(int x, int y) {} - enum Color { RED, GREEN, BLUE } - record ColoredPoint(Point p, Color c) {} - record Rectangle(ColoredPoint upperLeft, ColoredPoint lowerRight) {} - - void printSum1(Object o) { - if (o instanceof Point p) { - int x = p.x(); - int y = p.y(); - System.out.println(x+y); - } - } - - // record pattern - void printSum2(Object o) { - if (o instanceof Point(int x, int y)) { - System.out.println(x+y); - } - } - - void printUpperLeftColoredPoint(Rectangle r) { - if (r instanceof Rectangle(ColoredPoint ul, ColoredPoint lr)) { - System.out.println(ul.c()); - } - } - - // nested record pattern - void printColorOfUpperLeftPoint(Rectangle r) { - if (r instanceof Rectangle(ColoredPoint(Point p, Color c), - ColoredPoint lr)) { - System.out.println(c); - } - } - - Rectangle createRectangle(int x1, int y1, Color c1, int x2, int y2, Color c2) { - Rectangle r = new Rectangle(new ColoredPoint(new Point(x1, y1), c1), - new ColoredPoint(new Point(x2, y2), c2)); - return r; - } - - // fully nested record pattern, also using "var" - void printXCoordOfUpperLeftPointWithPatterns(Rectangle r) { - if (r instanceof Rectangle(ColoredPoint(Point(var x, var y), var c), - var lr)) { - System.out.println("Upper-left corner: " + x); - } - } - - record Pair(Object x, Object y) {} - void nestedPatternsCanFailToMatch() { - Pair p = new Pair(42, 42); - if (p instanceof Pair(String s, String t)) { - System.out.println(s + ", " + t); - } else { - System.out.println("Not a pair of strings"); - } - } - - // record patterns with generic types - record Box(T t) {} - void test1a(Box bo) { - if (bo instanceof Box(String s)) { - System.out.println("String " + s); - } - } - void test1(Box bo) { - if (bo instanceof Box(var s)) { - System.out.println("String " + s); - } - } - - // type argument is inferred - void test2(Box bo) { - if (bo instanceof Box(var s)) { // Inferred to be Box(var s) - System.out.println("String " + s); - } - } - - // nested record patterns - void test3(Box> bo) { - if (bo instanceof Box>(Box(var s))) { - System.out.println("String " + s); - } - } - - void test4(Box> bo) { - if (bo instanceof Box(Box(var s))) { - System.out.println("String " + s); - } - } -} diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatterns.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatterns.txt deleted file mode 100644 index 5fd641f5da..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatterns.txt +++ /dev/null @@ -1,557 +0,0 @@ -+- CompilationUnit[@PackageName = ""] - +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns", @CanonicalName = "RecordPatterns", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "RecordPatterns", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] - +- ClassBody[@Empty = false, @Size = 18] - +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns$Point", @CanonicalName = "RecordPatterns.Point", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Point", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] - | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] - | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] - | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] - | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] - | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] - | +- RecordBody[@Empty = true, @Size = 0] - +- EnumDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns$Color", @CanonicalName = "RecordPatterns.Color", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = true, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Color", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] - | +- EnumBody[@Empty = false, @SeparatorSemi = false, @Size = 3, @TrailingComma = false] - | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "RED", @MethodName = "new", @Name = "RED", @Visibility = Visibility.V_PUBLIC] - | | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "RED", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] - | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "GREEN", @MethodName = "new", @Name = "GREEN", @Visibility = Visibility.V_PUBLIC] - | | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "GREEN", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] - | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "BLUE", @MethodName = "new", @Name = "BLUE", @Visibility = Visibility.V_PUBLIC] - | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "BLUE", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] - +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns$ColoredPoint", @CanonicalName = "RecordPatterns.ColoredPoint", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "ColoredPoint", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] - | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] - | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] - | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] - | +- RecordBody[@Empty = true, @Size = 0] - +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns$Rectangle", @CanonicalName = "RecordPatterns.Rectangle", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Rectangle", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] - | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] - | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "upperLeft", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] - | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lowerRight", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] - | +- RecordBody[@Empty = true, @Size = 0] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "printSum1", @Name = "printSum1", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- IfStatement[@Else = false] - | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 3, @containsComment = false] - | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | +- VariableDeclarator[@Initializer = true, @Name = "x"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "x", @MethodName = "x", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "p", @Name = "p", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ArgumentList[@Empty = true, @Size = 0] - | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | +- VariableDeclarator[@Initializer = true, @Name = "y"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "y", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "y", @MethodName = "y", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "p", @Name = "p", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ArgumentList[@Empty = true, @Size = 0] - | +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "y", @Name = "y", @ParenthesisDepth = 0, @Parenthesized = false] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "printSum2", @Name = "printSum2", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- IfStatement[@Else = false] - | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] - | | +- PatternList[@Empty = false, @Size = 2] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "y", @Name = "y", @ParenthesisDepth = 0, @Parenthesized = false] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "printUpperLeftColoredPoint", @Name = "printUpperLeftColoredPoint", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- IfStatement[@Else = false] - | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] - | | +- PatternList[@Empty = false, @Size = 2] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "ul", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- MethodCall[@CompileTimeConstant = false, @Image = "c", @MethodName = "c", @ParenthesisDepth = 0, @Parenthesized = false] - | +- AmbiguousName[@CompileTimeConstant = false, @Image = "ul", @Name = "ul", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = true, @Size = 0] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "printColorOfUpperLeftPoint", @Name = "printColorOfUpperLeftPoint", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- IfStatement[@Else = false] - | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] - | | +- PatternList[@Empty = false, @Size = 2] - | | +- RecordPattern[@ParenthesisDepth = 0] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] - | | | +- PatternList[@Empty = false, @Size = 2] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false] - +- MethodDeclaration[@Abstract = false, @Arity = 6, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "createRectangle", @Name = "createRectangle", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] - | +- FormalParameters[@Empty = false, @Size = 6] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "x1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "y1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "c1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "x2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "y2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "c2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 2, @containsComment = false] - | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] - | | +- VariableDeclarator[@Initializer = true, @Name = "r"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] - | | +- ArgumentList[@Empty = false, @Size = 2] - | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] - | | | +- ArgumentList[@Empty = false, @Size = 2] - | | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] - | | | | +- ArgumentList[@Empty = false, @Size = 2] - | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x1", @Name = "x1", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "y1", @Name = "y1", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "c1", @Name = "c1", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] - | | +- ArgumentList[@Empty = false, @Size = 2] - | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] - | | | +- ArgumentList[@Empty = false, @Size = 2] - | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x2", @Name = "x2", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "y2", @Name = "y2", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "c2", @Name = "c2", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ReturnStatement[] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "printXCoordOfUpperLeftPointWithPatterns", @Name = "printXCoordOfUpperLeftPointWithPatterns", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- IfStatement[@Else = false] - | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] - | | +- PatternList[@Empty = false, @Size = 2] - | | +- RecordPattern[@ParenthesisDepth = 0] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] - | | | +- PatternList[@Empty = false, @Size = 2] - | | | +- RecordPattern[@ParenthesisDepth = 0] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] - | | | | +- PatternList[@Empty = false, @Size = 2] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] - | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Upper-left corner: ", @Empty = false, @Image = "\"Upper-left corner: \"", @Length = 19, @LiteralText = "\"Upper-left corner: \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] - +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns$Pair", @CanonicalName = "RecordPatterns.Pair", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Pair", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] - | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] - | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] - | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] - | +- RecordBody[@Empty = true, @Size = 0] - +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "nestedPatternsCanFailToMatch", @Name = "nestedPatternsCanFailToMatch", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- VoidType[] - | +- FormalParameters[@Empty = true, @Size = 0] - | +- Block[@Empty = false, @Size = 2, @containsComment = false] - | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] - | | +- VariableDeclarator[@Initializer = true, @Name = "p"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "p", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] - | | +- ArgumentList[@Empty = false, @Size = 2] - | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "42", @IntLiteral = true, @Integral = true, @LiteralText = "42", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42] - | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "42", @IntLiteral = true, @Integral = true, @LiteralText = "42", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42] - | +- IfStatement[@Else = true] - | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "p", @Name = "p", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] - | | +- PatternList[@Empty = false, @Size = 2] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | | +- ExpressionStatement[] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = ", ", @Empty = false, @Image = "\", \"", @Length = 2, @LiteralText = "\", \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "t", @Name = "t", @ParenthesisDepth = 0, @Parenthesized = false] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Not a pair of strings", @Empty = false, @Image = "\"Not a pair of strings\"", @Length = 21, @LiteralText = "\"Not a pair of strings\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns$Box", @CanonicalName = "RecordPatterns.Box", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Box", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] - | +- TypeParameters[@Empty = false, @Size = 1] - | | +- TypeParameter[@Image = "T", @Name = "T", @TypeBound = false] - | +- RecordComponentList[@Empty = false, @Size = 1, @Varargs = false] - | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "T"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] - | +- RecordBody[@Empty = true, @Size = 0] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "test1a", @Name = "test1a", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] - | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- IfStatement[@Else = false] - | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "bo", @Name = "bo", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] - | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- PatternList[@Empty = false, @Size = 1] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String ", @Empty = false, @Image = "\"String \"", @Length = 7, @LiteralText = "\"String \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "test1", @Name = "test1", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] - | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- IfStatement[@Else = false] - | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "bo", @Name = "bo", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] - | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- PatternList[@Empty = false, @Size = 1] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String ", @Empty = false, @Image = "\"String \"", @Length = 7, @LiteralText = "\"String \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "test2", @Name = "test2", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] - | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- IfStatement[@Else = false] - | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "bo", @Name = "bo", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] - | | +- PatternList[@Empty = false, @Size = 1] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String ", @Empty = false, @Image = "\"String \"", @Length = 7, @LiteralText = "\"String \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "test3", @Name = "test3", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] - | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] - | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- IfStatement[@Else = false] - | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "bo", @Name = "bo", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] - | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] - | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- PatternList[@Empty = false, @Size = 1] - | | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] - | | +- PatternList[@Empty = false, @Size = 1] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String ", @Empty = false, @Image = "\"String \"", @Length = 7, @LiteralText = "\"String \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "test4", @Name = "test4", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - +- VoidType[] - +- FormalParameters[@Empty = false, @Size = 1] - | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] - | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] - | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - +- Block[@Empty = false, @Size = 1, @containsComment = false] - +- IfStatement[@Else = false] - +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "bo", @Name = "bo", @ParenthesisDepth = 0, @Parenthesized = false] - | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- RecordPattern[@ParenthesisDepth = 0] - | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] - | +- PatternList[@Empty = false, @Size = 1] - | +- RecordPattern[@ParenthesisDepth = 0] - | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] - | +- PatternList[@Empty = false, @Size = 1] - | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- ClassType[@FullyQualified = false, @SimpleName = "var"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - +- Block[@Empty = false, @Size = 1, @containsComment = false] - +- ExpressionStatement[] - +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - +- ArgumentList[@Empty = false, @Size = 1] - +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String ", @Empty = false, @Image = "\"String \"", @Length = 7, @LiteralText = "\"String \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsExhaustiveSwitch.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsExhaustiveSwitch.java deleted file mode 100644 index 7fb9f1250e..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsExhaustiveSwitch.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -/** - * @see JEP 432: Record Patterns (Second Preview) - */ -public class RecordPatternsExhaustiveSwitch { - class A {} - class B extends A {} - sealed interface I permits C, D {} - final class C implements I {} - final class D implements I {} - record Pair(T x, T y) {} - - static void test() { - Pair p1 = null; - Pair p2 = null; - - switch (p1) { // Error! - case Pair(A a, B b) -> System.out.println("a"); - case Pair(B b, A a) -> System.out.println("a"); - case Pair(A a1, A a2) -> System.out.println("exhaustive now"); // without this case, compile error - } - - switch (p2) { - case Pair(I i, C c) -> System.out.println("a"); - case Pair(I i, D d) -> System.out.println("a"); - } - - switch (p2) { - case Pair(C c, I i) -> System.out.println("a"); - case Pair(D d, C c) -> System.out.println("a"); - case Pair(D d1, D d2) -> System.out.println("a"); - } - } -} diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsExhaustiveSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsExhaustiveSwitch.txt deleted file mode 100644 index 93ed78d5f0..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsExhaustiveSwitch.txt +++ /dev/null @@ -1,237 +0,0 @@ -+- CompilationUnit[@PackageName = ""] - +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch", @CanonicalName = "RecordPatternsExhaustiveSwitch", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "RecordPatternsExhaustiveSwitch", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] - +- ClassBody[@Empty = false, @Size = 7] - +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch$A", @CanonicalName = "RecordPatternsExhaustiveSwitch.A", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "A", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- ClassBody[@Empty = true, @Size = 0] - +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch$B", @CanonicalName = "RecordPatternsExhaustiveSwitch.B", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "B", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- ExtendsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] - | +- ClassBody[@Empty = true, @Size = 0] - +- ClassDeclaration[@Abstract = true, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch$I", @CanonicalName = "RecordPatternsExhaustiveSwitch.I", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = true, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = true, @SimpleName = "I", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{sealed, abstract, static}", @ExplicitModifiers = "{sealed}"] - | +- PermitsList[@Empty = false, @Size = 2] - | | +- ClassType[@FullyQualified = false, @SimpleName = "C"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "D"] - | +- ClassBody[@Empty = true, @Size = 0] - +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch$C", @CanonicalName = "RecordPatternsExhaustiveSwitch.C", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "C", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"] - | +- ImplementsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] - | +- ClassBody[@Empty = true, @Size = 0] - +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch$D", @CanonicalName = "RecordPatternsExhaustiveSwitch.D", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "D", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"] - | +- ImplementsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] - | +- ClassBody[@Empty = true, @Size = 0] - +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch$Pair", @CanonicalName = "RecordPatternsExhaustiveSwitch.Pair", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Pair", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] - | +- TypeParameters[@Empty = false, @Size = 1] - | | +- TypeParameter[@Image = "T", @Name = "T", @TypeBound = false] - | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] - | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "T"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] - | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "T"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] - | +- RecordBody[@Empty = true, @Size = 0] - +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "test", @Name = "test", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - +- VoidType[] - +- FormalParameters[@Empty = true, @Size = 0] - +- Block[@Empty = false, @Size = 5, @containsComment = false] - +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] - | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] - | +- VariableDeclarator[@Initializer = true, @Name = "p1"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "p1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] - +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] - | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] - | +- VariableDeclarator[@Initializer = true, @Name = "p2"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "p2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] - +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "p1", @Name = "p1", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- RecordPattern[@ParenthesisDepth = 0] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] - | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] - | | | +- PatternList[@Empty = false, @Size = 2] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "B"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- RecordPattern[@ParenthesisDepth = 0] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] - | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] - | | | +- PatternList[@Empty = false, @Size = 2] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "B"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- SwitchArrowBranch[@Default = false] - | +- SwitchLabel[@Default = false] - | | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] - | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] - | | +- PatternList[@Empty = false, @Size = 2] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a1", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a2", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "exhaustive now", @Empty = false, @Image = "\"exhaustive now\"", @Length = 14, @LiteralText = "\"exhaustive now\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "p2", @Name = "p2", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- RecordPattern[@ParenthesisDepth = 0] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] - | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] - | | | +- PatternList[@Empty = false, @Size = 2] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "C"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- SwitchArrowBranch[@Default = false] - | +- SwitchLabel[@Default = false] - | | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] - | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] - | | +- PatternList[@Empty = false, @Size = 2] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "D"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] - +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "p2", @Name = "p2", @ParenthesisDepth = 0, @Parenthesized = false] - +- SwitchArrowBranch[@Default = false] - | +- SwitchLabel[@Default = false] - | | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] - | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] - | | +- PatternList[@Empty = false, @Size = 2] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "C"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- SwitchArrowBranch[@Default = false] - | +- SwitchLabel[@Default = false] - | | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] - | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] - | | +- PatternList[@Empty = false, @Size = 2] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "D"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "C"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- SwitchArrowBranch[@Default = false] - +- SwitchLabel[@Default = false] - | +- RecordPattern[@ParenthesisDepth = 0] - | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] - | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] - | +- PatternList[@Empty = false, @Size = 2] - | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "D"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d1", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- ClassType[@FullyQualified = false, @SimpleName = "D"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d2", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - +- ArgumentList[@Empty = false, @Size = 1] - +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsInEnhancedFor.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsInEnhancedFor.java deleted file mode 100644 index 0f3b5f2274..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsInEnhancedFor.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -/** - * @see JEP 432: Record Patterns (Second Preview) - */ -public class RecordPatternsInEnhancedFor { - record Point(int x, int y) {} - enum Color { RED, GREEN, BLUE } - record ColoredPoint(Point p, Color c) {} - record Rectangle(ColoredPoint upperLeft, ColoredPoint lowerRight) {} - - // record patterns in for-each loop (enhanced for statement) - static void dump(Point[] pointArray) { - for (Point(var x, var y) : pointArray) { // Record Pattern in header! - System.out.println("(" + x + ", " + y + ")"); - } - } - - // nested record patterns in enhanced for statement - static void printUpperLeftColors(Rectangle[] r) { - for (Rectangle(ColoredPoint(Point p, Color c), ColoredPoint lr): r) { - System.out.println(c); - } - } - - record Pair(Object fst, Object snd){} - static void exceptionTest() { - Pair[] ps = new Pair[]{ - new Pair(1,2), - null, - new Pair("hello","world") - }; - for (Pair(var f, var s): ps) { // Run-time MatchException - System.out.println(f + " -> " + s); - } - } - - public static void main(String[] args) { - exceptionTest(); - } -} diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsInEnhancedFor.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsInEnhancedFor.txt deleted file mode 100644 index 3a29eeffca..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsInEnhancedFor.txt +++ /dev/null @@ -1,215 +0,0 @@ -+- CompilationUnit[@PackageName = ""] - +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsInEnhancedFor", @CanonicalName = "RecordPatternsInEnhancedFor", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "RecordPatternsInEnhancedFor", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] - +- ClassBody[@Empty = false, @Size = 9] - +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsInEnhancedFor$Point", @CanonicalName = "RecordPatternsInEnhancedFor.Point", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Point", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] - | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] - | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] - | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] - | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] - | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] - | +- RecordBody[@Empty = true, @Size = 0] - +- EnumDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsInEnhancedFor$Color", @CanonicalName = "RecordPatternsInEnhancedFor.Color", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = true, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Color", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] - | +- EnumBody[@Empty = false, @SeparatorSemi = false, @Size = 3, @TrailingComma = false] - | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "RED", @MethodName = "new", @Name = "RED", @Visibility = Visibility.V_PUBLIC] - | | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "RED", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] - | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "GREEN", @MethodName = "new", @Name = "GREEN", @Visibility = Visibility.V_PUBLIC] - | | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "GREEN", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] - | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "BLUE", @MethodName = "new", @Name = "BLUE", @Visibility = Visibility.V_PUBLIC] - | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "BLUE", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] - +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsInEnhancedFor$ColoredPoint", @CanonicalName = "RecordPatternsInEnhancedFor.ColoredPoint", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "ColoredPoint", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] - | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] - | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] - | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] - | +- RecordBody[@Empty = true, @Size = 0] - +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsInEnhancedFor$Rectangle", @CanonicalName = "RecordPatternsInEnhancedFor.Rectangle", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Rectangle", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] - | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] - | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "upperLeft", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] - | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lowerRight", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] - | +- RecordBody[@Empty = true, @Size = 0] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "dump", @Name = "dump", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ArrayType[@ArrayDepth = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] - | | | +- ArrayDimensions[@Empty = false, @Size = 1] - | | | +- ArrayTypeDim[@Varargs = false] - | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "pointArray", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- ForeachStatement[] - | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] - | | +- PatternList[@Empty = false, @Size = 2] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "pointArray", @Name = "pointArray", @ParenthesisDepth = 0, @Parenthesized = false] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "(", @Empty = false, @Image = "\"(\"", @Length = 1, @LiteralText = "\"(\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = ", ", @Empty = false, @Image = "\", \"", @Length = 2, @LiteralText = "\", \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "y", @Name = "y", @ParenthesisDepth = 0, @Parenthesized = false] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = ")", @Empty = false, @Image = "\")\"", @Length = 1, @LiteralText = "\")\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "printUpperLeftColors", @Name = "printUpperLeftColors", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ArrayType[@ArrayDepth = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] - | | | +- ArrayDimensions[@Empty = false, @Size = 1] - | | | +- ArrayTypeDim[@Varargs = false] - | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- ForeachStatement[] - | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] - | | +- PatternList[@Empty = false, @Size = 2] - | | +- RecordPattern[@ParenthesisDepth = 0] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] - | | | +- PatternList[@Empty = false, @Size = 2] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false] - +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsInEnhancedFor$Pair", @CanonicalName = "RecordPatternsInEnhancedFor.Pair", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Pair", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] - | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] - | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "fst", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] - | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "snd", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] - | +- RecordBody[@Empty = true, @Size = 0] - +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "exceptionTest", @Name = "exceptionTest", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | +- VoidType[] - | +- FormalParameters[@Empty = true, @Size = 0] - | +- Block[@Empty = false, @Size = 2, @containsComment = false] - | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ArrayType[@ArrayDepth = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] - | | | +- ArrayDimensions[@Empty = false, @Size = 1] - | | | +- ArrayTypeDim[@Varargs = false] - | | +- VariableDeclarator[@Initializer = true, @Name = "ps"] - | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "ps", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ArrayAllocation[@ArrayDepth = 1, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ArrayType[@ArrayDepth = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] - | | | +- ArrayDimensions[@Empty = false, @Size = 1] - | | | +- ArrayTypeDim[@Varargs = false] - | | +- ArrayInitializer[@CompileTimeConstant = false, @Length = 3, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] - | | | +- ArgumentList[@Empty = false, @Size = 2] - | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] - | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] - | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] - | | +- ArgumentList[@Empty = false, @Size = 2] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "hello", @Empty = false, @Image = "\"hello\"", @Length = 5, @LiteralText = "\"hello\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "world", @Empty = false, @Image = "\"world\"", @Length = 5, @LiteralText = "\"world\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- ForeachStatement[] - | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] - | | +- PatternList[@Empty = false, @Size = 2] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "f", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "ps", @Name = "ps", @ParenthesisDepth = 0, @Parenthesized = false] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "f", @Name = "f", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = " -> ", @Empty = false, @Image = "\" -> \"", @Length = 4, @LiteralText = "\" -> \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "main", @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] - +- VoidType[] - +- FormalParameters[@Empty = false, @Size = 1] - | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- ArrayType[@ArrayDepth = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- ArrayDimensions[@Empty = false, @Size = 1] - | | +- ArrayTypeDim[@Varargs = false] - | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - +- Block[@Empty = false, @Size = 1, @containsComment = false] - +- ExpressionStatement[] - +- MethodCall[@CompileTimeConstant = false, @Image = "exceptionTest", @MethodName = "exceptionTest", @ParenthesisDepth = 0, @Parenthesized = false] - +- ArgumentList[@Empty = true, @Size = 0] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RefiningPatternsInSwitch.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RefiningPatternsInSwitch.java deleted file mode 100644 index c2eadc6711..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RefiningPatternsInSwitch.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -/** - * @see JEP 433: Pattern Matching for switch (Fourth Preview) - */ -public class RefiningPatternsInSwitch { - - static class Shape {} - static class Rectangle extends Shape {} - static class Triangle extends Shape { - private int area; - Triangle(int area) { - this.area = area; - } - int calculateArea() { return area; } - } - - static void testTriangle(Shape s) { - switch (s) { - case null: - break; - case Triangle t: - if (t.calculateArea() > 100) { - System.out.println("Large triangle"); - break; - } - default: - System.out.println("A shape, possibly a small triangle"); - } - } - - static void testTriangleRefined(Shape s) { - switch (s) { - case null -> - { break; } - case Triangle t - when t.calculateArea() > 100 -> - System.out.println("Large triangle"); - default -> - System.out.println("A shape, possibly a small triangle"); - } - } - - static void testTriangleRefined2(Shape s) { - switch (s) { - case null -> - { break; } - case Triangle t - when t.calculateArea() > 100 -> - System.out.println("Large triangle"); - case Triangle t -> - System.out.println("Small triangle"); - default -> - System.out.println("Non-triangle"); - } - } - - public static void main(String[] args) { - Triangle large = new Triangle(200); - Triangle small = new Triangle(10); - Rectangle rect = new Rectangle(); - - testTriangle(large); - testTriangle(small); - testTriangle(rect); - - testTriangleRefined(large); - testTriangleRefined(small); - testTriangleRefined(rect); - - testTriangleRefined2(large); - testTriangleRefined2(small); - testTriangleRefined2(rect); - } -} diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RefiningPatternsInSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RefiningPatternsInSwitch.txt deleted file mode 100644 index 5a961e9b61..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RefiningPatternsInSwitch.txt +++ /dev/null @@ -1,257 +0,0 @@ -+- CompilationUnit[@PackageName = ""] - +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RefiningPatternsInSwitch", @CanonicalName = "RefiningPatternsInSwitch", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "RefiningPatternsInSwitch", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] - +- ClassBody[@Empty = false, @Size = 7] - +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RefiningPatternsInSwitch$Shape", @CanonicalName = "RefiningPatternsInSwitch.Shape", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Shape", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | +- ClassBody[@Empty = true, @Size = 0] - +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RefiningPatternsInSwitch$Rectangle", @CanonicalName = "RefiningPatternsInSwitch.Rectangle", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Rectangle", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | +- ExtendsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Shape"] - | +- ClassBody[@Empty = true, @Size = 0] - +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RefiningPatternsInSwitch$Triangle", @CanonicalName = "RefiningPatternsInSwitch.Triangle", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Triangle", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | +- ExtendsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Shape"] - | +- ClassBody[@Empty = false, @Size = 3] - | +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private}", @ExplicitModifiers = "{private}"] - | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | +- VariableDeclarator[@Initializer = false, @Name = "area"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "area", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] - | +- ConstructorDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "Triangle", @Name = "Triangle", @Varargs = false, @Visibility = Visibility.V_PACKAGE, @containsComment = false] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- FormalParameters[@Empty = false, @Size = 1] - | | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "area", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | | +- ExpressionStatement[] - | | +- AssignmentExpression[@CompileTimeConstant = false, @Compound = false, @Operator = AssignmentOp.ASSIGN, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "area", @Name = "area", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ThisExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "area", @Name = "area", @ParenthesisDepth = 0, @Parenthesized = false] - | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "calculateArea", @Name = "calculateArea", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | +- FormalParameters[@Empty = true, @Size = 0] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- ReturnStatement[] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "area", @Name = "area", @ParenthesisDepth = 0, @Parenthesized = false] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "testTriangle", @Name = "testTriangle", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Shape"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchFallthroughBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- BreakStatement[@Label = null] - | +- SwitchFallthroughBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- IfStatement[@Else = false] - | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "calculateArea", @MethodName = "calculateArea", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "t", @Name = "t", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ArgumentList[@Empty = true, @Size = 0] - | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "100", @IntLiteral = true, @Integral = true, @LiteralText = "100", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 100.0, @ValueAsFloat = 100.0, @ValueAsInt = 100, @ValueAsLong = 100] - | | +- Block[@Empty = false, @Size = 2, @containsComment = false] - | | +- ExpressionStatement[] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Large triangle", @Empty = false, @Image = "\"Large triangle\"", @Length = 14, @LiteralText = "\"Large triangle\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- BreakStatement[@Label = null] - | +- SwitchFallthroughBranch[@Default = true] - | +- SwitchLabel[@Default = true] - | +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "A shape, possibly a small triangle", @Empty = false, @Image = "\"A shape, possibly a small triangle\"", @Length = 34, @LiteralText = "\"A shape, possibly a small triangle\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "testTriangleRefined", @Name = "testTriangleRefined", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Shape"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | | +- BreakStatement[@Label = null] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- Guard[] - | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "calculateArea", @MethodName = "calculateArea", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "t", @Name = "t", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ArgumentList[@Empty = true, @Size = 0] - | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "100", @IntLiteral = true, @Integral = true, @LiteralText = "100", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 100.0, @ValueAsFloat = 100.0, @ValueAsInt = 100, @ValueAsLong = 100] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Large triangle", @Empty = false, @Image = "\"Large triangle\"", @Length = 14, @LiteralText = "\"Large triangle\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- SwitchArrowBranch[@Default = true] - | +- SwitchLabel[@Default = true] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "A shape, possibly a small triangle", @Empty = false, @Image = "\"A shape, possibly a small triangle\"", @Length = 34, @LiteralText = "\"A shape, possibly a small triangle\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "testTriangleRefined2", @Name = "testTriangleRefined2", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Shape"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | | +- BreakStatement[@Label = null] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- Guard[] - | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "calculateArea", @MethodName = "calculateArea", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "t", @Name = "t", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ArgumentList[@Empty = true, @Size = 0] - | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "100", @IntLiteral = true, @Integral = true, @LiteralText = "100", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 100.0, @ValueAsFloat = 100.0, @ValueAsInt = 100, @ValueAsLong = 100] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Large triangle", @Empty = false, @Image = "\"Large triangle\"", @Length = 14, @LiteralText = "\"Large triangle\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Small triangle", @Empty = false, @Image = "\"Small triangle\"", @Length = 14, @LiteralText = "\"Small triangle\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- SwitchArrowBranch[@Default = true] - | +- SwitchLabel[@Default = true] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Non-triangle", @Empty = false, @Image = "\"Non-triangle\"", @Length = 12, @LiteralText = "\"Non-triangle\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "main", @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] - +- VoidType[] - +- FormalParameters[@Empty = false, @Size = 1] - | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- ArrayType[@ArrayDepth = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- ArrayDimensions[@Empty = false, @Size = 1] - | | +- ArrayTypeDim[@Varargs = false] - | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - +- Block[@Empty = false, @Size = 12, @containsComment = false] - +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"] - | +- VariableDeclarator[@Initializer = true, @Name = "large"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "large", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "200", @IntLiteral = true, @Integral = true, @LiteralText = "200", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 200.0, @ValueAsFloat = 200.0, @ValueAsInt = 200, @ValueAsLong = 200] - +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"] - | +- VariableDeclarator[@Initializer = true, @Name = "small"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "small", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "10", @IntLiteral = true, @Integral = true, @LiteralText = "10", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 10.0, @ValueAsFloat = 10.0, @ValueAsInt = 10, @ValueAsLong = 10] - +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] - | +- VariableDeclarator[@Initializer = true, @Name = "rect"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "rect", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] - | +- ArgumentList[@Empty = true, @Size = 0] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "testTriangle", @MethodName = "testTriangle", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "large", @Name = "large", @ParenthesisDepth = 0, @Parenthesized = false] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "testTriangle", @MethodName = "testTriangle", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "small", @Name = "small", @ParenthesisDepth = 0, @Parenthesized = false] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "testTriangle", @MethodName = "testTriangle", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "rect", @Name = "rect", @ParenthesisDepth = 0, @Parenthesized = false] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "testTriangleRefined", @MethodName = "testTriangleRefined", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "large", @Name = "large", @ParenthesisDepth = 0, @Parenthesized = false] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "testTriangleRefined", @MethodName = "testTriangleRefined", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "small", @Name = "small", @ParenthesisDepth = 0, @Parenthesized = false] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "testTriangleRefined", @MethodName = "testTriangleRefined", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "rect", @Name = "rect", @ParenthesisDepth = 0, @Parenthesized = false] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "testTriangleRefined2", @MethodName = "testTriangleRefined2", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "large", @Name = "large", @ParenthesisDepth = 0, @Parenthesized = false] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "testTriangleRefined2", @MethodName = "testTriangleRefined2", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "small", @Name = "small", @ParenthesisDepth = 0, @Parenthesized = false] - +- ExpressionStatement[] - +- MethodCall[@CompileTimeConstant = false, @Image = "testTriangleRefined2", @MethodName = "testTriangleRefined2", @ParenthesisDepth = 0, @Parenthesized = false] - +- ArgumentList[@Empty = false, @Size = 1] - +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "rect", @Name = "rect", @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ScopeOfPatternVariableDeclarations.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ScopeOfPatternVariableDeclarations.java deleted file mode 100644 index d65340e4da..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ScopeOfPatternVariableDeclarations.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -/** - * @see JEP 433: Pattern Matching for switch (Fourth Preview) - */ -public class ScopeOfPatternVariableDeclarations { - - static void testSwitchBlock(Object obj) { - switch (obj) { - case Character c - when c.charValue() == 7: - System.out.println("Ding!"); - break; - default: - break; - } - } - - static void testSwitchRule(Object o) { - switch (o) { - case Character c -> { - if (c.charValue() == 7) { - System.out.println("Ding!"); - } - System.out.println("Character"); - } - case Integer i -> - throw new IllegalStateException("Invalid Integer argument of value " + i.intValue()); - default -> { - break; - } - } - } - - - static void test2(Object o) { - switch (o) { - case Character c: - if (c.charValue() == 7) { - System.out.print("Ding "); - } - if (c.charValue() == 9) { - System.out.print("Tab "); - } - System.out.println("character"); - default: - System.out.println("fall-through"); - } - } - - - public static void main(String[] args) { - testSwitchBlock('\u0007'); - testSwitchRule('A'); - try { - testSwitchRule(42); // throws - } catch (IllegalStateException e) { - System.out.println(e); - } - test2('\t'); - } -} diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ScopeOfPatternVariableDeclarations.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ScopeOfPatternVariableDeclarations.txt deleted file mode 100644 index 50fa9893ec..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ScopeOfPatternVariableDeclarations.txt +++ /dev/null @@ -1,200 +0,0 @@ -+- CompilationUnit[@PackageName = ""] - +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ScopeOfPatternVariableDeclarations", @CanonicalName = "ScopeOfPatternVariableDeclarations", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "ScopeOfPatternVariableDeclarations", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] - +- ClassBody[@Empty = false, @Size = 4] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "testSwitchBlock", @Name = "testSwitchBlock", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "obj", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchFallthroughBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Character"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- Guard[] - | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "charValue", @MethodName = "charValue", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ArgumentList[@Empty = true, @Size = 0] - | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "7", @IntLiteral = true, @Integral = true, @LiteralText = "7", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 7.0, @ValueAsFloat = 7.0, @ValueAsInt = 7, @ValueAsLong = 7] - | | +- ExpressionStatement[] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Ding!", @Empty = false, @Image = "\"Ding!\"", @Length = 5, @LiteralText = "\"Ding!\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- BreakStatement[@Label = null] - | +- SwitchFallthroughBranch[@Default = true] - | +- SwitchLabel[@Default = true] - | +- BreakStatement[@Label = null] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "testSwitchRule", @Name = "testSwitchRule", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Character"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- Block[@Empty = false, @Size = 2, @containsComment = false] - | | +- IfStatement[@Else = false] - | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- MethodCall[@CompileTimeConstant = false, @Image = "charValue", @MethodName = "charValue", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | | +- ArgumentList[@Empty = true, @Size = 0] - | | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "7", @IntLiteral = true, @Integral = true, @LiteralText = "7", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 7.0, @ValueAsFloat = 7.0, @ValueAsInt = 7, @ValueAsLong = 7] - | | | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | | | +- ExpressionStatement[] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Ding!", @Empty = false, @Image = "\"Ding!\"", @Length = 5, @LiteralText = "\"Ding!\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- ExpressionStatement[] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Character", @Empty = false, @Image = "\"Character\"", @Length = 9, @LiteralText = "\"Character\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ThrowStatement[] - | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "IllegalStateException"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Invalid Integer argument of value ", @Empty = false, @Image = "\"Invalid Integer argument of value \"", @Length = 34, @LiteralText = "\"Invalid Integer argument of value \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "intValue", @MethodName = "intValue", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ArgumentList[@Empty = true, @Size = 0] - | +- SwitchArrowBranch[@Default = true] - | +- SwitchLabel[@Default = true] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- BreakStatement[@Label = null] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "test2", @Name = "test2", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchFallthroughBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Character"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- IfStatement[@Else = false] - | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- MethodCall[@CompileTimeConstant = false, @Image = "charValue", @MethodName = "charValue", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | | +- ArgumentList[@Empty = true, @Size = 0] - | | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "7", @IntLiteral = true, @Integral = true, @LiteralText = "7", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 7.0, @ValueAsFloat = 7.0, @ValueAsInt = 7, @ValueAsLong = 7] - | | | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | | | +- ExpressionStatement[] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "print", @MethodName = "print", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Ding ", @Empty = false, @Image = "\"Ding \"", @Length = 5, @LiteralText = "\"Ding \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- IfStatement[@Else = false] - | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- MethodCall[@CompileTimeConstant = false, @Image = "charValue", @MethodName = "charValue", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | | +- ArgumentList[@Empty = true, @Size = 0] - | | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "9", @IntLiteral = true, @Integral = true, @LiteralText = "9", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 9.0, @ValueAsFloat = 9.0, @ValueAsInt = 9, @ValueAsLong = 9] - | | | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | | | +- ExpressionStatement[] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "print", @MethodName = "print", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Tab ", @Empty = false, @Image = "\"Tab \"", @Length = 4, @LiteralText = "\"Tab \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- ExpressionStatement[] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "character", @Empty = false, @Image = "\"character\"", @Length = 9, @LiteralText = "\"character\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- SwitchFallthroughBranch[@Default = true] - | +- SwitchLabel[@Default = true] - | +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "fall-through", @Empty = false, @Image = "\"fall-through\"", @Length = 12, @LiteralText = "\"fall-through\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "main", @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] - +- VoidType[] - +- FormalParameters[@Empty = false, @Size = 1] - | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- ArrayType[@ArrayDepth = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- ArrayDimensions[@Empty = false, @Size = 1] - | | +- ArrayTypeDim[@Varargs = false] - | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - +- Block[@Empty = false, @Size = 4, @containsComment = false] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "testSwitchBlock", @MethodName = "testSwitchBlock", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- CharLiteral[@CompileTimeConstant = true, @Image = "\'\u0007\'", @LiteralText = "\'\u0007\'", @ParenthesisDepth = 0, @Parenthesized = false] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "testSwitchRule", @MethodName = "testSwitchRule", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- CharLiteral[@CompileTimeConstant = true, @Image = "\'A\'", @LiteralText = "\'A\'", @ParenthesisDepth = 0, @Parenthesized = false] - +- TryStatement[@TryWithResources = false] - | +- Block[@Empty = false, @Size = 1, @containsComment = true] - | | +- ExpressionStatement[] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "testSwitchRule", @MethodName = "testSwitchRule", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "42", @IntLiteral = true, @Integral = true, @LiteralText = "42", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42] - | +- CatchClause[] - | +- CatchParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Multicatch = false, @Name = "e", @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "IllegalStateException"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "e", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "e", @Name = "e", @ParenthesisDepth = 0, @Parenthesized = false] - +- ExpressionStatement[] - +- MethodCall[@CompileTimeConstant = false, @Image = "test2", @MethodName = "test2", @ParenthesisDepth = 0, @Parenthesized = false] - +- ArgumentList[@Empty = false, @Size = 1] - +- CharLiteral[@CompileTimeConstant = true, @Image = "\'\\t\'", @LiteralText = "\'\\t\'", @ParenthesisDepth = 0, @Parenthesized = false] From c4eccf49af308bdf2b9521f80090968048952c18 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 15 Feb 2024 10:03:37 +0100 Subject: [PATCH 06/52] [java] Remove old java 20 preview features - Record patterns in enhanced for statements - parenthesized patterns These features have not been standardized. --- docs/pages/release_notes.md | 3 + pmd-java/etc/grammar/Java.jjt | 17 ++--- .../pmd/lang/java/ast/ASTPattern.java | 13 ---- .../pmd/lang/java/ast/ASTRecordPattern.java | 16 ----- .../pmd/lang/java/ast/ASTTypePattern.java | 16 +---- .../pmd/lang/java/ast/ASTUnnamedPattern.java | 5 -- .../pmd/lang/java/ast/AstImplUtil.java | 16 ----- .../java16/PatternMatchingInstanceof.txt | 14 ++-- .../java21/DealingWithNull.txt | 12 ++-- .../java21/EnhancedTypeCheckingSwitch.txt | 8 +-- .../java21/ExhaustiveSwitch.txt | 20 +++--- .../java21/GuardedPatterns.txt | 20 +++--- .../java21/Jep440_RecordPatterns.txt | 54 +++++++-------- .../Jep441_PatternMatchingForSwitch.txt | 32 ++++----- .../java21/PatternsInSwitchLabels.txt | 8 +-- .../jdkversiontests/java21/RecordPatterns.txt | 68 +++++++++---------- .../java21/RecordPatternsExhaustiveSwitch.txt | 48 ++++++------- .../java21/RefiningPatternsInSwitch.txt | 8 +-- .../ScopeOfPatternVariableDeclarations.txt | 8 +-- .../Jep443_UnnamedPatternsAndVariables.txt | 56 +++++++-------- 20 files changed, 187 insertions(+), 255 deletions(-) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 510d9a5fbf..8f567c6be6 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -235,6 +235,9 @@ The rules have been moved into categories with PMD 6. **pmd-java** * Support for Java 20 preview language features have been removed. The version "20-preview" is no longer available. +* {%jdoc java::lang.java.ast.ASTPattern %}, {%jdoc java::lang.java.ast.ASTRecordPattern %}, + {%jdoc java::lang.java.ast.ASTTypePattern %}, {%jdoc java::lang.java.ast.ASTUnnamedPattern %} + - method `getParenthesisDepth()` has been removed. **New API** diff --git a/pmd-java/etc/grammar/Java.jjt b/pmd-java/etc/grammar/Java.jjt index df8f248e1f..69522d60fe 100644 --- a/pmd-java/etc/grammar/Java.jjt +++ b/pmd-java/etc/grammar/Java.jjt @@ -1,4 +1,8 @@ /** + * Remove support for Record pattern in enhanced for statements. This was only a Java 20 Preview feature. + * Remove support for ParenthesizedPatterns. This was only a Java 20 Preview feature. + * Andreas Dangel 02/2024 + *==================================================================== * Renamed various nodes: * ClassOrInterfaceType -> ClassType * ClassOrInterfaceDeclaration -> ClassDeclaration @@ -1895,18 +1899,9 @@ void Pattern() #void: {} { LOOKAHEAD((Annotation())* ReferenceType() "(") RecordPattern() - | LOOKAHEAD("(") ParenthesizedPattern() | TypePattern() } -// ParenthesizedPatterns are removed with Java 21 (JEP 441), but needed for now to support Java 20 Preview -// TODO: Remove ParenthesizedPattern once java 20-preview is removed -void ParenthesizedPattern() #void: -{} -{ - "(" Pattern() ")" { AstImplUtil.bumpParenDepth((ASTPattern) jjtree.peekNode()); } -} - void TypePattern(): {} { @@ -2771,9 +2766,7 @@ void ForStatement() #void: void EnhancedForDeclaration() #void: {} { - LOOKAHEAD(LocalVariableDeclaration()) LocalVariableDeclaration() - // TODO: a recored pattern here is only valid with Java 20 Preview and not anymore with Java 21 (see JEP 440) - | RecordPattern() + LocalVariableDeclaration() } void ForInit() : diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTPattern.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTPattern.java index e80ed54084..eeedf1aaa8 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTPattern.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTPattern.java @@ -4,8 +4,6 @@ package net.sourceforge.pmd.lang.java.ast; -import net.sourceforge.pmd.annotation.Experimental; - /** * A pattern for pattern matching constructs like {@link ASTInfixExpression InstanceOfExpression} * or within a {@link ASTSwitchLabel}). This is a JDK 16 feature. @@ -21,18 +19,7 @@ import net.sourceforge.pmd.annotation.Experimental; * * * @see JEP 394: Pattern Matching for instanceof (Java 16) - * @see JEP 405: Record Patterns (Preview) (Java 19) - * @see JEP 432: Record Patterns (Second Preview) (Java 20) * @see JEP 440: Record Patterns (Java 21) */ public interface ASTPattern extends JavaNode { - - /** - * Returns the number of parenthesis levels around this pattern. - * If this method returns 0, then no parentheses are present. - * @deprecated Parenthesized patterns are only possible with Java 20 Preview and are removed with Java 21. - */ - @Experimental - @Deprecated - int getParenthesisDepth(); } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTRecordPattern.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTRecordPattern.java index ee9da2fb40..f16730342f 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTRecordPattern.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTRecordPattern.java @@ -5,8 +5,6 @@ package net.sourceforge.pmd.lang.java.ast; -import net.sourceforge.pmd.annotation.Experimental; - /** * A record pattern, a Java 21 language feature. * @@ -17,14 +15,10 @@ import net.sourceforge.pmd.annotation.Experimental; * * * @see ASTRecordDeclaration - * @see JEP 405: Record Patterns (Preview) (Java 19) - * @see JEP 432: Record Patterns (Second Preview) (Java 20) * @see JEP 440: Record Patterns (Java 21) */ public final class ASTRecordPattern extends AbstractJavaNode implements ASTPattern { - private int parenDepth; - ASTRecordPattern(int id) { super(id); } @@ -45,14 +39,4 @@ public final class ASTRecordPattern extends AbstractJavaNode implements ASTPatte public ASTVariableId getVarId() { return firstChild(ASTVariableId.class); } - - void bumpParenDepth() { - parenDepth++; - } - - @Override - @Experimental - public int getParenthesisDepth() { - return parenDepth; - } } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTypePattern.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTypePattern.java index bcbe9802ba..3a99a89ea2 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTypePattern.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTypePattern.java @@ -8,8 +8,6 @@ import java.util.Objects; import org.checkerframework.checker.nullness.qual.NonNull; -import net.sourceforge.pmd.annotation.Experimental; - /** * A type pattern (JDK16). This can be found on * the right-hand side of an {@link ASTInfixExpression InstanceOfExpression}, @@ -21,12 +19,10 @@ import net.sourceforge.pmd.annotation.Experimental; * * * - * @see JEP 394: Pattern Matching for instanceof + * @see JEP 394: Pattern Matching for instanceof (Java 16) */ public final class ASTTypePattern extends AbstractJavaNode implements ASTPattern, ModifierOwner { - private int parenDepth; - ASTTypePattern(int id) { super(id); } @@ -47,14 +43,4 @@ public final class ASTTypePattern extends AbstractJavaNode implements ASTPattern public @NonNull ASTVariableId getVarId() { return Objects.requireNonNull(firstChild(ASTVariableId.class)); } - - void bumpParenDepth() { - parenDepth++; - } - - @Override - @Experimental - public int getParenthesisDepth() { - return parenDepth; - } } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTUnnamedPattern.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTUnnamedPattern.java index 641e932458..6eed6e6d93 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTUnnamedPattern.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTUnnamedPattern.java @@ -29,9 +29,4 @@ public final class ASTUnnamedPattern extends AbstractJavaNode implements ASTPatt protected R acceptVisitor(JavaVisitor visitor, P data) { return visitor.visit(this, data); } - - @Override - public int getParenthesisDepth() { - return 0; - } } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/AstImplUtil.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/AstImplUtil.java index 5ed897d23a..e82aa68a37 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/AstImplUtil.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/AstImplUtil.java @@ -47,20 +47,4 @@ final class AstImplUtil { ((AbstractJavaExpr) expression).bumpParenDepth(); } - - /** - * @deprecated Parenthesized patterns are only possible with Java 20 Preview and are removed with Java 21. - */ - @Deprecated - static void bumpParenDepth(ASTPattern pattern) { - assert pattern instanceof ASTTypePattern - || pattern instanceof ASTRecordPattern - : pattern.getClass() + " doesn't have parenDepth attribute!"; - - if (pattern instanceof ASTTypePattern) { - ((ASTTypePattern) pattern).bumpParenDepth(); - } else if (pattern instanceof ASTRecordPattern) { - ((ASTRecordPattern) pattern).bumpParenDepth(); - } - } } diff --git a/pmd-java/src/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 4dd88b2d5d..040bd905eb 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/PatternMatchingInstanceof.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/PatternMatchingInstanceof.txt @@ -33,7 +33,7 @@ | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -85,7 +85,7 @@ | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 1, @Parenthesized = true] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -118,7 +118,7 @@ | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -144,7 +144,7 @@ | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -169,7 +169,7 @@ | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -201,7 +201,7 @@ | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- Annotation[@SimpleName = "Deprecated"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Deprecated"] @@ -235,7 +235,7 @@ | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"] | | | +- Annotation[@SimpleName = "Deprecated"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Deprecated"] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/DealingWithNull.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/DealingWithNull.txt index b8bf1c9fc8..6e3acc92f2 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/DealingWithNull.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/DealingWithNull.txt @@ -53,7 +53,7 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -95,7 +95,7 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -136,7 +136,7 @@ | | +- ArgumentList[@Empty = true, @Size = 0] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -150,7 +150,7 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -192,7 +192,7 @@ | | | +- BreakStatement[@Label = null] | | +- SwitchFallthroughBranch[@Default = false] | | | +- SwitchLabel[@Default = false] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -227,7 +227,7 @@ | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "null", @Empty = false, @Image = "\"null\"", @Length = 4, @LiteralText = "\"null\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- SwitchArrowBranch[@Default = false] | | | +- SwitchLabel[@Default = false] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/EnhancedTypeCheckingSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/EnhancedTypeCheckingSwitch.txt index 467b41816f..076c8640c5 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/EnhancedTypeCheckingSwitch.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/EnhancedTypeCheckingSwitch.txt @@ -48,7 +48,7 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "null", @Empty = false, @Image = "\"null\"", @Length = 4, @LiteralText = "\"null\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -60,7 +60,7 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String", @Empty = false, @Image = "\"String\"", @Length = 6, @LiteralText = "\"String\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -76,7 +76,7 @@ | | +- ArgumentList[@Empty = true, @Size = 0] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -92,7 +92,7 @@ | | +- ArgumentList[@Empty = true, @Size = 0] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ArrayType[@ArrayDepth = 1] | | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ExhaustiveSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ExhaustiveSwitch.txt index 90d5a427d0..71f2d7c7ab 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ExhaustiveSwitch.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ExhaustiveSwitch.txt @@ -16,7 +16,7 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -25,7 +25,7 @@ | | +- ArgumentList[@Empty = true, @Size = 0] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -46,7 +46,7 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchFallthroughBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -60,7 +60,7 @@ | | +- BreakStatement[@Label = null] | +- SwitchFallthroughBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -116,21 +116,21 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "B"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] | +- SwitchArrowBranch[@Default = false] | +- SwitchLabel[@Default = false] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "C"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -148,7 +148,7 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] | | +- SwitchFallthroughBranch[@Default = false] | | | +- SwitchLabel[@Default = false] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -162,7 +162,7 @@ | | | +- BreakStatement[@Label = null] | | +- SwitchFallthroughBranch[@Default = false] | | | +- SwitchLabel[@Default = false] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "C"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -227,7 +227,7 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | +- SwitchLabel[@Default = false] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "F"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/GuardedPatterns.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/GuardedPatterns.txt index be1b066f9d..de9bc407a5 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/GuardedPatterns.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/GuardedPatterns.txt @@ -15,7 +15,7 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -33,7 +33,7 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "single char string", @Empty = false, @Image = "\"single char string\"", @Length = 18, @LiteralText = "\"single char string\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -45,7 +45,7 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "string", @Empty = false, @Image = "\"string\"", @Length = 6, @LiteralText = "\"string\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -119,7 +119,7 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -137,7 +137,7 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "single char string", @Empty = false, @Image = "\"single char string\"", @Length = 18, @LiteralText = "\"single char string\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -149,7 +149,7 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "string", @Empty = false, @Image = "\"string\"", @Length = 6, @LiteralText = "\"string\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -196,7 +196,7 @@ | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -222,7 +222,7 @@ | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -244,7 +244,7 @@ | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 1, @Parenthesized = true] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -275,7 +275,7 @@ | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 1, @Parenthesized = true] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep440_RecordPatterns.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep440_RecordPatterns.txt index 8a5dd29bfb..694d2a5d5f 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep440_RecordPatterns.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep440_RecordPatterns.txt @@ -27,14 +27,14 @@ | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] | | +- PatternList[@Empty = false, @Size = 2] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -97,21 +97,21 @@ | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] | | +- PatternList[@Empty = false, @Size = 2] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] | | | +- PatternList[@Empty = false, @Size = 2] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -136,28 +136,28 @@ | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] | | +- PatternList[@Empty = false, @Size = 2] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] | | | +- PatternList[@Empty = false, @Size = 2] - | | | +- RecordPattern[@ParenthesisDepth = 0] + | | | +- RecordPattern[] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] | | | | +- PatternList[@Empty = false, @Size = 2] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -202,14 +202,14 @@ | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "p", @Name = "p", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] | | +- PatternList[@Empty = false, @Size = 2] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -265,14 +265,14 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "pair", @Name = "pair", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | +- SwitchLabel[@Default = false] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | +- ClassType[@FullyQualified = false, @SimpleName = "MyPair"] | | +- PatternList[@Empty = false, @Size = 2] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "f", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -309,17 +309,17 @@ | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "bbs", @Name = "bbs", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- PatternList[@Empty = false, @Size = 1] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | +- PatternList[@Empty = false, @Size = 1] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -350,13 +350,13 @@ +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "bbs", @Name = "bbs", @ParenthesisDepth = 0, @Parenthesized = false] | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- RecordPattern[@ParenthesisDepth = 0] + | +- RecordPattern[] | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | +- PatternList[@Empty = false, @Size = 1] - | +- RecordPattern[@ParenthesisDepth = 0] + | +- RecordPattern[] | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | +- PatternList[@Empty = false, @Size = 1] - | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | +- ClassType[@FullyQualified = false, @SimpleName = "var"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep441_PatternMatchingForSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep441_PatternMatchingForSwitch.txt index 97bb756d4b..150946eeee 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep441_PatternMatchingForSwitch.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep441_PatternMatchingForSwitch.txt @@ -16,7 +16,7 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -28,7 +28,7 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Long"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "l", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -40,7 +40,7 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "l", @Name = "l", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Double"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -52,7 +52,7 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "d", @Name = "d", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -122,7 +122,7 @@ | | +- Block[@Empty = true, @Size = 0, @containsComment = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -141,7 +141,7 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "You got it", @Empty = false, @Image = "\"You got it\"", @Length = 10, @LiteralText = "\"You got it\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -160,7 +160,7 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Shame", @Empty = false, @Image = "\"Shame\"", @Length = 5, @LiteralText = "\"Shame\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | +- SwitchLabel[@Default = false] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -213,7 +213,7 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Shame", @Empty = false, @Image = "\"Shame\"", @Length = 5, @LiteralText = "\"Shame\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -232,7 +232,7 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "You got it", @Empty = false, @Image = "\"You got it\"", @Length = 10, @LiteralText = "\"You got it\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -251,7 +251,7 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Shame", @Empty = false, @Image = "\"Shame\"", @Length = 5, @LiteralText = "\"Shame\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | +- SwitchLabel[@Default = false] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -304,7 +304,7 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Suit"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -324,7 +324,7 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "It\'s clubs", @Empty = false, @Image = "\"It\'s clubs\"", @Length = 10, @LiteralText = "\"It\'s clubs\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Suit"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -344,7 +344,7 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "It\'s diamonds", @Empty = false, @Image = "\"It\'s diamonds\"", @Length = 13, @LiteralText = "\"It\'s diamonds\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Suit"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -364,7 +364,7 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "It\'s hearts", @Empty = false, @Image = "\"It\'s hearts\"", @Length = 11, @LiteralText = "\"It\'s hearts\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Suit"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -378,7 +378,7 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "It\'s spades", @Empty = false, @Image = "\"It\'s spades\"", @Length = 11, @LiteralText = "\"It\'s spades\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | +- SwitchLabel[@Default = false] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "Tarot"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -455,7 +455,7 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "It\'s spades", @Empty = false, @Image = "\"It\'s spades\"", @Length = 11, @LiteralText = "\"It\'s spades\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | +- SwitchLabel[@Default = false] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "Tarot"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/PatternsInSwitchLabels.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/PatternsInSwitchLabels.txt index d9f95d947e..745724d7a7 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/PatternsInSwitchLabels.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/PatternsInSwitchLabels.txt @@ -29,7 +29,7 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -41,7 +41,7 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Long"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "l", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -53,7 +53,7 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "l", @Name = "l", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Double"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -65,7 +65,7 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "d", @Name = "d", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatterns.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatterns.txt index 5fd641f5da..eb42a383fd 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatterns.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatterns.txt @@ -63,7 +63,7 @@ | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -106,14 +106,14 @@ | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] | | +- PatternList[@Empty = false, @Size = 2] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -140,14 +140,14 @@ | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] | | +- PatternList[@Empty = false, @Size = 2] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "ul", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -174,21 +174,21 @@ | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] | | +- PatternList[@Empty = false, @Size = 2] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] | | | +- PatternList[@Empty = false, @Size = 2] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -270,28 +270,28 @@ | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] | | +- PatternList[@Empty = false, @Size = 2] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] | | | +- PatternList[@Empty = false, @Size = 2] - | | | +- RecordPattern[@ParenthesisDepth = 0] + | | | +- RecordPattern[] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] | | | | +- PatternList[@Empty = false, @Size = 2] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -336,14 +336,14 @@ | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "p", @Name = "p", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] | | +- PatternList[@Empty = false, @Size = 2] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -392,12 +392,12 @@ | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "bo", @Name = "bo", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | | +- PatternList[@Empty = false, @Size = 1] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -426,12 +426,12 @@ | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "bo", @Name = "bo", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- PatternList[@Empty = false, @Size = 1] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -460,10 +460,10 @@ | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "bo", @Name = "bo", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | +- PatternList[@Empty = false, @Size = 1] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -494,17 +494,17 @@ | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "bo", @Name = "bo", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- PatternList[@Empty = false, @Size = 1] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | +- PatternList[@Empty = false, @Size = 1] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -535,13 +535,13 @@ +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "bo", @Name = "bo", @ParenthesisDepth = 0, @Parenthesized = false] | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- RecordPattern[@ParenthesisDepth = 0] + | +- RecordPattern[] | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | +- PatternList[@Empty = false, @Size = 1] - | +- RecordPattern[@ParenthesisDepth = 0] + | +- RecordPattern[] | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | +- PatternList[@Empty = false, @Size = 1] - | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | +- ClassType[@FullyQualified = false, @SimpleName = "var"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatternsExhaustiveSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatternsExhaustiveSwitch.txt index 93ed78d5f0..8e9d096f49 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatternsExhaustiveSwitch.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatternsExhaustiveSwitch.txt @@ -65,16 +65,16 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "p1", @Name = "p1", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- RecordPattern[@ParenthesisDepth = 0] + | | | +- RecordPattern[] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] | | | +- PatternList[@Empty = false, @Size = 2] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "B"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -86,16 +86,16 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- RecordPattern[@ParenthesisDepth = 0] + | | | +- RecordPattern[] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] | | | +- PatternList[@Empty = false, @Size = 2] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "B"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -107,16 +107,16 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | +- SwitchLabel[@Default = false] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] | | +- PatternList[@Empty = false, @Size = 2] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a1", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a2", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -130,16 +130,16 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "p2", @Name = "p2", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- RecordPattern[@ParenthesisDepth = 0] + | | | +- RecordPattern[] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] | | | +- PatternList[@Empty = false, @Size = 2] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "C"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -151,16 +151,16 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | +- SwitchLabel[@Default = false] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] | | +- PatternList[@Empty = false, @Size = 2] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "D"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -174,16 +174,16 @@ +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "p2", @Name = "p2", @ParenthesisDepth = 0, @Parenthesized = false] +- SwitchArrowBranch[@Default = false] | +- SwitchLabel[@Default = false] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] | | +- PatternList[@Empty = false, @Size = 2] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "C"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -195,16 +195,16 @@ | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- SwitchArrowBranch[@Default = false] | +- SwitchLabel[@Default = false] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] | | +- PatternList[@Empty = false, @Size = 2] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "D"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "C"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -216,16 +216,16 @@ | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- SwitchArrowBranch[@Default = false] +- SwitchLabel[@Default = false] - | +- RecordPattern[@ParenthesisDepth = 0] + | +- RecordPattern[] | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] | +- PatternList[@Empty = false, @Size = 2] - | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "D"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d1", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | +- ClassType[@FullyQualified = false, @SimpleName = "D"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d2", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RefiningPatternsInSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RefiningPatternsInSwitch.txt index 5a961e9b61..0757c10f56 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RefiningPatternsInSwitch.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RefiningPatternsInSwitch.txt @@ -57,7 +57,7 @@ | | +- BreakStatement[@Label = null] | +- SwitchFallthroughBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -103,7 +103,7 @@ | | +- BreakStatement[@Label = null] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -145,7 +145,7 @@ | | +- BreakStatement[@Label = null] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -163,7 +163,7 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Large triangle", @Empty = false, @Image = "\"Large triangle\"", @Length = 14, @LiteralText = "\"Large triangle\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ScopeOfPatternVariableDeclarations.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ScopeOfPatternVariableDeclarations.txt index 50fa9893ec..f559e29cd4 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ScopeOfPatternVariableDeclarations.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ScopeOfPatternVariableDeclarations.txt @@ -15,7 +15,7 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchFallthroughBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Character"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -49,7 +49,7 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Character"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -77,7 +77,7 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Character", @Empty = false, @Image = "\"Character\"", @Length = 9, @LiteralText = "\"Character\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -107,7 +107,7 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchFallthroughBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Character"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep443_UnnamedPatternsAndVariables.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep443_UnnamedPatternsAndVariables.txt index 5cd04c2718..fcb1e37135 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep443_UnnamedPatternsAndVariables.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep443_UnnamedPatternsAndVariables.txt @@ -67,14 +67,14 @@ | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- RecordPattern[@ParenthesisDepth = 0] + | | | +- RecordPattern[] | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] | | | +- PatternList[@Empty = false, @Size = 2] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -98,21 +98,21 @@ | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] | | +- PatternList[@Empty = false, @Size = 2] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] | | | +- PatternList[@Empty = false, @Size = 2] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- UnnamedPattern[@ParenthesisDepth = 0] + | | +- UnnamedPattern[] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -182,10 +182,10 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false] | | +- SwitchArrowBranch[@Default = false] | | | +- SwitchLabel[@Default = false] - | | | | +- RecordPattern[@ParenthesisDepth = 0] + | | | | +- RecordPattern[] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | | +- PatternList[@Empty = false, @Size = 1] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "RedBall"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -194,10 +194,10 @@ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false] | | +- SwitchArrowBranch[@Default = false] | | | +- SwitchLabel[@Default = false] - | | | | +- RecordPattern[@ParenthesisDepth = 0] + | | | | +- RecordPattern[] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | | +- PatternList[@Empty = false, @Size = 1] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "BlueBall"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -206,10 +206,10 @@ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false] | | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- RecordPattern[@ParenthesisDepth = 0] + | | | +- RecordPattern[] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | +- PatternList[@Empty = false, @Size = 1] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "GreenBall"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -219,17 +219,17 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false] | | +- SwitchArrowBranch[@Default = false] | | | +- SwitchLabel[@Default = false] - | | | | +- RecordPattern[@ParenthesisDepth = 0] + | | | | +- RecordPattern[] | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | | | +- PatternList[@Empty = false, @Size = 1] - | | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "RedBall"] | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | | +- RecordPattern[@ParenthesisDepth = 0] + | | | | +- RecordPattern[] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | | +- PatternList[@Empty = false, @Size = 1] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "BlueBall"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -238,10 +238,10 @@ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false] | | +- SwitchArrowBranch[@Default = false] | | | +- SwitchLabel[@Default = false] - | | | | +- RecordPattern[@ParenthesisDepth = 0] + | | | | +- RecordPattern[] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | | +- PatternList[@Empty = false, @Size = 1] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "GreenBall"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -249,10 +249,10 @@ | | | +- ArgumentList[@Empty = true, @Size = 0] | | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- RecordPattern[@ParenthesisDepth = 0] + | | | +- RecordPattern[] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | +- PatternList[@Empty = false, @Size = 1] - | | | +- UnnamedPattern[@ParenthesisDepth = 0] + | | | +- UnnamedPattern[] | | +- MethodCall[@CompileTimeConstant = false, @Image = "pickAnotherBox", @MethodName = "pickAnotherBox", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArgumentList[@Empty = true, @Size = 0] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -265,17 +265,17 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- RecordPattern[@ParenthesisDepth = 0] + | | | +- RecordPattern[] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | | +- PatternList[@Empty = false, @Size = 1] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "RedBall"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- RecordPattern[@ParenthesisDepth = 0] + | | | +- RecordPattern[] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | | +- PatternList[@Empty = false, @Size = 1] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "BlueBall"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -288,10 +288,10 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | +- SwitchLabel[@Default = false] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | +- PatternList[@Empty = false, @Size = 1] - | | +- UnnamedPattern[@ParenthesisDepth = 0] + | | +- UnnamedPattern[] | +- MethodCall[@CompileTimeConstant = false, @Image = "pickAnotherBox", @MethodName = "pickAnotherBox", @ParenthesisDepth = 0, @Parenthesized = false] | +- ArgumentList[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Image = "processBox", @Name = "processBox", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = true] From 96bc9ef6c6b9758993332e375409034fe081a1d9 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 15 Feb 2024 10:24:48 +0100 Subject: [PATCH 07/52] [java] Update LanguageLevelChecker#RegularLanguageFeature - after 20-preview is gone - Note: DECONSTRUCTION_PATTERNS_IN_ENHANCED_FOR_STATEMENT is completely gone. This was only available for 20-preview and has been removed with 21. --- .../ast/internal/LanguageLevelChecker.java | 97 ++++++++----------- .../pmd/lang/java/ast/Java21TreeDumpTest.java | 12 +-- 2 files changed, 49 insertions(+), 60 deletions(-) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/internal/LanguageLevelChecker.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/internal/LanguageLevelChecker.java index 2b1267f9ee..e6dbcd8437 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/internal/LanguageLevelChecker.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/internal/LanguageLevelChecker.java @@ -122,52 +122,6 @@ public class LanguageLevelChecker { * They might be also be standardized. */ private enum PreviewFeature implements LanguageFeature { - /** - * Pattern matching for switch - * @see JEP 406: Pattern Matching for switch (Preview) (Java 17) - * @see JEP 420: Pattern Matching for switch (Second Preview) (Java 18) - * @see JEP 427: Pattern Matching for switch (Third Preview) (Java 19) - * @see JEP 433: Pattern Matching for switch (Fourth Preview) (Java 20) - * @see JEP 441: Pattern Matching for switch (Java 21) - */ - PATTERNS_IN_SWITCH_STATEMENTS(17, 20, true), - - /** - * Part of pattern matching for switch - * @see #PATTERNS_IN_SWITCH_STATEMENTS - * @see JEP 406: Pattern Matching for switch (Preview) (Java 17) - * @see JEP 420: Pattern Matching for switch (Second Preview) (Java 18) - * @see JEP 427: Pattern Matching for switch (Third Preview) (Java 19) - * @see JEP 433: Pattern Matching for switch (Fourth Preview) (Java 20) - * @see JEP 441: Pattern Matching for switch (Java 21) - */ - NULL_IN_SWITCH_CASES(17, 20, true), - - /** - * Part of pattern matching for switch: Case refinement using "when" - * @see #PATTERNS_IN_SWITCH_STATEMENTS - * @see JEP 427: Pattern Matching for switch (Third Preview) (Java 19) - * @see JEP 433: Pattern Matching for switch (Fourth Preview) (Java 20) - * @see JEP 441: Pattern Matching for switch (Java 21) - */ - CASE_REFINEMENT(19, 20, true), - - /** - * Record patterns - * @see JEP 405: Record Patterns (Preview) (Java 19) - * @see JEP 432: Record Patterns (Second Preview) (Java 20) - * @see JEP 440: Record Patterns (Java 21) - */ - RECORD_PATTERNS(19, 20, true), - - /** - * Record deconstruction patterns in for-each loops. - * Note: support for this has been removed with Java 21 (JEP 440). - * @see JEP 432: Record Patterns (Second Preview) (Java 20) - * @see JEP 440: Record Patterns (Java 21) - */ - DECONSTRUCTION_PATTERNS_IN_ENHANCED_FOR_STATEMENT(20, 20, false), - /** * String Templates. * @see JEP 430: String Templates (Preview) (Java 21) @@ -378,6 +332,44 @@ public class LanguageLevelChecker { */ SEALED_CLASSES(17), + /** + * Pattern matching for switch + * @see JEP 406: Pattern Matching for switch (Preview) (Java 17) + * @see JEP 420: Pattern Matching for switch (Second Preview) (Java 18) + * @see JEP 427: Pattern Matching for switch (Third Preview) (Java 19) + * @see JEP 433: Pattern Matching for switch (Fourth Preview) (Java 20) + * @see JEP 441: Pattern Matching for switch (Java 21) + */ + PATTERNS_IN_SWITCH_STATEMENTS(21), + + /** + * Part of pattern matching for switch + * @see #PATTERNS_IN_SWITCH_STATEMENTS + * @see JEP 406: Pattern Matching for switch (Preview) (Java 17) + * @see JEP 420: Pattern Matching for switch (Second Preview) (Java 18) + * @see JEP 427: Pattern Matching for switch (Third Preview) (Java 19) + * @see JEP 433: Pattern Matching for switch (Fourth Preview) (Java 20) + * @see JEP 441: Pattern Matching for switch (Java 21) + */ + NULL_IN_SWITCH_CASES(21), + + /** + * Part of pattern matching for switch: Case refinement using "when" + * @see #PATTERNS_IN_SWITCH_STATEMENTS + * @see JEP 427: Pattern Matching for switch (Third Preview) (Java 19) + * @see JEP 433: Pattern Matching for switch (Fourth Preview) (Java 20) + * @see JEP 441: Pattern Matching for switch (Java 21) + */ + CASE_REFINEMENT(21), + + /** + * Record patterns + * @see JEP 405: Record Patterns (Preview) (Java 19) + * @see JEP 432: Record Patterns (Second Preview) (Java 20) + * @see JEP 440: Record Patterns (Java 21) + */ + RECORD_PATTERNS(21), + ; // SUPPRESS CHECKSTYLE enum trailing semi is awesome private final int minJdkLevel; @@ -512,9 +504,6 @@ public class LanguageLevelChecker { @Override public Void visit(ASTForeachStatement node, T data) { check(node, RegularLanguageFeature.FOREACH_LOOPS, data); - if (node.getFirstChild() instanceof ASTRecordPattern) { - check(node, PreviewFeature.DECONSTRUCTION_PATTERNS_IN_ENHANCED_FOR_STATEMENT, data); - } return null; } @@ -578,13 +567,13 @@ public class LanguageLevelChecker { @Override public Void visit(ASTRecordPattern node, T data) { - check(node, PreviewFeature.RECORD_PATTERNS, data); + check(node, RegularLanguageFeature.RECORD_PATTERNS, data); return null; } @Override public Void visit(ASTGuard node, T data) { - check(node, PreviewFeature.CASE_REFINEMENT, data); + check(node, RegularLanguageFeature.CASE_REFINEMENT, data); return null; } @@ -627,13 +616,13 @@ public class LanguageLevelChecker { check(node, RegularLanguageFeature.COMPOSITE_CASE_LABEL, data); } if (node.isDefault() && JavaTokenKinds.CASE == node.getFirstToken().getKind()) { - check(node, PreviewFeature.PATTERNS_IN_SWITCH_STATEMENTS, data); + check(node, RegularLanguageFeature.PATTERNS_IN_SWITCH_STATEMENTS, data); } if (node.getFirstChild() instanceof ASTNullLiteral) { - check(node, PreviewFeature.NULL_IN_SWITCH_CASES, data); + check(node, RegularLanguageFeature.NULL_IN_SWITCH_CASES, data); } if (node.getFirstChild() instanceof ASTPattern) { - check(node, PreviewFeature.PATTERNS_IN_SWITCH_STATEMENTS, data); + check(node, RegularLanguageFeature.PATTERNS_IN_SWITCH_STATEMENTS, data); } return null; } diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java21TreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java21TreeDumpTest.java index 6ffde7d974..b5f7eed371 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java21TreeDumpTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java21TreeDumpTest.java @@ -34,7 +34,7 @@ class Java21TreeDumpTest extends BaseJavaTreeDumpTest { @Test void patternMatchingForSwitchBeforeJava21() { ParseException thrown = assertThrows(ParseException.class, () -> java20.parseResource("Jep441_PatternMatchingForSwitch.java")); - assertThat(thrown.getMessage(), containsString("Patterns in switch statements is a preview feature of JDK 20, you should select your language version accordingly")); + assertThat(thrown.getMessage(), containsString("Patterns in switch statements are a feature of Java 21, you should select your language version accordingly")); } @Test @@ -45,7 +45,7 @@ class Java21TreeDumpTest extends BaseJavaTreeDumpTest { @Test void dealingWithNullBeforeJava21() { ParseException thrown = assertThrows(ParseException.class, () -> java20.parseResource("DealingWithNull.java")); - assertThat(thrown.getMessage(), containsString("Null in switch cases is a preview feature of JDK 20, you should select your language version accordingly")); + assertThat(thrown.getMessage(), containsString("Null in switch cases are a feature of Java 21, you should select your language version accordingly")); } @@ -67,7 +67,7 @@ class Java21TreeDumpTest extends BaseJavaTreeDumpTest { @Test void guardedPatternsBeforeJava21() { ParseException thrown = assertThrows(ParseException.class, () -> java20.parseResource("GuardedPatterns.java")); - assertThat(thrown.getMessage(), containsString("Patterns in switch statements is a preview feature of JDK 20, you should select your language version accordingly")); + assertThat(thrown.getMessage(), containsString("Patterns in switch statements are a feature of Java 21, you should select your language version accordingly")); } @Test @@ -78,7 +78,7 @@ class Java21TreeDumpTest extends BaseJavaTreeDumpTest { @Test void patternsInSwitchLabelsBeforeJava21() { ParseException thrown = assertThrows(ParseException.class, () -> java20.parseResource("PatternsInSwitchLabels.java")); - assertThat(thrown.getMessage(), containsString("Patterns in switch statements is a preview feature of JDK 20, you should select your language version accordingly")); + assertThat(thrown.getMessage(), containsString("Patterns in switch statements are a feature of Java 21, you should select your language version accordingly")); } @Test @@ -99,7 +99,7 @@ class Java21TreeDumpTest extends BaseJavaTreeDumpTest { @Test void recordPatternsJepBeforeJava21() { ParseException thrown = assertThrows(ParseException.class, () -> java20.parseResource("Jep440_RecordPatterns.java")); - assertThat(thrown.getMessage(), containsString("Record patterns is a preview feature of JDK 20, you should select your language version accordingly")); + assertThat(thrown.getMessage(), containsString("Record patterns are a feature of Java 21, you should select your language version accordingly")); } @Test @@ -110,7 +110,7 @@ class Java21TreeDumpTest extends BaseJavaTreeDumpTest { @Test void recordPatternsBeforeJava21() { ParseException thrown = assertThrows(ParseException.class, () -> java20.parseResource("RecordPatterns.java")); - assertThat(thrown.getMessage(), containsString("Record patterns is a preview feature of JDK 20, you should select your language version accordingly")); + assertThat(thrown.getMessage(), containsString("Record patterns are a feature of Java 21, you should select your language version accordingly")); } @Test From fbb9da24f214a40d0235c48cd3d0992ac245c889 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 15 Feb 2024 11:04:54 +0100 Subject: [PATCH 08/52] [java] Update Tests for JEP 459 String Templates TemplateFragment now has an attribute "content". --- docs/pages/release_notes.md | 2 + pmd-java/etc/grammar/Java.jjt | 16 +- .../pmd/lang/java/ast/ASTTemplate.java | 7 +- .../lang/java/ast/ASTTemplateExpression.java | 7 +- .../lang/java/ast/ASTTemplateFragment.java | 18 +- .../ast/internal/LanguageLevelChecker.java | 7 +- .../java/ast/Java22PreviewTreeDumpTest.java | 104 +++ .../java21p/Jep430_StringTemplates.txt | 160 ++-- .../Jep443_UnnamedPatternsAndVariables.java | 123 +++ .../Jep443_UnnamedPatternsAndVariables.txt | 608 +++++++++++++++ .../Jep443_UnnamedPatternsAndVariables2.java | 26 + .../java22p/Jep445_UnnamedClasses1.java | 13 + .../java22p/Jep445_UnnamedClasses1.txt | 13 + .../java22p/Jep445_UnnamedClasses2.java | 15 + .../java22p/Jep445_UnnamedClasses2.txt | 21 + .../java22p/Jep445_UnnamedClasses3.java | 15 + .../java22p/Jep445_UnnamedClasses3.txt | 19 + .../java22p/Jep459_StringTemplates.java | 194 +++++ .../java22p/Jep459_StringTemplates.txt | 707 ++++++++++++++++++ 19 files changed, 1976 insertions(+), 99 deletions(-) create mode 100644 pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java22PreviewTreeDumpTest.java create mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep443_UnnamedPatternsAndVariables.java create mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep443_UnnamedPatternsAndVariables.txt create mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep443_UnnamedPatternsAndVariables2.java create mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep445_UnnamedClasses1.java create mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep445_UnnamedClasses1.txt create mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep445_UnnamedClasses2.java create mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep445_UnnamedClasses2.txt create mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep445_UnnamedClasses3.java create mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep445_UnnamedClasses3.txt create mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep459_StringTemplates.java create mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep459_StringTemplates.txt diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 8f567c6be6..e9df137ccc 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -238,6 +238,8 @@ The rules have been moved into categories with PMD 6. * {%jdoc java::lang.java.ast.ASTPattern %}, {%jdoc java::lang.java.ast.ASTRecordPattern %}, {%jdoc java::lang.java.ast.ASTTypePattern %}, {%jdoc java::lang.java.ast.ASTUnnamedPattern %} - method `getParenthesisDepth()` has been removed. +* {%jdoc java::lang.java.ast.ASTTemplateFragment %}: To get the content of the template, use now + {%jdoc java::lang.java.ast.ASTTemplateFragment#getContent() %} or `@Content` instead of `getImage()`/`@Image`. **New API** diff --git a/pmd-java/etc/grammar/Java.jjt b/pmd-java/etc/grammar/Java.jjt index 69522d60fe..111c4cc2a1 100644 --- a/pmd-java/etc/grammar/Java.jjt +++ b/pmd-java/etc/grammar/Java.jjt @@ -1,4 +1,6 @@ /** + * Support "JEP 459: String Templates (Second Preview)" (Java 22) + * Use ASTTemplate.setContent instead of setImage. * Remove support for Record pattern in enhanced for statements. This was only a Java 20 Preview feature. * Remove support for ParenthesizedPatterns. This was only a Java 20 Preview feature. * Andreas Dangel 02/2024 @@ -1053,7 +1055,7 @@ TOKEN : // In order to produce the correct token sequence, the ambiguity needs to be resolved using the context. // That means, that STRING_TEMPLATE_MID/END and TEXT_BLOCK_TEMPLATE_MID/END could actually be a closing bracket ("}"). // Additionally, a STRING_TEMPLATE_MID could be a TEXT_BLOCK_TEMPLATE_MID and the other way round. -// See JLS 3.13 Fragments (Java 21 Preview) +// See JLS 3.13 Fragments (Java 21 Preview and Java 22 Preview) TOKEN : { @@ -2336,10 +2338,10 @@ void StringTemplate() #void : { { tokenContexts.push(TokenContext.STRING_TEMPLATE); } - { setLastTokenImage(jjtThis); } #TemplateFragment + { jjtThis.setContent(getToken(0).getImage()); } #TemplateFragment EmbeddedExpression() - ( { setLastTokenImage(jjtThis); } #TemplateFragment EmbeddedExpression() )* - { setLastTokenImage(jjtThis); } #TemplateFragment + ( { jjtThis.setContent(getToken(0).getImage()); } #TemplateFragment EmbeddedExpression() )* + { jjtThis.setContent(getToken(0).getImage()); } #TemplateFragment { tokenContexts.pop(); } } @@ -2349,10 +2351,10 @@ void TextBlockTemplate() #void : { { tokenContexts.push(TokenContext.TEXT_BLOCK_TEMPLATE); } - { setLastTokenImage(jjtThis); } #TemplateFragment + { jjtThis.setContent(getToken(0).getImage()); } #TemplateFragment EmbeddedExpression() - ( { setLastTokenImage(jjtThis); } #TemplateFragment EmbeddedExpression() )* - { setLastTokenImage(jjtThis); } #TemplateFragment + ( { jjtThis.setContent(getToken(0).getImage()); } #TemplateFragment EmbeddedExpression() )* + { jjtThis.setContent(getToken(0).getImage()); } #TemplateFragment { tokenContexts.pop(); } } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTemplate.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTemplate.java index 15c2c72a85..13decf984d 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTemplate.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTemplate.java @@ -7,7 +7,7 @@ package net.sourceforge.pmd.lang.java.ast; import net.sourceforge.pmd.annotation.Experimental; /** - * This is a Java 21 Preview feature. + * This is a Java 21/22 Preview feature. * *
  *
@@ -15,9 +15,10 @@ import net.sourceforge.pmd.annotation.Experimental;
  *
  * 
* - * @see JEP 430: String Templates (Preview) + * @see JEP 430: String Templates (Preview) (Java 21) + * @see JEP 459: String Templates (Second Preview) (Java 22) */ -@Experimental +@Experimental("String templates is a Java 21/22 Preview feature") public final class ASTTemplate extends AbstractJavaNode { ASTTemplate(int i) { super(i); diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTemplateExpression.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTemplateExpression.java index 76a91b8e0b..ef2b512b09 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTemplateExpression.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTemplateExpression.java @@ -8,7 +8,7 @@ import net.sourceforge.pmd.annotation.Experimental; import net.sourceforge.pmd.lang.java.ast.ASTAssignableExpr.ASTNamedReferenceExpr; /** - * This is a Java 21 Preview feature. + * This is a Java 21/22 Preview feature. * *
  *
@@ -17,9 +17,10 @@ import net.sourceforge.pmd.lang.java.ast.ASTAssignableExpr.ASTNamedReferenceExpr
  *
  * 
* - * @see JEP 430: String Templates (Preview) + * @see JEP 430: String Templates (Preview) (Java 21) + * @see JEP 459: String Templates (Second Preview) (Java 22) */ -@Experimental +@Experimental("String templates is a Java 21/22 Preview feature") public final class ASTTemplateExpression extends AbstractJavaExpr { ASTTemplateExpression(int i) { super(i); diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTemplateFragment.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTemplateFragment.java index 8bb1c40b87..2ecf0cc3fc 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTemplateFragment.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTemplateFragment.java @@ -7,7 +7,7 @@ package net.sourceforge.pmd.lang.java.ast; import net.sourceforge.pmd.annotation.Experimental; /** - * This is a Java 21 Preview feature. + * This is a Java 21/22 Preview feature. * *
  *
@@ -16,10 +16,13 @@ import net.sourceforge.pmd.annotation.Experimental;
  *
  * 
* - * @see JEP 430: String Templates (Preview) + * @see JEP 430: String Templates (Preview) (Java 21) + * @see JEP 459: String Templates (Second Preview) (Java 22) */ -@Experimental +@Experimental("String templates is a Java 21/22 Preview feature") public final class ASTTemplateFragment extends AbstractJavaNode { + private String content; + ASTTemplateFragment(int i) { super(i); } @@ -28,4 +31,13 @@ public final class ASTTemplateFragment extends AbstractJavaNode { protected R acceptVisitor(JavaVisitor visitor, P data) { return visitor.visit(this, data); } + + public String getContent() { + return content; + } + + void setContent(String content) { + this.content = content; + } + } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/internal/LanguageLevelChecker.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/internal/LanguageLevelChecker.java index e6dbcd8437..a9dd43a843 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/internal/LanguageLevelChecker.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/internal/LanguageLevelChecker.java @@ -125,20 +125,21 @@ public class LanguageLevelChecker { /** * String Templates. * @see JEP 430: String Templates (Preview) (Java 21) + * @see JEP 459: String Templates (Second Preview) (Java 22) */ - STRING_TEMPLATES(21, 21, false), + STRING_TEMPLATES(21, 22, false), /** * Unnamed patterns and variables. * @see JEP 443: Unnamed patterns and variables (Preview) (Java 21) */ - UNNAMED_PATTERNS_AND_VARIABLES(21, 21, false), + UNNAMED_PATTERNS_AND_VARIABLES(21, 22, false), /** * Unnamed Classes and Instance Main Methods * @see JEP 445: Unnamed Classes and Instance Main Methods (Preview) (Java 21) */ - UNNAMED_CLASSES(21, 21, false), + UNNAMED_CLASSES(21, 22, false), ; // SUPPRESS CHECKSTYLE enum trailing semi is awesome diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java22PreviewTreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java22PreviewTreeDumpTest.java new file mode 100644 index 0000000000..6d9a59e087 --- /dev/null +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java22PreviewTreeDumpTest.java @@ -0,0 +1,104 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +package net.sourceforge.pmd.lang.java.ast; + +import static org.hamcrest.CoreMatchers.containsString; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.junit.jupiter.api.Test; + +import net.sourceforge.pmd.lang.ast.ParseException; +import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; +import net.sourceforge.pmd.lang.java.BaseJavaTreeDumpTest; +import net.sourceforge.pmd.lang.java.JavaParsingHelper; +import net.sourceforge.pmd.lang.java.symbols.JClassSymbol; +import net.sourceforge.pmd.lang.java.types.JTypeMirror; + +class Java22PreviewTreeDumpTest extends BaseJavaTreeDumpTest { + private final JavaParsingHelper java22p = + JavaParsingHelper.DEFAULT.withDefaultVersion("22-preview") + .withResourceContext(Java22PreviewTreeDumpTest.class, "jdkversiontests/java22p/"); + private final JavaParsingHelper java22 = java22p.withDefaultVersion("22"); + + @Override + public BaseParsingHelper getParser() { + return java22p; + } + + @Test + void jep459TemplateProcessors() { + doTest("Jep459_StringTemplates"); + } + + @Test + void jep459TemplateProcessorsBeforeJava22Preview() { + ParseException thrown = assertThrows(ParseException.class, () -> java22.parseResource("Jep459_StringTemplates.java")); + assertThat(thrown.getMessage(), containsString("String templates is a preview feature of JDK 22, you should select your language version accordingly")); + } + + @Test + void jep459TemplateExpressionType() { + ASTCompilationUnit unit = java22p.parse("class Foo {{ int i = 1; String s = STR.\"i = \\{i}\"; }}"); + ASTTemplateExpression templateExpression = unit.descendants(ASTTemplateExpression.class).first(); + JTypeMirror typeMirror = templateExpression.getTypeMirror(); + assertEquals("java.lang.String", ((JClassSymbol) typeMirror.getSymbol()).getCanonicalName()); + } + + @Test + void unnamedPatternsAndVariables() { + doTest("Jep443_UnnamedPatternsAndVariables"); + } + + @Test + void unnamedPatternsAndVariablesBeforeJava22Preview() { + ParseException thrown = assertThrows(ParseException.class, () -> java22.parseResource("Jep443_UnnamedPatternsAndVariables.java")); + assertThat(thrown.getMessage(), containsString("Since Java 9, '_' is reserved and cannot be used as an identifier")); + + thrown = assertThrows(ParseException.class, () -> java22.parseResource("Jep443_UnnamedPatternsAndVariables2.java")); + assertThat(thrown.getMessage(), containsString("Unnamed patterns and variables is a preview feature of JDK 22, you should select your language version accordingly")); + } + + @Test + void unnamedClasses1() { + doTest("Jep445_UnnamedClasses1"); + ASTCompilationUnit compilationUnit = java22p.parseResource("Jep445_UnnamedClasses1.java"); + assertTrue(compilationUnit.isUnnamedClass()); + ASTMethodCall methodCall = compilationUnit.descendants(ASTMethodCall.class).first(); + assertNotNull(methodCall.getTypeMirror()); + } + + @Test + void unnamedClasses2() { + doTest("Jep445_UnnamedClasses2"); + } + + @Test + void unnamedClasses3() { + doTest("Jep445_UnnamedClasses3"); + } + + @Test + void unnamedClassesBeforeJava22Preview() { + ParseException thrown = assertThrows(ParseException.class, () -> java22.parseResource("Jep445_UnnamedClasses1.java")); + assertThat(thrown.getMessage(), containsString("Unnamed classes is a preview feature of JDK 22, you should select your language version accordingly")); + } + + @Test + void testOrdinaryCompilationUnit() { + ASTCompilationUnit compilationUnit = java22.parse("public class Foo { public static void main(String[] args) {}}"); + assertFalse(compilationUnit.isUnnamedClass()); + } + + @Test + void testModularCompilationUnit() { + ASTCompilationUnit compilationUnit = java22.parse("module foo {}"); + assertFalse(compilationUnit.isUnnamedClass()); + } +} 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 1c58280187..1ecf0c1a3b 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep430_StringTemplates.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep430_StringTemplates.txt @@ -48,11 +48,11 @@ | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Template[] - | | +- TemplateFragment[@Image = "\"\\{"] + | | +- TemplateFragment[@Content = "\"\\{"] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "firstName", @Name = "firstName", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TemplateFragment[@Image = "} \\{"] + | | +- TemplateFragment[@Content = "} \\{"] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "lastName", @Name = "lastName", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TemplateFragment[@Image = "}\""] + | | +- TemplateFragment[@Content = "}\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] @@ -61,11 +61,11 @@ | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Template[] - | | +- TemplateFragment[@Image = "\"\\{"] + | | +- TemplateFragment[@Content = "\"\\{"] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "lastName", @Name = "lastName", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TemplateFragment[@Image = "}, \\{"] + | | +- TemplateFragment[@Content = "}, \\{"] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "firstName", @Name = "firstName", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TemplateFragment[@Image = "}\""] + | | +- TemplateFragment[@Content = "}\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] @@ -83,15 +83,15 @@ | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Template[] - | | +- TemplateFragment[@Image = "\"\\{"] + | | +- TemplateFragment[@Content = "\"\\{"] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TemplateFragment[@Image = "} + \\{"] + | | +- TemplateFragment[@Content = "} + \\{"] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "y", @Name = "y", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TemplateFragment[@Image = "} = \\{"] + | | +- TemplateFragment[@Content = "} = \\{"] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "y", @Name = "y", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TemplateFragment[@Image = "}\""] + | | +- TemplateFragment[@Content = "}\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] @@ -100,10 +100,10 @@ | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Template[] - | | +- TemplateFragment[@Image = "\"You have a \\{"] + | | +- TemplateFragment[@Content = "\"You have a \\{"] | | +- MethodCall[@CompileTimeConstant = false, @Image = "getOfferType", @MethodName = "getOfferType", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ArgumentList[@Empty = true, @Size = 0] - | | +- TemplateFragment[@Image = "} waiting for you!\""] + | | +- TemplateFragment[@Content = "} waiting for you!\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "Request"] @@ -123,16 +123,16 @@ | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Template[] - | | +- TemplateFragment[@Image = "\"Access at \\{"] + | | +- TemplateFragment[@Content = "\"Access at \\{"] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "date", @Name = "date", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "req", @Name = "req", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TemplateFragment[@Image = "} \\{"] + | | +- TemplateFragment[@Content = "} \\{"] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "time", @Name = "time", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "req", @Name = "req", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TemplateFragment[@Image = "} from \\{"] + | | +- TemplateFragment[@Content = "} from \\{"] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "ipAddress", @Name = "ipAddress", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "req", @Name = "req", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TemplateFragment[@Image = "}\""] + | | +- TemplateFragment[@Content = "}\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] @@ -175,16 +175,16 @@ | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Template[] - | | +- TemplateFragment[@Image = "\"The file \\{"] + | | +- TemplateFragment[@Content = "\"The file \\{"] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "filePath", @Name = "filePath", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TemplateFragment[@Image = "} \\{"] + | | +- TemplateFragment[@Content = "} \\{"] | | +- ConditionalExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "exists", @MethodName = "exists", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "file", @Name = "file", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- ArgumentList[@Empty = true, @Size = 0] | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "does", @Empty = false, @Image = "\"does\"", @Length = 4, @LiteralText = "\"does\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "does not", @Empty = false, @Image = "\"does not\"", @Length = 8, @LiteralText = "\"does not\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- TemplateFragment[@Image = "} exist\""] + | | +- TemplateFragment[@Content = "} exist\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] @@ -193,7 +193,7 @@ | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Template[] - | | +- TemplateFragment[@Image = "\"The time is \\{"] + | | +- TemplateFragment[@Content = "\"The time is \\{"] | | +- MethodCall[@CompileTimeConstant = false, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "ofPattern", @MethodName = "ofPattern", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] @@ -205,7 +205,7 @@ | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "LocalTime"] | | | +- ArgumentList[@Empty = true, @Size = 0] - | | +- TemplateFragment[@Image = "} right now\""] + | | +- TemplateFragment[@Content = "} right now\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] @@ -220,19 +220,19 @@ | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Template[] - | | +- TemplateFragment[@Image = "\"\\{"] + | | +- TemplateFragment[@Content = "\"\\{"] | | +- UnaryExpression[@CompileTimeConstant = false, @Operator = UnaryOp.POST_INCREMENT, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "index", @Name = "index", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TemplateFragment[@Image = "}, \\{"] + | | +- TemplateFragment[@Content = "}, \\{"] | | +- UnaryExpression[@CompileTimeConstant = false, @Operator = UnaryOp.POST_INCREMENT, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "index", @Name = "index", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TemplateFragment[@Image = "}, \\{"] + | | +- TemplateFragment[@Content = "}, \\{"] | | +- UnaryExpression[@CompileTimeConstant = false, @Operator = UnaryOp.POST_INCREMENT, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "index", @Name = "index", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TemplateFragment[@Image = "}, \\{"] + | | +- TemplateFragment[@Content = "}, \\{"] | | +- UnaryExpression[@CompileTimeConstant = false, @Operator = UnaryOp.POST_INCREMENT, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "index", @Name = "index", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TemplateFragment[@Image = "}\""] + | | +- TemplateFragment[@Content = "}\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ArrayType[@ArrayDepth = 1] @@ -253,24 +253,24 @@ | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Template[] - | | +- TemplateFragment[@Image = "\"\\{"] + | | +- TemplateFragment[@Content = "\"\\{"] | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "fruit", @Name = "fruit", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] - | | +- TemplateFragment[@Image = "}, \\{"] + | | +- TemplateFragment[@Content = "}, \\{"] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- Template[] - | | | +- TemplateFragment[@Image = "\"\\{"] + | | | +- TemplateFragment[@Content = "\"\\{"] | | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "fruit", @Name = "fruit", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] - | | | +- TemplateFragment[@Image = "}, \\{"] + | | | +- TemplateFragment[@Content = "}, \\{"] | | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "fruit", @Name = "fruit", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] - | | | +- TemplateFragment[@Image = "}\""] - | | +- TemplateFragment[@Image = "}\""] + | | | +- TemplateFragment[@Content = "}\""] + | | +- TemplateFragment[@Content = "}\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] @@ -279,24 +279,24 @@ | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | +- Template[] - | +- TemplateFragment[@Image = "\"\\{"] + | +- TemplateFragment[@Content = "\"\\{"] | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "fruit", @Name = "fruit", @ParenthesisDepth = 0, @Parenthesized = false] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] - | +- TemplateFragment[@Image = "}, \\{"] + | +- TemplateFragment[@Content = "}, \\{"] | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Template[] - | | +- TemplateFragment[@Image = "\"\\{"] + | | +- TemplateFragment[@Content = "\"\\{"] | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "fruit", @Name = "fruit", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] - | | +- TemplateFragment[@Image = "}, \\{"] + | | +- TemplateFragment[@Content = "}, \\{"] | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "fruit", @Name = "fruit", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] - | | +- TemplateFragment[@Image = "}\""] - | +- TemplateFragment[@Image = "}\""] + | | +- TemplateFragment[@Content = "}\""] + | +- TemplateFragment[@Content = "}\""] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "getOfferType", @Name = "getOfferType", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] @@ -329,11 +329,11 @@ | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Template[] - | | +- TemplateFragment[@Image = "\"\"\"\n \n \n \\{"] + | | +- TemplateFragment[@Content = "\"\"\"\n <html>\n <head>\n <title>\\{"] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "title", @Name = "title", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TemplateFragment[@Image = "}\n \n \n

\\{"] + | | +- TemplateFragment[@Content = "}\n \n \n

\\{"] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "text", @Name = "text", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TemplateFragment[@Image = "}

\n \n \n \"\"\""] + | | +- TemplateFragment[@Content = "}

\n \n \n \"\"\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] @@ -360,76 +360,76 @@ | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | +- Template[] - | +- TemplateFragment[@Image = "\"\"\"\n {\n \"name\": \"\\{"] + | +- TemplateFragment[@Content = "\"\"\"\n {\n \"name\": \"\\{"] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false] - | +- TemplateFragment[@Image = "}\",\n \"phone\": \"\\{"] + | +- TemplateFragment[@Content = "}\",\n \"phone\": \"\\{"] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "phone", @Name = "phone", @ParenthesisDepth = 0, @Parenthesized = false] - | +- TemplateFragment[@Image = "}\",\n \"address\": \"\\{"] + | +- TemplateFragment[@Content = "}\",\n \"address\": \"\\{"] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "address", @Name = "address", @ParenthesisDepth = 0, @Parenthesized = false] - | +- TemplateFragment[@Image = "}\"\n }\n \"\"\";\n /*\n | \"\"\"\n | {\n | \"name\": \"Joan Smith\",\n | \"phone\": \"555-123-4567\",\n | \"address\": \"1 Maple Drive, Anytown\"\n | }\n | \"\"\"\n */\n\n record Rectangle(String name, double width, double height) {\n double area() {\n return width * height;\n }\n }\n Rectangle[] zone = new Rectangle[] {\n new Rectangle(\"Alfa\", 17.8, 31.4),\n new Rectangle(\"Bravo\", 9.6, 12.4),\n new Rectangle(\"Charlie\", 7.1, 11.23),\n };\n String table = STR.\"\"\"\n Description Width Height Area\n \\{"] + | +- TemplateFragment[@Content = "}\"\n }\n \"\"\";\n /*\n | \"\"\"\n | {\n | \"name\": \"Joan Smith\",\n | \"phone\": \"555-123-4567\",\n | \"address\": \"1 Maple Drive, Anytown\"\n | }\n | \"\"\"\n */\n\n record Rectangle(String name, double width, double height) {\n double area() {\n return width * height;\n }\n }\n Rectangle[] zone = new Rectangle[] {\n new Rectangle(\"Alfa\", 17.8, 31.4),\n new Rectangle(\"Bravo\", 9.6, 12.4),\n new Rectangle(\"Charlie\", 7.1, 11.23),\n };\n String table = STR.\"\"\"\n Description Width Height Area\n \\{"] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] - | +- TemplateFragment[@Image = "} \\{"] + | +- TemplateFragment[@Content = "} \\{"] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "width", @Name = "width", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] - | +- TemplateFragment[@Image = "} \\{"] + | +- TemplateFragment[@Content = "} \\{"] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "height", @Name = "height", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] - | +- TemplateFragment[@Image = "} \\{"] + | +- TemplateFragment[@Content = "} \\{"] | +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] | | +- ArgumentList[@Empty = true, @Size = 0] - | +- TemplateFragment[@Image = "}\n \\{"] + | +- TemplateFragment[@Content = "}\n \\{"] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] - | +- TemplateFragment[@Image = "} \\{"] + | +- TemplateFragment[@Content = "} \\{"] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "width", @Name = "width", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] - | +- TemplateFragment[@Image = "} \\{"] + | +- TemplateFragment[@Content = "} \\{"] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "height", @Name = "height", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] - | +- TemplateFragment[@Image = "} \\{"] + | +- TemplateFragment[@Content = "} \\{"] | +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] | | +- ArgumentList[@Empty = true, @Size = 0] - | +- TemplateFragment[@Image = "}\n \\{"] + | +- TemplateFragment[@Content = "}\n \\{"] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] - | +- TemplateFragment[@Image = "} \\{"] + | +- TemplateFragment[@Content = "} \\{"] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "width", @Name = "width", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] - | +- TemplateFragment[@Image = "} \\{"] + | +- TemplateFragment[@Content = "} \\{"] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "height", @Name = "height", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] - | +- TemplateFragment[@Image = "} \\{"] + | +- TemplateFragment[@Content = "} \\{"] | +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] | | +- ArgumentList[@Empty = true, @Size = 0] - | +- TemplateFragment[@Image = "}\n Total \\{"] + | +- TemplateFragment[@Content = "}\n Total \\{"] | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false] @@ -447,7 +447,7 @@ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] | | +- ArgumentList[@Empty = true, @Size = 0] - | +- TemplateFragment[@Image = "}\n \"\"\""] + | +- TemplateFragment[@Content = "}\n \"\"\""] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "FMTTemplateProcessor", @Name = "FMTTemplateProcessor", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] | +- VoidType[] @@ -520,75 +520,75 @@ | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "FMT", @Name = "FMT", @ParenthesisDepth = 0, @Parenthesized = false] | +- Template[] - | +- TemplateFragment[@Image = "\"\"\"\n Description Width Height Area\n %-12s\\{"] + | +- TemplateFragment[@Content = "\"\"\"\n Description Width Height Area\n %-12s\\{"] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] - | +- TemplateFragment[@Image = "} %7.2f\\{"] + | +- TemplateFragment[@Content = "} %7.2f\\{"] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "width", @Name = "width", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] - | +- TemplateFragment[@Image = "} %7.2f\\{"] + | +- TemplateFragment[@Content = "} %7.2f\\{"] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "height", @Name = "height", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] - | +- TemplateFragment[@Image = "} %7.2f\\{"] + | +- TemplateFragment[@Content = "} %7.2f\\{"] | +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] | | +- ArgumentList[@Empty = true, @Size = 0] - | +- TemplateFragment[@Image = "}\n %-12s\\{"] + | +- TemplateFragment[@Content = "}\n %-12s\\{"] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] - | +- TemplateFragment[@Image = "} %7.2f\\{"] + | +- TemplateFragment[@Content = "} %7.2f\\{"] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "width", @Name = "width", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] - | +- TemplateFragment[@Image = "} %7.2f\\{"] + | +- TemplateFragment[@Content = "} %7.2f\\{"] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "height", @Name = "height", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] - | +- TemplateFragment[@Image = "} %7.2f\\{"] + | +- TemplateFragment[@Content = "} %7.2f\\{"] | +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] | | +- ArgumentList[@Empty = true, @Size = 0] - | +- TemplateFragment[@Image = "}\n %-12s\\{"] + | +- TemplateFragment[@Content = "}\n %-12s\\{"] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] - | +- TemplateFragment[@Image = "} %7.2f\\{"] + | +- TemplateFragment[@Content = "} %7.2f\\{"] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "width", @Name = "width", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] - | +- TemplateFragment[@Image = "} %7.2f\\{"] + | +- TemplateFragment[@Content = "} %7.2f\\{"] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "height", @Name = "height", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] - | +- TemplateFragment[@Image = "} %7.2f\\{"] + | +- TemplateFragment[@Content = "} %7.2f\\{"] | +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] | | +- ArgumentList[@Empty = true, @Size = 0] - | +- TemplateFragment[@Image = "}\n \\{"] + | +- TemplateFragment[@Content = "}\n \\{"] | +- MethodCall[@CompileTimeConstant = false, @Image = "repeat", @MethodName = "repeat", @ParenthesisDepth = 0, @Parenthesized = false] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = " ", @Empty = false, @Image = "\" \"", @Length = 1, @LiteralText = "\" \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "28", @IntLiteral = true, @Integral = true, @LiteralText = "28", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 28.0, @ValueAsFloat = 28.0, @ValueAsInt = 28, @ValueAsLong = 28] - | +- TemplateFragment[@Image = "} Total %7.2f\\{"] + | +- TemplateFragment[@Content = "} Total %7.2f\\{"] | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false] @@ -606,7 +606,7 @@ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] | | +- ArgumentList[@Empty = true, @Size = 0] - | +- TemplateFragment[@Image = "}\n \"\"\""] + | +- TemplateFragment[@Content = "}\n \"\"\""] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "ensuringSafety", @Name = "ensuringSafety", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] | +- VoidType[] @@ -626,9 +626,9 @@ | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "RAW", @Name = "RAW", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Template[] - | | +- TemplateFragment[@Image = "\"My name is \\{"] + | | +- TemplateFragment[@Content = "\"My name is \\{"] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TemplateFragment[@Image = "}\""] + | | +- TemplateFragment[@Content = "}\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] @@ -681,15 +681,15 @@ | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | +- Template[] - | +- TemplateFragment[@Image = "\"Welcome, \\{"] + | +- TemplateFragment[@Content = "\"Welcome, \\{"] | +- MethodCall[@CompileTimeConstant = false, @Image = "firstName", @MethodName = "firstName", @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "user", @Name = "user", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArgumentList[@Empty = true, @Size = 0] - | +- TemplateFragment[@Image = "}, to your account \\{"] + | +- TemplateFragment[@Content = "}, to your account \\{"] | +- MethodCall[@CompileTimeConstant = false, @Image = "accountNumber", @MethodName = "accountNumber", @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "user", @Name = "user", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArgumentList[@Empty = true, @Size = 0] - | +- TemplateFragment[@Image = "}\""] + | +- TemplateFragment[@Content = "}\""] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "emptyEmbeddedExpression", @Name = "emptyEmbeddedExpression", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] +- VoidType[] @@ -703,5 +703,5 @@ +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] +- Template[] - +- TemplateFragment[@Image = "\"Test \\{"] - +- TemplateFragment[@Image = "}\""] + +- TemplateFragment[@Content = "\"Test \\{"] + +- TemplateFragment[@Content = "}\""] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep443_UnnamedPatternsAndVariables.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep443_UnnamedPatternsAndVariables.java new file mode 100644 index 0000000000..dc2e9f4c7a --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep443_UnnamedPatternsAndVariables.java @@ -0,0 +1,123 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + + +import java.util.ArrayDeque; +import java.util.List; +import java.util.Queue; +import java.util.stream.Collectors; + +/** + * @see JEP 443: Unnamed Patterns and Variables (Preview) + */ +class Jep443_UnamedPatternsAndVariables { + record Point(int x, int y) { } + enum Color { RED, GREEN, BLUE } + record ColoredPoint(Point p, Color c) { } + + void unnamedPatterns1() { + ColoredPoint r = new ColoredPoint(new Point(3,4), Color.GREEN); + + if (r instanceof ColoredPoint(Point p, Color _)) { + System.out.println(p.x() + " " + p.y()); + } + + if (r instanceof ColoredPoint(Point(int x, int y), _)) { + System.out.println(x + " " + y); + } + } + + sealed abstract class Ball permits RedBall, BlueBall, GreenBall { } + final class RedBall extends Ball { } + final class BlueBall extends Ball { } + final class GreenBall extends Ball { } + + record Box(T content) { } + + void unnamedPatterns2() { + Box b = new Box<>(new RedBall()); + switch (b) { + case Box(RedBall _) -> processBox(b); + case Box(BlueBall _) -> processBox(b); + case Box(GreenBall _) -> stopProcessing(); + } + + switch (b) { + case Box(RedBall _), Box(BlueBall _) -> processBox(b); + case Box(GreenBall _) -> stopProcessing(); + case Box(_) -> pickAnotherBox(); + } + + int x = 42; + switch (b) { + // multiple patterns guarded by one guard + case Box(RedBall _), Box(BlueBall _) when x == 42 -> processBox(b); + case Box(_) -> pickAnotherBox(); + } + } + + private void processBox(Box b) {} + private void stopProcessing() {} + private void pickAnotherBox() {} + + class Order {} + private static final int LIMIT = 10; + private int sideEffect() { + return 0; + } + + void unnamedVariables(List orders) { + int total = 0; + for (Order _ : orders) { + if (total < LIMIT) { + total++; + } + } + System.out.println("total: " + total); + + for (int i = 0, _ = sideEffect(); i < 10; i++) { + System.out.println(i); + } + + Queue q = new ArrayDeque<>(); // x1, y1, z1, x2, y2, z2 .. + while (q.size() >= 3) { + int x = q.remove(); + int y = q.remove(); + int _ = q.remove(); // z is unused + Point p = new Point(x, y); + } + while (q.size() >= 3) { + var x = q.remove(); + var _ = q.remove(); + var _ = q.remove(); + Point p = new Point(x, 0); + } + } + + static class ScopedContext implements AutoCloseable { + @Override + public void close() { } + public static ScopedContext acquire() { + return new ScopedContext(); + } + } + + void unusedVariables2() { + try (var _ = ScopedContext.acquire()) { + //... acquiredContext not used ... + } + + String s = "123"; + try { + int i = Integer.parseInt(s); + System.out.println(i); + } catch (NumberFormatException _) { + System.out.println("Bad number: " + s); + } catch (Exception _) { + System.out.println("error..."); + } + + List.of("a", "b").stream().collect(Collectors.toMap(String::toUpperCase, _ -> "NO_DATA")); + } +} diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep443_UnnamedPatternsAndVariables.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep443_UnnamedPatternsAndVariables.txt new file mode 100644 index 0000000000..fcb1e37135 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep443_UnnamedPatternsAndVariables.txt @@ -0,0 +1,608 @@ ++- CompilationUnit[@PackageName = ""] + +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.util.ArrayDeque", @ImportedSimpleName = "ArrayDeque", @PackageName = "java.util", @Static = false] + +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.util.List", @ImportedSimpleName = "List", @PackageName = "java.util", @Static = false] + +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.util.Queue", @ImportedSimpleName = "Queue", @PackageName = "java.util", @Static = false] + +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.util.stream.Collectors", @ImportedSimpleName = "Collectors", @PackageName = "java.util.stream", @Static = false] + +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "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 = "{}"] + +- ClassBody[@Empty = false, @Size = 19] + +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep443_UnamedPatternsAndVariables$Point", @CanonicalName = "Jep443_UnamedPatternsAndVariables.Point", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Point", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] + | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] + | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] + | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] + | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] + | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | +- RecordBody[@Empty = true, @Size = 0] + +- EnumDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "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 = "{}"] + | +- EnumBody[@Empty = false, @SeparatorSemi = false, @Size = 3, @TrailingComma = false] + | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "RED", @MethodName = "new", @Name = "RED", @Visibility = Visibility.V_PUBLIC] + | | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "RED", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] + | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "GREEN", @MethodName = "new", @Name = "GREEN", @Visibility = Visibility.V_PUBLIC] + | | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "GREEN", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] + | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "BLUE", @MethodName = "new", @Name = "BLUE", @Visibility = Visibility.V_PUBLIC] + | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "BLUE", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] + +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "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 = "{}"] + | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] + | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] + | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] + | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | +- RecordBody[@Empty = true, @Size = 0] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "unnamedPatterns1", @Name = "unnamedPatterns1", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] + | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- VoidType[] + | +- FormalParameters[@Empty = true, @Size = 0] + | +- Block[@Empty = false, @Size = 3, @containsComment = false] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] + | | +- VariableDeclarator[@Initializer = true, @Name = "r"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] + | | +- ArgumentList[@Empty = false, @Size = 2] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] + | | | +- ArgumentList[@Empty = false, @Size = 2] + | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LiteralText = "3", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3] + | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "4", @IntLiteral = true, @Integral = true, @LiteralText = "4", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 4.0, @ValueAsFloat = 4.0, @ValueAsInt = 4, @ValueAsLong = 4] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "GREEN", @Name = "GREEN", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] + | +- IfStatement[@Else = false] + | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- RecordPattern[] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] + | | | +- PatternList[@Empty = false, @Size = 2] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] + | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] + | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | +- ExpressionStatement[] + | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Image = "x", @MethodName = "x", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "p", @Name = "p", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ArgumentList[@Empty = true, @Size = 0] + | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = " ", @Empty = false, @Image = "\" \"", @Length = 1, @LiteralText = "\" \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | | +- MethodCall[@CompileTimeConstant = false, @Image = "y", @MethodName = "y", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "p", @Name = "p", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- IfStatement[@Else = false] + | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- RecordPattern[] + | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] + | | +- PatternList[@Empty = false, @Size = 2] + | | +- RecordPattern[] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] + | | | +- PatternList[@Empty = false, @Size = 2] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] + | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] + | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- UnnamedPattern[] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = " ", @Empty = false, @Image = "\" \"", @Length = 1, @LiteralText = "\" \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "y", @Name = "y", @ParenthesisDepth = 0, @Parenthesized = false] + +- ClassDeclaration[@Abstract = true, @Annotation = false, @Anonymous = false, @BinaryName = "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}"] + | +- 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}"] + | +- 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}"] + | +- 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}"] + | +- 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 = "{}"] + | +- TypeParameters[@Empty = false, @Size = 1] + | | +- TypeParameter[@Image = "T", @Name = "T", @TypeBound = true] + | | +- ClassType[@FullyQualified = false, @SimpleName = "Ball"] + | +- RecordComponentList[@Empty = false, @Size = 1, @Varargs = false] + | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] + | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "T"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "content", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | +- RecordBody[@Empty = true, @Size = 0] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "unnamedPatterns2", @Name = "unnamedPatterns2", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] + | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- VoidType[] + | +- FormalParameters[@Empty = true, @Size = 0] + | +- Block[@Empty = false, @Size = 5, @containsComment = false] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | | +- WildcardType[@LowerBound = false, @UpperBound = true] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "Ball"] + | | +- VariableDeclarator[@Initializer = true, @Name = "b"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "b", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | | +- TypeArguments[@Diamond = true, @Empty = true, @Size = 0] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | +- ClassType[@FullyQualified = false, @SimpleName = "RedBall"] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- SwitchArrowBranch[@Default = false] + | | | +- SwitchLabel[@Default = false] + | | | | +- RecordPattern[] + | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | | | +- PatternList[@Empty = false, @Size = 1] + | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] + | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ClassType[@FullyQualified = false, @SimpleName = "RedBall"] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- MethodCall[@CompileTimeConstant = false, @Image = "processBox", @MethodName = "processBox", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ArgumentList[@Empty = false, @Size = 1] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- SwitchArrowBranch[@Default = false] + | | | +- SwitchLabel[@Default = false] + | | | | +- RecordPattern[] + | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | | | +- PatternList[@Empty = false, @Size = 1] + | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] + | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ClassType[@FullyQualified = false, @SimpleName = "BlueBall"] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- MethodCall[@CompileTimeConstant = false, @Image = "processBox", @MethodName = "processBox", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ArgumentList[@Empty = false, @Size = 1] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- RecordPattern[] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | | +- PatternList[@Empty = false, @Size = 1] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] + | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "GreenBall"] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- MethodCall[@CompileTimeConstant = false, @Image = "stopProcessing", @MethodName = "stopProcessing", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- SwitchArrowBranch[@Default = false] + | | | +- SwitchLabel[@Default = false] + | | | | +- RecordPattern[] + | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | | | | +- PatternList[@Empty = false, @Size = 1] + | | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] + | | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "RedBall"] + | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- RecordPattern[] + | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | | | +- PatternList[@Empty = false, @Size = 1] + | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] + | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ClassType[@FullyQualified = false, @SimpleName = "BlueBall"] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- MethodCall[@CompileTimeConstant = false, @Image = "processBox", @MethodName = "processBox", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ArgumentList[@Empty = false, @Size = 1] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- SwitchArrowBranch[@Default = false] + | | | +- SwitchLabel[@Default = false] + | | | | +- RecordPattern[] + | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | | | +- PatternList[@Empty = false, @Size = 1] + | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] + | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ClassType[@FullyQualified = false, @SimpleName = "GreenBall"] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- MethodCall[@CompileTimeConstant = false, @Image = "stopProcessing", @MethodName = "stopProcessing", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ArgumentList[@Empty = true, @Size = 0] + | | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- RecordPattern[] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | | +- PatternList[@Empty = false, @Size = 1] + | | | +- UnnamedPattern[] + | | +- MethodCall[@CompileTimeConstant = false, @Image = "pickAnotherBox", @MethodName = "pickAnotherBox", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] + | | +- VariableDeclarator[@Initializer = true, @Name = "x"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "42", @IntLiteral = true, @Integral = true, @LiteralText = "42", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42] + | +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- RecordPattern[] + | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | | | +- PatternList[@Empty = false, @Size = 1] + | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] + | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ClassType[@FullyQualified = false, @SimpleName = "RedBall"] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- RecordPattern[] + | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | | | +- PatternList[@Empty = false, @Size = 1] + | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] + | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ClassType[@FullyQualified = false, @SimpleName = "BlueBall"] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- Guard[] + | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "42", @IntLiteral = true, @Integral = true, @LiteralText = "42", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42] + | | +- MethodCall[@CompileTimeConstant = false, @Image = "processBox", @MethodName = "processBox", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchArrowBranch[@Default = false] + | +- SwitchLabel[@Default = false] + | | +- RecordPattern[] + | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | +- PatternList[@Empty = false, @Size = 1] + | | +- UnnamedPattern[] + | +- MethodCall[@CompileTimeConstant = false, @Image = "pickAnotherBox", @MethodName = "pickAnotherBox", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = true, @Size = 0] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Image = "processBox", @Name = "processBox", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = true] + | +- ModifierList[@EffectiveModifiers = "{private}", @ExplicitModifiers = "{private}"] + | +- VoidType[] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | | +- WildcardType[@LowerBound = false, @UpperBound = true] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "Ball"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- Block[@Empty = true, @Size = 0, @containsComment = false] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Image = "stopProcessing", @Name = "stopProcessing", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = true] + | +- ModifierList[@EffectiveModifiers = "{private}", @ExplicitModifiers = "{private}"] + | +- VoidType[] + | +- FormalParameters[@Empty = true, @Size = 0] + | +- Block[@Empty = true, @Size = 0, @containsComment = false] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Image = "pickAnotherBox", @Name = "pickAnotherBox", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = true] + | +- ModifierList[@EffectiveModifiers = "{private}", @ExplicitModifiers = "{private}"] + | +- VoidType[] + | +- FormalParameters[@Empty = true, @Size = 0] + | +- Block[@Empty = true, @Size = 0, @containsComment = false] + +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "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 = "{}"] + | +- ClassBody[@Empty = true, @Size = 0] + +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = true, @Visibility = Visibility.V_PRIVATE] + | +- ModifierList[@EffectiveModifiers = "{private, static, final}", @ExplicitModifiers = "{private, static, final}"] + | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] + | +- VariableDeclarator[@Initializer = true, @Name = "LIMIT"] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "LIMIT", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "10", @IntLiteral = true, @Integral = true, @LiteralText = "10", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 10.0, @ValueAsFloat = 10.0, @ValueAsInt = 10, @ValueAsLong = 10] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Image = "sideEffect", @Name = "sideEffect", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = false] + | +- ModifierList[@EffectiveModifiers = "{private}", @ExplicitModifiers = "{private}"] + | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] + | +- FormalParameters[@Empty = true, @Size = 0] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ReturnStatement[] + | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "unnamedVariables", @Name = "unnamedVariables", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] + | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- VoidType[] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "List"] + | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "Order"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "orders", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- Block[@Empty = false, @Size = 7, @containsComment = false] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] + | | +- VariableDeclarator[@Initializer = true, @Name = "total"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "total", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + | +- ForeachStatement[] + | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "Order"] + | | | +- VariableDeclarator[@Initializer = false, @Name = "_"] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = true, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "orders", @Name = "orders", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | +- IfStatement[@Else = false] + | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.LT, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "total", @Name = "total", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = true, @Image = "LIMIT", @Name = "LIMIT", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | +- ExpressionStatement[] + | | +- UnaryExpression[@CompileTimeConstant = false, @Operator = UnaryOp.POST_INCREMENT, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "total", @Name = "total", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ExpressionStatement[] + | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "total: ", @Empty = false, @Image = "\"total: \"", @Length = 7, @LiteralText = "\"total: \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "total", @Name = "total", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ForStatement[] + | | +- ForInit[] + | | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] + | | | +- VariableDeclarator[@Initializer = true, @Name = "i"] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = true, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + | | | +- VariableDeclarator[@Initializer = true, @Name = "_"] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = true, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- MethodCall[@CompileTimeConstant = false, @Image = "sideEffect", @MethodName = "sideEffect", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ArgumentList[@Empty = true, @Size = 0] + | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.LT, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "10", @IntLiteral = true, @Integral = true, @LiteralText = "10", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 10.0, @ValueAsFloat = 10.0, @ValueAsInt = 10, @ValueAsLong = 10] + | | +- ForUpdate[] + | | | +- StatementExpressionList[@Empty = false, @Size = 1] + | | | +- UnaryExpression[@CompileTimeConstant = false, @Operator = UnaryOp.POST_INCREMENT, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | +- ExpressionStatement[] + | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "Queue"] + | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] + | | +- VariableDeclarator[@Initializer = true, @Name = "q"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "q", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | +- ClassType[@FullyQualified = false, @SimpleName = "ArrayDeque"] + | | | +- TypeArguments[@Diamond = true, @Empty = true, @Size = 0] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- WhileStatement[] + | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GE, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Image = "size", @MethodName = "size", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ArgumentList[@Empty = true, @Size = 0] + | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LiteralText = "3", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3] + | | +- Block[@Empty = false, @Size = 4, @containsComment = false] + | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] + | | | +- VariableDeclarator[@Initializer = true, @Name = "x"] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- MethodCall[@CompileTimeConstant = false, @Image = "remove", @MethodName = "remove", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ArgumentList[@Empty = true, @Size = 0] + | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] + | | | +- VariableDeclarator[@Initializer = true, @Name = "y"] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "y", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- MethodCall[@CompileTimeConstant = false, @Image = "remove", @MethodName = "remove", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ArgumentList[@Empty = true, @Size = 0] + | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] + | | | +- VariableDeclarator[@Initializer = true, @Name = "_"] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- MethodCall[@CompileTimeConstant = false, @Image = "remove", @MethodName = "remove", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ArgumentList[@Empty = true, @Size = 0] + | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] + | | +- VariableDeclarator[@Initializer = true, @Name = "p"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "p", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] + | | +- ArgumentList[@Empty = false, @Size = 2] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "y", @Name = "y", @ParenthesisDepth = 0, @Parenthesized = false] + | +- WhileStatement[] + | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GE, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- MethodCall[@CompileTimeConstant = false, @Image = "size", @MethodName = "size", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ArgumentList[@Empty = true, @Size = 0] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LiteralText = "3", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3] + | +- Block[@Empty = false, @Size = 4, @containsComment = false] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- VariableDeclarator[@Initializer = true, @Name = "x"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] + | | +- MethodCall[@CompileTimeConstant = false, @Image = "remove", @MethodName = "remove", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- VariableDeclarator[@Initializer = true, @Name = "_"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] + | | +- MethodCall[@CompileTimeConstant = false, @Image = "remove", @MethodName = "remove", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- VariableDeclarator[@Initializer = true, @Name = "_"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] + | | +- MethodCall[@CompileTimeConstant = false, @Image = "remove", @MethodName = "remove", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] + | +- VariableDeclarator[@Initializer = true, @Name = "p"] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "p", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] + | +- ArgumentList[@Empty = false, @Size = 2] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] + | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "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}"] + | +- 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, @Image = "close", @Name = "close", @Overridden = true, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] + | | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | | | +- Annotation[@SimpleName = "Override"] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "Override"] + | | +- VoidType[] + | | +- FormalParameters[@Empty = true, @Size = 0] + | | +- Block[@Empty = true, @Size = 0, @containsComment = false] + | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "acquire", @Name = "acquire", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] + | +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] + | +- ClassType[@FullyQualified = false, @SimpleName = "ScopedContext"] + | +- FormalParameters[@Empty = true, @Size = 0] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ReturnStatement[] + | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | +- ClassType[@FullyQualified = false, @SimpleName = "ScopedContext"] + | +- ArgumentList[@Empty = true, @Size = 0] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "unusedVariables2", @Name = "unusedVariables2", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] + +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + +- VoidType[] + +- FormalParameters[@Empty = true, @Size = 0] + +- Block[@Empty = false, @Size = 4, @containsComment = false] + +- TryStatement[@TryWithResources = true] + | +- ResourceList[@Empty = false, @Size = 1, @TrailingSemiColon = false] + | | +- Resource[@ConciseResource = false, @StableName = "_"] + | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = true, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{}"] + | | +- VariableDeclarator[@Initializer = true, @Name = "_"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] + | | +- MethodCall[@CompileTimeConstant = false, @Image = "acquire", @MethodName = "acquire", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "ScopedContext"] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- Block[@Empty = true, @Size = 0, @containsComment = true] + +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- VariableDeclarator[@Initializer = true, @Name = "s"] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "123", @Empty = false, @Image = "\"123\"", @Length = 3, @LiteralText = "\"123\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + +- TryStatement[@TryWithResources = false] + | +- Block[@Empty = false, @Size = 2, @containsComment = false] + | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] + | | | +- VariableDeclarator[@Initializer = true, @Name = "i"] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- MethodCall[@CompileTimeConstant = false, @Image = "parseInt", @MethodName = "parseInt", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] + | | | +- ArgumentList[@Empty = false, @Size = 1] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ExpressionStatement[] + | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] + | +- CatchClause[] + | | +- CatchParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Multicatch = false, @Name = "_", @Visibility = Visibility.V_PACKAGE] + | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "NumberFormatException"] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] + | | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | +- ExpressionStatement[] + | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Bad number: ", @Empty = false, @Image = "\"Bad number: \"", @Length = 12, @LiteralText = "\"Bad number: \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] + | +- CatchClause[] + | +- CatchParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Multicatch = false, @Name = "_", @Visibility = Visibility.V_PACKAGE] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "Exception"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "error...", @Empty = false, @Image = "\"error...\"", @Length = 8, @LiteralText = "\"error...\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + +- ExpressionStatement[] + +- MethodCall[@CompileTimeConstant = false, @Image = "collect", @MethodName = "collect", @ParenthesisDepth = 0, @Parenthesized = false] + +- MethodCall[@CompileTimeConstant = false, @Image = "stream", @MethodName = "stream", @ParenthesisDepth = 0, @Parenthesized = false] + | +- MethodCall[@CompileTimeConstant = false, @Image = "of", @MethodName = "of", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "List"] + | | +- ArgumentList[@Empty = false, @Size = 2] + | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "b", @Empty = false, @Image = "\"b\"", @Length = 1, @LiteralText = "\"b\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | +- ArgumentList[@Empty = true, @Size = 0] + +- ArgumentList[@Empty = false, @Size = 1] + +- MethodCall[@CompileTimeConstant = false, @Image = "toMap", @MethodName = "toMap", @ParenthesisDepth = 0, @Parenthesized = false] + +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | +- ClassType[@FullyQualified = false, @SimpleName = "Collectors"] + +- ArgumentList[@Empty = false, @Size = 2] + +- MethodReference[@CompileTimeConstant = false, @ConstructorReference = false, @MethodName = "toUpperCase", @ParenthesisDepth = 0, @Parenthesized = false] + | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] + +- LambdaParameterList[@Empty = false, @Size = 1] + | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] + | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] + +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "NO_DATA", @Empty = false, @Image = "\"NO_DATA\"", @Length = 7, @LiteralText = "\"NO_DATA\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep443_UnnamedPatternsAndVariables2.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep443_UnnamedPatternsAndVariables2.java new file mode 100644 index 0000000000..7d690d41e5 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep443_UnnamedPatternsAndVariables2.java @@ -0,0 +1,26 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + + +import java.util.ArrayDeque; +import java.util.List; +import java.util.Queue; +import java.util.stream.Collectors; + +/** + * @see JEP 443: Unnamed Patterns and Variables (Preview) + */ +class Jep443_UnamedPatternsAndVariables2 { + record Point(int x, int y) { } + enum Color { RED, GREEN, BLUE } + record ColoredPoint(Point p, Color c) { } + + void unnamedPatterns1() { + ColoredPoint r = new ColoredPoint(new Point(3,4), Color.GREEN); + + if (r instanceof ColoredPoint(Point(int x, int y), _)) { + System.out.println(x + " " + y); + } + } +} diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep445_UnnamedClasses1.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep445_UnnamedClasses1.java new file mode 100644 index 0000000000..5a8891fd2f --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep445_UnnamedClasses1.java @@ -0,0 +1,13 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + + + +/** + * @see JEP 445: Unnamed Classes and Instance Main Methods (Preview) + */ + +void main() { + System.out.println("Hello World"); +} diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep445_UnnamedClasses1.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep445_UnnamedClasses1.txt new file mode 100644 index 0000000000..7b2ceabde1 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep445_UnnamedClasses1.txt @@ -0,0 +1,13 @@ ++- CompilationUnit[@PackageName = ""] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "main", @MainMethod = true, @Name = "main", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] + +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + +- VoidType[] + +- FormalParameters[@Empty = true, @Size = 0] + +- Block[@Empty = false, @Size = 1, @containsComment = false] + +- ExpressionStatement[] + +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + +- ArgumentList[@Empty = false, @Size = 1] + +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Hello World", @Empty = false, @Image = "\"Hello World\"", @Length = 11, @LiteralText = "\"Hello World\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep445_UnnamedClasses2.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep445_UnnamedClasses2.java new file mode 100644 index 0000000000..49d30a40e1 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep445_UnnamedClasses2.java @@ -0,0 +1,15 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + + + +/** + * @see JEP 445: Unnamed Classes and Instance Main Methods (Preview) + */ + +String greeting() { return "Hello, World!"; } + +void main() { + System.out.println(greeting()); +} diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep445_UnnamedClasses2.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep445_UnnamedClasses2.txt new file mode 100644 index 0000000000..4b147ea7bf --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep445_UnnamedClasses2.txt @@ -0,0 +1,21 @@ ++- CompilationUnit[@PackageName = ""] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "greeting", @Name = "greeting", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] + | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- FormalParameters[@Empty = true, @Size = 0] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ReturnStatement[] + | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Hello, World!", @Empty = false, @Image = "\"Hello, World!\"", @Length = 13, @LiteralText = "\"Hello, World!\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "main", @MainMethod = true, @Name = "main", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] + +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + +- VoidType[] + +- FormalParameters[@Empty = true, @Size = 0] + +- Block[@Empty = false, @Size = 1, @containsComment = false] + +- ExpressionStatement[] + +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + +- ArgumentList[@Empty = false, @Size = 1] + +- MethodCall[@CompileTimeConstant = false, @Image = "greeting", @MethodName = "greeting", @ParenthesisDepth = 0, @Parenthesized = false] + +- ArgumentList[@Empty = true, @Size = 0] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep445_UnnamedClasses3.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep445_UnnamedClasses3.java new file mode 100644 index 0000000000..9c4fcae3f7 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep445_UnnamedClasses3.java @@ -0,0 +1,15 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + + + +/** + * @see JEP 445: Unnamed Classes and Instance Main Methods (Preview) + */ + +String greeting = "Hello, World!"; + +void main() { + System.out.println(greeting); +} diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep445_UnnamedClasses3.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep445_UnnamedClasses3.txt new file mode 100644 index 0000000000..5e04a358e1 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep445_UnnamedClasses3.txt @@ -0,0 +1,19 @@ ++- CompilationUnit[@PackageName = ""] + +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PACKAGE, @Static = false, @Visibility = Visibility.V_PACKAGE] + | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- VariableDeclarator[@Initializer = true, @Name = "greeting"] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "greeting", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] + | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Hello, World!", @Empty = false, @Image = "\"Hello, World!\"", @Length = 13, @LiteralText = "\"Hello, World!\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "main", @MainMethod = true, @Name = "main", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] + +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + +- VoidType[] + +- FormalParameters[@Empty = true, @Size = 0] + +- Block[@Empty = false, @Size = 1, @containsComment = false] + +- ExpressionStatement[] + +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + +- ArgumentList[@Empty = false, @Size = 1] + +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "greeting", @Name = "greeting", @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep459_StringTemplates.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep459_StringTemplates.java new file mode 100644 index 0000000000..1d4cc98254 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep459_StringTemplates.java @@ -0,0 +1,194 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +import static java.lang.StringTemplate.RAW; +import static java.util.FormatProcessor.FMT; + +import java.io.File; +import java.time.format.DateTimeFormatter; +import java.time.LocalTime; + +/** + * @see JEP 430: String Templates (Preview) (Java 21) + * @see JEP 459: String Templates (Second Preview) (Java 22) + */ +class Jep459_StringTemplates { + record Request(String date, String time, String ipAddress) {} + + static void STRTemplateProcessor() { + // Embedded expressions can be strings + String firstName = "Bill"; + String lastName = "Duck"; + String fullName = STR."\{firstName} \{lastName}"; + // | "Bill Duck" + String sortName = STR."\{lastName}, \{firstName}"; + // | "Duck, Bill" + + // Embedded expressions can perform arithmetic + int x = 10, y = 20; + String s1 = STR."\{x} + \{y} = \{x + y}"; + // | "10 + 20 = 30" + + // Embedded expressions can invoke methods and access fields + String s2 = STR."You have a \{getOfferType()} waiting for you!"; + // | "You have a gift waiting for you!" + Request req = new Request("2022-03-25", "15:34", "8.8.8.8"); + String t = STR."Access at \{req.date} \{req.time} from \{req.ipAddress}"; + //| "Access at 2022-03-25 15:34 from 8.8.8.8" + + String filePath = "tmp.dat"; + File file = new File(filePath); + String old = "The file " + filePath + " " + (file.exists() ? "does" : "does not") + " exist"; + String msg = STR."The file \{filePath} \{file.exists() ? "does" : "does not"} exist"; + // | "The file tmp.dat does exist" or "The file tmp.dat does not exist" + + // spread over multiple lines + String time = STR."The time is \{ + // The java.time.format package is very useful + DateTimeFormatter + .ofPattern("HH:mm:ss") + .format(LocalTime.now()) + } right now"; + // | "The time is 12:34:56 right now" + + // Left to right + // Embedded expressions can be postfix increment expressions + int index = 0; + String data = STR."\{index++}, \{index++}, \{index++}, \{index++}"; + // | "0, 1, 2, 3" + + // Embedded expression is a (nested) template expression + String[] fruit = { "apples", "oranges", "peaches" }; + String s3 = STR."\{fruit[0]}, \{STR."\{fruit[1]}, \{fruit[2]}"}"; + // | "apples, oranges, peaches" + String s4 = STR."\{fruit[0]}, \{ + STR."\{fruit[1]}, \{fruit[2]}" + }"; + } + + static String getOfferType() { return "_getOfferType_"; } + + static void multilineTemplateExpressions() { + String title = "My Web Page"; + String text = "Hello, world"; + String html = STR.""" + + + \{title} + + +

\{text}

+ + + """; + /* + | """ + | + | + | My Web Page + | + | + |

Hello, world

+ | + | + | """ + */ + + String name = "Joan Smith"; + String phone = "555-123-4567"; + String address = "1 Maple Drive, Anytown"; + String json = STR.""" + { + "name": "\{name}", + "phone": "\{phone}", + "address": "\{address}" + } + """; + /* + | """ + | { + | "name": "Joan Smith", + | "phone": "555-123-4567", + | "address": "1 Maple Drive, Anytown" + | } + | """ + */ + + record Rectangle(String name, double width, double height) { + double area() { + return width * height; + } + } + Rectangle[] zone = new Rectangle[] { + new Rectangle("Alfa", 17.8, 31.4), + new Rectangle("Bravo", 9.6, 12.4), + new Rectangle("Charlie", 7.1, 11.23), + }; + String table = STR.""" + Description Width Height Area + \{zone[0].name} \{zone[0].width} \{zone[0].height} \{zone[0].area()} + \{zone[1].name} \{zone[1].width} \{zone[1].height} \{zone[1].area()} + \{zone[2].name} \{zone[2].width} \{zone[2].height} \{zone[2].area()} + Total \{zone[0].area() + zone[1].area() + zone[2].area()} + """; + /* + | """ + | Description Width Height Area + | Alfa 17.8 31.4 558.92 + | Bravo 9.6 12.4 119.03999999999999 + | Charlie 7.1 11.23 79.733 + | Total 757.693 + | """ + */ + } + + static void FMTTemplateProcessor() { + record Rectangle(String name, double width, double height) { + double area() { + return width * height; + } + }; + Rectangle[] zone = new Rectangle[] { + new Rectangle("Alfa", 17.8, 31.4), + new Rectangle("Bravo", 9.6, 12.4), + new Rectangle("Charlie", 7.1, 11.23), + }; + String table = FMT.""" + Description Width Height Area + %-12s\{zone[0].name} %7.2f\{zone[0].width} %7.2f\{zone[0].height} %7.2f\{zone[0].area()} + %-12s\{zone[1].name} %7.2f\{zone[1].width} %7.2f\{zone[1].height} %7.2f\{zone[1].area()} + %-12s\{zone[2].name} %7.2f\{zone[2].width} %7.2f\{zone[2].height} %7.2f\{zone[2].area()} + \{" ".repeat(28)} Total %7.2f\{zone[0].area() + zone[1].area() + zone[2].area()} + """; + /* + | """ + | Description Width Height Area + | Alfa 17.80 31.40 558.92 + | Bravo 9.60 12.40 119.04 + | Charlie 7.10 11.23 79.73 + | Total 757.69 + | """ + */ + } + + static void ensuringSafety() { + String name = "Joan"; + StringTemplate st = RAW."My name is \{name}"; + String info = STR.process(st); + } + + record User(String firstName, int accountNumber) {} + + static void literalsInsideTemplateExpressions() { + String s1 = STR."Welcome to your account"; + // | "Welcome to your account" + User user = new User("Lisa", 12345); + String s2 = STR."Welcome, \{user.firstName()}, to your account \{user.accountNumber()}"; + // | "Welcome, Lisa, to your account 12345" + } + + static void emptyEmbeddedExpression() { + String s1=STR."Test \{ }"; + } +} diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep459_StringTemplates.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep459_StringTemplates.txt new file mode 100644 index 0000000000..7ac8614246 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep459_StringTemplates.txt @@ -0,0 +1,707 @@ ++- CompilationUnit[@PackageName = ""] + +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.lang.StringTemplate.RAW", @ImportedSimpleName = "RAW", @PackageName = "java.lang.StringTemplate", @Static = true] + +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.util.FormatProcessor.FMT", @ImportedSimpleName = "FMT", @PackageName = "java.util.FormatProcessor", @Static = true] + +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.io.File", @ImportedSimpleName = "File", @PackageName = "java.io", @Static = false] + +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.time.format.DateTimeFormatter", @ImportedSimpleName = "DateTimeFormatter", @PackageName = "java.time.format", @Static = false] + +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.time.LocalTime", @ImportedSimpleName = "LocalTime", @PackageName = "java.time", @Static = false] + +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep459_StringTemplates", @CanonicalName = "Jep459_StringTemplates", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Jep459_StringTemplates", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE] + +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + +- ClassBody[@Empty = false, @Size = 9] + +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep459_StringTemplates$Request", @CanonicalName = "Jep459_StringTemplates.Request", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Request", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] + | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] + | +- RecordComponentList[@Empty = false, @Size = 3, @Varargs = false] + | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] + | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "date", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] + | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "time", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] + | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "ipAddress", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | +- RecordBody[@Empty = true, @Size = 0] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "STRTemplateProcessor", @Name = "STRTemplateProcessor", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] + | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- VoidType[] + | +- FormalParameters[@Empty = true, @Size = 0] + | +- Block[@Empty = false, @Size = 19, @containsComment = false] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- VariableDeclarator[@Initializer = true, @Name = "firstName"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "firstName", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Bill", @Empty = false, @Image = "\"Bill\"", @Length = 4, @LiteralText = "\"Bill\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- VariableDeclarator[@Initializer = true, @Name = "lastName"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "lastName", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Duck", @Empty = false, @Image = "\"Duck\"", @Length = 4, @LiteralText = "\"Duck\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- VariableDeclarator[@Initializer = true, @Name = "fullName"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "fullName", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- Template[] + | | +- TemplateFragment[@Content = "\"\\{"] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "firstName", @Name = "firstName", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TemplateFragment[@Content = "} \\{"] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "lastName", @Name = "lastName", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TemplateFragment[@Content = "}\""] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- VariableDeclarator[@Initializer = true, @Name = "sortName"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "sortName", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- Template[] + | | +- TemplateFragment[@Content = "\"\\{"] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "lastName", @Name = "lastName", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TemplateFragment[@Content = "}, \\{"] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "firstName", @Name = "firstName", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TemplateFragment[@Content = "}\""] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] + | | +- VariableDeclarator[@Initializer = true, @Name = "x"] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "10", @IntLiteral = true, @Integral = true, @LiteralText = "10", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 10.0, @ValueAsFloat = 10.0, @ValueAsInt = 10, @ValueAsLong = 10] + | | +- VariableDeclarator[@Initializer = true, @Name = "y"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "y", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "20", @IntLiteral = true, @Integral = true, @LiteralText = "20", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 20.0, @ValueAsFloat = 20.0, @ValueAsInt = 20, @ValueAsLong = 20] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- VariableDeclarator[@Initializer = true, @Name = "s1"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- Template[] + | | +- TemplateFragment[@Content = "\"\\{"] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TemplateFragment[@Content = "} + \\{"] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "y", @Name = "y", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TemplateFragment[@Content = "} = \\{"] + | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "y", @Name = "y", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TemplateFragment[@Content = "}\""] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- VariableDeclarator[@Initializer = true, @Name = "s2"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- Template[] + | | +- TemplateFragment[@Content = "\"You have a \\{"] + | | +- MethodCall[@CompileTimeConstant = false, @Image = "getOfferType", @MethodName = "getOfferType", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ArgumentList[@Empty = true, @Size = 0] + | | +- TemplateFragment[@Content = "} waiting for you!\""] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "Request"] + | | +- VariableDeclarator[@Initializer = true, @Name = "req"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "req", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | +- ClassType[@FullyQualified = false, @SimpleName = "Request"] + | | +- ArgumentList[@Empty = false, @Size = 3] + | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "2022-03-25", @Empty = false, @Image = "\"2022-03-25\"", @Length = 10, @LiteralText = "\"2022-03-25\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "15:34", @Empty = false, @Image = "\"15:34\"", @Length = 5, @LiteralText = "\"15:34\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "8.8.8.8", @Empty = false, @Image = "\"8.8.8.8\"", @Length = 7, @LiteralText = "\"8.8.8.8\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- VariableDeclarator[@Initializer = true, @Name = "t"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "t", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- Template[] + | | +- TemplateFragment[@Content = "\"Access at \\{"] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "date", @Name = "date", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "req", @Name = "req", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TemplateFragment[@Content = "} \\{"] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "time", @Name = "time", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "req", @Name = "req", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TemplateFragment[@Content = "} from \\{"] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "ipAddress", @Name = "ipAddress", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "req", @Name = "req", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TemplateFragment[@Content = "}\""] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- VariableDeclarator[@Initializer = true, @Name = "filePath"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "filePath", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "tmp.dat", @Empty = false, @Image = "\"tmp.dat\"", @Length = 7, @LiteralText = "\"tmp.dat\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "File"] + | | +- VariableDeclarator[@Initializer = true, @Name = "file"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "file", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | +- ClassType[@FullyQualified = false, @SimpleName = "File"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "filePath", @Name = "filePath", @ParenthesisDepth = 0, @Parenthesized = false] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- VariableDeclarator[@Initializer = true, @Name = "old"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "old", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "The file ", @Empty = false, @Image = "\"The file \"", @Length = 9, @LiteralText = "\"The file \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "filePath", @Name = "filePath", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = " ", @Empty = false, @Image = "\" \"", @Length = 1, @LiteralText = "\" \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | | | +- ConditionalExpression[@CompileTimeConstant = false, @ParenthesisDepth = 1, @Parenthesized = true] + | | | +- MethodCall[@CompileTimeConstant = false, @Image = "exists", @MethodName = "exists", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "file", @Name = "file", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ArgumentList[@Empty = true, @Size = 0] + | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "does", @Empty = false, @Image = "\"does\"", @Length = 4, @LiteralText = "\"does\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "does not", @Empty = false, @Image = "\"does not\"", @Length = 8, @LiteralText = "\"does not\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = " exist", @Empty = false, @Image = "\" exist\"", @Length = 6, @LiteralText = "\" exist\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- VariableDeclarator[@Initializer = true, @Name = "msg"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "msg", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- Template[] + | | +- TemplateFragment[@Content = "\"The file \\{"] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "filePath", @Name = "filePath", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TemplateFragment[@Content = "} \\{"] + | | +- ConditionalExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Image = "exists", @MethodName = "exists", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "file", @Name = "file", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ArgumentList[@Empty = true, @Size = 0] + | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "does", @Empty = false, @Image = "\"does\"", @Length = 4, @LiteralText = "\"does\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "does not", @Empty = false, @Image = "\"does not\"", @Length = 8, @LiteralText = "\"does not\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | | +- TemplateFragment[@Content = "} exist\""] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- VariableDeclarator[@Initializer = true, @Name = "time"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "time", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- Template[] + | | +- TemplateFragment[@Content = "\"The time is \\{"] + | | +- MethodCall[@CompileTimeConstant = false, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Image = "ofPattern", @MethodName = "ofPattern", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "DateTimeFormatter"] + | | | | +- ArgumentList[@Empty = false, @Size = 1] + | | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "HH:mm:ss", @Empty = false, @Image = "\"HH:mm:ss\"", @Length = 8, @LiteralText = "\"HH:mm:ss\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | | | +- ArgumentList[@Empty = false, @Size = 1] + | | | +- MethodCall[@CompileTimeConstant = false, @Image = "now", @MethodName = "now", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ClassType[@FullyQualified = false, @SimpleName = "LocalTime"] + | | | +- ArgumentList[@Empty = true, @Size = 0] + | | +- TemplateFragment[@Content = "} right now\""] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] + | | +- VariableDeclarator[@Initializer = true, @Name = "index"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "index", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- VariableDeclarator[@Initializer = true, @Name = "data"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "data", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- Template[] + | | +- TemplateFragment[@Content = "\"\\{"] + | | +- UnaryExpression[@CompileTimeConstant = false, @Operator = UnaryOp.POST_INCREMENT, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "index", @Name = "index", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TemplateFragment[@Content = "}, \\{"] + | | +- UnaryExpression[@CompileTimeConstant = false, @Operator = UnaryOp.POST_INCREMENT, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "index", @Name = "index", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TemplateFragment[@Content = "}, \\{"] + | | +- UnaryExpression[@CompileTimeConstant = false, @Operator = UnaryOp.POST_INCREMENT, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "index", @Name = "index", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TemplateFragment[@Content = "}, \\{"] + | | +- UnaryExpression[@CompileTimeConstant = false, @Operator = UnaryOp.POST_INCREMENT, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "index", @Name = "index", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TemplateFragment[@Content = "}\""] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ArrayType[@ArrayDepth = 1] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ArrayDimensions[@Empty = false, @Size = 1] + | | | +- ArrayTypeDim[@Varargs = false] + | | +- VariableDeclarator[@Initializer = true, @Name = "fruit"] + | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "fruit", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ArrayInitializer[@CompileTimeConstant = false, @Length = 3, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "apples", @Empty = false, @Image = "\"apples\"", @Length = 6, @LiteralText = "\"apples\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "oranges", @Empty = false, @Image = "\"oranges\"", @Length = 7, @LiteralText = "\"oranges\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "peaches", @Empty = false, @Image = "\"peaches\"", @Length = 7, @LiteralText = "\"peaches\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- VariableDeclarator[@Initializer = true, @Name = "s3"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s3", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- Template[] + | | +- TemplateFragment[@Content = "\"\\{"] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "fruit", @Name = "fruit", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + | | +- TemplateFragment[@Content = "}, \\{"] + | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- Template[] + | | | +- TemplateFragment[@Content = "\"\\{"] + | | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "fruit", @Name = "fruit", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + | | | +- TemplateFragment[@Content = "}, \\{"] + | | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "fruit", @Name = "fruit", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] + | | | +- TemplateFragment[@Content = "}\""] + | | +- TemplateFragment[@Content = "}\""] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- VariableDeclarator[@Initializer = true, @Name = "s4"] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s4", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] + | +- Template[] + | +- TemplateFragment[@Content = "\"\\{"] + | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "fruit", @Name = "fruit", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + | +- TemplateFragment[@Content = "}, \\{"] + | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- Template[] + | | +- TemplateFragment[@Content = "\"\\{"] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "fruit", @Name = "fruit", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + | | +- TemplateFragment[@Content = "}, \\{"] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "fruit", @Name = "fruit", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] + | | +- TemplateFragment[@Content = "}\""] + | +- TemplateFragment[@Content = "}\""] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "getOfferType", @Name = "getOfferType", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] + | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- FormalParameters[@Empty = true, @Size = 0] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ReturnStatement[] + | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "_getOfferType_", @Empty = false, @Image = "\"_getOfferType_\"", @Length = 14, @LiteralText = "\"_getOfferType_\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "multilineTemplateExpressions", @Name = "multilineTemplateExpressions", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] + | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- VoidType[] + | +- FormalParameters[@Empty = true, @Size = 0] + | +- Block[@Empty = false, @Size = 7, @containsComment = false] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- VariableDeclarator[@Initializer = true, @Name = "title"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "title", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "My Web Page", @Empty = false, @Image = "\"My Web Page\"", @Length = 11, @LiteralText = "\"My Web Page\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- VariableDeclarator[@Initializer = true, @Name = "text"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "text", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Hello, world", @Empty = false, @Image = "\"Hello, world\"", @Length = 12, @LiteralText = "\"Hello, world\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- VariableDeclarator[@Initializer = true, @Name = "html"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "html", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- Template[] + | | +- TemplateFragment[@Content = "\"\"\"\n \n \n \\{"] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "title", @Name = "title", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TemplateFragment[@Content = "}\n \n \n

\\{"] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "text", @Name = "text", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TemplateFragment[@Content = "}

\n \n \n \"\"\""] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- VariableDeclarator[@Initializer = true, @Name = "name"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "name", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Joan Smith", @Empty = false, @Image = "\"Joan Smith\"", @Length = 10, @LiteralText = "\"Joan Smith\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- VariableDeclarator[@Initializer = true, @Name = "phone"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "phone", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "555-123-4567", @Empty = false, @Image = "\"555-123-4567\"", @Length = 12, @LiteralText = "\"555-123-4567\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- VariableDeclarator[@Initializer = true, @Name = "address"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "address", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "1 Maple Drive, Anytown", @Empty = false, @Image = "\"1 Maple Drive, Anytown\"", @Length = 22, @LiteralText = "\"1 Maple Drive, Anytown\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- VariableDeclarator[@Initializer = true, @Name = "json"] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "json", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] + | +- Template[] + | +- TemplateFragment[@Content = "\"\"\"\n {\n \"name\": \"\\{"] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false] + | +- TemplateFragment[@Content = "}\",\n \"phone\": \"\\{"] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "phone", @Name = "phone", @ParenthesisDepth = 0, @Parenthesized = false] + | +- TemplateFragment[@Content = "}\",\n \"address\": \"\\{"] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "address", @Name = "address", @ParenthesisDepth = 0, @Parenthesized = false] + | +- TemplateFragment[@Content = "}\"\n }\n \"\"\";\n /*\n | \"\"\"\n | {\n | \"name\": \"Joan Smith\",\n | \"phone\": \"555-123-4567\",\n | \"address\": \"1 Maple Drive, Anytown\"\n | }\n | \"\"\"\n */\n\n record Rectangle(String name, double width, double height) {\n double area() {\n return width * height;\n }\n }\n Rectangle[] zone = new Rectangle[] {\n new Rectangle(\"Alfa\", 17.8, 31.4),\n new Rectangle(\"Bravo\", 9.6, 12.4),\n new Rectangle(\"Charlie\", 7.1, 11.23),\n };\n String table = STR.\"\"\"\n Description Width Height Area\n \\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + | +- TemplateFragment[@Content = "} \\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "width", @Name = "width", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + | +- TemplateFragment[@Content = "} \\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "height", @Name = "height", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + | +- TemplateFragment[@Content = "} \\{"] + | +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- TemplateFragment[@Content = "}\n \\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + | +- TemplateFragment[@Content = "} \\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "width", @Name = "width", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + | +- TemplateFragment[@Content = "} \\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "height", @Name = "height", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + | +- TemplateFragment[@Content = "} \\{"] + | +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- TemplateFragment[@Content = "}\n \\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] + | +- TemplateFragment[@Content = "} \\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "width", @Name = "width", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] + | +- TemplateFragment[@Content = "} \\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "height", @Name = "height", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] + | +- TemplateFragment[@Content = "} \\{"] + | +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- TemplateFragment[@Content = "}\n Total \\{"] + | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + | | | | +- ArgumentList[@Empty = true, @Size = 0] + | | | +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + | | | +- ArgumentList[@Empty = true, @Size = 0] + | | +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- TemplateFragment[@Content = "}\n \"\"\""] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "FMTTemplateProcessor", @Name = "FMTTemplateProcessor", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] + | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- VoidType[] + | +- FormalParameters[@Empty = true, @Size = 0] + | +- Block[@Empty = false, @Size = 4, @containsComment = false] + | +- LocalClassStatement[] + | | +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep459_StringTemplates$1Rectangle", @CanonicalName = null, @EffectiveVisibility = Visibility.V_LOCAL, @Enum = false, @Final = true, @Interface = false, @Local = true, @Nested = false, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Rectangle", @Static = true, @TopLevel = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] + | | +- RecordComponentList[@Empty = false, @Size = 3, @Varargs = false] + | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] + | | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "name", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] + | | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.DOUBLE] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "width", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] + | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.DOUBLE] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "height", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | +- RecordBody[@Empty = false, @Size = 1] + | | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Image = "area", @Name = "area", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- PrimitiveType[@Kind = PrimitiveTypeKind.DOUBLE] + | | +- FormalParameters[@Empty = true, @Size = 0] + | | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | +- ReturnStatement[] + | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.MUL, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "width", @Name = "width", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "height", @Name = "height", @ParenthesisDepth = 0, @Parenthesized = false] + | +- EmptyStatement[] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ArrayType[@ArrayDepth = 1] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] + | | | +- ArrayDimensions[@Empty = false, @Size = 1] + | | | +- ArrayTypeDim[@Varargs = false] + | | +- VariableDeclarator[@Initializer = true, @Name = "zone"] + | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "zone", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ArrayAllocation[@ArrayDepth = 1, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayType[@ArrayDepth = 1] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] + | | | +- ArrayDimensions[@Empty = false, @Size = 1] + | | | +- ArrayTypeDim[@Varargs = false] + | | +- ArrayInitializer[@CompileTimeConstant = false, @Length = 3, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] + | | | +- ArgumentList[@Empty = false, @Size = 3] + | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Alfa", @Empty = false, @Image = "\"Alfa\"", @Length = 4, @LiteralText = "\"Alfa\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "17.8", @IntLiteral = false, @Integral = false, @LiteralText = "17.8", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 17.8, @ValueAsFloat = 17.8, @ValueAsInt = 17, @ValueAsLong = 17] + | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "31.4", @IntLiteral = false, @Integral = false, @LiteralText = "31.4", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 31.4, @ValueAsFloat = 31.4, @ValueAsInt = 31, @ValueAsLong = 31] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] + | | | +- ArgumentList[@Empty = false, @Size = 3] + | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Bravo", @Empty = false, @Image = "\"Bravo\"", @Length = 5, @LiteralText = "\"Bravo\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "9.6", @IntLiteral = false, @Integral = false, @LiteralText = "9.6", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 9.6, @ValueAsFloat = 9.6, @ValueAsInt = 9, @ValueAsLong = 9] + | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "12.4", @IntLiteral = false, @Integral = false, @LiteralText = "12.4", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 12.4, @ValueAsFloat = 12.4, @ValueAsInt = 12, @ValueAsLong = 12] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] + | | +- ArgumentList[@Empty = false, @Size = 3] + | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Charlie", @Empty = false, @Image = "\"Charlie\"", @Length = 7, @LiteralText = "\"Charlie\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "7.1", @IntLiteral = false, @Integral = false, @LiteralText = "7.1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 7.1, @ValueAsFloat = 7.1, @ValueAsInt = 7, @ValueAsLong = 7] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "11.23", @IntLiteral = false, @Integral = false, @LiteralText = "11.23", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 11.23, @ValueAsFloat = 11.23, @ValueAsInt = 11, @ValueAsLong = 11] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- VariableDeclarator[@Initializer = true, @Name = "table"] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "table", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "FMT", @Name = "FMT", @ParenthesisDepth = 0, @Parenthesized = false] + | +- Template[] + | +- TemplateFragment[@Content = "\"\"\"\n Description Width Height Area\n %-12s\\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + | +- TemplateFragment[@Content = "} %7.2f\\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "width", @Name = "width", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + | +- TemplateFragment[@Content = "} %7.2f\\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "height", @Name = "height", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + | +- TemplateFragment[@Content = "} %7.2f\\{"] + | +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- TemplateFragment[@Content = "}\n %-12s\\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + | +- TemplateFragment[@Content = "} %7.2f\\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "width", @Name = "width", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + | +- TemplateFragment[@Content = "} %7.2f\\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "height", @Name = "height", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + | +- TemplateFragment[@Content = "} %7.2f\\{"] + | +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- TemplateFragment[@Content = "}\n %-12s\\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] + | +- TemplateFragment[@Content = "} %7.2f\\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "width", @Name = "width", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] + | +- TemplateFragment[@Content = "} %7.2f\\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "height", @Name = "height", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] + | +- TemplateFragment[@Content = "} %7.2f\\{"] + | +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- TemplateFragment[@Content = "}\n \\{"] + | +- MethodCall[@CompileTimeConstant = false, @Image = "repeat", @MethodName = "repeat", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = " ", @Empty = false, @Image = "\" \"", @Length = 1, @LiteralText = "\" \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "28", @IntLiteral = true, @Integral = true, @LiteralText = "28", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 28.0, @ValueAsFloat = 28.0, @ValueAsInt = 28, @ValueAsLong = 28] + | +- TemplateFragment[@Content = "} Total %7.2f\\{"] + | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + | | | | +- ArgumentList[@Empty = true, @Size = 0] + | | | +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + | | | +- ArgumentList[@Empty = true, @Size = 0] + | | +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- TemplateFragment[@Content = "}\n \"\"\""] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "ensuringSafety", @Name = "ensuringSafety", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] + | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- VoidType[] + | +- FormalParameters[@Empty = true, @Size = 0] + | +- Block[@Empty = false, @Size = 3, @containsComment = false] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- VariableDeclarator[@Initializer = true, @Name = "name"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "name", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Joan", @Empty = false, @Image = "\"Joan\"", @Length = 4, @LiteralText = "\"Joan\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "StringTemplate"] + | | +- VariableDeclarator[@Initializer = true, @Name = "st"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "st", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "RAW", @Name = "RAW", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- Template[] + | | +- TemplateFragment[@Content = "\"My name is \\{"] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TemplateFragment[@Content = "}\""] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- VariableDeclarator[@Initializer = true, @Name = "info"] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "info", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- MethodCall[@CompileTimeConstant = false, @Image = "process", @MethodName = "process", @ParenthesisDepth = 0, @Parenthesized = false] + | +- AmbiguousName[@CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "st", @Name = "st", @ParenthesisDepth = 0, @Parenthesized = false] + +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep459_StringTemplates$User", @CanonicalName = "Jep459_StringTemplates.User", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "User", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] + | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] + | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] + | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] + | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "firstName", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] + | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "accountNumber", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | +- RecordBody[@Empty = true, @Size = 0] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "literalsInsideTemplateExpressions", @Name = "literalsInsideTemplateExpressions", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] + | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- VoidType[] + | +- FormalParameters[@Empty = true, @Size = 0] + | +- Block[@Empty = false, @Size = 3, @containsComment = false] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- VariableDeclarator[@Initializer = true, @Name = "s1"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Welcome to your account", @Empty = false, @Image = "\"Welcome to your account\"", @Length = 23, @LiteralText = "\"Welcome to your account\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "User"] + | | +- VariableDeclarator[@Initializer = true, @Name = "user"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "user", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | +- ClassType[@FullyQualified = false, @SimpleName = "User"] + | | +- ArgumentList[@Empty = false, @Size = 2] + | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Lisa", @Empty = false, @Image = "\"Lisa\"", @Length = 4, @LiteralText = "\"Lisa\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "12345", @IntLiteral = true, @Integral = true, @LiteralText = "12345", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 12345.0, @ValueAsFloat = 12345.0, @ValueAsInt = 12345, @ValueAsLong = 12345] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- VariableDeclarator[@Initializer = true, @Name = "s2"] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] + | +- Template[] + | +- TemplateFragment[@Content = "\"Welcome, \\{"] + | +- MethodCall[@CompileTimeConstant = false, @Image = "firstName", @MethodName = "firstName", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "user", @Name = "user", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- TemplateFragment[@Content = "}, to your account \\{"] + | +- MethodCall[@CompileTimeConstant = false, @Image = "accountNumber", @MethodName = "accountNumber", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "user", @Name = "user", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- TemplateFragment[@Content = "}\""] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "emptyEmbeddedExpression", @Name = "emptyEmbeddedExpression", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] + +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + +- VoidType[] + +- FormalParameters[@Empty = true, @Size = 0] + +- Block[@Empty = false, @Size = 1, @containsComment = false] + +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + +- ClassType[@FullyQualified = false, @SimpleName = "String"] + +- VariableDeclarator[@Initializer = true, @Name = "s1"] + +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] + +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] + +- Template[] + +- TemplateFragment[@Content = "\"Test \\{"] + +- TemplateFragment[@Content = "}\""] From cb3ceef17ab9c265c6da030f1ca9f1efec9607ff Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 15 Feb 2024 11:26:12 +0100 Subject: [PATCH 09/52] [java] Update Tests for JEP 463: Implicitly Declared Classes and Instance Main Methods --- pmd-java/etc/grammar/Java.jjt | 4 ++- .../ast/internal/LanguageLevelChecker.java | 1 + .../java/ast/Java22PreviewTreeDumpTest.java | 27 ++++++++------ ...sses1.java => Jep463_UnnamedClasses1.java} | 3 +- ...lasses1.txt => Jep463_UnnamedClasses1.txt} | 0 ...sses2.java => Jep463_UnnamedClasses2.java} | 3 +- ...lasses2.txt => Jep463_UnnamedClasses2.txt} | 0 ...sses3.java => Jep463_UnnamedClasses3.java} | 3 +- ...lasses3.txt => Jep463_UnnamedClasses3.txt} | 0 .../Jep463_UnnamedClasses4WithImports.java | 17 +++++++++ .../Jep463_UnnamedClasses4WithImports.txt | 35 +++++++++++++++++++ 11 files changed, 78 insertions(+), 15 deletions(-) rename pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/{Jep445_UnnamedClasses1.java => Jep463_UnnamedClasses1.java} (52%) rename pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/{Jep445_UnnamedClasses1.txt => Jep463_UnnamedClasses1.txt} (100%) rename pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/{Jep445_UnnamedClasses2.java => Jep463_UnnamedClasses2.java} (56%) rename pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/{Jep445_UnnamedClasses2.txt => Jep463_UnnamedClasses2.txt} (100%) rename pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/{Jep445_UnnamedClasses3.java => Jep463_UnnamedClasses3.java} (55%) rename pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/{Jep445_UnnamedClasses3.txt => Jep463_UnnamedClasses3.txt} (100%) create mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses4WithImports.java create mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses4WithImports.txt diff --git a/pmd-java/etc/grammar/Java.jjt b/pmd-java/etc/grammar/Java.jjt index 111c4cc2a1..cf66ce0cb0 100644 --- a/pmd-java/etc/grammar/Java.jjt +++ b/pmd-java/etc/grammar/Java.jjt @@ -1,4 +1,6 @@ /** + * Support "JEP 463: Implicitly Declared Classes and Instance Main Methods (Second Preview)" (Java 22) + * No changes. * Support "JEP 459: String Templates (Second Preview)" (Java 22) * Use ASTTemplate.setContent instead of setImage. * Remove support for Record pattern in enhanced for statements. This was only a Java 20 Preview feature. @@ -1153,7 +1155,7 @@ ASTCompilationUnit CompilationUnit() : // OrdinaryCompilationUnit: -> TopLevelClassOrInterfaceDeclaration ( TypeDeclaration() ( EmptyDeclaration() )* )* - // UnnamedClassCompilationUnit: + // SimpleCompilationUnit: [ ( LOOKAHEAD(3) ClassMemberDeclarationNoMethod() )* ModifierList() MethodDeclaration() diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/internal/LanguageLevelChecker.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/internal/LanguageLevelChecker.java index a9dd43a843..dccede5cc9 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/internal/LanguageLevelChecker.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/internal/LanguageLevelChecker.java @@ -138,6 +138,7 @@ public class LanguageLevelChecker { /** * Unnamed Classes and Instance Main Methods * @see JEP 445: Unnamed Classes and Instance Main Methods (Preview) (Java 21) + * @see JEP 463: Implicitly Declared Classes and Instance Main Methods (Second Preview) (Java 22) */ UNNAMED_CLASSES(21, 22, false), diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java22PreviewTreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java22PreviewTreeDumpTest.java index 6d9a59e087..0b24ca452e 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java22PreviewTreeDumpTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java22PreviewTreeDumpTest.java @@ -66,38 +66,43 @@ class Java22PreviewTreeDumpTest extends BaseJavaTreeDumpTest { } @Test - void unnamedClasses1() { - doTest("Jep445_UnnamedClasses1"); - ASTCompilationUnit compilationUnit = java22p.parseResource("Jep445_UnnamedClasses1.java"); + void jep463UnnamedClasses1() { + doTest("Jep463_UnnamedClasses1"); + ASTCompilationUnit compilationUnit = java22p.parseResource("Jep463_UnnamedClasses1.java"); assertTrue(compilationUnit.isUnnamedClass()); ASTMethodCall methodCall = compilationUnit.descendants(ASTMethodCall.class).first(); assertNotNull(methodCall.getTypeMirror()); } @Test - void unnamedClasses2() { - doTest("Jep445_UnnamedClasses2"); + void jep463UnnamedClasses2() { + doTest("Jep463_UnnamedClasses2"); } @Test - void unnamedClasses3() { - doTest("Jep445_UnnamedClasses3"); + void jep463UnnamedClasses3() { + doTest("Jep463_UnnamedClasses3"); } @Test - void unnamedClassesBeforeJava22Preview() { - ParseException thrown = assertThrows(ParseException.class, () -> java22.parseResource("Jep445_UnnamedClasses1.java")); + void jep463UnnamedClasses4WithImports() { + doTest("Jep463_UnnamedClasses4WithImports"); + } + + @Test + void jep463UnnamedClassesBeforeJava22Preview() { + ParseException thrown = assertThrows(ParseException.class, () -> java22.parseResource("Jep463_UnnamedClasses1.java")); assertThat(thrown.getMessage(), containsString("Unnamed classes is a preview feature of JDK 22, you should select your language version accordingly")); } @Test - void testOrdinaryCompilationUnit() { + void jep463TestOrdinaryCompilationUnit() { ASTCompilationUnit compilationUnit = java22.parse("public class Foo { public static void main(String[] args) {}}"); assertFalse(compilationUnit.isUnnamedClass()); } @Test - void testModularCompilationUnit() { + void jep463TestModularCompilationUnit() { ASTCompilationUnit compilationUnit = java22.parse("module foo {}"); assertFalse(compilationUnit.isUnnamedClass()); } diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep445_UnnamedClasses1.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses1.java similarity index 52% rename from pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep445_UnnamedClasses1.java rename to pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses1.java index 5a8891fd2f..fc1cea6d7c 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep445_UnnamedClasses1.java +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses1.java @@ -5,7 +5,8 @@ /** - * @see JEP 445: Unnamed Classes and Instance Main Methods (Preview) + * @see JEP 445: Unnamed Classes and Instance Main Methods (Preview) (Java 21) + * @see JEP 463: Implicitly Declared Classes and Instance Main Methods (Second Preview) (Java 22) */ void main() { diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep445_UnnamedClasses1.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses1.txt similarity index 100% rename from pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep445_UnnamedClasses1.txt rename to pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses1.txt diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep445_UnnamedClasses2.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses2.java similarity index 56% rename from pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep445_UnnamedClasses2.java rename to pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses2.java index 49d30a40e1..1e2d223c24 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep445_UnnamedClasses2.java +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses2.java @@ -5,7 +5,8 @@ /** - * @see JEP 445: Unnamed Classes and Instance Main Methods (Preview) + * @see JEP 445: Unnamed Classes and Instance Main Methods (Preview) (Java 21) + * @see JEP 463: Implicitly Declared Classes and Instance Main Methods (Second Preview) (Java 22) */ String greeting() { return "Hello, World!"; } diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep445_UnnamedClasses2.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses2.txt similarity index 100% rename from pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep445_UnnamedClasses2.txt rename to pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses2.txt diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep445_UnnamedClasses3.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses3.java similarity index 55% rename from pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep445_UnnamedClasses3.java rename to pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses3.java index 9c4fcae3f7..3cbde1d0e5 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep445_UnnamedClasses3.java +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses3.java @@ -5,7 +5,8 @@ /** - * @see JEP 445: Unnamed Classes and Instance Main Methods (Preview) + * @see JEP 445: Unnamed Classes and Instance Main Methods (Preview) (Java 21) + * @see JEP 463: Implicitly Declared Classes and Instance Main Methods (Second Preview) (Java 22) */ String greeting = "Hello, World!"; diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep445_UnnamedClasses3.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses3.txt similarity index 100% rename from pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep445_UnnamedClasses3.txt rename to pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses3.txt diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses4WithImports.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses4WithImports.java new file mode 100644 index 0000000000..b22ef710d0 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses4WithImports.java @@ -0,0 +1,17 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +import java.util.Arrays; +import java.util.stream.Collectors; + +/** + * @see JEP 445: Unnamed Classes and Instance Main Methods (Preview) (Java 21) + * @see JEP 463: Implicitly Declared Classes and Instance Main Methods (Second Preview) (Java 22) + */ + +String greeting = Arrays.asList("Hello", "World!").stream().collect(Collectors.joining(", ")); + +void main() { + System.out.println(greeting); +} diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses4WithImports.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses4WithImports.txt new file mode 100644 index 0000000000..6324eadc34 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses4WithImports.txt @@ -0,0 +1,35 @@ ++- CompilationUnit[@PackageName = ""] + +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.util.Arrays", @ImportedSimpleName = "Arrays", @PackageName = "java.util", @Static = false] + +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.util.stream.Collectors", @ImportedSimpleName = "Collectors", @PackageName = "java.util.stream", @Static = false] + +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PACKAGE, @Static = false, @Visibility = Visibility.V_PACKAGE] + | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- VariableDeclarator[@Initializer = true, @Name = "greeting"] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "greeting", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] + | +- MethodCall[@CompileTimeConstant = false, @Image = "collect", @MethodName = "collect", @ParenthesisDepth = 0, @Parenthesized = false] + | +- MethodCall[@CompileTimeConstant = false, @Image = "stream", @MethodName = "stream", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- MethodCall[@CompileTimeConstant = false, @Image = "asList", @MethodName = "asList", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Arrays"] + | | | +- ArgumentList[@Empty = false, @Size = 2] + | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Hello", @Empty = false, @Image = "\"Hello\"", @Length = 5, @LiteralText = "\"Hello\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "World!", @Empty = false, @Image = "\"World!\"", @Length = 6, @LiteralText = "\"World!\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- MethodCall[@CompileTimeConstant = false, @Image = "joining", @MethodName = "joining", @ParenthesisDepth = 0, @Parenthesized = false] + | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassType[@FullyQualified = false, @SimpleName = "Collectors"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = ", ", @Empty = false, @Image = "\", \"", @Length = 2, @LiteralText = "\", \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "main", @MainMethod = true, @Name = "main", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] + +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + +- VoidType[] + +- FormalParameters[@Empty = true, @Size = 0] + +- Block[@Empty = false, @Size = 1, @containsComment = false] + +- ExpressionStatement[] + +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + +- ArgumentList[@Empty = false, @Size = 1] + +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "greeting", @Name = "greeting", @ParenthesisDepth = 0, @Parenthesized = false] From 4e01a3dafb4aea3d78b7e40293e898221ef9c78c Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 15 Feb 2024 12:12:12 +0100 Subject: [PATCH 10/52] [java] JEP 456: Unnamed Variables & Patterns This is now standardized. --- docs/pages/release_notes.md | 2 + pmd-java/etc/grammar/Java.jjt | 2 + .../pmd/lang/java/ast/ASTUnnamedPattern.java | 7 +-- .../ast/internal/LanguageLevelChecker.java | 17 +++---- .../lang/java/ast/AllJavaAstTreeDumpTest.java | 3 +- .../java/ast/Java21PreviewTreeDumpTest.java | 5 +- .../java/ast/Java22PreviewTreeDumpTest.java | 14 ------ .../pmd/lang/java/ast/Java22TreeDumpTest.java | 46 +++++++++++++++++++ .../Jep443_UnnamedPatternsAndVariables2.java | 26 ----------- .../Jep456_UnnamedPatternsAndVariables.java} | 5 +- .../Jep456_UnnamedPatternsAndVariables.txt} | 22 ++++----- .../Jep443_UnnamedPatternsAndVariables2.java | 26 ----------- 12 files changed, 78 insertions(+), 97 deletions(-) create mode 100644 pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java22TreeDumpTest.java delete mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep443_UnnamedPatternsAndVariables2.java rename pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/{java22p/Jep443_UnnamedPatternsAndVariables.java => java22/Jep456_UnnamedPatternsAndVariables.java} (94%) rename pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/{java22p/Jep443_UnnamedPatternsAndVariables.txt => java22/Jep456_UnnamedPatternsAndVariables.txt} (98%) delete mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep443_UnnamedPatternsAndVariables2.java diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index e9df137ccc..0d1a0b54dd 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -240,6 +240,8 @@ The rules have been moved into categories with PMD 6. - method `getParenthesisDepth()` has been removed. * {%jdoc java::lang.java.ast.ASTTemplateFragment %}: To get the content of the template, use now {%jdoc java::lang.java.ast.ASTTemplateFragment#getContent() %} or `@Content` instead of `getImage()`/`@Image`. +* {%jdoc java::lang.java.ast.ASTUnnamedPattern %} is not experimental anymore. The language feature + has been standardized with Java 22. **New API** diff --git a/pmd-java/etc/grammar/Java.jjt b/pmd-java/etc/grammar/Java.jjt index cf66ce0cb0..3d01cd8830 100644 --- a/pmd-java/etc/grammar/Java.jjt +++ b/pmd-java/etc/grammar/Java.jjt @@ -1,4 +1,6 @@ /** + * Support "JEP 456: Unnamed Variables & Patterns" (Java 22) + * This is now a regular language feature. Otherwise no changes. * Support "JEP 463: Implicitly Declared Classes and Instance Main Methods (Second Preview)" (Java 22) * No changes. * Support "JEP 459: String Templates (Second Preview)" (Java 22) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTUnnamedPattern.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTUnnamedPattern.java index 6eed6e6d93..52a5534764 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTUnnamedPattern.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTUnnamedPattern.java @@ -5,10 +5,8 @@ package net.sourceforge.pmd.lang.java.ast; -import net.sourceforge.pmd.annotation.Experimental; - /** - * An unnamed pattern, a Java 21 Preview language feature. + * An unnamed pattern, a Java 22 language feature. * *
  *
@@ -16,9 +14,8 @@ import net.sourceforge.pmd.annotation.Experimental;
  *
  * 
* - * @see JEP 443: Unnamed patterns and variables (Preview) (Java 21) + * @see JEP 456: Unnamed Variables & Patterns (Java 22) */ -@Experimental public final class ASTUnnamedPattern extends AbstractJavaNode implements ASTPattern { ASTUnnamedPattern(int id) { diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/internal/LanguageLevelChecker.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/internal/LanguageLevelChecker.java index dccede5cc9..326e14b23a 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/internal/LanguageLevelChecker.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/internal/LanguageLevelChecker.java @@ -130,10 +130,11 @@ public class LanguageLevelChecker { STRING_TEMPLATES(21, 22, false), /** - * Unnamed patterns and variables. + * Unnamed variables and patterns. * @see JEP 443: Unnamed patterns and variables (Preview) (Java 21) + * @see JEP 456: Unnamed Variables & Patterns (Java 22) */ - UNNAMED_PATTERNS_AND_VARIABLES(21, 22, false), + UNNAMED_VARIABLES_AND_PATTERNS(21, 21, true), /** * Unnamed Classes and Instance Main Methods @@ -167,10 +168,10 @@ public class LanguageLevelChecker { } String message = StringUtils.capitalize(displayNameLower(name())); - if (canBePreview) { + if (wasStandardized) { + message += " was only standardized in Java " + (maxPreviewVersion + 1); + } else if (canBePreview) { message += " is a preview feature of JDK " + jdk; - } else if (wasStandardized) { - message = message + " was only standardized in Java " + (maxPreviewVersion + 1); } else if (minPreviewVersion == maxPreviewVersion) { message += " is a preview feature of JDK " + minPreviewVersion; } else { @@ -655,7 +656,7 @@ public class LanguageLevelChecker { @Override public Void visit(ASTUnnamedPattern node, T data) { - check(node, PreviewFeature.UNNAMED_PATTERNS_AND_VARIABLES, data); + check(node, PreviewFeature.UNNAMED_VARIABLES_AND_PATTERNS, data); return null; } @@ -688,8 +689,8 @@ public class LanguageLevelChecker { } else if ("assert".equals(simpleName)) { check(node, Keywords.ASSERT_AS_AN_IDENTIFIER, acc); } else if ("_".equals(simpleName)) { - if (LanguageLevelChecker.this.preview) { - check(node, PreviewFeature.UNNAMED_PATTERNS_AND_VARIABLES, acc); + if (LanguageLevelChecker.this.jdkVersion >= 21) { + check(node, PreviewFeature.UNNAMED_VARIABLES_AND_PATTERNS, acc); } else { check(node, Keywords.UNDERSCORE_AS_AN_IDENTIFIER, acc); } diff --git a/pmd-java/src/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 42794be992..64c8afd050 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 @@ -16,7 +16,8 @@ import org.junit.platform.suite.api.Suite; Java16TreeDumpTest.class, Java17TreeDumpTest.class, Java21TreeDumpTest.class, - Java21PreviewTreeDumpTest.class + Java21PreviewTreeDumpTest.class, + Java22TreeDumpTest.class }) class AllJavaAstTreeDumpTest { diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java21PreviewTreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java21PreviewTreeDumpTest.java index 26c055469d..802d43fdba 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java21PreviewTreeDumpTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java21PreviewTreeDumpTest.java @@ -59,10 +59,7 @@ class Java21PreviewTreeDumpTest extends BaseJavaTreeDumpTest { @Test void unnamedPatternsAndVariablesBeforeJava21Preview() { ParseException thrown = assertThrows(ParseException.class, () -> java21.parseResource("Jep443_UnnamedPatternsAndVariables.java")); - assertThat(thrown.getMessage(), containsString("Since Java 9, '_' is reserved and cannot be used as an identifier")); - - thrown = assertThrows(ParseException.class, () -> java21.parseResource("Jep443_UnnamedPatternsAndVariables2.java")); - assertThat(thrown.getMessage(), containsString("Unnamed patterns and variables is a preview feature of JDK 21, you should select your language version accordingly")); + assertThat(thrown.getMessage(), containsString("Unnamed variables and patterns was only standardized in Java 22, you should select your language version accordingly")); } @Test diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java22PreviewTreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java22PreviewTreeDumpTest.java index 0b24ca452e..e6ceeed81d 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java22PreviewTreeDumpTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java22PreviewTreeDumpTest.java @@ -51,20 +51,6 @@ class Java22PreviewTreeDumpTest extends BaseJavaTreeDumpTest { assertEquals("java.lang.String", ((JClassSymbol) typeMirror.getSymbol()).getCanonicalName()); } - @Test - void unnamedPatternsAndVariables() { - doTest("Jep443_UnnamedPatternsAndVariables"); - } - - @Test - void unnamedPatternsAndVariablesBeforeJava22Preview() { - ParseException thrown = assertThrows(ParseException.class, () -> java22.parseResource("Jep443_UnnamedPatternsAndVariables.java")); - assertThat(thrown.getMessage(), containsString("Since Java 9, '_' is reserved and cannot be used as an identifier")); - - thrown = assertThrows(ParseException.class, () -> java22.parseResource("Jep443_UnnamedPatternsAndVariables2.java")); - assertThat(thrown.getMessage(), containsString("Unnamed patterns and variables is a preview feature of JDK 22, you should select your language version accordingly")); - } - @Test void jep463UnnamedClasses1() { doTest("Jep463_UnnamedClasses1"); diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java22TreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java22TreeDumpTest.java new file mode 100644 index 0000000000..b28af7a40e --- /dev/null +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java22TreeDumpTest.java @@ -0,0 +1,46 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +package net.sourceforge.pmd.lang.java.ast; + +import static org.hamcrest.CoreMatchers.containsString; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import org.junit.jupiter.api.Test; + +import net.sourceforge.pmd.lang.ast.ParseException; +import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; +import net.sourceforge.pmd.lang.java.BaseJavaTreeDumpTest; +import net.sourceforge.pmd.lang.java.JavaParsingHelper; + +class Java22TreeDumpTest extends BaseJavaTreeDumpTest { + private final JavaParsingHelper java22 = + JavaParsingHelper.DEFAULT.withDefaultVersion("22") + .withResourceContext(Java21TreeDumpTest.class, "jdkversiontests/java22/"); + private final JavaParsingHelper java21 = java22.withDefaultVersion("21"); + private final JavaParsingHelper java17 = java22.withDefaultVersion("17"); + + @Override + public BaseParsingHelper getParser() { + return java22; + } + + @Test + void jep456UnnamedPatternsAndVariables() { + doTest("Jep456_UnnamedPatternsAndVariables"); + } + + @Test + void jep456UnnamedPatternsAndVariablesBeforeJava22() { + ParseException thrown = assertThrows(ParseException.class, () -> java21.parseResource("Jep456_UnnamedPatternsAndVariables.java")); + assertThat(thrown.getMessage(), containsString("Unnamed variables and patterns was only standardized in Java 22, you should select your language version accordingly")); + } + + @Test + void jep456UnnamedVariablesAndPatternsUnderscoreBeforeJava21() { + ParseException thrown = assertThrows(ParseException.class, () -> java17.parse("class Test { { for(Integer _ : java.util.Arrays.asList(1, 2, 3)) {} } }")); + assertThat(thrown.getMessage(), containsString("Since Java 9, '_' is reserved and cannot be used as an identifier")); + } +} diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep443_UnnamedPatternsAndVariables2.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep443_UnnamedPatternsAndVariables2.java deleted file mode 100644 index 7d690d41e5..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep443_UnnamedPatternsAndVariables2.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - - -import java.util.ArrayDeque; -import java.util.List; -import java.util.Queue; -import java.util.stream.Collectors; - -/** - * @see JEP 443: Unnamed Patterns and Variables (Preview) - */ -class Jep443_UnamedPatternsAndVariables2 { - record Point(int x, int y) { } - enum Color { RED, GREEN, BLUE } - record ColoredPoint(Point p, Color c) { } - - void unnamedPatterns1() { - ColoredPoint r = new ColoredPoint(new Point(3,4), Color.GREEN); - - if (r instanceof ColoredPoint(Point(int x, int y), _)) { - System.out.println(x + " " + y); - } - } -} diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep443_UnnamedPatternsAndVariables.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22/Jep456_UnnamedPatternsAndVariables.java similarity index 94% rename from pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep443_UnnamedPatternsAndVariables.java rename to pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22/Jep456_UnnamedPatternsAndVariables.java index dc2e9f4c7a..a9d8cb8004 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep443_UnnamedPatternsAndVariables.java +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22/Jep456_UnnamedPatternsAndVariables.java @@ -9,9 +9,10 @@ import java.util.Queue; import java.util.stream.Collectors; /** - * @see JEP 443: Unnamed Patterns and Variables (Preview) + * @see JEP 443: Unnamed Patterns and Variables (Preview) (Java 21) + * @see JEP 456: Unnamed Variables & Patterns (Java 22) */ -class Jep443_UnamedPatternsAndVariables { +class Jep456_UnamedPatternsAndVariables { record Point(int x, int y) { } enum Color { RED, GREEN, BLUE } record ColoredPoint(Point p, Color c) { } diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep443_UnnamedPatternsAndVariables.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22/Jep456_UnnamedPatternsAndVariables.txt similarity index 98% rename from pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep443_UnnamedPatternsAndVariables.txt rename to pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22/Jep456_UnnamedPatternsAndVariables.txt index fcb1e37135..8ade7f7fcc 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep443_UnnamedPatternsAndVariables.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22/Jep456_UnnamedPatternsAndVariables.txt @@ -3,10 +3,10 @@ +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.util.List", @ImportedSimpleName = "List", @PackageName = "java.util", @Static = false] +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.util.Queue", @ImportedSimpleName = "Queue", @PackageName = "java.util", @Static = false] +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.util.stream.Collectors", @ImportedSimpleName = "Collectors", @PackageName = "java.util.stream", @Static = false] - +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "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] + +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep456_UnamedPatternsAndVariables", @CanonicalName = "Jep456_UnamedPatternsAndVariables", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Jep456_UnamedPatternsAndVariables", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE] +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] +- ClassBody[@Empty = false, @Size = 19] - +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "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] + +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep456_UnamedPatternsAndVariables$Point", @CanonicalName = "Jep456_UnamedPatternsAndVariables.Point", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Point", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] @@ -18,7 +18,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 = "y", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] - +- EnumDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "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] + +- EnumDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep456_UnamedPatternsAndVariables$Color", @CanonicalName = "Jep456_UnamedPatternsAndVariables.Color", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = true, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Color", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] | +- EnumBody[@Empty = false, @SeparatorSemi = false, @Size = 3, @TrailingComma = false] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "RED", @MethodName = "new", @Name = "RED", @Visibility = Visibility.V_PUBLIC] @@ -30,7 +30,7 @@ | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "BLUE", @MethodName = "new", @Name = "BLUE", @Visibility = Visibility.V_PUBLIC] | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "BLUE", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] - +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "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] + +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep456_UnamedPatternsAndVariables$ColoredPoint", @CanonicalName = "Jep456_UnamedPatternsAndVariables.ColoredPoint", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "ColoredPoint", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] @@ -125,29 +125,29 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = " ", @Empty = false, @Image = "\" \"", @Length = 1, @LiteralText = "\" \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "y", @Name = "y", @ParenthesisDepth = 0, @Parenthesized = false] - +- ClassDeclaration[@Abstract = true, @Annotation = false, @Anonymous = false, @BinaryName = "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] + +- ClassDeclaration[@Abstract = true, @Annotation = false, @Anonymous = false, @BinaryName = "Jep456_UnamedPatternsAndVariables$Ball", @CanonicalName = "Jep456_UnamedPatternsAndVariables.Ball", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Ball", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = "{sealed, abstract}", @ExplicitModifiers = "{sealed, abstract}"] | +- PermitsList[@Empty = false, @Size = 3] | | +- ClassType[@FullyQualified = false, @SimpleName = "RedBall"] | | +- ClassType[@FullyQualified = false, @SimpleName = "BlueBall"] | | +- ClassType[@FullyQualified = false, @SimpleName = "GreenBall"] | +- ClassBody[@Empty = true, @Size = 0] - +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "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] + +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep456_UnamedPatternsAndVariables$RedBall", @CanonicalName = "Jep456_UnamedPatternsAndVariables.RedBall", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "RedBall", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"] | +- ExtendsList[@Empty = false, @Size = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "Ball"] | +- ClassBody[@Empty = true, @Size = 0] - +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "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] + +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep456_UnamedPatternsAndVariables$BlueBall", @CanonicalName = "Jep456_UnamedPatternsAndVariables.BlueBall", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "BlueBall", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"] | +- ExtendsList[@Empty = false, @Size = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "Ball"] | +- ClassBody[@Empty = true, @Size = 0] - +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "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] + +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep456_UnamedPatternsAndVariables$GreenBall", @CanonicalName = "Jep456_UnamedPatternsAndVariables.GreenBall", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "GreenBall", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"] | +- ExtendsList[@Empty = false, @Size = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "Ball"] | +- ClassBody[@Empty = true, @Size = 0] - +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "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] + +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep456_UnamedPatternsAndVariables$Box", @CanonicalName = "Jep456_UnamedPatternsAndVariables.Box", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Box", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] | +- TypeParameters[@Empty = false, @Size = 1] | | +- TypeParameter[@Image = "T", @Name = "T", @TypeBound = true] @@ -316,7 +316,7 @@ | +- 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] + +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep456_UnamedPatternsAndVariables$Order", @CanonicalName = "Jep456_UnamedPatternsAndVariables.Order", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Order", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | +- ClassBody[@Empty = true, @Size = 0] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = true, @Visibility = Visibility.V_PRIVATE] @@ -491,7 +491,7 @@ | +- 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] + +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep456_UnamedPatternsAndVariables$ScopedContext", @CanonicalName = "Jep456_UnamedPatternsAndVariables.ScopedContext", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "ScopedContext", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] | +- ImplementsList[@Empty = false, @Size = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "AutoCloseable"] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep443_UnnamedPatternsAndVariables2.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep443_UnnamedPatternsAndVariables2.java deleted file mode 100644 index 7d690d41e5..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep443_UnnamedPatternsAndVariables2.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - - -import java.util.ArrayDeque; -import java.util.List; -import java.util.Queue; -import java.util.stream.Collectors; - -/** - * @see JEP 443: Unnamed Patterns and Variables (Preview) - */ -class Jep443_UnamedPatternsAndVariables2 { - record Point(int x, int y) { } - enum Color { RED, GREEN, BLUE } - record ColoredPoint(Point p, Color c) { } - - void unnamedPatterns1() { - ColoredPoint r = new ColoredPoint(new Point(3,4), Color.GREEN); - - if (r instanceof ColoredPoint(Point(int x, int y), _)) { - System.out.println(x + " " + y); - } - } -} From bfe9ce66e2fd323c17309c56ee9b1f5da427d467 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 15 Feb 2024 13:20:46 +0100 Subject: [PATCH 11/52] [java] JEP 447: Statements before super(...) (Preview) (Java 22) --- pmd-java/etc/grammar/Java.jjt | 3 + .../ast/internal/LanguageLevelChecker.java | 19 ++ .../java/ast/Java22PreviewTreeDumpTest.java | 11 + .../java22p/Jep447_StatementsBeforeSuper.java | 86 ++++++ .../java22p/Jep447_StatementsBeforeSuper.txt | 283 ++++++++++++++++++ 5 files changed, 402 insertions(+) create mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep447_StatementsBeforeSuper.java create mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep447_StatementsBeforeSuper.txt diff --git a/pmd-java/etc/grammar/Java.jjt b/pmd-java/etc/grammar/Java.jjt index 3d01cd8830..3c18bbd5c3 100644 --- a/pmd-java/etc/grammar/Java.jjt +++ b/pmd-java/etc/grammar/Java.jjt @@ -1,4 +1,6 @@ /** + * Support "JEP 447: Statements before super(...) (Preview)" (Java 22) + * Changes in ConstructorBlock * Support "JEP 456: Unnamed Variables & Patterns" (Java 22) * This is now a regular language feature. Otherwise no changes. * Support "JEP 463: Implicitly Declared Classes and Instance Main Methods (Second Preview)" (Java 22) @@ -1522,6 +1524,7 @@ private void ConstructorBlock() #Block: {} { "{" { tokenContexts.push(TokenContext.BLOCK); } + ( LOOKAHEAD(2) BlockStatement() )* [ LOOKAHEAD(ExplicitConstructorInvocation()) ExplicitConstructorInvocation() ] ( BlockStatement() )* "}" { tokenContexts.pop(); } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/internal/LanguageLevelChecker.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/internal/LanguageLevelChecker.java index 326e14b23a..aa9ae5a538 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/internal/LanguageLevelChecker.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/internal/LanguageLevelChecker.java @@ -18,7 +18,9 @@ import net.sourceforge.pmd.lang.java.ast.ASTCastExpression; import net.sourceforge.pmd.lang.java.ast.ASTCatchClause; import net.sourceforge.pmd.lang.java.ast.ASTCompilationUnit; import net.sourceforge.pmd.lang.java.ast.ASTConstructorCall; +import net.sourceforge.pmd.lang.java.ast.ASTConstructorDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTEnumDeclaration; +import net.sourceforge.pmd.lang.java.ast.ASTExplicitConstructorInvocation; import net.sourceforge.pmd.lang.java.ast.ASTForeachStatement; import net.sourceforge.pmd.lang.java.ast.ASTFormalParameter; import net.sourceforge.pmd.lang.java.ast.ASTGuard; @@ -143,6 +145,12 @@ public class LanguageLevelChecker { */ UNNAMED_CLASSES(21, 22, false), + /** + * Statements before super + * @see JEP 447: Statements before super(...) (Preview) (Java 22) + */ + STATEMENTS_BEFORE_SUPER(22, 22, false), + ; // SUPPRESS CHECKSTYLE enum trailing semi is awesome @@ -683,6 +691,17 @@ public class LanguageLevelChecker { return null; } + @Override + public Void visit(ASTConstructorDeclaration node, T data) { + super.visit(node, data); + if (node.getBody().descendants(ASTExplicitConstructorInvocation.class).nonEmpty()) { + if (!(node.getBody().getFirstChild() instanceof ASTExplicitConstructorInvocation)) { + check(node, PreviewFeature.STATEMENTS_BEFORE_SUPER, data); + } + } + return null; + } + private void checkIdent(JavaNode node, String simpleName, T acc) { if ("enum".equals(simpleName)) { check(node, Keywords.ENUM_AS_AN_IDENTIFIER, acc); diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java22PreviewTreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java22PreviewTreeDumpTest.java index e6ceeed81d..387aabfbc7 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java22PreviewTreeDumpTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java22PreviewTreeDumpTest.java @@ -92,4 +92,15 @@ class Java22PreviewTreeDumpTest extends BaseJavaTreeDumpTest { ASTCompilationUnit compilationUnit = java22.parse("module foo {}"); assertFalse(compilationUnit.isUnnamedClass()); } + + @Test + void jep447StatementsBeforeSuper() { + doTest("Jep447_StatementsBeforeSuper"); + } + + @Test + void jep447StatementsBeforeSuperBeforeJava22Preview() { + ParseException thrown = assertThrows(ParseException.class, () -> java22.parseResource("Jep447_StatementsBeforeSuper.java")); + assertThat(thrown.getMessage(), containsString("Statements before super is a preview feature of JDK 22, you should select your language version accordingly")); + } } diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep447_StatementsBeforeSuper.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep447_StatementsBeforeSuper.java new file mode 100644 index 0000000000..de3b25ddaf --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep447_StatementsBeforeSuper.java @@ -0,0 +1,86 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +import java.math.BigInteger; +import java.nio.charset.StandardCharsets; +import java.security.cert.Certificate; +import java.security.interfaces.DSAPublicKey; +import java.security.interfaces.RSAKey; + +/** + * @see JEP 447: Statements before super(...) (Preview) (Java 22) + */ +class Jep447_StatementsBeforeSuper { + // To test backwards compatibility - "normal" explicit constructor invocation + public static class Old { + public Old() { + super(); + } + } + + // Example: Validating superclass constructor arguments + public static class PositiveBigInteger extends BigInteger { + + public PositiveBigInteger(long value) { + if (value <= 0) + throw new IllegalArgumentException("non-positive value"); + final String valueAsString = String.valueOf(value); + super(valueAsString); + } + } + + // Example: Preparing superclass constructor arguments + public static class Super { + public Super(byte[] bytes) {} + } + + public class Sub extends Super { + public Sub(Certificate certificate) { + var publicKey = certificate.getPublicKey(); + if (publicKey == null) + throw new IllegalArgumentException("null certificate"); + final byte[] byteArray = switch (publicKey) { + case RSAKey rsaKey -> rsaKey.toString().getBytes(StandardCharsets.UTF_8); + case DSAPublicKey dsaKey -> dsaKey.toString().getBytes(StandardCharsets.UTF_8); + default -> new byte[0]; + }; + super(byteArray); + } + } + + // Example: Sharing superclass constructor arguments + public static class F {} + public static class Super2 { + public Super2(F f1, F f2) {} + } + public class Sub2 extends Super2 { + public Sub2(int i) { + var f = new F(); + super(f, f); + // ... i ... + } + } + + // Example with records + public record Range(int lo, int hi) { + public Range(int lo, int hi, int maxDistance) { + if (lo > hi) + throw new IllegalArgumentException(String.format("(%d,%d)", lo, hi)); + if (hi - lo > maxDistance) + throw new IllegalArgumentException(String.format("(%d,%d,%d", lo, hi, maxDistance)); + this(lo, hi); + } + } + + // Example with enum + public enum Color { + BLUE(1); + private Color() { + } + private Color(int a) { + if (a < 0) throw new IllegalArgumentException(); + this(); + }; + } +} diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep447_StatementsBeforeSuper.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep447_StatementsBeforeSuper.txt new file mode 100644 index 0000000000..5d4c451e61 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep447_StatementsBeforeSuper.txt @@ -0,0 +1,283 @@ ++- CompilationUnit[@PackageName = ""] + +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.math.BigInteger", @ImportedSimpleName = "BigInteger", @PackageName = "java.math", @Static = false] + +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.nio.charset.StandardCharsets", @ImportedSimpleName = "StandardCharsets", @PackageName = "java.nio.charset", @Static = false] + +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.security.cert.Certificate", @ImportedSimpleName = "Certificate", @PackageName = "java.security.cert", @Static = false] + +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.security.interfaces.DSAPublicKey", @ImportedSimpleName = "DSAPublicKey", @PackageName = "java.security.interfaces", @Static = false] + +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.security.interfaces.RSAKey", @ImportedSimpleName = "RSAKey", @PackageName = "java.security.interfaces", @Static = false] + +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep447_StatementsBeforeSuper", @CanonicalName = "Jep447_StatementsBeforeSuper", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Jep447_StatementsBeforeSuper", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE] + +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + +- ClassBody[@Empty = false, @Size = 9] + +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep447_StatementsBeforeSuper$Old", @CanonicalName = "Jep447_StatementsBeforeSuper.Old", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Old", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] + | +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] + | +- ClassBody[@Empty = false, @Size = 1] + | +- ConstructorDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "Old", @Name = "Old", @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false] + | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- FormalParameters[@Empty = true, @Size = 0] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ExplicitConstructorInvocation[@ArgumentCount = 0, @MethodName = "new", @Qualified = false, @Super = true, @This = false] + | +- ArgumentList[@Empty = true, @Size = 0] + +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep447_StatementsBeforeSuper$PositiveBigInteger", @CanonicalName = "Jep447_StatementsBeforeSuper.PositiveBigInteger", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "PositiveBigInteger", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] + | +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] + | +- ExtendsList[@Empty = false, @Size = 1] + | | +- ClassType[@FullyQualified = false, @SimpleName = "BigInteger"] + | +- ClassBody[@Empty = false, @Size = 1] + | +- ConstructorDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "PositiveBigInteger", @Name = "PositiveBigInteger", @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false] + | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- PrimitiveType[@Kind = PrimitiveTypeKind.LONG] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "value", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- Block[@Empty = false, @Size = 3, @containsComment = false] + | +- IfStatement[@Else = false] + | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.LE, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "value", @Name = "value", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + | | +- ThrowStatement[] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | +- ClassType[@FullyQualified = false, @SimpleName = "IllegalArgumentException"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "non-positive value", @Empty = false, @Image = "\"non-positive value\"", @Length = 18, @LiteralText = "\"non-positive value\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = true, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- VariableDeclarator[@Initializer = true, @Name = "valueAsString"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "valueAsString", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- MethodCall[@CompileTimeConstant = false, @Image = "valueOf", @MethodName = "valueOf", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "value", @Name = "value", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ExplicitConstructorInvocation[@ArgumentCount = 1, @MethodName = "new", @Qualified = false, @Super = true, @This = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "valueAsString", @Name = "valueAsString", @ParenthesisDepth = 0, @Parenthesized = false] + +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep447_StatementsBeforeSuper$Super", @CanonicalName = "Jep447_StatementsBeforeSuper.Super", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Super", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] + | +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] + | +- ClassBody[@Empty = false, @Size = 1] + | +- ConstructorDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "Super", @Name = "Super", @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false] + | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ArrayType[@ArrayDepth = 1] + | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.BYTE] + | | | +- ArrayDimensions[@Empty = false, @Size = 1] + | | | +- ArrayTypeDim[@Varargs = false] + | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "bytes", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- Block[@Empty = true, @Size = 0, @containsComment = false] + +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep447_StatementsBeforeSuper$Sub", @CanonicalName = "Jep447_StatementsBeforeSuper.Sub", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Sub", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] + | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- ExtendsList[@Empty = false, @Size = 1] + | | +- ClassType[@FullyQualified = false, @SimpleName = "Super"] + | +- ClassBody[@Empty = false, @Size = 1] + | +- ConstructorDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "Sub", @Name = "Sub", @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false] + | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "Certificate"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "certificate", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- Block[@Empty = false, @Size = 4, @containsComment = false] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- VariableDeclarator[@Initializer = true, @Name = "publicKey"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "publicKey", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] + | | +- MethodCall[@CompileTimeConstant = false, @Image = "getPublicKey", @MethodName = "getPublicKey", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "certificate", @Name = "certificate", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- IfStatement[@Else = false] + | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "publicKey", @Name = "publicKey", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ThrowStatement[] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | +- ClassType[@FullyQualified = false, @SimpleName = "IllegalArgumentException"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "null certificate", @Empty = false, @Image = "\"null certificate\"", @Length = 16, @LiteralText = "\"null certificate\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = true, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"] + | | +- ArrayType[@ArrayDepth = 1] + | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.BYTE] + | | | +- ArrayDimensions[@Empty = false, @Size = 1] + | | | +- ArrayTypeDim[@Varargs = false] + | | +- VariableDeclarator[@Initializer = true, @Name = "byteArray"] + | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "byteArray", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- SwitchExpression[@CompileTimeConstant = false, @DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "publicKey", @Name = "publicKey", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- SwitchArrowBranch[@Default = false] + | | | +- SwitchLabel[@Default = false] + | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] + | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ClassType[@FullyQualified = false, @SimpleName = "RSAKey"] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "rsaKey", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- MethodCall[@CompileTimeConstant = false, @Image = "getBytes", @MethodName = "getBytes", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Image = "toString", @MethodName = "toString", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "rsaKey", @Name = "rsaKey", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ArgumentList[@Empty = true, @Size = 0] + | | | +- ArgumentList[@Empty = false, @Size = 1] + | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "UTF_8", @Name = "UTF_8", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "StandardCharsets"] + | | +- SwitchArrowBranch[@Default = false] + | | | +- SwitchLabel[@Default = false] + | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] + | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ClassType[@FullyQualified = false, @SimpleName = "DSAPublicKey"] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "dsaKey", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- MethodCall[@CompileTimeConstant = false, @Image = "getBytes", @MethodName = "getBytes", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Image = "toString", @MethodName = "toString", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "dsaKey", @Name = "dsaKey", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ArgumentList[@Empty = true, @Size = 0] + | | | +- ArgumentList[@Empty = false, @Size = 1] + | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "UTF_8", @Name = "UTF_8", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "StandardCharsets"] + | | +- SwitchArrowBranch[@Default = true] + | | +- SwitchLabel[@Default = true] + | | +- ArrayAllocation[@ArrayDepth = 1, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayType[@ArrayDepth = 1] + | | +- PrimitiveType[@Kind = PrimitiveTypeKind.BYTE] + | | +- ArrayDimensions[@Empty = false, @Size = 1] + | | +- ArrayDimExpr[@Varargs = false] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + | +- ExplicitConstructorInvocation[@ArgumentCount = 1, @MethodName = "new", @Qualified = false, @Super = true, @This = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "byteArray", @Name = "byteArray", @ParenthesisDepth = 0, @Parenthesized = false] + +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep447_StatementsBeforeSuper$F", @CanonicalName = "Jep447_StatementsBeforeSuper.F", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "F", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] + | +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] + | +- ClassBody[@Empty = true, @Size = 0] + +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep447_StatementsBeforeSuper$Super2", @CanonicalName = "Jep447_StatementsBeforeSuper.Super2", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Super2", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] + | +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] + | +- ClassBody[@Empty = false, @Size = 1] + | +- ConstructorDeclaration[@Abstract = false, @Arity = 2, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "Super2", @Name = "Super2", @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false] + | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- FormalParameters[@Empty = false, @Size = 2] + | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] + | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "F"] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "f1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "F"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "f2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- Block[@Empty = true, @Size = 0, @containsComment = false] + +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep447_StatementsBeforeSuper$Sub2", @CanonicalName = "Jep447_StatementsBeforeSuper.Sub2", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Sub2", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] + | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- ExtendsList[@Empty = false, @Size = 1] + | | +- ClassType[@FullyQualified = false, @SimpleName = "Super2"] + | +- ClassBody[@Empty = false, @Size = 1] + | +- ConstructorDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "Sub2", @Name = "Sub2", @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = true] + | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- Block[@Empty = false, @Size = 2, @containsComment = true] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- VariableDeclarator[@Initializer = true, @Name = "f"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "f", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | +- ClassType[@FullyQualified = false, @SimpleName = "F"] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- ExplicitConstructorInvocation[@ArgumentCount = 2, @MethodName = "new", @Qualified = false, @Super = true, @This = false] + | +- ArgumentList[@Empty = false, @Size = 2] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "f", @Name = "f", @ParenthesisDepth = 0, @Parenthesized = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "f", @Name = "f", @ParenthesisDepth = 0, @Parenthesized = false] + +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep447_StatementsBeforeSuper$Range", @CanonicalName = "Jep447_StatementsBeforeSuper.Range", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Range", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] + | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{public}"] + | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] + | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] + | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lo", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] + | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "hi", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | +- RecordBody[@Empty = false, @Size = 1] + | +- ConstructorDeclaration[@Abstract = false, @Arity = 3, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "Range", @Name = "Range", @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false] + | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- FormalParameters[@Empty = false, @Size = 3] + | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] + | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "lo", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] + | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "hi", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "maxDistance", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- Block[@Empty = false, @Size = 3, @containsComment = false] + | +- IfStatement[@Else = false] + | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "lo", @Name = "lo", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "hi", @Name = "hi", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ThrowStatement[] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | +- ClassType[@FullyQualified = false, @SimpleName = "IllegalArgumentException"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- MethodCall[@CompileTimeConstant = false, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ArgumentList[@Empty = false, @Size = 3] + | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "(%d,%d)", @Empty = false, @Image = "\"(%d,%d)\"", @Length = 7, @LiteralText = "\"(%d,%d)\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "lo", @Name = "lo", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "hi", @Name = "hi", @ParenthesisDepth = 0, @Parenthesized = false] + | +- IfStatement[@Else = false] + | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.SUB, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "hi", @Name = "hi", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "lo", @Name = "lo", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "maxDistance", @Name = "maxDistance", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ThrowStatement[] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | +- ClassType[@FullyQualified = false, @SimpleName = "IllegalArgumentException"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- MethodCall[@CompileTimeConstant = false, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ArgumentList[@Empty = false, @Size = 4] + | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "(%d,%d,%d", @Empty = false, @Image = "\"(%d,%d,%d\"", @Length = 9, @LiteralText = "\"(%d,%d,%d\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "lo", @Name = "lo", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "hi", @Name = "hi", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "maxDistance", @Name = "maxDistance", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ExplicitConstructorInvocation[@ArgumentCount = 2, @MethodName = "new", @Qualified = false, @Super = false, @This = true] + | +- ArgumentList[@Empty = false, @Size = 2] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "lo", @Name = "lo", @ParenthesisDepth = 0, @Parenthesized = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "hi", @Name = "hi", @ParenthesisDepth = 0, @Parenthesized = false] + +- EnumDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep447_StatementsBeforeSuper$Color", @CanonicalName = "Jep447_StatementsBeforeSuper.Color", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = true, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Color", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] + +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{public}"] + +- EnumBody[@Empty = false, @SeparatorSemi = true, @Size = 4, @TrailingComma = false] + +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "BLUE", @MethodName = "new", @Name = "BLUE", @Visibility = Visibility.V_PUBLIC] + | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "BLUE", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + +- ConstructorDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PRIVATE, @Image = "Color", @Name = "Color", @Varargs = false, @Visibility = Visibility.V_PRIVATE, @containsComment = false] + | +- ModifierList[@EffectiveModifiers = "{private}", @ExplicitModifiers = "{private}"] + | +- FormalParameters[@Empty = true, @Size = 0] + | +- Block[@Empty = true, @Size = 0, @containsComment = false] + +- ConstructorDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PRIVATE, @Image = "Color", @Name = "Color", @Varargs = false, @Visibility = Visibility.V_PRIVATE, @containsComment = false] + | +- ModifierList[@EffectiveModifiers = "{private}", @ExplicitModifiers = "{private}"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- Block[@Empty = false, @Size = 2, @containsComment = false] + | +- IfStatement[@Else = false] + | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.LT, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "a", @Name = "a", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + | | +- ThrowStatement[] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | +- ClassType[@FullyQualified = false, @SimpleName = "IllegalArgumentException"] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- ExplicitConstructorInvocation[@ArgumentCount = 0, @MethodName = "new", @Qualified = false, @Super = false, @This = true] + | +- ArgumentList[@Empty = true, @Size = 0] + +- EmptyDeclaration[] From 2a1aaa6bce086aff65f33e2959ad1482596990ad Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 15 Feb 2024 15:07:50 +0100 Subject: [PATCH 12/52] [java] Fix tests with ExplicitConstructorInvocations --- pmd-java/etc/grammar/Java.jjt | 8 ++++++-- .../pmd/lang/java/ast/AllJavaAstTreeDumpTest.java | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/pmd-java/etc/grammar/Java.jjt b/pmd-java/etc/grammar/Java.jjt index 3c18bbd5c3..65f530b19e 100644 --- a/pmd-java/etc/grammar/Java.jjt +++ b/pmd-java/etc/grammar/Java.jjt @@ -1524,8 +1524,12 @@ private void ConstructorBlock() #Block: {} { "{" { tokenContexts.push(TokenContext.BLOCK); } - ( LOOKAHEAD(2) BlockStatement() )* - [ LOOKAHEAD(ExplicitConstructorInvocation()) ExplicitConstructorInvocation() ] + ( + LOOKAHEAD(ExplicitConstructorInvocation()) ExplicitConstructorInvocation() + | + ( LOOKAHEAD(2) BlockStatement() )* + [ LOOKAHEAD(ExplicitConstructorInvocation()) ExplicitConstructorInvocation() ] + ) ( BlockStatement() )* "}" { tokenContexts.pop(); } } 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 64c8afd050..cd1e20ef28 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/AllJavaAstTreeDumpTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/AllJavaAstTreeDumpTest.java @@ -17,7 +17,8 @@ import org.junit.platform.suite.api.Suite; Java17TreeDumpTest.class, Java21TreeDumpTest.class, Java21PreviewTreeDumpTest.class, - Java22TreeDumpTest.class + Java22TreeDumpTest.class, + Java22PreviewTreeDumpTest.class }) class AllJavaAstTreeDumpTest { From 01647beb5943c77f8d2d9c93eeadd790dcb48f09 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 15 Feb 2024 15:13:27 +0100 Subject: [PATCH 13/52] [doc] Update release notes (#4794) Java 22 --- docs/pages/release_notes.md | 24 ++++++++++++++++++++++++ docs/pages/release_notes_pmd7.md | 22 ++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 0d1a0b54dd..cd16d4e593 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -73,6 +73,28 @@ As PMD 7 revamped the Java module, if you have custom rules, you need to migrate See the use case [I'm using custom rules]({{ baseurl }}pmd_userdocs_migrating_to_pmd7.html#im-using-custom-rules) in the Migration Guide. +##### Java 22 Support + +This release of PMD brings support for Java 22. There are the following new standard language features, +that are supported now: + +* [JEP 456: Unnamed Variables & Patterns](https://openjdk.org/jeps/456) + +PMD also supports the following preview language features: + +* [JEP 447: Statements before super(...) (Preview)](https://openjdk.org/jeps/447) +* [JEP 459: String Templates (Second Preview)](https://openjdk.org/jeps/459) +* [JEP 463: Implicitly Declared Classes and Instance Main Methods (Second Preview)](https://openjdk.org/jeps/463) + +In order to analyze a project with PMD that uses these language features, +you'll need to enable it via the environment variable `PMD_JAVA_OPTS` and select the new language +version `22-preview`: + + export PMD_JAVA_OPTS=--enable-preview + pmd check --use-version java-22-preview ... + +Note: Support for Java 20 preview language features have been removed. The version "20-preview" is no longer available. + ##### Swift Support * limited support for Swift 5.9 (Macro Expansions) @@ -212,6 +234,7 @@ The rules have been moved into categories with PMD 6. * [#3751](https://github.com/pmd/pmd/issues/3751): \[java] Rename some node types * [#4628](https://github.com/pmd/pmd/pull/4628): \[java] Support loading classes from java runtime images * [#4753](https://github.com/pmd/pmd/issues/4753): \[java] PMD crashes while using generics and wildcards + * [#4794](https://github.com/pmd/pmd/issues/4794): \[java] Support JDK 22 * java-codestyle * [#2847](https://github.com/pmd/pmd/issues/2847): \[java] New Rule: Use Explicit Types * [#4578](https://github.com/pmd/pmd/issues/4578): \[java] CommentDefaultAccessModifier comment needs to be before annotation if present @@ -872,6 +895,7 @@ Language specific fixes: * [#4583](https://github.com/pmd/pmd/issues/4583): \[java] Support JDK 21 (LTS) * [#4628](https://github.com/pmd/pmd/pull/4628): \[java] Support loading classes from java runtime images * [#4753](https://github.com/pmd/pmd/issues/4753): \[java] PMD crashes while using generics and wildcards + * [#4794](https://github.com/pmd/pmd/issues/4794): \[java] Support JDK 22 * java-bestpractices * [#342](https://github.com/pmd/pmd/issues/342): \[java] AccessorMethodGeneration: Name clash with another public field not properly handled * [#755](https://github.com/pmd/pmd/issues/755): \[java] AccessorClassGeneration false positive for private constructors diff --git a/docs/pages/release_notes_pmd7.md b/docs/pages/release_notes_pmd7.md index cf71d941ff..4ad03ad34b 100644 --- a/docs/pages/release_notes_pmd7.md +++ b/docs/pages/release_notes_pmd7.md @@ -218,6 +218,28 @@ module `pmd-coco`. Contributors: [Wener](https://github.com/wener-tiobe) (@wener-tiobe) +### Java 22 Support + +This release of PMD brings support for Java 22. There are the following new standard language features, +that are supported now: + +* [JEP 456: Unnamed Variables & Patterns](https://openjdk.org/jeps/456) + +PMD also supports the following preview language features: + +* [JEP 447: Statements before super(...) (Preview)](https://openjdk.org/jeps/447) +* [JEP 459: String Templates (Second Preview)](https://openjdk.org/jeps/459) +* [JEP 463: Implicitly Declared Classes and Instance Main Methods (Second Preview)](https://openjdk.org/jeps/463) + +In order to analyze a project with PMD that uses these language features, +you'll need to enable it via the environment variable `PMD_JAVA_OPTS` and select the new language +version `22-preview`: + + export PMD_JAVA_OPTS=--enable-preview + pmd check --use-version java-22-preview ... + +Note: Support for Java 20 preview language features have been removed. The version "20-preview" is no longer available. + ### New: Java 21 Support This release of PMD brings support for Java 21. There are the following new standard language features, From ac2c52e2201d4928a715ec5b23eae5259cf28761 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 15 Feb 2024 16:33:13 +0100 Subject: [PATCH 14/52] [ant] Fix ant Formatter with Java 22 Java 22 provides a real console from System.console() even if it is non-interactive. In that case, we need to check whether we have a terminal. --- .../java/net/sourceforge/pmd/ant/Formatter.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/pmd-ant/src/main/java/net/sourceforge/pmd/ant/Formatter.java b/pmd-ant/src/main/java/net/sourceforge/pmd/ant/Formatter.java index 48296af944..f592c0f2ef 100644 --- a/pmd-ant/src/main/java/net/sourceforge/pmd/ant/Formatter.java +++ b/pmd-ant/src/main/java/net/sourceforge/pmd/ant/Formatter.java @@ -11,6 +11,7 @@ import java.io.IOException; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.Writer; +import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; @@ -210,8 +211,21 @@ public class Formatter { private static String getConsoleEncoding() { Console console = System.console(); - // in case of pipe or redirect, no interactive console. + // in case of pipe or redirect, no interactive console, we get null if (console != null) { + // Since Java 22, this returns a console even for redirected streams. + // In that case, we need to check Console.isTerminal() + // See: JLine As The Default Console Provider (JDK-8308591) + try { + Boolean isTerminal = (Boolean) MethodUtils.invokeMethod(console, "isTerminal"); + if (!isTerminal) { + // stop here, we don't have an interactive console. + return null; + } + } catch (InvocationTargetException | NoSuchMethodException | IllegalAccessException e) { + // fall-through - we use a Java Runtime < 22. + } + try { Object res = FieldUtils.readDeclaredField(console, "cs", true); if (res instanceof Charset) { From ccebca525c4768fe9271eb86d12a6dfa4b2826e6 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 15 Feb 2024 17:05:07 +0100 Subject: [PATCH 15/52] Ignore empty catch block --- pmd-ant/src/main/java/net/sourceforge/pmd/ant/Formatter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pmd-ant/src/main/java/net/sourceforge/pmd/ant/Formatter.java b/pmd-ant/src/main/java/net/sourceforge/pmd/ant/Formatter.java index f592c0f2ef..865944a300 100644 --- a/pmd-ant/src/main/java/net/sourceforge/pmd/ant/Formatter.java +++ b/pmd-ant/src/main/java/net/sourceforge/pmd/ant/Formatter.java @@ -222,7 +222,7 @@ public class Formatter { // stop here, we don't have an interactive console. return null; } - } catch (InvocationTargetException | NoSuchMethodException | IllegalAccessException e) { + } catch (InvocationTargetException | NoSuchMethodException | IllegalAccessException ignored) { // fall-through - we use a Java Runtime < 22. } From 0f7dff69091217e09686f636df9217e529de52bf Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Sat, 17 Feb 2024 18:38:42 +0100 Subject: [PATCH 16/52] [compat6] Support configuration errors --- pmd-compat6/src/it/pmd-for-java/config_error_ruleset.xml | 5 +++++ pmd-compat6/src/it/pmd-for-java/pom.xml | 1 + pmd-compat6/src/it/pmd-for-java/verify.bsh | 3 +++ .../src/main/java/net/sourceforge/pmd/reporting/Report.java | 5 +++++ 4 files changed, 14 insertions(+) create mode 100644 pmd-compat6/src/it/pmd-for-java/config_error_ruleset.xml diff --git a/pmd-compat6/src/it/pmd-for-java/config_error_ruleset.xml b/pmd-compat6/src/it/pmd-for-java/config_error_ruleset.xml new file mode 100644 index 0000000000..1d646a3073 --- /dev/null +++ b/pmd-compat6/src/it/pmd-for-java/config_error_ruleset.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/pmd-compat6/src/it/pmd-for-java/pom.xml b/pmd-compat6/src/it/pmd-for-java/pom.xml index 55682ec03b..9ba028cf53 100644 --- a/pmd-compat6/src/it/pmd-for-java/pom.xml +++ b/pmd-compat6/src/it/pmd-for-java/pom.xml @@ -35,6 +35,7 @@ /rulesets/java/maven-pmd-plugin-default.xml ${project.basedir}/exception_ruleset.xml + ${project.basedir}/config_error_ruleset.xml diff --git a/pmd-compat6/src/it/pmd-for-java/verify.bsh b/pmd-compat6/src/it/pmd-for-java/verify.bsh index 43e010d774..5e813cab8b 100644 --- a/pmd-compat6/src/it/pmd-for-java/verify.bsh +++ b/pmd-compat6/src/it/pmd-for-java/verify.bsh @@ -36,6 +36,9 @@ if (!pmdXml.contains(mainFile + "\">")) { if (!pmdXml.contains("")) { + throw new RuntimeException("Configuration error has not been reported"); +} File pmdCsvReport = new File(basedir, "target/pmd.csv"); if (!pmdCsvReport.exists()) { diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/reporting/Report.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/reporting/Report.java index 22d8b59758..39dbfd1036 100644 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/reporting/Report.java +++ b/pmd-compat6/src/main/java/net/sourceforge/pmd/reporting/Report.java @@ -13,6 +13,11 @@ public class Report extends net.sourceforge.pmd.Report { public ConfigurationError(Rule theRule, String theIssue) { super(theRule, theIssue); } + + @Override + public net.sourceforge.pmd.lang.rule.Rule rule() { + return (net.sourceforge.pmd.lang.rule.Rule) super.rule(); + } } public static class ProcessingError extends net.sourceforge.pmd.Report.ProcessingError { From b223b1a672439fc0707e279326b1ce3255513da0 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Sat, 17 Feb 2024 18:39:50 +0100 Subject: [PATCH 17/52] [compat6] Support other cpd languages like cs --- .../src/it/cpd-for-csharp/invoker.properties | 2 + pmd-compat6/src/it/cpd-for-csharp/pom.xml | 78 +++++++++++++++++++ .../it/cpd-for-csharp/src/main/cs/strings1.cs | 12 +++ .../it/cpd-for-csharp/src/main/cs/strings2.cs | 12 +++ pmd-compat6/src/it/cpd-for-csharp/verify.bsh | 46 +++++++++++ .../sourceforge/pmd/cpd/CPDConfiguration.java | 3 + .../sourceforge/pmd/cpd/LanguageFactory.java | 45 ++++++++++- 7 files changed, 197 insertions(+), 1 deletion(-) create mode 100644 pmd-compat6/src/it/cpd-for-csharp/invoker.properties create mode 100644 pmd-compat6/src/it/cpd-for-csharp/pom.xml create mode 100644 pmd-compat6/src/it/cpd-for-csharp/src/main/cs/strings1.cs create mode 100644 pmd-compat6/src/it/cpd-for-csharp/src/main/cs/strings2.cs create mode 100644 pmd-compat6/src/it/cpd-for-csharp/verify.bsh diff --git a/pmd-compat6/src/it/cpd-for-csharp/invoker.properties b/pmd-compat6/src/it/cpd-for-csharp/invoker.properties new file mode 100644 index 0000000000..0d92d959f3 --- /dev/null +++ b/pmd-compat6/src/it/cpd-for-csharp/invoker.properties @@ -0,0 +1,2 @@ +invoker.goals = verify +invoker.buildResult = failure diff --git a/pmd-compat6/src/it/cpd-for-csharp/pom.xml b/pmd-compat6/src/it/cpd-for-csharp/pom.xml new file mode 100644 index 0000000000..d324ef4634 --- /dev/null +++ b/pmd-compat6/src/it/cpd-for-csharp/pom.xml @@ -0,0 +1,78 @@ + + + 4.0.0 + + net.sourceforge.pmd.pmd-compat6.it + cpd-for-csharp + 1.0-SNAPSHOT + + + 11 + 11 + UTF-8 + + + + + + org.apache.maven.plugins + maven-pmd-plugin + @maven-pmd-plugin.version.for.integrationtest@ + + + csharp-cpd-check + + cpd-check + + + + + cs + 10 + + **/*.cs + + + ${basedir}/src/main/cs + + true + false + + + + net.sourceforge.pmd + pmd-compat6 + @project.version@ + + + net.sourceforge.pmd + pmd-core + @pmd.version.for.integrationtest@ + + + net.sourceforge.pmd + pmd-java + @pmd.version.for.integrationtest@ + + + net.sourceforge.pmd + pmd-javascript + @pmd.version.for.integrationtest@ + + + net.sourceforge.pmd + pmd-jsp + @pmd.version.for.integrationtest@ + + + net.sourceforge.pmd + pmd-cs + @pmd.version.for.integrationtest@ + + + + + + diff --git a/pmd-compat6/src/it/cpd-for-csharp/src/main/cs/strings1.cs b/pmd-compat6/src/it/cpd-for-csharp/src/main/cs/strings1.cs new file mode 100644 index 0000000000..b36845bb8a --- /dev/null +++ b/pmd-compat6/src/it/cpd-for-csharp/src/main/cs/strings1.cs @@ -0,0 +1,12 @@ +class Foo { + void bar() { + + var test = $@"test"; + var test2 = @$"test"; + + String query = + @"SELECT foo, bar + FROM table + WHERE id = 42"; + } +} diff --git a/pmd-compat6/src/it/cpd-for-csharp/src/main/cs/strings2.cs b/pmd-compat6/src/it/cpd-for-csharp/src/main/cs/strings2.cs new file mode 100644 index 0000000000..b36845bb8a --- /dev/null +++ b/pmd-compat6/src/it/cpd-for-csharp/src/main/cs/strings2.cs @@ -0,0 +1,12 @@ +class Foo { + void bar() { + + var test = $@"test"; + var test2 = @$"test"; + + String query = + @"SELECT foo, bar + FROM table + WHERE id = 42"; + } +} diff --git a/pmd-compat6/src/it/cpd-for-csharp/verify.bsh b/pmd-compat6/src/it/cpd-for-csharp/verify.bsh new file mode 100644 index 0000000000..f5db9350bd --- /dev/null +++ b/pmd-compat6/src/it/cpd-for-csharp/verify.bsh @@ -0,0 +1,46 @@ +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; + +String readFile(File file) throws IOException { + StringBuilder content = new StringBuilder(); + for (String line : Files.readAllLines(file.toPath(), StandardCharsets.UTF_8)) { + content.append(line).append(System.lineSeparator()); + } + return content.toString(); +} + +File buildLogPath = new File(basedir, "build.log"); +String buildLog = readFile(buildLogPath); +if (buildLog.contains("An API incompatibility was encountered while")) { + throw new RuntimeException("Executing failed due to API incompatibility"); +} + +if (!buildLog.contains("[INFO] CPD Failure: Found 12 lines of duplicated code at locations:")) { + throw new RuntimeException("No CPD failures detected, did CPD run?"); +} +File classA = new File("cpd-for-csharp/src/main/cs/strings1.cs"); +if (!buildLog.contains(classA + " line 1")) { + throw new RuntimeException("No CPD failures detected, did CPD run?"); +} +File classB = new File("cpd-for-csharp/src/main/cs/strings2.cs"); +if (!buildLog.contains(classA + " line 1")) { + throw new RuntimeException("No CPD failures detected, did CPD run?"); +} + +File cpdXmlReport = new File(basedir, "target/cpd.xml"); +if (!cpdXmlReport.exists()) { + throw new FileNotFoundException("Could not find cpd xml report: " + cpdXmlReport); +} +String cpdXml = readFile(cpdXmlReport); +if (!cpdXml.contains("")) { + throw new RuntimeException("Expected duplication has not been reported"); +} +if (!cpdXml.contains(classA + "\"/>")) { + throw new RuntimeException("Expected duplication has not been reported"); +} +if (!cpdXml.contains(classB + "\"/>")) { + throw new RuntimeException("Expected duplication has not been reported"); +} diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/CPDConfiguration.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/CPDConfiguration.java index a747e69b2c..133ffec71d 100644 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/CPDConfiguration.java +++ b/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/CPDConfiguration.java @@ -295,6 +295,9 @@ public class CPDConfiguration extends AbstractConfiguration { } else if (language instanceof JSPLanguage) { filenameFilter = language.getFileFilter(); setForceLanguageVersion(JspLanguageModule.getInstance().getDefaultVersion()); + } else if (language instanceof LanguageFactory.CpdLanguageAdapter) { + filenameFilter = language.getFileFilter(); + setForceLanguageVersion(((LanguageFactory.CpdLanguageAdapter) language).getLanguage().getDefaultVersion()); } else { throw new UnsupportedOperationException("Language " + language.getName() + " is not supported"); } diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/LanguageFactory.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/LanguageFactory.java index 09769cd57b..8191bcb298 100644 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/LanguageFactory.java +++ b/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/LanguageFactory.java @@ -10,6 +10,11 @@ package net.sourceforge.pmd.cpd; import java.util.Properties; +import java.util.stream.Collectors; + +import net.sourceforge.pmd.lang.LanguagePropertyBundle; +import net.sourceforge.pmd.lang.LanguageRegistry; +import net.sourceforge.pmd.properties.PropertyDescriptor; public final class LanguageFactory { private LanguageFactory() { @@ -17,6 +22,44 @@ public final class LanguageFactory { } public static Language createLanguage(String name, Properties properties) { - throw new UnsupportedOperationException(); + CpdCapableLanguage cpdLanguage = (CpdCapableLanguage) LanguageRegistry.CPD.getLanguageById(name); + if (cpdLanguage != null) { + return new CpdLanguageAdapter(cpdLanguage, properties); + } + throw new UnsupportedOperationException("Language " + name + " is not supported"); + } + + public static class CpdLanguageAdapter extends AbstractLanguage { + private CpdCapableLanguage language; + + public CpdLanguageAdapter(CpdCapableLanguage cpdCapableLanguage, Properties properties) { + super(cpdCapableLanguage.getName(), cpdCapableLanguage.getId(), createLexer(cpdCapableLanguage, properties), convertExtensions(cpdCapableLanguage)); + this.language = cpdCapableLanguage; + } + + private static Tokenizer createLexer(CpdCapableLanguage cpdCapableLanguage, Properties properties) { + LanguagePropertyBundle propertyBundle = cpdCapableLanguage.newPropertyBundle(); + for (String propName : properties.stringPropertyNames()) { + PropertyDescriptor propertyDescriptor = propertyBundle.getPropertyDescriptor(propName); + if (propertyDescriptor != null) { + setProperty(propertyBundle, propertyDescriptor, properties.getProperty(propName)); + } + } + CpdLexer cpdLexer = cpdCapableLanguage.createCpdLexer(propertyBundle); + return cpdLexer::tokenize; + } + + private static void setProperty(LanguagePropertyBundle propertyBundle, PropertyDescriptor propertyDescriptor, String stringValue) { + T value = propertyDescriptor.serializer().fromString(stringValue); + propertyBundle.setProperty(propertyDescriptor, value); + } + + private static String[] convertExtensions(CpdCapableLanguage cpdCapableLanguage) { + return cpdCapableLanguage.getExtensions().stream().map(s -> "." + s).collect(Collectors.toList()).toArray(new String[0]); + } + + public CpdCapableLanguage getLanguage() { + return language; + } } } From 3dd4ace6438540b97783b8242355710d6d6c14b0 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Sun, 18 Feb 2024 09:13:04 +0100 Subject: [PATCH 18/52] [compat6] add dependency to pmd-cs --- pmd-compat6/pom.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pmd-compat6/pom.xml b/pmd-compat6/pom.xml index 10d2fc34c3..e9385ac4ff 100644 --- a/pmd-compat6/pom.xml +++ b/pmd-compat6/pom.xml @@ -39,6 +39,11 @@ pmd-jsp ${project.version} + + net.sourceforge.pmd + pmd-cs + ${project.version} + From f2aedc86e519d7aacd3db59f13eb2f6a65b18394 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Sun, 18 Feb 2024 09:15:11 +0100 Subject: [PATCH 19/52] [doc] Update release notes (#4827) --- 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 885c20c5b0..5ca92f7686 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -204,6 +204,7 @@ The rules have been moved into categories with PMD 6. * [#4749](https://github.com/pmd/pmd/pull/4749): Fixes NoSuchMethodError on processing errors in pmd-compat6 * [#4776](https://github.com/pmd/pmd/issues/4776): \[ci] Upgrade to ruby 3 * [#4796](https://github.com/pmd/pmd/pull/4796): Remove deprecated and release rulesets + * [#4827](https://github.com/pmd/pmd/pull/4827): \[compat6] Support config errors and cpd for csharp * apex-performance * [#4675](https://github.com/pmd/pmd/issues/4675): \[apex] New Rule: OperationWithHighCostInLoop * groovy @@ -726,6 +727,7 @@ See also [Detailed Release Notes for PMD 7]({{ baseurl }}pmd_release_notes_pmd7. * [#4749](https://github.com/pmd/pmd/pull/4749): Fixes NoSuchMethodError on processing errors in pmd-compat6 * [#4776](https://github.com/pmd/pmd/issues/4776): \[ci] Upgrade to ruby 3 * [#4796](https://github.com/pmd/pmd/pull/4796): Remove deprecated and release rulesets + * [#4827](https://github.com/pmd/pmd/pull/4827): \[compat6] Support config errors and cpd for csharp * ant * [#4080](https://github.com/pmd/pmd/issues/4080): \[ant] Split off Ant integration into a new submodule * core From 621cd0e0137390e16d1ce6df3707575c8419fa39 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 15 Feb 2024 09:01:55 +0100 Subject: [PATCH 20/52] Update to use renamed pmd-designer See pmd/pmd-designer#80 --- do-release.sh | 2 +- .../adding_a_new_javacc_based_language.md | 2 +- docs/pages/pmd/userdocs/extending/designer_reference.md | 6 +++--- docs/pages/release_notes.md | 2 ++ pmd-cli/pom.xml | 2 +- pmd-dist/pom.xml | 2 +- 6 files changed, 9 insertions(+), 7 deletions(-) diff --git a/do-release.sh b/do-release.sh index 28d9d70e4a..ac43cffdb5 100755 --- a/do-release.sh +++ b/do-release.sh @@ -281,7 +281,7 @@ echo "Then proceed with releasing pmd-designer..." echo "" echo echo "Press enter to continue when pmd-designer is available in maven-central..." -echo "." +echo "." echo echo "Note: If there is no new pmd-designer release needed, you can directly proceed." read -r diff --git a/docs/pages/pmd/devdocs/major_contributions/adding_a_new_javacc_based_language.md b/docs/pages/pmd/devdocs/major_contributions/adding_a_new_javacc_based_language.md index fe5caf5aec..dc5981e86e 100644 --- a/docs/pages/pmd/devdocs/major_contributions/adding_a_new_javacc_based_language.md +++ b/docs/pages/pmd/devdocs/major_contributions/adding_a_new_javacc_based_language.md @@ -252,7 +252,7 @@ This can be achieved with Rule Designer: * Fork and clone the [pmd/pmd-designer](https://github.com/pmd/pmd-designer) repository. * Add a syntax highlighter implementation to `net.sourceforge.pmd.util.fxdesigner.util.codearea.syntaxhighlighting` (you could use Java as an example). * Register it in the `AvailableSyntaxHighlighters` enumeration. - * Now build your implementation and place the `target/pmd-ui--SNAPSHOT.jar` to the `lib` directory inside your `pmd-bin-...` distribution (you have to delete old `pmd-ui-*.jar` from there). + * Now build your implementation and place the `target/pmd-designer--SNAPSHOT.jar` to the `lib` directory inside your `pmd-bin-...` distribution (you have to delete old `pmd-designer-*.jar` from there). ## Optional features diff --git a/docs/pages/pmd/userdocs/extending/designer_reference.md b/docs/pages/pmd/userdocs/extending/designer_reference.md index 33af658835..c6ba0a79cf 100644 --- a/docs/pages/pmd/userdocs/extending/designer_reference.md +++ b/docs/pages/pmd/userdocs/extending/designer_reference.md @@ -3,7 +3,7 @@ title: The rule designer short_title: Rule designer tags: [extending, userdocs] summary: "Learn about the usage and features of the rule designer." -last_updated: December 2023 (7.0.0) +last_updated: February 2024 (7.0.0) permalink: pmd_userdocs_extending_designer_reference.html author: Clément Fournier --- @@ -25,7 +25,7 @@ If the bin directory of your PMD distribution is on your shell's path, then you windows="pmd.bat designer" %} -{% include note.html content="pmd-ui.jar is not a runnable jar, because it doesn't include any PMD language module, or PMD Core. " %} +{% include note.html content="pmd-designer.jar is not a runnable jar, because it doesn't include any PMD language module, or PMD Core. " %} This is to allow easy updating, and let you choose the dependencies you're interested in. @@ -36,7 +36,7 @@ standard PMD startup scripts, which setups the classpath with the available PMD ### Updating The latest version of the designer currently **works with PMD 7.0.0 and above**. You can simply replace -pmd-ui-7.X.Y.jar with the [latest build](https://github.com/pmd/pmd-designer/releases) in the installation +pmd-designer-7.X.Y.jar with the [latest build](https://github.com/pmd/pmd-designer/releases) in the installation folder of your PMD distribution, and run it normally. Note that updating may cause some persisted state to get lost, for example the code snippet. diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 6dd6099c26..81485fd438 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -264,6 +264,7 @@ The rules have been moved into categories with PMD 6. * [#4749](https://github.com/pmd/pmd/pull/4749): Fixes NoSuchMethodError on processing errors in pmd-compat6 * [#4776](https://github.com/pmd/pmd/issues/4776): \[ci] Upgrade to ruby 3 * [#4796](https://github.com/pmd/pmd/pull/4796): Remove deprecated and release rulesets + * [#4823](https://github.com/pmd/pmd/pull/4823): Update to use renamed pmd-designer * apex * [#3766](https://github.com/pmd/pmd/issues/3766): \[apex] Replace Jorje with fully open source front-end * apex-performance @@ -1220,6 +1221,7 @@ See also [Detailed Release Notes for PMD 7]({{ baseurl }}pmd_release_notes_pmd7. * [#4749](https://github.com/pmd/pmd/pull/4749): Fixes NoSuchMethodError on processing errors in pmd-compat6 * [#4776](https://github.com/pmd/pmd/issues/4776): \[ci] Upgrade to ruby 3 * [#4796](https://github.com/pmd/pmd/pull/4796): Remove deprecated and release rulesets + * [#4823](https://github.com/pmd/pmd/pull/4823): Update to use renamed pmd-designer * ant * [#4080](https://github.com/pmd/pmd/issues/4080): \[ant] Split off Ant integration into a new submodule * core diff --git a/pmd-cli/pom.xml b/pmd-cli/pom.xml index 81fc5d26b2..9efefa2cbc 100644 --- a/pmd-cli/pom.xml +++ b/pmd-cli/pom.xml @@ -32,7 +32,7 @@ net.sourceforge.pmd - pmd-ui + pmd-designer ${pmd-designer.version} diff --git a/pmd-dist/pom.xml b/pmd-dist/pom.xml index fdd6d93f97..998ed84cf8 100644 --- a/pmd-dist/pom.xml +++ b/pmd-dist/pom.xml @@ -146,7 +146,7 @@ net.sourceforge.pmd - pmd-ui + pmd-designer ${pmd-designer.version} From 95870ffa58e29cac492764ce62f0fd9ba8ef9142 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 23 Feb 2024 11:24:49 +0100 Subject: [PATCH 21/52] [html] Move HtmlCpdLexer --- docs/pages/release_notes.md | 2 ++ .../net/sourceforge/pmd/lang/html/HtmlLanguageModule.java | 2 +- .../pmd/lang/html/{ast => cpd}/HtmlCpdLexer.java | 6 +++++- 3 files changed, 8 insertions(+), 2 deletions(-) rename pmd-html/src/main/java/net/sourceforge/pmd/lang/html/{ast => cpd}/HtmlCpdLexer.java (87%) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 6dd6099c26..24e69a593f 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -330,6 +330,8 @@ in the migration guide for details. * {%jdoc core::reporting.RuleViolation %} * {%jdoc core::reporting.ViolationSuppressor %} * {%jdoc core::lang.rule.xpath.XPathRule %} has been moved into subpackage {% jdoc_package core::lang.rule.xpath %}. +* pmd-html + * `net.sourceforge.pmd.lang.html.ast.HtmlCpdLexer` moved into package `cpd`: {%jdoc html::lang.html.cpd.HtmlCpdLexer %}. **Internalized classes and interfaces and methods** diff --git a/pmd-html/src/main/java/net/sourceforge/pmd/lang/html/HtmlLanguageModule.java b/pmd-html/src/main/java/net/sourceforge/pmd/lang/html/HtmlLanguageModule.java index 26d02710a9..c4809cc487 100644 --- a/pmd-html/src/main/java/net/sourceforge/pmd/lang/html/HtmlLanguageModule.java +++ b/pmd-html/src/main/java/net/sourceforge/pmd/lang/html/HtmlLanguageModule.java @@ -7,7 +7,7 @@ package net.sourceforge.pmd.lang.html; import net.sourceforge.pmd.cpd.CpdLexer; import net.sourceforge.pmd.lang.LanguagePropertyBundle; import net.sourceforge.pmd.lang.LanguageRegistry; -import net.sourceforge.pmd.lang.html.ast.HtmlCpdLexer; +import net.sourceforge.pmd.lang.html.cpd.HtmlCpdLexer; import net.sourceforge.pmd.lang.impl.SimpleLanguageModuleBase; public final class HtmlLanguageModule extends SimpleLanguageModuleBase { diff --git a/pmd-html/src/main/java/net/sourceforge/pmd/lang/html/ast/HtmlCpdLexer.java b/pmd-html/src/main/java/net/sourceforge/pmd/lang/html/cpd/HtmlCpdLexer.java similarity index 87% rename from pmd-html/src/main/java/net/sourceforge/pmd/lang/html/ast/HtmlCpdLexer.java rename to pmd-html/src/main/java/net/sourceforge/pmd/lang/html/cpd/HtmlCpdLexer.java index f7f0668de6..18a2392e08 100644 --- a/pmd-html/src/main/java/net/sourceforge/pmd/lang/html/ast/HtmlCpdLexer.java +++ b/pmd-html/src/main/java/net/sourceforge/pmd/lang/html/cpd/HtmlCpdLexer.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.html.ast; +package net.sourceforge.pmd.lang.html.cpd; import java.io.IOException; import java.io.UncheckedIOException; @@ -15,6 +15,10 @@ import net.sourceforge.pmd.lang.ast.Parser.ParserTask; import net.sourceforge.pmd.lang.ast.SemanticErrorReporter; import net.sourceforge.pmd.lang.document.TextDocument; import net.sourceforge.pmd.lang.html.HtmlLanguageModule; +import net.sourceforge.pmd.lang.html.ast.ASTHtmlDocument; +import net.sourceforge.pmd.lang.html.ast.ASTHtmlTextNode; +import net.sourceforge.pmd.lang.html.ast.HtmlNode; +import net.sourceforge.pmd.lang.html.ast.HtmlParser; /** *

Note: This class has been called HtmlTokenizer in PMD 6

. From 45d2a6935e30b71899e7e4089682f45a34a4bbbf Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 23 Feb 2024 11:34:35 +0100 Subject: [PATCH 22/52] [doc] Internalize all classes in pmd-doc --- docs/pages/release_notes.md | 4 ++++ pmd-doc/pom.xml | 8 ++++---- .../pmd/{docs => doc/internal}/DeadLinksChecker.java | 2 +- .../pmd/{docs => doc/internal}/DefaultFileWriter.java | 2 +- .../pmd/{docs => doc/internal}/EscapeUtils.java | 2 +- .../pmd/{docs => doc/internal}/FileWriter.java | 2 +- .../pmd/{docs => doc/internal}/GenerateRuleDocsCmd.java | 2 +- .../pmd/{docs => doc/internal}/RuleDocGenerator.java | 2 +- .../pmd/{docs => doc/internal}/RuleSetUtils.java | 2 +- .../pmd/{docs => doc/internal}/RuleTagChecker.java | 2 +- .../pmd/{docs => doc/internal}/SidebarGenerator.java | 2 +- .../pmd/{docs => doc/internal}/EscapeUtilsTest.java | 2 +- .../pmd/{docs => doc/internal}/MockedFileWriter.java | 2 +- .../pmd/{docs => doc/internal}/RuleDocGeneratorTest.java | 4 ++-- .../pmd/{docs => doc/internal}/RuleSetResolverTest.java | 2 +- .../pmd/{docs => doc/internal}/RuleTagCheckerTest.java | 2 +- .../pmd/{docs => doc/internal}/SidebarGeneratorTest.java | 2 +- .../sourceforge/pmd/{docs => doc/internal}/sidebar.yml | 0 18 files changed, 24 insertions(+), 20 deletions(-) rename pmd-doc/src/main/java/net/sourceforge/pmd/{docs => doc/internal}/DeadLinksChecker.java (99%) rename pmd-doc/src/main/java/net/sourceforge/pmd/{docs => doc/internal}/DefaultFileWriter.java (92%) rename pmd-doc/src/main/java/net/sourceforge/pmd/{docs => doc/internal}/EscapeUtils.java (98%) rename pmd-doc/src/main/java/net/sourceforge/pmd/{docs => doc/internal}/FileWriter.java (86%) rename pmd-doc/src/main/java/net/sourceforge/pmd/{docs => doc/internal}/GenerateRuleDocsCmd.java (98%) rename pmd-doc/src/main/java/net/sourceforge/pmd/{docs => doc/internal}/RuleDocGenerator.java (99%) rename pmd-doc/src/main/java/net/sourceforge/pmd/{docs => doc/internal}/RuleSetUtils.java (98%) rename pmd-doc/src/main/java/net/sourceforge/pmd/{docs => doc/internal}/RuleTagChecker.java (99%) rename pmd-doc/src/main/java/net/sourceforge/pmd/{docs => doc/internal}/SidebarGenerator.java (99%) rename pmd-doc/src/test/java/net/sourceforge/pmd/{docs => doc/internal}/EscapeUtilsTest.java (98%) rename pmd-doc/src/test/java/net/sourceforge/pmd/{docs => doc/internal}/MockedFileWriter.java (96%) rename pmd-doc/src/test/java/net/sourceforge/pmd/{docs => doc/internal}/RuleDocGeneratorTest.java (96%) rename pmd-doc/src/test/java/net/sourceforge/pmd/{docs => doc/internal}/RuleSetResolverTest.java (98%) rename pmd-doc/src/test/java/net/sourceforge/pmd/{docs => doc/internal}/RuleTagCheckerTest.java (97%) rename pmd-doc/src/test/java/net/sourceforge/pmd/{docs => doc/internal}/SidebarGeneratorTest.java (98%) rename pmd-doc/src/test/resources/net/sourceforge/pmd/{docs => doc/internal}/sidebar.yml (100%) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 24e69a593f..5afda090bc 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -393,6 +393,10 @@ package or made (package) private and are _not accessible_ anymore. * Method `replacementIfDeprecated()` is now package private. * `net.sourceforge.pmd.properties.PropertyTypeId` - moved in subpackage `internal`. * {%jdoc !!core::properties.PropertyDescriptor %} - method `getTypeId()` is now package private. +* pmd-doc + * The whole maven module `pmd-doc` is now considered internal API even though it was not declared so before. + It's used to generate the rule documentation for the built-in rules. + * All the classes have been moved into package `net.sourceforge.pmd.doc.internal`. * pmd-ant * {%jdoc !!ant::ant.Formatter %} * Method `getRenderer()` has been removed. diff --git a/pmd-doc/pom.xml b/pmd-doc/pom.xml index 55529bfed2..e449a52d79 100644 --- a/pmd-doc/pom.xml +++ b/pmd-doc/pom.xml @@ -2,7 +2,7 @@ 4.0.0 pmd-doc - PMD Documentation Generator + PMD Documentation Generator (internal) jar @@ -35,7 +35,7 @@ package - net.sourceforge.pmd.docs.GenerateRuleDocsCmd + net.sourceforge.pmd.doc.internal.GenerateRuleDocsCmd ${project.basedir} @@ -48,7 +48,7 @@ verify - net.sourceforge.pmd.docs.DeadLinksChecker + net.sourceforge.pmd.doc.internal.DeadLinksChecker ${project.basedir} @@ -61,7 +61,7 @@ verify - net.sourceforge.pmd.docs.RuleTagChecker + net.sourceforge.pmd.doc.internal.RuleTagChecker ${project.basedir} diff --git a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/DeadLinksChecker.java b/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/DeadLinksChecker.java similarity index 99% rename from pmd-doc/src/main/java/net/sourceforge/pmd/docs/DeadLinksChecker.java rename to pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/DeadLinksChecker.java index 9e3b11c5c2..ad849464da 100644 --- a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/DeadLinksChecker.java +++ b/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/DeadLinksChecker.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.docs; +package net.sourceforge.pmd.doc.internal; import java.io.IOException; import java.io.InputStream; diff --git a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/DefaultFileWriter.java b/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/DefaultFileWriter.java similarity index 92% rename from pmd-doc/src/main/java/net/sourceforge/pmd/docs/DefaultFileWriter.java rename to pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/DefaultFileWriter.java index 5c7e84ad2f..3a105f05d2 100644 --- a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/DefaultFileWriter.java +++ b/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/DefaultFileWriter.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.docs; +package net.sourceforge.pmd.doc.internal; import java.io.IOException; import java.nio.charset.StandardCharsets; diff --git a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/EscapeUtils.java b/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/EscapeUtils.java similarity index 98% rename from pmd-doc/src/main/java/net/sourceforge/pmd/docs/EscapeUtils.java rename to pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/EscapeUtils.java index 78e5a4fd57..1dda3b8182 100644 --- a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/EscapeUtils.java +++ b/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/EscapeUtils.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.docs; +package net.sourceforge.pmd.doc.internal; import java.util.List; import java.util.regex.Matcher; diff --git a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/FileWriter.java b/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/FileWriter.java similarity index 86% rename from pmd-doc/src/main/java/net/sourceforge/pmd/docs/FileWriter.java rename to pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/FileWriter.java index d47452754d..e00b335f02 100644 --- a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/FileWriter.java +++ b/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/FileWriter.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.docs; +package net.sourceforge.pmd.doc.internal; import java.io.IOException; import java.nio.file.Path; diff --git a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/GenerateRuleDocsCmd.java b/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/GenerateRuleDocsCmd.java similarity index 98% rename from pmd-doc/src/main/java/net/sourceforge/pmd/docs/GenerateRuleDocsCmd.java rename to pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/GenerateRuleDocsCmd.java index 256e605904..c1958e9c39 100644 --- a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/GenerateRuleDocsCmd.java +++ b/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/GenerateRuleDocsCmd.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.docs; +package net.sourceforge.pmd.doc.internal; import java.io.File; import java.io.IOException; diff --git a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/RuleDocGenerator.java b/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/RuleDocGenerator.java similarity index 99% rename from pmd-doc/src/main/java/net/sourceforge/pmd/docs/RuleDocGenerator.java rename to pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/RuleDocGenerator.java index a5d32cc979..cdaec8328e 100644 --- a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/RuleDocGenerator.java +++ b/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/RuleDocGenerator.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.docs; +package net.sourceforge.pmd.doc.internal; import java.io.File; import java.io.IOException; diff --git a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/RuleSetUtils.java b/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/RuleSetUtils.java similarity index 98% rename from pmd-doc/src/main/java/net/sourceforge/pmd/docs/RuleSetUtils.java rename to pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/RuleSetUtils.java index 156946cfbc..2399f96ebd 100644 --- a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/RuleSetUtils.java +++ b/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/RuleSetUtils.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.docs; +package net.sourceforge.pmd.doc.internal; import java.io.File; import java.util.regex.Pattern; diff --git a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/RuleTagChecker.java b/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/RuleTagChecker.java similarity index 99% rename from pmd-doc/src/main/java/net/sourceforge/pmd/docs/RuleTagChecker.java rename to pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/RuleTagChecker.java index a1ae35b753..9e41a1fa32 100644 --- a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/RuleTagChecker.java +++ b/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/RuleTagChecker.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.docs; +package net.sourceforge.pmd.doc.internal; import java.io.IOException; import java.nio.charset.StandardCharsets; diff --git a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/SidebarGenerator.java b/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/SidebarGenerator.java similarity index 99% rename from pmd-doc/src/main/java/net/sourceforge/pmd/docs/SidebarGenerator.java rename to pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/SidebarGenerator.java index 0982f7fb5b..d9f248eb0c 100644 --- a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/SidebarGenerator.java +++ b/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/SidebarGenerator.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.docs; +package net.sourceforge.pmd.doc.internal; import java.io.IOException; import java.io.Reader; diff --git a/pmd-doc/src/test/java/net/sourceforge/pmd/docs/EscapeUtilsTest.java b/pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/EscapeUtilsTest.java similarity index 98% rename from pmd-doc/src/test/java/net/sourceforge/pmd/docs/EscapeUtilsTest.java rename to pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/EscapeUtilsTest.java index 439a9f41bc..fe83327d77 100644 --- a/pmd-doc/src/test/java/net/sourceforge/pmd/docs/EscapeUtilsTest.java +++ b/pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/EscapeUtilsTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.docs; +package net.sourceforge.pmd.doc.internal; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/pmd-doc/src/test/java/net/sourceforge/pmd/docs/MockedFileWriter.java b/pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/MockedFileWriter.java similarity index 96% rename from pmd-doc/src/test/java/net/sourceforge/pmd/docs/MockedFileWriter.java rename to pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/MockedFileWriter.java index b954a3a9d3..7173fcc927 100644 --- a/pmd-doc/src/test/java/net/sourceforge/pmd/docs/MockedFileWriter.java +++ b/pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/MockedFileWriter.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.docs; +package net.sourceforge.pmd.doc.internal; import java.io.IOException; import java.nio.file.Path; diff --git a/pmd-doc/src/test/java/net/sourceforge/pmd/docs/RuleDocGeneratorTest.java b/pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/RuleDocGeneratorTest.java similarity index 96% rename from pmd-doc/src/test/java/net/sourceforge/pmd/docs/RuleDocGeneratorTest.java rename to pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/RuleDocGeneratorTest.java index b593280141..cffe8af125 100644 --- a/pmd-doc/src/test/java/net/sourceforge/pmd/docs/RuleDocGeneratorTest.java +++ b/pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/RuleDocGeneratorTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.docs; +package net.sourceforge.pmd.doc.internal; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -19,7 +19,7 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; -import net.sourceforge.pmd.docs.MockedFileWriter.FileEntry; +import net.sourceforge.pmd.doc.internal.MockedFileWriter.FileEntry; import net.sourceforge.pmd.internal.util.IOUtil; import net.sourceforge.pmd.lang.rule.RuleSet; import net.sourceforge.pmd.lang.rule.RuleSetLoader; diff --git a/pmd-doc/src/test/java/net/sourceforge/pmd/docs/RuleSetResolverTest.java b/pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/RuleSetResolverTest.java similarity index 98% rename from pmd-doc/src/test/java/net/sourceforge/pmd/docs/RuleSetResolverTest.java rename to pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/RuleSetResolverTest.java index bd3ee01d54..9abb6b4618 100644 --- a/pmd-doc/src/test/java/net/sourceforge/pmd/docs/RuleSetResolverTest.java +++ b/pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/RuleSetResolverTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.docs; +package net.sourceforge.pmd.doc.internal; import static net.sourceforge.pmd.util.CollectionUtil.listOf; import static org.junit.jupiter.api.Assertions.assertFalse; diff --git a/pmd-doc/src/test/java/net/sourceforge/pmd/docs/RuleTagCheckerTest.java b/pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/RuleTagCheckerTest.java similarity index 97% rename from pmd-doc/src/test/java/net/sourceforge/pmd/docs/RuleTagCheckerTest.java rename to pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/RuleTagCheckerTest.java index 3808b616a5..d9aa3cf7a1 100644 --- a/pmd-doc/src/test/java/net/sourceforge/pmd/docs/RuleTagCheckerTest.java +++ b/pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/RuleTagCheckerTest.java @@ -3,7 +3,7 @@ */ -package net.sourceforge.pmd.docs; +package net.sourceforge.pmd.doc.internal; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/pmd-doc/src/test/java/net/sourceforge/pmd/docs/SidebarGeneratorTest.java b/pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/SidebarGeneratorTest.java similarity index 98% rename from pmd-doc/src/test/java/net/sourceforge/pmd/docs/SidebarGeneratorTest.java rename to pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/SidebarGeneratorTest.java index 68ce308d5b..81f3392583 100644 --- a/pmd-doc/src/test/java/net/sourceforge/pmd/docs/SidebarGeneratorTest.java +++ b/pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/SidebarGeneratorTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.docs; +package net.sourceforge.pmd.doc.internal; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/pmd-doc/src/test/resources/net/sourceforge/pmd/docs/sidebar.yml b/pmd-doc/src/test/resources/net/sourceforge/pmd/doc/internal/sidebar.yml similarity index 100% rename from pmd-doc/src/test/resources/net/sourceforge/pmd/docs/sidebar.yml rename to pmd-doc/src/test/resources/net/sourceforge/pmd/doc/internal/sidebar.yml From 3a7460de292231d53c9599520e0204da81838e95 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 23 Feb 2024 12:04:54 +0100 Subject: [PATCH 23/52] [lang-test] Move classes into n.s.p.lang.test --- .../adding_a_new_javacc_based_language.md | 4 ++-- docs/pages/release_notes.md | 6 ++++++ .../pmd/lang/apex/SuppressWarningsTest.java | 4 ++-- .../pmd/lang/apex/ast/ApexParserTest.java | 4 ++-- .../pmd/lang/apex/ast/ApexParsingHelper.java | 2 +- .../pmd/lang/apex/ast/ApexTreeDumpTest.java | 6 +++--- .../pmd/lang/apex/cpd/ApexCpdLexerTest.java | 2 +- .../metrics/impl/CognitiveComplexityTestRule.java | 2 +- .../pmd/lang/apex/metrics/impl/CycloTestRule.java | 2 +- .../pmd/lang/apex/metrics/impl/WmcTestRule.java | 2 +- .../pmd/lang/apex/rule/AbstractApexRuleTest.java | 2 +- .../pmd/lang/apex/rule/ApexXPathRuleTest.java | 2 +- .../pmd/lang/coco/cpd/CocoCpdLexerTest.java | 2 +- .../pmd/lang/cpp/cpd/CppCpdLexerTest.java | 4 ++-- .../sourceforge/pmd/lang/cs/cpd/CsCpdLexerTest.java | 4 ++-- .../pmd/lang/dart/cpd/DartCpdLexerTest.java | 2 +- .../pmd/lang/fortran/cpd/FortranCpdLexerTest.java | 2 +- .../pmd/lang/gherkin/cpd/GherkinCpdLexerTest.java | 2 +- .../sourceforge/pmd/lang/go/cpd/GoCpdLexerTest.java | 2 +- .../pmd/lang/groovy/cpd/GroovyCpdLexerTest.java | 2 +- .../pmd/lang/html/ast/HtmlParsingHelper.java | 2 +- .../pmd/lang/html/ast/HtmlTreeDumpTest.java | 6 +++--- .../sourceforge/pmd/lang/html/ast/PositionTest.java | 6 +++--- .../pmd/lang/html/cpd/HtmlCpdLexerTest.java | 2 +- .../java/net/sourceforge/pmd/ExcludeLinesTest.java | 4 ++-- .../test/java/net/sourceforge/pmd/ReportTest.java | 4 ++-- .../pmd/lang/java/BaseJavaTreeDumpTest.java | 2 +- .../pmd/lang/java/JavaAttributesPrinter.java | 2 +- .../sourceforge/pmd/lang/java/JavaParsingHelper.java | 2 +- .../pmd/lang/java/SuppressWarningsTest.java | 2 +- .../pmd/lang/java/ast/JDKVersionTest.java | 2 +- .../pmd/lang/java/ast/Java14TreeDumpTest.java | 2 +- .../pmd/lang/java/ast/Java15TreeDumpTest.java | 2 +- .../pmd/lang/java/ast/Java16TreeDumpTest.java | 2 +- .../pmd/lang/java/ast/Java17TreeDumpTest.java | 2 +- .../pmd/lang/java/ast/Java20PreviewTreeDumpTest.java | 2 +- .../pmd/lang/java/ast/Java21PreviewTreeDumpTest.java | 2 +- .../pmd/lang/java/ast/Java21TreeDumpTest.java | 2 +- .../pmd/lang/java/ast/Java9TreeDumpTest.java | 2 +- .../pmd/lang/java/ast/ParserCornersTest.java | 2 +- .../pmd/lang/java/cpd/JavaCpdLexerTest.java | 4 ++-- .../java/metrics/impl/JavaDoubleMetricTestRule.java | 2 +- .../java/metrics/impl/JavaIntMetricTestRule.java | 2 +- .../pmd/lang/java/metrics/impl/NPathTestRule.java | 2 +- .../rule/xpath/internal/BaseXPathFunctionTest.java | 2 +- .../pmd/lang/java/types/TypesTreeDumpTest.java | 6 +++--- .../pmd/lang/java/ast/ASTAnnotationTest.kt | 2 +- .../pmd/lang/java/ast/ASTAnonymousClassTest.kt | 2 +- .../pmd/lang/java/ast/ASTArrayAccessTest.kt | 2 +- .../pmd/lang/java/ast/ASTArrayAllocationTest.kt | 2 +- .../pmd/lang/java/ast/ASTArrayTypeTest.kt | 2 +- .../pmd/lang/java/ast/ASTAssignmentExpressionTest.kt | 2 +- .../pmd/lang/java/ast/ASTCastExpressionTest.kt | 3 +-- .../pmd/lang/java/ast/ASTCatchClauseTest.kt | 2 +- .../pmd/lang/java/ast/ASTClassDeclarationTest.kt | 2 +- .../pmd/lang/java/ast/ASTClassLiteralTest.kt | 2 +- .../pmd/lang/java/ast/ASTConstructorCallTest.kt | 2 +- .../lang/java/ast/ASTConstructorDeclarationTest.kt | 2 +- .../pmd/lang/java/ast/ASTEnumConstantTest.kt | 2 +- .../java/ast/ASTExplicitConstructorInvocationTest.kt | 2 +- .../pmd/lang/java/ast/ASTFieldAccessTest.kt | 3 +-- .../pmd/lang/java/ast/ASTFieldDeclarationTest.kt | 4 ++-- .../pmd/lang/java/ast/ASTInstanceOfExpressionTest.kt | 2 +- .../pmd/lang/java/ast/ASTLambdaExpressionTest.kt | 2 +- .../sourceforge/pmd/lang/java/ast/ASTLiteralTest.kt | 6 ++++-- .../lang/java/ast/ASTLocalVariableDeclarationTest.kt | 2 +- .../pmd/lang/java/ast/ASTMethodCallTest.kt | 2 +- .../pmd/lang/java/ast/ASTMethodDeclarationTest.kt | 4 ++-- .../pmd/lang/java/ast/ASTMethodReferenceTest.kt | 2 +- .../pmd/lang/java/ast/ASTModuleDeclarationTest.kt | 4 ++-- .../pmd/lang/java/ast/ASTStatementsTest.kt | 2 +- .../pmd/lang/java/ast/ASTSuperExpressionTest.kt | 2 +- .../pmd/lang/java/ast/ASTSwitchExpressionTests.kt | 4 ++-- .../pmd/lang/java/ast/ASTThisExpressionTest.kt | 2 +- .../pmd/lang/java/ast/ASTTryStatementTest.kt | 2 +- .../net/sourceforge/pmd/lang/java/ast/ASTTypeTest.kt | 2 +- .../pmd/lang/java/ast/ASTWildcardTypeTest.kt | 2 +- .../pmd/lang/java/ast/ConstValuesKotlinTest.kt | 2 +- .../net/sourceforge/pmd/lang/java/ast/Java11Test.kt | 4 +--- .../pmd/lang/java/ast/Java15KotlinTest.kt | 2 +- .../pmd/lang/java/ast/JavaTextAccessTest.kt | 2 +- .../pmd/lang/java/ast/JavaUnicodeEscapesTest.kt | 4 ++-- .../pmd/lang/java/ast/KotlinTestingDsl.kt | 2 +- .../sourceforge/pmd/lang/java/ast/ModifiersTest.kt | 2 +- .../sourceforge/pmd/lang/java/ast/ParenthesesTest.kt | 2 +- .../sourceforge/pmd/lang/java/ast/ParserTestSpec.kt | 8 ++++---- .../sourceforge/pmd/lang/java/ast/TestExtensions.kt | 6 +++--- .../sourceforge/pmd/lang/java/ast/TokenUtilsTest.kt | 4 ++-- .../pmd/lang/java/ast/TypeDisambiguationTest.kt | 4 ++-- .../pmd/lang/java/ast/UsageResolutionTest.kt | 4 ++-- .../pmd/lang/java/ast/VarDisambiguationTest.kt | 7 +++---- .../java/symbols/internal/AstSymbolResolverTest.kt | 2 +- .../pmd/lang/java/symbols/internal/AstSymbolTests.kt | 6 +++--- .../java/symbols/internal/PrimitiveSymbolTests.kt | 2 +- .../symbols/internal/ReflectedClassSymbolTests.kt | 4 ++-- .../symbols/internal/ReflectedFieldSymbolTest.kt | 2 +- .../java/symbols/internal/UnresolvedClassTest.kt | 4 ++-- .../lang/java/symbols/internal/asm/AsmLoaderTest.kt | 4 ++-- .../java/symbols/internal/asm/BrokenClasspathTest.kt | 2 +- .../pmd/lang/java/symbols/internal/asm/NamesTest.kt | 2 +- .../lang/java/symbols/internal/asm/SigParserTest.kt | 6 ++---- .../java/symbols/table/internal/HeaderScopesTest.kt | 6 ++---- .../symbols/table/internal/LocalTypeScopesTest.kt | 2 +- .../symbols/table/internal/MemberInheritanceTest.kt | 8 ++++---- .../symbols/table/internal/PatternVarScopingTests.kt | 4 ++-- .../symbols/table/internal/TypeParamScopingTest.kt | 4 ++-- .../pmd/lang/java/symbols/table/internal/Utils.kt | 2 +- .../java/symbols/table/internal/VarScopingTest.kt | 8 ++++---- .../pmd/lang/java/types/ArraySymbolTests.kt | 4 ++-- .../pmd/lang/java/types/ClassTypeImplTest.kt | 4 ++-- .../net/sourceforge/pmd/lang/java/types/GlbTest.kt | 2 +- .../pmd/lang/java/types/InnerTypesTest.kt | 4 ++-- .../pmd/lang/java/types/JPrimitiveTypeTest.kt | 2 +- .../pmd/lang/java/types/SpecialTypesTest.kt | 4 ++-- .../sourceforge/pmd/lang/java/types/SubtypingTest.kt | 2 +- .../pmd/lang/java/types/TestUtilitiesForTypes.kt | 12 ++++++------ .../pmd/lang/java/types/TypeParamSubstTest.kt | 4 ++-- .../pmd/lang/java/types/TypeSystemTest.kt | 6 +++--- .../pmd/lang/java/types/TypesFromAstTest.kt | 2 +- .../lang/java/types/ast/ConversionContextTests.kt | 4 ++-- .../lang/java/types/internal/infer/AnonCtorsTest.kt | 6 +++--- .../types/internal/infer/BranchingExprsTestCases.kt | 5 ++--- .../types/internal/infer/CaptureInferenceTest.kt | 4 ++-- .../java/types/internal/infer/ExplicitTypesTest.kt | 2 +- .../java/types/internal/infer/Java7InferenceTest.kt | 2 +- .../java/types/internal/infer/LambdaInferenceTest.kt | 7 +++++-- .../types/internal/infer/LocalVarInferenceTest.kt | 2 +- .../types/internal/infer/MethodRefInferenceTest.kt | 8 ++++---- .../types/internal/infer/OverloadResolutionTest.kt | 4 ++-- .../types/internal/infer/OverloadSpecificityTest.kt | 2 +- .../java/types/internal/infer/PolyResolutionTest.kt | 4 ++-- .../java/types/internal/infer/SpecialMethodsTest.kt | 4 ++-- .../java/types/internal/infer/StandaloneTypesTest.kt | 7 ++----- .../pmd/lang/java/types/internal/infer/StressTest.kt | 4 ++-- .../java/types/internal/infer/TypeInferenceTest.kt | 8 ++++---- .../types/internal/infer/UncheckedInferenceTest.kt | 2 +- .../internal/infer/UnresolvedTypesRecoveryTest.kt | 4 ++-- .../test/java/net/sourceforge/pmd/ReportTest.java | 4 ++-- .../pmd/lang/ecmascript/ast/JsParsingHelper.java | 2 +- .../pmd/lang/ecmascript/ast/JsTreeDumpTest.java | 6 +++--- .../ecmascript/cpd/AnyCpdLexerForTypescriptTest.java | 2 +- .../lang/ecmascript/cpd/EcmascriptCpdLexerTest.java | 2 +- .../lang/typescript/cpd/TypeScriptCpdLexerTest.java | 2 +- .../pmd/lang/jsp/ast/JspParsingHelper.java | 2 +- .../pmd/lang/jsp/cpd/JspCpdLexerTest.java | 2 +- .../pmd/lang/julia/cpd/JuliaCpdLexerTest.java | 2 +- .../pmd/lang/kotlin/ast/BaseKotlinTreeDumpTest.java | 4 ++-- .../pmd/lang/kotlin/ast/KotlinParsingHelper.java | 2 +- .../pmd/lang/kotlin/cpd/KotlinCpdLexerTest.java | 2 +- .../pmd/{ => lang}/test/AbstractMetricTestRule.java | 2 +- .../pmd/{ => lang}/test/BaseTextComparisonTest.kt | 2 +- .../{ast/test => test/ast}/AstMatcherDslAdapter.kt | 2 +- .../lang/{ast/test => test/ast}/BaseParsingHelper.kt | 2 +- .../lang/{ast/test => test/ast}/BaseTreeDumpTest.kt | 4 ++-- .../pmd/lang/{ast/test => test/ast}/IntelliMarker.kt | 2 +- .../lang/{ast/test => test/ast}/NodeExtensions.kt | 2 +- .../pmd/lang/{ast/test => test/ast}/NodePrinters.kt | 2 +- .../pmd/lang/{ast/test => test/ast}/TestUtils.kt | 2 +- .../test => lang/test/cpd}/CpdTextComparisonTest.kt | 4 ++-- .../pmd/lang/lua/cpd/LuaCpdLexerTest.java | 2 +- .../pmd/lang/matlab/cpd/MatlabCpdLexerTest.java | 2 +- .../pmd/lang/modelica/ModelicaParsingHelper.java | 2 +- .../pmd/lang/modelica/ast/ModelicaCoordsTest.kt | 8 ++++---- .../lang/objectivec/cpd/ObjectiveCCpdLexerTest.java | 2 +- .../pmd/lang/perl/cpd/PerlCpdLexerTest.java | 2 +- .../pmd/lang/plsql/PlsqlParsingHelper.java | 2 +- .../plsql/ast/ExecuteImmediateBulkCollectTest.java | 6 +++--- .../pmd/lang/plsql/ast/ParenthesisGroupTest.java | 6 +++--- .../pmd/lang/plsql/ast/PlsqlTreeDumpTest.java | 6 +++--- .../pmd/lang/plsql/cpd/PLSQLCpdLexerTest.java | 2 +- .../pmd/lang/python/cpd/PythonCpdLexerTest.java | 2 +- .../pmd/lang/ruby/cpd/RubyCpdLexerTest.java | 2 +- .../net/sourceforge/pmd/cpd/ScalaCpdLexerTest.java | 2 +- .../pmd/lang/scala/ast/ScalaParsingHelper.java | 2 +- .../pmd/lang/scala/ast/ScalaParserTests.kt | 6 +++--- .../sourceforge/pmd/lang/scala/ast/ScalaTreeTests.kt | 6 +++--- .../pmd/lang/swift/ast/BaseSwiftTreeDumpTest.java | 4 ++-- .../pmd/lang/swift/ast/SwiftParsingHelper.java | 2 +- .../pmd/lang/swift/cpd/SwiftCpdLexerTest.java | 2 +- .../pmd/lang/tsql/cpd/TSqlCpdLexerTest.java | 2 +- .../sourceforge/pmd/lang/vf/ast/VfParsingHelper.java | 2 +- .../sourceforge/pmd/lang/vf/cpd/VfCpdLexerTest.java | 2 +- .../net/sourceforge/pmd/lang/vm/VmParsingHelper.java | 2 +- .../sourceforge/pmd/lang/vm/cpd/VmCpdLexerTest.java | 2 +- .../sourceforge/pmd/lang/xml/XmlParsingHelper.java | 2 +- .../pmd/lang/xml/ast/XmlCoordinatesTest.java | 8 ++++---- .../sourceforge/pmd/lang/xml/ast/XmlParserTest.java | 6 +++--- .../pmd/lang/xml/cpd/XmlCPDCpdLexerTest.java | 2 +- .../pmd/lang/xml/rule/XmlXPathRuleTest.java | 2 +- 189 files changed, 301 insertions(+), 303 deletions(-) rename pmd-lang-test/src/main/java/net/sourceforge/pmd/{ => lang}/test/AbstractMetricTestRule.java (99%) rename pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/{ => lang}/test/BaseTextComparisonTest.kt (99%) rename pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/{ast/test => test/ast}/AstMatcherDslAdapter.kt (98%) rename pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/{ast/test => test/ast}/BaseParsingHelper.kt (99%) rename pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/{ast/test => test/ast}/BaseTreeDumpTest.kt (92%) rename pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/{ast/test => test/ast}/IntelliMarker.kt (93%) rename pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/{ast/test => test/ast}/NodeExtensions.kt (97%) rename pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/{ast/test => test/ast}/NodePrinters.kt (98%) rename pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/{ast/test => test/ast}/TestUtils.kt (98%) rename pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/{cpd/test => lang/test/cpd}/CpdTextComparisonTest.kt (98%) diff --git a/docs/pages/pmd/devdocs/major_contributions/adding_a_new_javacc_based_language.md b/docs/pages/pmd/devdocs/major_contributions/adding_a_new_javacc_based_language.md index fe5caf5aec..9db065a73a 100644 --- a/docs/pages/pmd/devdocs/major_contributions/adding_a_new_javacc_based_language.md +++ b/docs/pages/pmd/devdocs/major_contributions/adding_a_new_javacc_based_language.md @@ -119,7 +119,7 @@ against a previously recorded version. If there are differences, the test fails. This helps to detect anything in the AST structure that changed, maybe unexpectedly. * Create a test class in the package `net.sourceforge.pmd.lang.$lang.ast` with the name `$langTreeDumpTest`. -* This test class must extend `net.sourceforge.pmd.lang.ast.test.BaseTreeDumpTest`. Note: This class +* This test class must extend `net.sourceforge.pmd.lang.test.ast.BaseTreeDumpTest`. Note: This class is written in kotlin and is available in the module "lang-test". * Add a default constructor, that calls the super constructor like so: @@ -131,7 +131,7 @@ This helps to detect anything in the AST structure that changed, maybe unexpecte Replace "$lang" and "$extension" accordingly. * Implement the method `getParser()`. It must return a - subclass of `net.sourceforge.pmd.lang.ast.test.BaseParsingHelper`. See + subclass of `net.sourceforge.pmd.lang.test.ast.BaseParsingHelper`. See `net.sourceforge.pmd.lang.ecmascript.ast.JsParsingHelper` for an example. With this parser helper you can also specify, where the test files are searched, by using the method `withResourceContext(Class, String)`. diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 5afda090bc..7c00ac8e22 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -332,6 +332,12 @@ in the migration guide for details. * {%jdoc core::lang.rule.xpath.XPathRule %} has been moved into subpackage {% jdoc_package core::lang.rule.xpath %}. * pmd-html * `net.sourceforge.pmd.lang.html.ast.HtmlCpdLexer` moved into package `cpd`: {%jdoc html::lang.html.cpd.HtmlCpdLexer %}. +* pmd-lang-test: All types have been moved under the new base package {%jdoc_package lang-test::lang.test %}: + * {%jdoc lang-test::lang.test.AbstractMetricTestRule %} (moved from `net.sourceforge.pmd.test.AbstractMetricTestRule`) + * {%jdoc lang-test::lang.test.BaseTextComparisonTest %} (moved from `net.sourceforge.pmd.test.BaseTextComparisonTest`) + * {%jdoc lang-test::lang.test.cpd.CpdTextComparisonTest %} (moved from `net.sourceforge.pmd.cpd.test.CpdTextComparisonTest`) + * {%jdoc lang-test::lang.test.ast.BaseTreeDumpTest %} (moved from `net.sourceforge.pmd.lang.ast.test.BaseTreeDumpTest`) + * Any many other types have been moved from `net.sourceforge.pmd.lang.ast.test` to `net.sourceforge.pmd.lang.test`. **Internalized classes and interfaces and methods** diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/SuppressWarningsTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/SuppressWarningsTest.java index c43609aa03..2fea34a088 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/SuppressWarningsTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/SuppressWarningsTest.java @@ -4,8 +4,8 @@ package net.sourceforge.pmd.lang.apex; -import static net.sourceforge.pmd.lang.ast.test.TestUtilsKt.assertSize; -import static net.sourceforge.pmd.lang.ast.test.TestUtilsKt.assertSuppressed; +import static net.sourceforge.pmd.lang.test.ast.TestUtilsKt.assertSize; +import static net.sourceforge.pmd.lang.test.ast.TestUtilsKt.assertSuppressed; import static org.junit.jupiter.api.Assertions.assertEquals; import java.util.List; diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/ast/ApexParserTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/ast/ApexParserTest.java index 8f8ee2070e..ede06c79af 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/ast/ApexParserTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/ast/ApexParserTest.java @@ -4,8 +4,8 @@ package net.sourceforge.pmd.lang.apex.ast; -import static net.sourceforge.pmd.lang.ast.test.NodeExtensionsKt.textOfReportLocation; -import static net.sourceforge.pmd.lang.ast.test.TestUtilsKt.assertPosition; +import static net.sourceforge.pmd.lang.test.ast.NodeExtensionsKt.textOfReportLocation; +import static net.sourceforge.pmd.lang.test.ast.TestUtilsKt.assertPosition; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.core.IsInstanceOf.instanceOf; import static org.hamcrest.core.StringContains.containsString; diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/ast/ApexParsingHelper.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/ast/ApexParsingHelper.java index 5fd387a61b..5761140413 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/ast/ApexParsingHelper.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/ast/ApexParsingHelper.java @@ -5,7 +5,7 @@ package net.sourceforge.pmd.lang.apex.ast; import net.sourceforge.pmd.lang.apex.ApexLanguageModule; -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; public class ApexParsingHelper extends BaseParsingHelper { diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/ast/ApexTreeDumpTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/ast/ApexTreeDumpTest.java index 7818b4f229..e08ab01d3b 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/ast/ApexTreeDumpTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/ast/ApexTreeDumpTest.java @@ -7,9 +7,9 @@ package net.sourceforge.pmd.lang.apex.ast; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; -import net.sourceforge.pmd.lang.ast.test.BaseTreeDumpTest; -import net.sourceforge.pmd.lang.ast.test.RelevantAttributePrinter; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; +import net.sourceforge.pmd.lang.test.ast.BaseTreeDumpTest; +import net.sourceforge.pmd.lang.test.ast.RelevantAttributePrinter; class ApexTreeDumpTest extends BaseTreeDumpTest { 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 d1f6a32143..c93950ac81 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 @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.apex.cpd; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest; +import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest; import net.sourceforge.pmd.lang.apex.ApexLanguageModule; class ApexCpdLexerTest extends CpdTextComparisonTest { diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/metrics/impl/CognitiveComplexityTestRule.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/metrics/impl/CognitiveComplexityTestRule.java index 569f16e6f8..b2eaec826f 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/metrics/impl/CognitiveComplexityTestRule.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/metrics/impl/CognitiveComplexityTestRule.java @@ -7,7 +7,7 @@ package net.sourceforge.pmd.lang.apex.metrics.impl; import net.sourceforge.pmd.lang.apex.ast.ASTMethod; import net.sourceforge.pmd.lang.apex.metrics.ApexMetrics; import net.sourceforge.pmd.lang.ast.Node; -import net.sourceforge.pmd.test.AbstractMetricTestRule; +import net.sourceforge.pmd.lang.test.AbstractMetricTestRule; /** * @author Gwilym Kuiper diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/metrics/impl/CycloTestRule.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/metrics/impl/CycloTestRule.java index 195d6f3192..68151b6853 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/metrics/impl/CycloTestRule.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/metrics/impl/CycloTestRule.java @@ -8,7 +8,7 @@ import net.sourceforge.pmd.lang.apex.ast.ASTMethod; import net.sourceforge.pmd.lang.apex.ast.ASTUserClassOrInterface; import net.sourceforge.pmd.lang.apex.metrics.ApexMetrics; import net.sourceforge.pmd.lang.ast.Node; -import net.sourceforge.pmd.test.AbstractMetricTestRule; +import net.sourceforge.pmd.lang.test.AbstractMetricTestRule; /** * Tests standard cyclo. diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/metrics/impl/WmcTestRule.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/metrics/impl/WmcTestRule.java index 12063ede03..a10dfca088 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/metrics/impl/WmcTestRule.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/metrics/impl/WmcTestRule.java @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.apex.metrics.impl; import net.sourceforge.pmd.lang.apex.metrics.ApexMetrics; import net.sourceforge.pmd.lang.ast.Node; -import net.sourceforge.pmd.test.AbstractMetricTestRule; +import net.sourceforge.pmd.lang.test.AbstractMetricTestRule; /** * @author ClĂ©ment Fournier diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/AbstractApexRuleTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/AbstractApexRuleTest.java index d16f2c69ea..724859e818 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/AbstractApexRuleTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/AbstractApexRuleTest.java @@ -12,7 +12,7 @@ import net.sourceforge.pmd.lang.apex.ast.ASTUserEnum; import net.sourceforge.pmd.lang.apex.ast.ASTUserInterface; import net.sourceforge.pmd.lang.apex.ast.ASTUserTrigger; import net.sourceforge.pmd.lang.apex.ast.ApexParserTestBase; -import net.sourceforge.pmd.lang.ast.test.TestUtilsKt; +import net.sourceforge.pmd.lang.test.ast.TestUtilsKt; import net.sourceforge.pmd.reporting.Report; class AbstractApexRuleTest extends ApexParserTestBase { diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/ApexXPathRuleTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/ApexXPathRuleTest.java index 2373ce39ed..380aa836e3 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/ApexXPathRuleTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/ApexXPathRuleTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule; -import static net.sourceforge.pmd.lang.ast.test.TestUtilsKt.assertSize; +import static net.sourceforge.pmd.lang.test.ast.TestUtilsKt.assertSize; import org.junit.jupiter.api.Test; diff --git a/pmd-coco/src/test/java/net/sourceforge/pmd/lang/coco/cpd/CocoCpdLexerTest.java b/pmd-coco/src/test/java/net/sourceforge/pmd/lang/coco/cpd/CocoCpdLexerTest.java index 3ef139cc41..4804e2952a 100644 --- a/pmd-coco/src/test/java/net/sourceforge/pmd/lang/coco/cpd/CocoCpdLexerTest.java +++ b/pmd-coco/src/test/java/net/sourceforge/pmd/lang/coco/cpd/CocoCpdLexerTest.java @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.coco.cpd; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest; +import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest; import net.sourceforge.pmd.lang.coco.CocoLanguageModule; class CocoCpdLexerTest extends CpdTextComparisonTest { diff --git a/pmd-cpp/src/test/java/net/sourceforge/pmd/lang/cpp/cpd/CppCpdLexerTest.java b/pmd-cpp/src/test/java/net/sourceforge/pmd/lang/cpp/cpd/CppCpdLexerTest.java index 8e7b1b22d5..e092b479f0 100644 --- a/pmd-cpp/src/test/java/net/sourceforge/pmd/lang/cpp/cpd/CppCpdLexerTest.java +++ b/pmd-cpp/src/test/java/net/sourceforge/pmd/lang/cpp/cpd/CppCpdLexerTest.java @@ -12,8 +12,8 @@ import org.junit.jupiter.api.Test; import net.sourceforge.pmd.cpd.CpdLanguageProperties; import net.sourceforge.pmd.cpd.CpdLexer; import net.sourceforge.pmd.cpd.Tokens; -import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest; -import net.sourceforge.pmd.cpd.test.LanguagePropertyConfig; +import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest; +import net.sourceforge.pmd.lang.test.cpd.LanguagePropertyConfig; import net.sourceforge.pmd.lang.cpp.CppLanguageModule; class CppCpdLexerTest extends CpdTextComparisonTest { diff --git a/pmd-cs/src/test/java/net/sourceforge/pmd/lang/cs/cpd/CsCpdLexerTest.java b/pmd-cs/src/test/java/net/sourceforge/pmd/lang/cs/cpd/CsCpdLexerTest.java index 49e9e81cc1..936e5c7b45 100644 --- a/pmd-cs/src/test/java/net/sourceforge/pmd/lang/cs/cpd/CsCpdLexerTest.java +++ b/pmd-cs/src/test/java/net/sourceforge/pmd/lang/cs/cpd/CsCpdLexerTest.java @@ -10,8 +10,8 @@ import org.checkerframework.checker.nullness.qual.NonNull; import org.junit.jupiter.api.Test; import net.sourceforge.pmd.cpd.CpdLanguageProperties; -import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest; -import net.sourceforge.pmd.cpd.test.LanguagePropertyConfig; +import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest; +import net.sourceforge.pmd.lang.test.cpd.LanguagePropertyConfig; import net.sourceforge.pmd.lang.ast.LexException; class CsCpdLexerTest extends CpdTextComparisonTest { diff --git a/pmd-dart/src/test/java/net/sourceforge/pmd/lang/dart/cpd/DartCpdLexerTest.java b/pmd-dart/src/test/java/net/sourceforge/pmd/lang/dart/cpd/DartCpdLexerTest.java index 7d85f57be4..41359a5ee8 100644 --- a/pmd-dart/src/test/java/net/sourceforge/pmd/lang/dart/cpd/DartCpdLexerTest.java +++ b/pmd-dart/src/test/java/net/sourceforge/pmd/lang/dart/cpd/DartCpdLexerTest.java @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.dart.cpd; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest; +import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest; class DartCpdLexerTest extends CpdTextComparisonTest { diff --git a/pmd-fortran/src/test/java/net/sourceforge/pmd/lang/fortran/cpd/FortranCpdLexerTest.java b/pmd-fortran/src/test/java/net/sourceforge/pmd/lang/fortran/cpd/FortranCpdLexerTest.java index 4174204f44..992072abae 100644 --- a/pmd-fortran/src/test/java/net/sourceforge/pmd/lang/fortran/cpd/FortranCpdLexerTest.java +++ b/pmd-fortran/src/test/java/net/sourceforge/pmd/lang/fortran/cpd/FortranCpdLexerTest.java @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.fortran.cpd; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest; +import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest; /** * @author rpelisse diff --git a/pmd-gherkin/src/test/java/net/sourceforge/pmd/lang/gherkin/cpd/GherkinCpdLexerTest.java b/pmd-gherkin/src/test/java/net/sourceforge/pmd/lang/gherkin/cpd/GherkinCpdLexerTest.java index 6fde983b27..92d7fcab15 100644 --- a/pmd-gherkin/src/test/java/net/sourceforge/pmd/lang/gherkin/cpd/GherkinCpdLexerTest.java +++ b/pmd-gherkin/src/test/java/net/sourceforge/pmd/lang/gherkin/cpd/GherkinCpdLexerTest.java @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.gherkin.cpd; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest; +import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest; class GherkinCpdLexerTest extends CpdTextComparisonTest { GherkinCpdLexerTest() { diff --git a/pmd-go/src/test/java/net/sourceforge/pmd/lang/go/cpd/GoCpdLexerTest.java b/pmd-go/src/test/java/net/sourceforge/pmd/lang/go/cpd/GoCpdLexerTest.java index e40d2c2b23..571102abf5 100644 --- a/pmd-go/src/test/java/net/sourceforge/pmd/lang/go/cpd/GoCpdLexerTest.java +++ b/pmd-go/src/test/java/net/sourceforge/pmd/lang/go/cpd/GoCpdLexerTest.java @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.go.cpd; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest; +import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest; class GoCpdLexerTest extends CpdTextComparisonTest { diff --git a/pmd-groovy/src/test/java/net/sourceforge/pmd/lang/groovy/cpd/GroovyCpdLexerTest.java b/pmd-groovy/src/test/java/net/sourceforge/pmd/lang/groovy/cpd/GroovyCpdLexerTest.java index 647020c363..38ddb03717 100644 --- a/pmd-groovy/src/test/java/net/sourceforge/pmd/lang/groovy/cpd/GroovyCpdLexerTest.java +++ b/pmd-groovy/src/test/java/net/sourceforge/pmd/lang/groovy/cpd/GroovyCpdLexerTest.java @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.groovy.cpd; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest; +import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest; class GroovyCpdLexerTest extends CpdTextComparisonTest { diff --git a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/ast/HtmlParsingHelper.java b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/ast/HtmlParsingHelper.java index 5cf5e3461a..a916551648 100644 --- a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/ast/HtmlParsingHelper.java +++ b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/ast/HtmlParsingHelper.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.html.ast; -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; import net.sourceforge.pmd.lang.html.HtmlLanguageModule; public final class HtmlParsingHelper extends BaseParsingHelper { diff --git a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/ast/HtmlTreeDumpTest.java b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/ast/HtmlTreeDumpTest.java index 864e9a04ed..0809b27f36 100644 --- a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/ast/HtmlTreeDumpTest.java +++ b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/ast/HtmlTreeDumpTest.java @@ -7,9 +7,9 @@ package net.sourceforge.pmd.lang.html.ast; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; -import net.sourceforge.pmd.lang.ast.test.BaseTreeDumpTest; -import net.sourceforge.pmd.lang.ast.test.RelevantAttributePrinter; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; +import net.sourceforge.pmd.lang.test.ast.BaseTreeDumpTest; +import net.sourceforge.pmd.lang.test.ast.RelevantAttributePrinter; class HtmlTreeDumpTest extends BaseTreeDumpTest { HtmlTreeDumpTest() { diff --git a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/ast/PositionTest.java b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/ast/PositionTest.java index 2979e52a47..c704e7bf35 100644 --- a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/ast/PositionTest.java +++ b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/ast/PositionTest.java @@ -6,9 +6,9 @@ package net.sourceforge.pmd.lang.html.ast; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; -import net.sourceforge.pmd.lang.ast.test.BaseTreeDumpTest; -import net.sourceforge.pmd.lang.ast.test.CoordinatesPrinter; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; +import net.sourceforge.pmd.lang.test.ast.BaseTreeDumpTest; +import net.sourceforge.pmd.lang.test.ast.CoordinatesPrinter; class PositionTest extends BaseTreeDumpTest { PositionTest() { diff --git a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/cpd/HtmlCpdLexerTest.java b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/cpd/HtmlCpdLexerTest.java index 2039a2f72b..63bc1a03dd 100644 --- a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/cpd/HtmlCpdLexerTest.java +++ b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/cpd/HtmlCpdLexerTest.java @@ -7,7 +7,7 @@ package net.sourceforge.pmd.lang.html.cpd; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest; +import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest; import net.sourceforge.pmd.lang.html.HtmlLanguageModule; class HtmlCpdLexerTest extends CpdTextComparisonTest { diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/ExcludeLinesTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/ExcludeLinesTest.java index e334d16371..1a4385924d 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/ExcludeLinesTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/ExcludeLinesTest.java @@ -4,8 +4,8 @@ package net.sourceforge.pmd; -import static net.sourceforge.pmd.lang.ast.test.TestUtilsKt.assertSize; -import static net.sourceforge.pmd.lang.ast.test.TestUtilsKt.assertSuppressed; +import static net.sourceforge.pmd.lang.test.ast.TestUtilsKt.assertSize; +import static net.sourceforge.pmd.lang.test.ast.TestUtilsKt.assertSuppressed; import org.junit.jupiter.api.Test; diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/ReportTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/ReportTest.java index f9bb61fdca..a69985f815 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/ReportTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/ReportTest.java @@ -4,8 +4,8 @@ package net.sourceforge.pmd; -import static net.sourceforge.pmd.lang.ast.test.TestUtilsKt.assertSize; -import static net.sourceforge.pmd.lang.ast.test.TestUtilsKt.assertSuppressed; +import static net.sourceforge.pmd.lang.test.ast.TestUtilsKt.assertSize; +import static net.sourceforge.pmd.lang.test.ast.TestUtilsKt.assertSuppressed; import static org.junit.jupiter.api.Assertions.assertFalse; import java.util.Optional; diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/BaseJavaTreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/BaseJavaTreeDumpTest.java index 0484a8f315..eeb5bba886 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/BaseJavaTreeDumpTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/BaseJavaTreeDumpTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java; -import net.sourceforge.pmd.lang.ast.test.BaseTreeDumpTest; +import net.sourceforge.pmd.lang.test.ast.BaseTreeDumpTest; /** * Special tweak of BaseTreeDumpTest to remove deprecated attributes diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/JavaAttributesPrinter.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/JavaAttributesPrinter.java index 4e598a9cef..fee672333d 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/JavaAttributesPrinter.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/JavaAttributesPrinter.java @@ -11,7 +11,7 @@ import java.util.stream.Collectors; import org.checkerframework.checker.nullness.qual.NonNull; import net.sourceforge.pmd.lang.ast.Node; -import net.sourceforge.pmd.lang.ast.test.RelevantAttributePrinter; +import net.sourceforge.pmd.lang.test.ast.RelevantAttributePrinter; import net.sourceforge.pmd.lang.java.ast.ASTExpression; import net.sourceforge.pmd.lang.java.ast.ASTMethodDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTModifierList; diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/JavaParsingHelper.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/JavaParsingHelper.java index 0fd2359166..c5bcd3332e 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/JavaParsingHelper.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/JavaParsingHelper.java @@ -24,7 +24,7 @@ import net.sourceforge.pmd.lang.LanguageProcessor; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.ast.SemanticErrorReporter; import net.sourceforge.pmd.lang.ast.SemanticException; -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; import net.sourceforge.pmd.lang.java.ast.ASTCompilationUnit; import net.sourceforge.pmd.lang.java.ast.JavaParser; import net.sourceforge.pmd.lang.java.internal.JavaAstProcessor; diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/SuppressWarningsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/SuppressWarningsTest.java index 3c71089661..6eac1121fb 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/SuppressWarningsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/SuppressWarningsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java; -import static net.sourceforge.pmd.lang.ast.test.TestUtilsKt.assertSize; +import static net.sourceforge.pmd.lang.test.ast.TestUtilsKt.assertSize; import org.checkerframework.checker.nullness.qual.NonNull; import org.junit.jupiter.api.Test; diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/JDKVersionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/JDKVersionTest.java index 45cb62715a..44516d5d53 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/JDKVersionTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/JDKVersionTest.java @@ -16,7 +16,7 @@ import org.checkerframework.checker.nullness.qual.NonNull; import org.junit.jupiter.api.Test; import net.sourceforge.pmd.lang.ast.ParseException; -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; import net.sourceforge.pmd.lang.java.BaseJavaTreeDumpTest; import net.sourceforge.pmd.lang.java.JavaParsingHelper; diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java14TreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java14TreeDumpTest.java index 5100aaba9f..0e75ba10c1 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java14TreeDumpTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java14TreeDumpTest.java @@ -11,7 +11,7 @@ import org.checkerframework.checker.nullness.qual.NonNull; import org.junit.jupiter.api.Test; import net.sourceforge.pmd.lang.ast.ParseException; -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; import net.sourceforge.pmd.lang.java.BaseJavaTreeDumpTest; import net.sourceforge.pmd.lang.java.JavaParsingHelper; diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java15TreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java15TreeDumpTest.java index 9b65df591e..c8ed83bde6 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java15TreeDumpTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java15TreeDumpTest.java @@ -9,7 +9,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import org.junit.jupiter.api.Test; import net.sourceforge.pmd.lang.ast.ParseException; -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; import net.sourceforge.pmd.lang.java.BaseJavaTreeDumpTest; import net.sourceforge.pmd.lang.java.JavaParsingHelper; diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java16TreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java16TreeDumpTest.java index bd830313eb..16324eef76 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java16TreeDumpTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java16TreeDumpTest.java @@ -18,7 +18,7 @@ import org.junit.jupiter.api.Test; import net.sourceforge.pmd.lang.ast.NodeStream; import net.sourceforge.pmd.lang.ast.ParseException; -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; import net.sourceforge.pmd.lang.java.BaseJavaTreeDumpTest; import net.sourceforge.pmd.lang.java.JavaParsingHelper; import net.sourceforge.pmd.lang.java.symbols.JElementSymbol; diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java17TreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java17TreeDumpTest.java index 64b7a127d7..e27c306f8e 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java17TreeDumpTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java17TreeDumpTest.java @@ -10,7 +10,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import org.junit.jupiter.api.Test; import net.sourceforge.pmd.lang.ast.ParseException; -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; import net.sourceforge.pmd.lang.java.BaseJavaTreeDumpTest; import net.sourceforge.pmd.lang.java.JavaParsingHelper; diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java20PreviewTreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java20PreviewTreeDumpTest.java index fec894662d..3dd1996f28 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java20PreviewTreeDumpTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java20PreviewTreeDumpTest.java @@ -10,7 +10,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import org.junit.jupiter.api.Test; import net.sourceforge.pmd.lang.ast.ParseException; -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; import net.sourceforge.pmd.lang.java.BaseJavaTreeDumpTest; import net.sourceforge.pmd.lang.java.JavaParsingHelper; diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java21PreviewTreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java21PreviewTreeDumpTest.java index 26c055469d..f73da2bae0 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java21PreviewTreeDumpTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java21PreviewTreeDumpTest.java @@ -15,7 +15,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import org.junit.jupiter.api.Test; import net.sourceforge.pmd.lang.ast.ParseException; -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; import net.sourceforge.pmd.lang.java.BaseJavaTreeDumpTest; import net.sourceforge.pmd.lang.java.JavaParsingHelper; import net.sourceforge.pmd.lang.java.symbols.JClassSymbol; diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java21TreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java21TreeDumpTest.java index 6ffde7d974..85d5bf7045 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java21TreeDumpTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java21TreeDumpTest.java @@ -11,7 +11,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import org.junit.jupiter.api.Test; import net.sourceforge.pmd.lang.ast.ParseException; -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; import net.sourceforge.pmd.lang.java.BaseJavaTreeDumpTest; import net.sourceforge.pmd.lang.java.JavaParsingHelper; diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java9TreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java9TreeDumpTest.java index b8c8522d76..b29dab3f0a 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java9TreeDumpTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java9TreeDumpTest.java @@ -7,7 +7,7 @@ package net.sourceforge.pmd.lang.java.ast; import org.checkerframework.checker.nullness.qual.NonNull; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; import net.sourceforge.pmd.lang.java.BaseJavaTreeDumpTest; import net.sourceforge.pmd.lang.java.JavaParsingHelper; diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/ParserCornersTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/ParserCornersTest.java index 8ebb9fde3c..69f4fd13b7 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/ParserCornersTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/ParserCornersTest.java @@ -20,7 +20,7 @@ import org.junit.jupiter.api.Timeout; import net.sourceforge.pmd.lang.ast.ParseException; import net.sourceforge.pmd.lang.ast.impl.javacc.MalformedSourceException; -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; import net.sourceforge.pmd.lang.document.FileId; import net.sourceforge.pmd.lang.java.BaseJavaTreeDumpTest; import net.sourceforge.pmd.lang.java.JavaParsingHelper; diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/cpd/JavaCpdLexerTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/cpd/JavaCpdLexerTest.java index 2e287f4efe..935b7c6b3c 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/cpd/JavaCpdLexerTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/cpd/JavaCpdLexerTest.java @@ -12,8 +12,8 @@ import org.junit.jupiter.api.Test; import net.sourceforge.pmd.cpd.CpdLanguageProperties; import net.sourceforge.pmd.cpd.CpdLexer; -import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest; -import net.sourceforge.pmd.cpd.test.LanguagePropertyConfig; +import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest; +import net.sourceforge.pmd.lang.test.cpd.LanguagePropertyConfig; import net.sourceforge.pmd.lang.ast.LexException; import net.sourceforge.pmd.lang.document.FileId; import net.sourceforge.pmd.lang.document.TextDocument; diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/metrics/impl/JavaDoubleMetricTestRule.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/metrics/impl/JavaDoubleMetricTestRule.java index f03e625677..bc5ac8e1e7 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/metrics/impl/JavaDoubleMetricTestRule.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/metrics/impl/JavaDoubleMetricTestRule.java @@ -10,7 +10,7 @@ import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.java.ast.ASTExecutableDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTTypeDeclaration; import net.sourceforge.pmd.lang.metrics.Metric; -import net.sourceforge.pmd.test.AbstractMetricTestRule; +import net.sourceforge.pmd.lang.test.AbstractMetricTestRule; /** * diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/metrics/impl/JavaIntMetricTestRule.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/metrics/impl/JavaIntMetricTestRule.java index e4d2348417..f566c58340 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/metrics/impl/JavaIntMetricTestRule.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/metrics/impl/JavaIntMetricTestRule.java @@ -8,7 +8,7 @@ import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.java.ast.ASTExecutableDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTTypeDeclaration; import net.sourceforge.pmd.lang.metrics.Metric; -import net.sourceforge.pmd.test.AbstractMetricTestRule; +import net.sourceforge.pmd.lang.test.AbstractMetricTestRule; /** * diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/metrics/impl/NPathTestRule.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/metrics/impl/NPathTestRule.java index 80850a2795..73dc04513f 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/metrics/impl/NPathTestRule.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/metrics/impl/NPathTestRule.java @@ -8,7 +8,7 @@ import java.math.BigInteger; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.java.metrics.JavaMetrics; -import net.sourceforge.pmd.test.AbstractMetricTestRule; +import net.sourceforge.pmd.lang.test.AbstractMetricTestRule; /** * @author ClĂ©ment Fournier diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/xpath/internal/BaseXPathFunctionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/xpath/internal/BaseXPathFunctionTest.java index d59517e7c3..3f6f6dd9ac 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/xpath/internal/BaseXPathFunctionTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/xpath/internal/BaseXPathFunctionTest.java @@ -15,7 +15,6 @@ import org.checkerframework.checker.nullness.qual.NonNull; import net.sourceforge.pmd.lang.LanguageProcessor; import net.sourceforge.pmd.lang.ast.FileAnalysisException; -import net.sourceforge.pmd.lang.ast.test.TestUtilsKt; import net.sourceforge.pmd.lang.java.BaseParserTest; import net.sourceforge.pmd.lang.java.JavaLanguageModule; import net.sourceforge.pmd.lang.rule.Rule; @@ -23,6 +22,7 @@ import net.sourceforge.pmd.lang.rule.xpath.PmdXPathException; import net.sourceforge.pmd.lang.rule.xpath.PmdXPathException.Phase; import net.sourceforge.pmd.lang.rule.xpath.XPathRule; import net.sourceforge.pmd.lang.rule.xpath.XPathVersion; +import net.sourceforge.pmd.lang.test.ast.TestUtilsKt; import net.sourceforge.pmd.reporting.Report; /** diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/types/TypesTreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/types/TypesTreeDumpTest.java index 597b2526f8..d85783803c 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/types/TypesTreeDumpTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/types/TypesTreeDumpTest.java @@ -10,9 +10,9 @@ import org.checkerframework.checker.nullness.qual.NonNull; import org.junit.jupiter.api.Test; import net.sourceforge.pmd.lang.ast.Node; -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; -import net.sourceforge.pmd.lang.ast.test.BaseTreeDumpTest; -import net.sourceforge.pmd.lang.ast.test.RelevantAttributePrinter; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; +import net.sourceforge.pmd.lang.test.ast.BaseTreeDumpTest; +import net.sourceforge.pmd.lang.test.ast.RelevantAttributePrinter; import net.sourceforge.pmd.lang.java.JavaParsingHelper; import net.sourceforge.pmd.lang.java.ast.ASTAssignableExpr.ASTNamedReferenceExpr; import net.sourceforge.pmd.lang.java.ast.ASTMethodDeclaration; diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTAnnotationTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTAnnotationTest.kt index ef1de16c16..3ee795c82f 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTAnnotationTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTAnnotationTest.kt @@ -5,7 +5,7 @@ package net.sourceforge.pmd.lang.java.ast import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.ast.JavaVersion.Companion.Earliest import net.sourceforge.pmd.lang.java.ast.JavaVersion.Companion.Latest import net.sourceforge.pmd.lang.java.ast.JavaVersion.J1_3 diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTAnonymousClassTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTAnonymousClassTest.kt index 9443e7e55a..d209ba43da 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTAnonymousClassTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTAnonymousClassTest.kt @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.java.ast import io.kotest.matchers.should import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.ast.ModifierOwner.Visibility.V_ANONYMOUS class ASTAnonymousClassTest : ParserTestSpec({ diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTArrayAccessTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTArrayAccessTest.kt index 213d687ab6..a667e208ad 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTArrayAccessTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTArrayAccessTest.kt @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.ast -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe /** * Nodes that previously corresponded to ASTAllocationExpression. diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTArrayAllocationTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTArrayAllocationTest.kt index ba92d24450..b8d6e8502d 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTArrayAllocationTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTArrayAllocationTest.kt @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.ast -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.INT /** diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTArrayTypeTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTArrayTypeTest.kt index 59c17e7482..26f70800ba 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTArrayTypeTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTArrayTypeTest.kt @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.ast -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe /** diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTAssignmentExpressionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTAssignmentExpressionTest.kt index 53c5b73398..8706831bfd 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTAssignmentExpressionTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTAssignmentExpressionTest.kt @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.ast -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.ast.ASTAssignableExpr.AccessType.READ import net.sourceforge.pmd.lang.java.ast.ASTAssignableExpr.AccessType.WRITE import net.sourceforge.pmd.lang.java.ast.AssignmentOp.* diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTCastExpressionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTCastExpressionTest.kt index ed3cb48cea..bf7f77c20a 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTCastExpressionTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTCastExpressionTest.kt @@ -4,10 +4,9 @@ package net.sourceforge.pmd.lang.java.ast -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.ast.JavaVersion.Companion.Earliest import net.sourceforge.pmd.lang.java.ast.JavaVersion.Companion.Latest -import net.sourceforge.pmd.lang.java.ast.ExpressionParsingCtx import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.* class ASTCastExpressionTest : ParserTestSpec({ diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTCatchClauseTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTCatchClauseTest.kt index dbfe402bea..4039461e8e 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTCatchClauseTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTCatchClauseTest.kt @@ -5,7 +5,7 @@ package net.sourceforge.pmd.lang.java.ast import io.kotest.matchers.string.shouldContain -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.ast.JavaVersion.* import net.sourceforge.pmd.lang.java.ast.JavaVersion.Companion.Earliest import net.sourceforge.pmd.lang.java.ast.JavaVersion.Companion.Latest diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTClassDeclarationTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTClassDeclarationTest.kt index bd0919054d..9ca8a75c99 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTClassDeclarationTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTClassDeclarationTest.kt @@ -5,7 +5,7 @@ package net.sourceforge.pmd.lang.java.ast -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe class ASTClassDeclarationTest : ParserTestSpec({ diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTClassLiteralTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTClassLiteralTest.kt index 46f1adbaf9..6a1276e645 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTClassLiteralTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTClassLiteralTest.kt @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.ast -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.* /** diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTConstructorCallTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTConstructorCallTest.kt index fdcb0df4bc..5077fdfa89 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTConstructorCallTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTConstructorCallTest.kt @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.ast -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.ast.ASTAssignableExpr.AccessType.READ class ASTConstructorCallTest : ParserTestSpec({ diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTConstructorDeclarationTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTConstructorDeclarationTest.kt index 8b50566636..aa0d9bc631 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTConstructorDeclarationTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTConstructorDeclarationTest.kt @@ -5,7 +5,7 @@ package net.sourceforge.pmd.lang.java.ast import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.* class ASTConstructorDeclarationTest : ParserTestSpec({ diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTEnumConstantTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTEnumConstantTest.kt index a6dc2550b8..23328aa275 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTEnumConstantTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTEnumConstantTest.kt @@ -7,7 +7,7 @@ package net.sourceforge.pmd.lang.java.ast import io.kotest.matchers.collections.beEmpty import io.kotest.matchers.collections.shouldContainExactly import io.kotest.matchers.should -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.ast.JModifier.* class ASTEnumConstantTest : ParserTestSpec({ diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTExplicitConstructorInvocationTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTExplicitConstructorInvocationTest.kt index a70887f661..2f318c9b2d 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTExplicitConstructorInvocationTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTExplicitConstructorInvocationTest.kt @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.ast -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe class ASTExplicitConstructorInvocationTest : ParserTestSpec({ diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTFieldAccessTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTFieldAccessTest.kt index b259b9c1bc..49f28bf52b 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTFieldAccessTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTFieldAccessTest.kt @@ -4,8 +4,7 @@ package net.sourceforge.pmd.lang.java.ast -import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe /** * @author ClĂ©ment Fournier diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTFieldDeclarationTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTFieldDeclarationTest.kt index 47306a36da..247a1da412 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTFieldDeclarationTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTFieldDeclarationTest.kt @@ -6,8 +6,8 @@ package net.sourceforge.pmd.lang.java.ast import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBe -import net.sourceforge.pmd.lang.ast.test.textOfReportLocation +import net.sourceforge.pmd.lang.test.ast.shouldBe +import net.sourceforge.pmd.lang.test.ast.textOfReportLocation import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.* class ASTFieldDeclarationTest : ParserTestSpec({ diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTInstanceOfExpressionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTInstanceOfExpressionTest.kt index 104328a259..3c3a4682e3 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTInstanceOfExpressionTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTInstanceOfExpressionTest.kt @@ -5,7 +5,7 @@ package net.sourceforge.pmd.lang.java.ast -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind class ASTInstanceOfExpressionTest : ParserTestSpec({ diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLambdaExpressionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLambdaExpressionTest.kt index eb355dda7b..9be4a6400e 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLambdaExpressionTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLambdaExpressionTest.kt @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.ast -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.ast.JavaVersion.Companion.Latest import net.sourceforge.pmd.lang.java.ast.JavaVersion.J1_8 import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.* diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLiteralTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLiteralTest.kt index 233a6a07aa..92d43cdffd 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLiteralTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLiteralTest.kt @@ -5,8 +5,7 @@ package net.sourceforge.pmd.lang.java.ast import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.* -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.ast.JavaVersion.* import net.sourceforge.pmd.lang.java.ast.JavaVersion.Companion.Earliest import net.sourceforge.pmd.lang.java.ast.JavaVersion.Companion.Latest @@ -14,6 +13,9 @@ import net.sourceforge.pmd.lang.java.ast.JavaVersion.Companion.since import net.sourceforge.pmd.lang.java.ast.UnaryOp.UNARY_MINUS import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.* +import net.sourceforge.pmd.lang.test.ast.NodeSpec +import net.sourceforge.pmd.lang.test.ast.ValuedNodeSpec +import net.sourceforge.pmd.lang.test.ast.shouldHaveText /** * @author ClĂ©ment Fournier diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLocalVariableDeclarationTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLocalVariableDeclarationTest.kt index eeaafcd524..064f8fd8a2 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLocalVariableDeclarationTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLocalVariableDeclarationTest.kt @@ -5,7 +5,7 @@ package net.sourceforge.pmd.lang.java.ast -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.INT class ASTLocalVariableDeclarationTest : ParserTestSpec({ diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodCallTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodCallTest.kt index e22d343589..ce40a17963 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodCallTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodCallTest.kt @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.ast -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe /** * @author ClĂ©ment Fournier diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodDeclarationTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodDeclarationTest.kt index ff47a82431..2db534ba12 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodDeclarationTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodDeclarationTest.kt @@ -7,8 +7,8 @@ package net.sourceforge.pmd.lang.java.ast import io.kotest.matchers.should import io.kotest.matchers.shouldBe import io.kotest.matchers.shouldNot -import net.sourceforge.pmd.lang.ast.test.shouldBe -import net.sourceforge.pmd.lang.ast.test.textOfReportLocation +import net.sourceforge.pmd.lang.test.ast.shouldBe +import net.sourceforge.pmd.lang.test.ast.textOfReportLocation import net.sourceforge.pmd.lang.java.ast.ModifierOwner.Visibility.V_PRIVATE import net.sourceforge.pmd.lang.java.ast.ModifierOwner.Visibility.V_PUBLIC import net.sourceforge.pmd.lang.java.ast.JModifier.* diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodReferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodReferenceTest.kt index 55ab0f5d51..97791223ea 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodReferenceTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodReferenceTest.kt @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.ast -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.* /** diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTModuleDeclarationTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTModuleDeclarationTest.kt index ec40f586ec..fdce63d865 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTModuleDeclarationTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTModuleDeclarationTest.kt @@ -8,8 +8,8 @@ import com.github.oowekyala.treeutils.matchers.TreeNodeWrapper import io.kotest.matchers.collections.shouldBeEmpty import io.kotest.matchers.shouldBe import net.sourceforge.pmd.lang.ast.Node -import net.sourceforge.pmd.lang.ast.test.NodeSpec -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.NodeSpec +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.ast.JavaVersion.Companion.since import net.sourceforge.pmd.lang.java.ast.JavaVersion.J9 import net.sourceforge.pmd.lang.java.symbols.JClassSymbol diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTStatementsTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTStatementsTest.kt index 986d7623bf..a0d0284216 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTStatementsTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTStatementsTest.kt @@ -5,7 +5,7 @@ package net.sourceforge.pmd.lang.java.ast -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.INT class ASTStatementsTest : ParserTestSpec({ diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTSuperExpressionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTSuperExpressionTest.kt index bd2bd9096f..090b5dec16 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTSuperExpressionTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTSuperExpressionTest.kt @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.ast -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe /** * @author ClĂ©ment Fournier diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTSwitchExpressionTests.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTSwitchExpressionTests.kt index b1be8e2041..0c80b00810 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTSwitchExpressionTests.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTSwitchExpressionTests.kt @@ -5,8 +5,8 @@ package net.sourceforge.pmd.lang.java.ast import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldMatchN +import net.sourceforge.pmd.lang.test.ast.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldMatchN import net.sourceforge.pmd.lang.java.ast.BinaryOp.* import net.sourceforge.pmd.lang.java.ast.JavaVersion.* import net.sourceforge.pmd.lang.java.ast.JavaVersion.Companion.Earliest diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTThisExpressionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTThisExpressionTest.kt index dc49ff18d4..525cd89d2a 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTThisExpressionTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTThisExpressionTest.kt @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.ast -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe /** * @author ClĂ©ment Fournier diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTTryStatementTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTTryStatementTest.kt index 091a931fe8..ad2c6a3682 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTTryStatementTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTTryStatementTest.kt @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.ast -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.ast.JavaVersion.Companion.Latest import net.sourceforge.pmd.lang.java.ast.JavaVersion.J1_7 import net.sourceforge.pmd.lang.java.ast.JavaVersion.J9 diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTTypeTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTTypeTest.kt index bee2963f29..c70d5c64a3 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTTypeTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTTypeTest.kt @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.ast -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe /** * @author ClĂ©ment Fournier diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTWildcardTypeTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTWildcardTypeTest.kt index 7a30b86ed3..2178115173 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTWildcardTypeTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTWildcardTypeTest.kt @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.ast -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.ast.JavaVersion.Companion.Latest import net.sourceforge.pmd.lang.java.ast.JavaVersion.J1_5 import net.sourceforge.pmd.lang.java.ast.JavaVersion.J1_8 diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ConstValuesKotlinTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ConstValuesKotlinTest.kt index c0457ac822..9c2e147443 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ConstValuesKotlinTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ConstValuesKotlinTest.kt @@ -5,7 +5,7 @@ package net.sourceforge.pmd.lang.java.ast import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBeA +import net.sourceforge.pmd.lang.test.ast.shouldBeA import net.sourceforge.pmd.lang.java.symbols.JFieldSymbol /** diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/Java11Test.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/Java11Test.kt index 8a0e225520..ce64233f0b 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/Java11Test.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/Java11Test.kt @@ -4,9 +4,7 @@ package net.sourceforge.pmd.lang.java.ast -import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBe -import net.sourceforge.pmd.lang.java.ast.* +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.ast.JavaVersion.* import net.sourceforge.pmd.lang.java.ast.JavaVersion.Companion.Latest diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/Java15KotlinTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/Java15KotlinTest.kt index 1063b8b919..03e2b01cf8 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/Java15KotlinTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/Java15KotlinTest.kt @@ -5,7 +5,7 @@ package net.sourceforge.pmd.lang.java.ast import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe class Java15KotlinTest : ParserTestSpec({ diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/JavaTextAccessTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/JavaTextAccessTest.kt index b11f001382..7609f2a3cc 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/JavaTextAccessTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/JavaTextAccessTest.kt @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.java.ast import io.kotest.matchers.shouldBe import net.sourceforge.pmd.lang.ast.TextAvailableNode -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.* // Use a string for comparison because CharSequence are not necessarily diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/JavaUnicodeEscapesTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/JavaUnicodeEscapesTest.kt index b84c3ba443..88f6225067 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/JavaUnicodeEscapesTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/JavaUnicodeEscapesTest.kt @@ -8,8 +8,8 @@ import io.kotest.assertions.throwables.shouldThrow import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.string.shouldContain import net.sourceforge.pmd.lang.ast.impl.javacc.MalformedSourceException -import net.sourceforge.pmd.lang.ast.test.IntelliMarker -import net.sourceforge.pmd.lang.ast.test.shouldBeA +import net.sourceforge.pmd.lang.test.ast.IntelliMarker +import net.sourceforge.pmd.lang.test.ast.shouldBeA import net.sourceforge.pmd.lang.document.TextDocument import net.sourceforge.pmd.lang.java.JavaParsingHelper diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/KotlinTestingDsl.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/KotlinTestingDsl.kt index 791df7c2a3..8b7b43b45e 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/KotlinTestingDsl.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/KotlinTestingDsl.kt @@ -13,7 +13,7 @@ import io.kotest.matchers.Matcher import io.kotest.matchers.MatcherResult import io.kotest.matchers.collections.shouldContainAll import net.sourceforge.pmd.lang.ast.* -import net.sourceforge.pmd.lang.ast.test.* +import net.sourceforge.pmd.lang.test.ast.* import net.sourceforge.pmd.lang.java.JavaLanguageModule import net.sourceforge.pmd.lang.java.JavaParsingHelper import net.sourceforge.pmd.lang.java.JavaParsingHelper.* diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ModifiersTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ModifiersTest.kt index b4fcb2c962..3b38656fa6 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ModifiersTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ModifiersTest.kt @@ -5,7 +5,7 @@ package net.sourceforge.pmd.lang.java.ast -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.ast.ModifierOwner.Visibility.* import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.INT diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ParenthesesTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ParenthesesTest.kt index d5a59df21a..fef0ad0bc4 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ParenthesesTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ParenthesesTest.kt @@ -5,7 +5,7 @@ package net.sourceforge.pmd.lang.java.ast import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.INT /** diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ParserTestSpec.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ParserTestSpec.kt index c12f489053..7fd12125b3 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ParserTestSpec.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ParserTestSpec.kt @@ -17,10 +17,10 @@ import io.kotest.core.test.TestType import io.kotest.matchers.Matcher import net.sourceforge.pmd.lang.ast.Node import net.sourceforge.pmd.lang.ast.ParseException -import net.sourceforge.pmd.lang.ast.test.Assertions -import net.sourceforge.pmd.lang.ast.test.IntelliMarker -import net.sourceforge.pmd.lang.ast.test.ValuedNodeSpec -import net.sourceforge.pmd.lang.ast.test.shouldMatchN +import net.sourceforge.pmd.lang.test.ast.Assertions +import net.sourceforge.pmd.lang.test.ast.IntelliMarker +import net.sourceforge.pmd.lang.test.ast.ValuedNodeSpec +import net.sourceforge.pmd.lang.test.ast.shouldMatchN import net.sourceforge.pmd.lang.java.types.JTypeMirror import net.sourceforge.pmd.lang.java.types.TypeDslMixin import net.sourceforge.pmd.lang.java.types.TypeDslOf diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TestExtensions.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TestExtensions.kt index 1759e7c91b..c4838cf101 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TestExtensions.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TestExtensions.kt @@ -13,9 +13,9 @@ import io.kotest.matchers.shouldNotBe import io.kotest.matchers.types.shouldBeInstanceOf import net.sourceforge.pmd.lang.ast.Node import net.sourceforge.pmd.lang.ast.impl.javacc.JavaccToken -import net.sourceforge.pmd.lang.ast.test.NodeSpec -import net.sourceforge.pmd.lang.ast.test.ValuedNodeSpec -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.NodeSpec +import net.sourceforge.pmd.lang.test.ast.ValuedNodeSpec +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.ast.internal.PrettyPrintingUtil import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.* diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TokenUtilsTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TokenUtilsTest.kt index c035c51635..40666304eb 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TokenUtilsTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TokenUtilsTest.kt @@ -9,8 +9,8 @@ import io.kotest.core.spec.style.FunSpec import io.kotest.core.test.TestScope import io.kotest.matchers.shouldBe import net.sourceforge.pmd.lang.ast.impl.javacc.JavaccToken -import net.sourceforge.pmd.lang.ast.test.Assertions -import net.sourceforge.pmd.lang.ast.test.IntelliMarker +import net.sourceforge.pmd.lang.test.ast.Assertions +import net.sourceforge.pmd.lang.test.ast.IntelliMarker /** * @author ClĂ©ment Fournier diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TypeDisambiguationTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TypeDisambiguationTest.kt index 7cf336cf72..69feb7264e 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TypeDisambiguationTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TypeDisambiguationTest.kt @@ -8,11 +8,11 @@ import io.kotest.matchers.collections.shouldBeEmpty import io.kotest.matchers.collections.shouldHaveSize import io.kotest.matchers.shouldBe import io.kotest.matchers.types.shouldBeSameInstanceAs -import net.sourceforge.pmd.lang.ast.test.* -import net.sourceforge.pmd.lang.ast.test.shouldBe import net.sourceforge.pmd.lang.java.symbols.JClassSymbol import net.sourceforge.pmd.lang.java.symbols.table.internal.JavaSemanticErrors.* import net.sourceforge.pmd.lang.java.types.JClassType +import net.sourceforge.pmd.lang.test.ast.* +import net.sourceforge.pmd.lang.test.ast.shouldBe import kotlin.test.assertEquals import kotlin.test.assertNull diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/UsageResolutionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/UsageResolutionTest.kt index bf332c059f..e81a2f58db 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/UsageResolutionTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/UsageResolutionTest.kt @@ -8,8 +8,8 @@ import io.kotest.matchers.collections.shouldBeSingleton import io.kotest.matchers.collections.shouldContainExactly import io.kotest.matchers.collections.shouldHaveSize import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBeA +import net.sourceforge.pmd.lang.test.ast.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBeA import net.sourceforge.pmd.lang.java.ast.ASTAssignableExpr.AccessType.WRITE import net.sourceforge.pmd.lang.java.symbols.JFieldSymbol import net.sourceforge.pmd.lang.java.symbols.JFormalParamSymbol diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/VarDisambiguationTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/VarDisambiguationTest.kt index d890ddd97d..56fd0976fd 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/VarDisambiguationTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/VarDisambiguationTest.kt @@ -5,13 +5,12 @@ package net.sourceforge.pmd.lang.java.ast import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBeA -import net.sourceforge.pmd.lang.ast.test.shouldMatchN +import net.sourceforge.pmd.lang.test.ast.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBeA +import net.sourceforge.pmd.lang.test.ast.shouldMatchN import net.sourceforge.pmd.lang.java.JavaParsingHelper import net.sourceforge.pmd.lang.java.symbols.JClassSymbol import net.sourceforge.pmd.lang.java.symbols.JTypeParameterSymbol -import net.sourceforge.pmd.lang.java.symbols.table.internal.JavaSemanticErrors import net.sourceforge.pmd.lang.java.symbols.table.internal.JavaSemanticErrors.* class VarDisambiguationTest : ParserTestSpec({ diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/AstSymbolResolverTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/AstSymbolResolverTest.kt index 2ed8e06068..650033a3f4 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/AstSymbolResolverTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/AstSymbolResolverTest.kt @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.java.symbols.internal import io.kotest.matchers.types.shouldBeSameInstanceAs import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBeA +import net.sourceforge.pmd.lang.test.ast.shouldBeA import net.sourceforge.pmd.lang.java.ast.InternalApiBridge import net.sourceforge.pmd.lang.java.ast.ProcessorTestSpec import net.sourceforge.pmd.lang.java.symbols.JClassSymbol diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/AstSymbolTests.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/AstSymbolTests.kt index cb8c48b9c8..1ee4941e90 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/AstSymbolTests.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/AstSymbolTests.kt @@ -4,16 +4,16 @@ package net.sourceforge.pmd.lang.java.symbols.internal +import io.kotest.matchers.collections.haveSize import io.kotest.matchers.collections.shouldBeEmpty import io.kotest.matchers.collections.shouldHaveSize -import io.kotest.matchers.collections.haveSize import io.kotest.matchers.should import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.* -import net.sourceforge.pmd.lang.ast.test.shouldBe import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.symbols.* import net.sourceforge.pmd.lang.java.types.Substitution +import net.sourceforge.pmd.lang.test.ast.* +import net.sourceforge.pmd.lang.test.ast.shouldBe import java.lang.reflect.Modifier /** diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/PrimitiveSymbolTests.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/PrimitiveSymbolTests.kt index fae15094cd..6310131ea0 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/PrimitiveSymbolTests.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/PrimitiveSymbolTests.kt @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.java.symbols.internal import io.kotest.core.spec.style.WordSpec import io.kotest.matchers.collections.shouldBeEmpty -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.symbols.JAccessibleElementSymbol.PRIMITIVE_PACKAGE import net.sourceforge.pmd.lang.java.symbols.JClassSymbol import net.sourceforge.pmd.lang.java.types.testTypeSystem diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/ReflectedClassSymbolTests.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/ReflectedClassSymbolTests.kt index 5051b1396e..2b2eb142af 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/ReflectedClassSymbolTests.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/ReflectedClassSymbolTests.kt @@ -7,8 +7,8 @@ package net.sourceforge.pmd.lang.java.symbols.internal import io.kotest.core.spec.style.WordSpec import io.kotest.matchers.shouldBe import io.kotest.property.checkAll -import net.sourceforge.pmd.lang.ast.test.IntelliMarker -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.IntelliMarker +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.types.testTypeSystem /** diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/ReflectedFieldSymbolTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/ReflectedFieldSymbolTest.kt index bf09835375..55335b58c1 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/ReflectedFieldSymbolTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/ReflectedFieldSymbolTest.kt @@ -11,7 +11,7 @@ import io.kotest.matchers.shouldNotBe import io.kotest.property.arbitrary.filterNot import javasymbols.testdata.impls.IdenticalToSomeFields import javasymbols.testdata.impls.SomeFields -import net.sourceforge.pmd.lang.ast.test.IntelliMarker +import net.sourceforge.pmd.lang.test.ast.IntelliMarker /** * @author ClĂ©ment Fournier diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/UnresolvedClassTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/UnresolvedClassTest.kt index 86d0561cee..454c33393f 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/UnresolvedClassTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/UnresolvedClassTest.kt @@ -7,8 +7,8 @@ package net.sourceforge.pmd.lang.java.symbols.internal import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.collections.haveSize import io.kotest.matchers.should -import net.sourceforge.pmd.lang.ast.test.IntelliMarker -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.IntelliMarker +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.types.testTypeSystem /** diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/AsmLoaderTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/AsmLoaderTest.kt index a89096feb6..4ffcc088cd 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/AsmLoaderTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/AsmLoaderTest.kt @@ -20,8 +20,8 @@ import javasymbols.testdata.deep.AClassWithLocals import javasymbols.testdata.deep.`Another$ClassWith$Dollar` import javasymbols.testdata.deep.OuterWithoutDollar import javasymbols.testdata.impls.GenericClass -import net.sourceforge.pmd.lang.ast.test.IntelliMarker -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.IntelliMarker +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.types.testTypeSystem import org.objectweb.asm.Opcodes import kotlin.test.assertSame diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/BrokenClasspathTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/BrokenClasspathTest.kt index 85f988420c..34f4df22ee 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/BrokenClasspathTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/BrokenClasspathTest.kt @@ -9,7 +9,7 @@ import io.kotest.assertions.withClue import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.shouldBe import io.kotest.matchers.shouldNotBe -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.symbols.JClassSymbol import net.sourceforge.pmd.lang.java.types.JClassType import net.sourceforge.pmd.lang.java.types.TypeOps diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/NamesTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/NamesTest.kt index 77d0df6cf4..ad89d9715b 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/NamesTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/NamesTest.kt @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.java.symbols.internal.asm import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.IntelliMarker +import net.sourceforge.pmd.lang.test.ast.IntelliMarker class NamesTest : IntelliMarker, FunSpec({ diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/SigParserTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/SigParserTest.kt index 4d16fdc868..723d288eaa 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/SigParserTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/SigParserTest.kt @@ -7,14 +7,12 @@ package net.sourceforge.pmd.lang.java.symbols.internal.asm import io.kotest.assertions.throwables.shouldThrow import io.kotest.assertions.withClue import io.kotest.core.spec.style.FunSpec -import io.kotest.matchers.Matcher import io.kotest.matchers.collections.shouldHaveSize -import io.kotest.matchers.should import io.kotest.matchers.shouldBe import io.kotest.matchers.string.shouldContain import javasymbols.testdata.impls.SomeInnerClasses -import net.sourceforge.pmd.lang.ast.test.IntelliMarker -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.IntelliMarker +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.symbols.JTypeParameterSymbol import net.sourceforge.pmd.lang.java.symbols.internal.asm.GenericSigBase.LazyMethodType import net.sourceforge.pmd.lang.java.symbols.internal.asm.TypeParamsParser.BaseTypeParamsBuilder diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/HeaderScopesTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/HeaderScopesTest.kt index e580ec1ceb..5fa69c253c 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/HeaderScopesTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/HeaderScopesTest.kt @@ -7,8 +7,6 @@ package net.sourceforge.pmd.lang.java.symbols.table.internal import io.kotest.matchers.collections.* -import io.kotest.matchers.maps.shouldBeEmpty -import io.kotest.matchers.maps.shouldContain import io.kotest.matchers.nulls.shouldNotBeNull import io.kotest.matchers.should import io.kotest.matchers.shouldBe @@ -16,8 +14,8 @@ import io.kotest.matchers.shouldNotBe import javasymbols.testdata.StaticNameCollision import javasymbols.testdata.StaticsSuper import javasymbols.testdata.deep.OuterWithoutDollar -import net.sourceforge.pmd.lang.ast.test.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBeA +import net.sourceforge.pmd.lang.test.ast.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBeA import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.symbols.JClassSymbol import net.sourceforge.pmd.lang.java.symbols.JFieldSymbol diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/LocalTypeScopesTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/LocalTypeScopesTest.kt index eb874dca5e..11c796362e 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/LocalTypeScopesTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/LocalTypeScopesTest.kt @@ -5,7 +5,7 @@ package net.sourceforge.pmd.lang.java.symbols.table.internal import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.types.JClassType import net.sourceforge.pmd.lang.java.types.shouldHaveType diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/MemberInheritanceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/MemberInheritanceTest.kt index 47f9947c13..92a44c7347 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/MemberInheritanceTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/MemberInheritanceTest.kt @@ -9,10 +9,10 @@ import io.kotest.matchers.collections.shouldBeSingleton import io.kotest.matchers.collections.shouldContainExactly import io.kotest.matchers.collections.shouldHaveSize import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.component6 -import net.sourceforge.pmd.lang.ast.test.component7 -import net.sourceforge.pmd.lang.ast.test.component8 -import net.sourceforge.pmd.lang.ast.test.shouldMatchN +import net.sourceforge.pmd.lang.test.ast.component6 +import net.sourceforge.pmd.lang.test.ast.component7 +import net.sourceforge.pmd.lang.test.ast.component8 +import net.sourceforge.pmd.lang.test.ast.shouldMatchN import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.symbols.table.coreimpl.ShadowChain import net.sourceforge.pmd.lang.java.types.* diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/PatternVarScopingTests.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/PatternVarScopingTests.kt index a87634d1a4..fa253394da 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/PatternVarScopingTests.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/PatternVarScopingTests.kt @@ -5,8 +5,8 @@ package net.sourceforge.pmd.lang.java.symbols.table.internal import io.kotest.assertions.withClue -import net.sourceforge.pmd.lang.ast.test.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBeA +import net.sourceforge.pmd.lang.test.ast.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBeA import net.sourceforge.pmd.lang.java.ast.* /** diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/TypeParamScopingTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/TypeParamScopingTest.kt index a209022c13..0546cc0878 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/TypeParamScopingTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/TypeParamScopingTest.kt @@ -6,8 +6,8 @@ package net.sourceforge.pmd.lang.java.symbols.table.internal import io.kotest.matchers.shouldBe import io.kotest.matchers.types.shouldBeSameInstanceAs -import net.sourceforge.pmd.lang.ast.test.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBeA +import net.sourceforge.pmd.lang.test.ast.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBeA import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.types.JClassType import net.sourceforge.pmd.lang.java.types.JTypeVar diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/Utils.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/Utils.kt index 24875a282d..adf653406d 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/Utils.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/Utils.kt @@ -5,7 +5,7 @@ package net.sourceforge.pmd.lang.java.symbols.table.internal import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBeA +import net.sourceforge.pmd.lang.test.ast.shouldBeA import net.sourceforge.pmd.lang.java.ast.ASTVariableId import net.sourceforge.pmd.lang.java.ast.JavaNode import net.sourceforge.pmd.lang.java.symbols.JFieldSymbol diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/VarScopingTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/VarScopingTest.kt index 2435e576d5..27be27b418 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/VarScopingTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/VarScopingTest.kt @@ -4,17 +4,17 @@ package net.sourceforge.pmd.lang.java.symbols.table.internal -import io.kotest.matchers.should -import io.kotest.matchers.shouldBe import io.kotest.matchers.collections.beEmpty import io.kotest.matchers.collections.shouldBeEmpty -import net.sourceforge.pmd.lang.ast.test.* -import net.sourceforge.pmd.lang.ast.test.shouldBe +import io.kotest.matchers.should +import io.kotest.matchers.shouldBe import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.symbols.JFieldSymbol import net.sourceforge.pmd.lang.java.symbols.JFormalParamSymbol import net.sourceforge.pmd.lang.java.symbols.JLocalVariableSymbol import net.sourceforge.pmd.lang.java.types.shouldHaveType +import net.sourceforge.pmd.lang.test.ast.* +import net.sourceforge.pmd.lang.test.ast.shouldBe import java.lang.reflect.Modifier @Suppress("UNUSED_VARIABLE") diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ArraySymbolTests.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ArraySymbolTests.kt index 34d72f2690..20e78a5511 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ArraySymbolTests.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ArraySymbolTests.kt @@ -6,8 +6,8 @@ package net.sourceforge.pmd.lang.java.types import io.kotest.core.spec.style.WordSpec import io.kotest.matchers.collections.shouldHaveSize -import net.sourceforge.pmd.lang.ast.test.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBeA +import net.sourceforge.pmd.lang.test.ast.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBeA import net.sourceforge.pmd.lang.java.ast.JavaNode import net.sourceforge.pmd.lang.java.symbols.JAccessibleElementSymbol.PRIMITIVE_PACKAGE import net.sourceforge.pmd.lang.java.symbols.JConstructorSymbol diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ClassTypeImplTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ClassTypeImplTest.kt index 3033056626..0ee4f05858 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ClassTypeImplTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ClassTypeImplTest.kt @@ -7,8 +7,8 @@ package net.sourceforge.pmd.lang.java.types import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.IntelliMarker -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.IntelliMarker +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.symbols.internal.asm.createUnresolvedAsmSymbol /** diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/GlbTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/GlbTest.kt index 95ade83763..0e9f8dff3f 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/GlbTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/GlbTest.kt @@ -10,7 +10,7 @@ import io.kotest.matchers.collections.shouldContainExactly import io.kotest.matchers.nulls.shouldBeNull import io.kotest.matchers.shouldBe import io.kotest.property.checkAll -import net.sourceforge.pmd.lang.ast.test.shouldBeA +import net.sourceforge.pmd.lang.test.ast.shouldBeA import net.sourceforge.pmd.lang.java.symbols.internal.asm.createUnresolvedAsmSymbol /** diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/InnerTypesTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/InnerTypesTest.kt index 2ac7f7d79a..3b9b28c748 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/InnerTypesTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/InnerTypesTest.kt @@ -7,8 +7,8 @@ package net.sourceforge.pmd.lang.java.types import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldMatchN +import net.sourceforge.pmd.lang.test.ast.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldMatchN import net.sourceforge.pmd.lang.java.ast.* class InnerTypesTest : ProcessorTestSpec({ diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/JPrimitiveTypeTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/JPrimitiveTypeTest.kt index d10837f433..2270f70e93 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/JPrimitiveTypeTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/JPrimitiveTypeTest.kt @@ -8,7 +8,7 @@ import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.collections.shouldBeEmpty import io.kotest.matchers.collections.shouldContain import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.IntelliMarker +import net.sourceforge.pmd.lang.test.ast.IntelliMarker import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind /** diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/SpecialTypesTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/SpecialTypesTest.kt index 0379c4ed00..092e03c6bb 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/SpecialTypesTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/SpecialTypesTest.kt @@ -7,8 +7,8 @@ package net.sourceforge.pmd.lang.java.types import io.kotest.assertions.throwables.shouldThrow import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.IntelliMarker -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.IntelliMarker +import net.sourceforge.pmd.lang.test.ast.shouldBe /** */ diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/SubtypingTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/SubtypingTest.kt index 1fdb1affa0..854ede6e34 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/SubtypingTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/SubtypingTest.kt @@ -13,7 +13,7 @@ import io.kotest.property.Exhaustive import io.kotest.property.checkAll import io.kotest.property.exhaustive.ints import io.kotest.property.forAll -import net.sourceforge.pmd.lang.ast.test.shouldBeA +import net.sourceforge.pmd.lang.test.ast.shouldBeA import net.sourceforge.pmd.lang.java.ast.ParserTestCtx import net.sourceforge.pmd.lang.java.symbols.JClassSymbol import net.sourceforge.pmd.lang.java.symbols.internal.UnresolvedClassStore diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TestUtilitiesForTypes.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TestUtilitiesForTypes.kt index 90482a9828..09a679838b 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TestUtilitiesForTypes.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TestUtilitiesForTypes.kt @@ -8,18 +8,18 @@ package net.sourceforge.pmd.lang.java.types import io.kotest.assertions.* -import io.kotest.assertions.print.Printed import io.kotest.assertions.print.print import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBeA import net.sourceforge.pmd.lang.java.JavaParsingHelper -import net.sourceforge.pmd.lang.java.ast.* +import net.sourceforge.pmd.lang.java.ast.InvocationNode +import net.sourceforge.pmd.lang.java.ast.TypeNode import net.sourceforge.pmd.lang.java.symbols.internal.asm.AsmSymbolResolver import net.sourceforge.pmd.lang.java.types.TypeOps.* +import net.sourceforge.pmd.lang.test.ast.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBeA import org.hamcrest.Description +import java.util.stream.Collectors import kotlin.String -import kotlin.streams.toList import kotlin.test.assertTrue /* @@ -45,7 +45,7 @@ val TypeSystem.STRING get() = declaration(getClassSymbol(String::class.java)) as typealias TypePair = Pair -fun JTypeMirror.getMethodsByName(name: String) = streamMethods { it.simpleName == name }.toList() +fun JTypeMirror.getMethodsByName(name: String) = streamMethods { it.simpleName == name }.collect(Collectors.toList()) fun JTypeMirror.shouldBeUnresolvedClass(canonicalName: String) = this.shouldBeA { diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeParamSubstTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeParamSubstTest.kt index 143b993da8..e57b4a7bf4 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeParamSubstTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeParamSubstTest.kt @@ -6,8 +6,8 @@ package net.sourceforge.pmd.lang.java.types import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBeA +import net.sourceforge.pmd.lang.test.ast.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBeA import net.sourceforge.pmd.lang.java.types.testdata.GenericFbound import net.sourceforge.pmd.lang.java.types.testdata.MutualTypeRecursion diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeSystemTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeSystemTest.kt index a0266f33e4..d4cdbb491d 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeSystemTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeSystemTest.kt @@ -13,9 +13,9 @@ import io.kotest.matchers.shouldNot import io.kotest.matchers.shouldNotBe import io.kotest.matchers.types.shouldBeSameInstanceAs import io.kotest.matchers.types.shouldNotBeSameInstanceAs -import net.sourceforge.pmd.lang.ast.test.IntelliMarker -import net.sourceforge.pmd.lang.ast.test.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBeA +import net.sourceforge.pmd.lang.test.ast.IntelliMarker +import net.sourceforge.pmd.lang.test.ast.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBeA import net.sourceforge.pmd.lang.java.ast.ParserTestCtx import net.sourceforge.pmd.lang.java.symbols.JClassSymbol import net.sourceforge.pmd.lang.java.symbols.internal.FakeSymAnnot diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypesFromAstTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypesFromAstTest.kt index 8dbdf6643e..b0a9f22821 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypesFromAstTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypesFromAstTest.kt @@ -5,7 +5,7 @@ package net.sourceforge.pmd.lang.java.types import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldMatchN +import net.sourceforge.pmd.lang.test.ast.shouldMatchN import net.sourceforge.pmd.lang.java.ast.ASTFieldDeclaration import net.sourceforge.pmd.lang.java.ast.ProcessorTestSpec import net.sourceforge.pmd.lang.java.ast.classType diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ast/ConversionContextTests.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ast/ConversionContextTests.kt index b17eeae84e..423d89e22e 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ast/ConversionContextTests.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ast/ConversionContextTests.kt @@ -7,8 +7,8 @@ package net.sourceforge.pmd.lang.java.types.ast import io.kotest.assertions.withClue import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.component6 -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.component6 +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.ast.internal.JavaAstUtils import net.sourceforge.pmd.lang.java.types.STRING diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/AnonCtorsTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/AnonCtorsTest.kt index 0ab0d87cdb..f97495cb6b 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/AnonCtorsTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/AnonCtorsTest.kt @@ -4,9 +4,9 @@ package net.sourceforge.pmd.lang.java.types.internal.infer import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBeA -import net.sourceforge.pmd.lang.ast.test.shouldMatchN +import net.sourceforge.pmd.lang.test.ast.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBeA +import net.sourceforge.pmd.lang.test.ast.shouldMatchN import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.symbols.JConstructorSymbol import net.sourceforge.pmd.lang.java.types.* diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/BranchingExprsTestCases.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/BranchingExprsTestCases.kt index 3810efe856..4eeab6941f 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/BranchingExprsTestCases.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/BranchingExprsTestCases.kt @@ -4,9 +4,8 @@ package net.sourceforge.pmd.lang.java.types.internal.infer -import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldMatchN +import net.sourceforge.pmd.lang.test.ast.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldMatchN import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.types.* import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.DOUBLE diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/CaptureInferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/CaptureInferenceTest.kt index b4f84781af..f9753a9ad4 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/CaptureInferenceTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/CaptureInferenceTest.kt @@ -5,8 +5,8 @@ package net.sourceforge.pmd.lang.java.types.internal.infer import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldMatchN +import net.sourceforge.pmd.lang.test.ast.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldMatchN import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.types.* import java.util.* diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/ExplicitTypesTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/ExplicitTypesTest.kt index 519b73f945..2abcd43a66 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/ExplicitTypesTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/ExplicitTypesTest.kt @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.types.internal.infer -import net.sourceforge.pmd.lang.ast.test.shouldBeA +import net.sourceforge.pmd.lang.test.ast.shouldBeA import net.sourceforge.pmd.lang.java.ast.ASTMethodCall import net.sourceforge.pmd.lang.java.ast.ProcessorTestSpec import net.sourceforge.pmd.lang.java.types.firstMethodCall diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/Java7InferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/Java7InferenceTest.kt index bb2778d52c..38b578caf1 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/Java7InferenceTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/Java7InferenceTest.kt @@ -3,7 +3,7 @@ */ package net.sourceforge.pmd.lang.java.types.internal.infer -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.ast.JavaVersion.* import net.sourceforge.pmd.lang.java.symbols.JConstructorSymbol diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/LambdaInferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/LambdaInferenceTest.kt index 05f5020c71..934ba6e60f 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/LambdaInferenceTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/LambdaInferenceTest.kt @@ -7,12 +7,15 @@ package net.sourceforge.pmd.lang.java.types.internal.infer import io.kotest.assertions.withClue import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.* -import net.sourceforge.pmd.lang.ast.test.shouldBe import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.types.* import net.sourceforge.pmd.lang.java.types.internal.infer.ast.JavaExprMirrors import net.sourceforge.pmd.lang.java.types.testdata.TypeInferenceTestCases +import net.sourceforge.pmd.lang.test.ast.component6 +import net.sourceforge.pmd.lang.test.ast.component7 +import net.sourceforge.pmd.lang.test.ast.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBeA +import net.sourceforge.pmd.lang.test.ast.shouldMatchN import java.util.function.DoubleConsumer import java.util.function.Supplier import kotlin.test.assertEquals diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/LocalVarInferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/LocalVarInferenceTest.kt index 26ee2a054c..46c240cb8e 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/LocalVarInferenceTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/LocalVarInferenceTest.kt @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.types.internal.infer -import net.sourceforge.pmd.lang.ast.test.shouldMatchN +import net.sourceforge.pmd.lang.test.ast.shouldMatchN import net.sourceforge.pmd.lang.java.ast.ProcessorTestSpec import net.sourceforge.pmd.lang.java.ast.variableAccess import net.sourceforge.pmd.lang.java.types.* diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/MethodRefInferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/MethodRefInferenceTest.kt index 89a7c79b77..70ca35ff47 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/MethodRefInferenceTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/MethodRefInferenceTest.kt @@ -5,10 +5,10 @@ package net.sourceforge.pmd.lang.java.types.internal.infer import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.component6 -import net.sourceforge.pmd.lang.ast.test.component7 -import net.sourceforge.pmd.lang.ast.test.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldMatchN +import net.sourceforge.pmd.lang.test.ast.component6 +import net.sourceforge.pmd.lang.test.ast.component7 +import net.sourceforge.pmd.lang.test.ast.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldMatchN import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.types.* import java.util.* diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverloadResolutionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverloadResolutionTest.kt index 43c5863b97..66c8fedcd6 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverloadResolutionTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverloadResolutionTest.kt @@ -7,8 +7,8 @@ package net.sourceforge.pmd.lang.java.types.internal.infer import io.kotest.matchers.should import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldMatchN +import net.sourceforge.pmd.lang.test.ast.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldMatchN import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.types.* import net.sourceforge.pmd.lang.java.types.testdata.Overloads diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverloadSpecificityTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverloadSpecificityTest.kt index b936f608d5..a84034f07b 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverloadSpecificityTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverloadSpecificityTest.kt @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.java.types.internal.infer import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.types.* import net.sourceforge.pmd.lang.java.types.TypeOps.areOverrideEquivalent diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/PolyResolutionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/PolyResolutionTest.kt index 73c4dcc101..6405b99afb 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/PolyResolutionTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/PolyResolutionTest.kt @@ -5,8 +5,8 @@ package net.sourceforge.pmd.lang.java.types.internal.infer -import net.sourceforge.pmd.lang.ast.test.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldMatchN +import net.sourceforge.pmd.lang.test.ast.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldMatchN import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.types.* import java.io.BufferedOutputStream diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/SpecialMethodsTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/SpecialMethodsTest.kt index 05ae0ee19a..d1e2009fdd 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/SpecialMethodsTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/SpecialMethodsTest.kt @@ -5,8 +5,8 @@ package net.sourceforge.pmd.lang.java.types.internal.infer import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBeA -import net.sourceforge.pmd.lang.ast.test.shouldMatchN +import net.sourceforge.pmd.lang.test.ast.shouldBeA +import net.sourceforge.pmd.lang.test.ast.shouldMatchN import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.symbols.JConstructorSymbol import net.sourceforge.pmd.lang.java.symbols.JFormalParamSymbol diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/StandaloneTypesTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/StandaloneTypesTest.kt index 51729be664..7306c6438b 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/StandaloneTypesTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/StandaloneTypesTest.kt @@ -8,11 +8,8 @@ package net.sourceforge.pmd.lang.java.types.internal.infer import io.kotest.assertions.withClue import io.kotest.matchers.shouldBe import io.kotest.matchers.shouldNotBe -import io.kotest.property.arbitrary.filterNot -import io.kotest.property.checkAll -import net.sourceforge.pmd.lang.ast.test.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBeA -import net.sourceforge.pmd.lang.ast.test.shouldMatchN +import net.sourceforge.pmd.lang.test.ast.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldMatchN import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.ast.BinaryOp.* import net.sourceforge.pmd.lang.java.types.* diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/StressTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/StressTest.kt index 587e564fd7..c77ee87a3e 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/StressTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/StressTest.kt @@ -9,8 +9,8 @@ import com.github.oowekyala.treeutils.matchers.TreeNodeWrapper import io.kotest.matchers.shouldBe import io.kotest.matchers.shouldNotBe import net.sourceforge.pmd.lang.ast.Node -import net.sourceforge.pmd.lang.ast.test.NodeSpec -import net.sourceforge.pmd.lang.ast.test.shouldBeA +import net.sourceforge.pmd.lang.test.ast.NodeSpec +import net.sourceforge.pmd.lang.test.ast.shouldBeA import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.types.JClassType import net.sourceforge.pmd.lang.java.types.shouldHaveType diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/TypeInferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/TypeInferenceTest.kt index 8a1e246d74..ee5890fda6 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/TypeInferenceTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/TypeInferenceTest.kt @@ -7,10 +7,10 @@ package net.sourceforge.pmd.lang.java.types.internal.infer import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.NodeSpec -import net.sourceforge.pmd.lang.ast.test.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBeA -import net.sourceforge.pmd.lang.ast.test.shouldMatchN +import net.sourceforge.pmd.lang.test.ast.NodeSpec +import net.sourceforge.pmd.lang.test.ast.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBeA +import net.sourceforge.pmd.lang.test.ast.shouldMatchN import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.symbols.JConstructorSymbol import net.sourceforge.pmd.lang.java.types.* diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/UncheckedInferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/UncheckedInferenceTest.kt index 058d0f99ab..42c7061581 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/UncheckedInferenceTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/UncheckedInferenceTest.kt @@ -7,7 +7,7 @@ package net.sourceforge.pmd.lang.java.types.internal.infer import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.types.* diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/UnresolvedTypesRecoveryTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/UnresolvedTypesRecoveryTest.kt index 9c2b3e147d..aa96b63266 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/UnresolvedTypesRecoveryTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/UnresolvedTypesRecoveryTest.kt @@ -7,8 +7,8 @@ package net.sourceforge.pmd.lang.java.types.internal.infer import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBeA -import net.sourceforge.pmd.lang.ast.test.shouldMatchN +import net.sourceforge.pmd.lang.test.ast.shouldBeA +import net.sourceforge.pmd.lang.test.ast.shouldMatchN import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.symbols.JClassSymbol import net.sourceforge.pmd.lang.java.types.* diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/ReportTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/ReportTest.java index 292986f722..398f596df5 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/ReportTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/ReportTest.java @@ -4,8 +4,8 @@ package net.sourceforge.pmd; -import static net.sourceforge.pmd.lang.ast.test.TestUtilsKt.assertSize; -import static net.sourceforge.pmd.lang.ast.test.TestUtilsKt.assertSuppressed; +import static net.sourceforge.pmd.lang.test.ast.TestUtilsKt.assertSize; +import static net.sourceforge.pmd.lang.test.ast.TestUtilsKt.assertSuppressed; import org.junit.jupiter.api.Test; diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/ast/JsParsingHelper.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/ast/JsParsingHelper.java index 0c0f2520fd..5fbc2a573d 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/ast/JsParsingHelper.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/ast/JsParsingHelper.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.ecmascript.ast; -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; import net.sourceforge.pmd.lang.ecmascript.EcmascriptLanguageModule; public final class JsParsingHelper extends BaseParsingHelper { diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/ast/JsTreeDumpTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/ast/JsTreeDumpTest.java index cdff450c60..1420aeea59 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/ast/JsTreeDumpTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/ast/JsTreeDumpTest.java @@ -7,9 +7,9 @@ package net.sourceforge.pmd.lang.ecmascript.ast; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; -import net.sourceforge.pmd.lang.ast.test.BaseTreeDumpTest; -import net.sourceforge.pmd.lang.ast.test.NodePrintersKt; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; +import net.sourceforge.pmd.lang.test.ast.BaseTreeDumpTest; +import net.sourceforge.pmd.lang.test.ast.NodePrintersKt; class JsTreeDumpTest extends BaseTreeDumpTest { JsTreeDumpTest() { diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/cpd/AnyCpdLexerForTypescriptTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/cpd/AnyCpdLexerForTypescriptTest.java index c159efd6e9..b7d8f05d88 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/cpd/AnyCpdLexerForTypescriptTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/cpd/AnyCpdLexerForTypescriptTest.java @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.ecmascript.cpd; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest; +import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest; import net.sourceforge.pmd.lang.ecmascript.EcmascriptLanguageModule; /** diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/cpd/EcmascriptCpdLexerTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/cpd/EcmascriptCpdLexerTest.java index 16b176bf43..35d420cdb3 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/cpd/EcmascriptCpdLexerTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/cpd/EcmascriptCpdLexerTest.java @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.ecmascript.cpd; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest; +import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest; import net.sourceforge.pmd.lang.ecmascript.EcmascriptLanguageModule; diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/typescript/cpd/TypeScriptCpdLexerTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/typescript/cpd/TypeScriptCpdLexerTest.java index aa2d7f84df..f37676926e 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/typescript/cpd/TypeScriptCpdLexerTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/typescript/cpd/TypeScriptCpdLexerTest.java @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.typescript.cpd; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest; +import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest; import net.sourceforge.pmd.lang.typescript.TsLanguageModule; class TypeScriptCpdLexerTest extends CpdTextComparisonTest { diff --git a/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/ast/JspParsingHelper.java b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/ast/JspParsingHelper.java index 3cfed74953..83f7c1b6c9 100644 --- a/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/ast/JspParsingHelper.java +++ b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/ast/JspParsingHelper.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.jsp.ast; -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; import net.sourceforge.pmd.lang.jsp.JspLanguageModule; public final class JspParsingHelper extends BaseParsingHelper { diff --git a/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/cpd/JspCpdLexerTest.java b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/cpd/JspCpdLexerTest.java index 8eeb08725b..430e414a08 100644 --- a/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/cpd/JspCpdLexerTest.java +++ b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/cpd/JspCpdLexerTest.java @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.jsp.cpd; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest; +import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest; import net.sourceforge.pmd.lang.jsp.JspLanguageModule; diff --git a/pmd-julia/src/test/java/net/sourceforge/pmd/lang/julia/cpd/JuliaCpdLexerTest.java b/pmd-julia/src/test/java/net/sourceforge/pmd/lang/julia/cpd/JuliaCpdLexerTest.java index 3fe59ee2d0..bd0c16ff58 100644 --- a/pmd-julia/src/test/java/net/sourceforge/pmd/lang/julia/cpd/JuliaCpdLexerTest.java +++ b/pmd-julia/src/test/java/net/sourceforge/pmd/lang/julia/cpd/JuliaCpdLexerTest.java @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.julia.cpd; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest; +import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest; import net.sourceforge.pmd.lang.julia.JuliaLanguageModule; class JuliaCpdLexerTest extends CpdTextComparisonTest { diff --git a/pmd-kotlin/src/test/java/net/sourceforge/pmd/lang/kotlin/ast/BaseKotlinTreeDumpTest.java b/pmd-kotlin/src/test/java/net/sourceforge/pmd/lang/kotlin/ast/BaseKotlinTreeDumpTest.java index 3541b69096..f1bfe30def 100644 --- a/pmd-kotlin/src/test/java/net/sourceforge/pmd/lang/kotlin/ast/BaseKotlinTreeDumpTest.java +++ b/pmd-kotlin/src/test/java/net/sourceforge/pmd/lang/kotlin/ast/BaseKotlinTreeDumpTest.java @@ -6,8 +6,8 @@ package net.sourceforge.pmd.lang.kotlin.ast; import org.checkerframework.checker.nullness.qual.NonNull; -import net.sourceforge.pmd.lang.ast.test.BaseTreeDumpTest; -import net.sourceforge.pmd.lang.ast.test.NodePrintersKt; +import net.sourceforge.pmd.lang.test.ast.BaseTreeDumpTest; +import net.sourceforge.pmd.lang.test.ast.NodePrintersKt; /** * diff --git a/pmd-kotlin/src/test/java/net/sourceforge/pmd/lang/kotlin/ast/KotlinParsingHelper.java b/pmd-kotlin/src/test/java/net/sourceforge/pmd/lang/kotlin/ast/KotlinParsingHelper.java index d5c3f307c6..ff1ceb7d2a 100644 --- a/pmd-kotlin/src/test/java/net/sourceforge/pmd/lang/kotlin/ast/KotlinParsingHelper.java +++ b/pmd-kotlin/src/test/java/net/sourceforge/pmd/lang/kotlin/ast/KotlinParsingHelper.java @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.kotlin.ast; import org.jetbrains.annotations.NotNull; -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; import net.sourceforge.pmd.lang.kotlin.KotlinLanguageModule; /** diff --git a/pmd-kotlin/src/test/java/net/sourceforge/pmd/lang/kotlin/cpd/KotlinCpdLexerTest.java b/pmd-kotlin/src/test/java/net/sourceforge/pmd/lang/kotlin/cpd/KotlinCpdLexerTest.java index 4016548186..35cccbea9b 100644 --- a/pmd-kotlin/src/test/java/net/sourceforge/pmd/lang/kotlin/cpd/KotlinCpdLexerTest.java +++ b/pmd-kotlin/src/test/java/net/sourceforge/pmd/lang/kotlin/cpd/KotlinCpdLexerTest.java @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.kotlin.cpd; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest; +import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest; class KotlinCpdLexerTest extends CpdTextComparisonTest { diff --git a/pmd-lang-test/src/main/java/net/sourceforge/pmd/test/AbstractMetricTestRule.java b/pmd-lang-test/src/main/java/net/sourceforge/pmd/lang/test/AbstractMetricTestRule.java similarity index 99% rename from pmd-lang-test/src/main/java/net/sourceforge/pmd/test/AbstractMetricTestRule.java rename to pmd-lang-test/src/main/java/net/sourceforge/pmd/lang/test/AbstractMetricTestRule.java index 59c5f8e8e3..61ae56b966 100644 --- a/pmd-lang-test/src/main/java/net/sourceforge/pmd/test/AbstractMetricTestRule.java +++ b/pmd-lang-test/src/main/java/net/sourceforge/pmd/lang/test/AbstractMetricTestRule.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.test; +package net.sourceforge.pmd.lang.test; import java.text.MessageFormat; import java.util.HashMap; diff --git a/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/test/BaseTextComparisonTest.kt b/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/test/BaseTextComparisonTest.kt similarity index 99% rename from pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/test/BaseTextComparisonTest.kt rename to pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/test/BaseTextComparisonTest.kt index 635a85655c..998bcad7ee 100644 --- a/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/test/BaseTextComparisonTest.kt +++ b/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/test/BaseTextComparisonTest.kt @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.test +package net.sourceforge.pmd.lang.test import net.sourceforge.pmd.lang.document.FileId import java.nio.file.Path diff --git a/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/ast/test/AstMatcherDslAdapter.kt b/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/test/ast/AstMatcherDslAdapter.kt similarity index 98% rename from pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/ast/test/AstMatcherDslAdapter.kt rename to pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/test/ast/AstMatcherDslAdapter.kt index d6d97dac49..f3a6f2af0d 100644 --- a/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/ast/test/AstMatcherDslAdapter.kt +++ b/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/test/ast/AstMatcherDslAdapter.kt @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.ast.test +package net.sourceforge.pmd.lang.test.ast import com.github.oowekyala.treeutils.DoublyLinkedTreeLikeAdapter import com.github.oowekyala.treeutils.matchers.MatchingConfig diff --git a/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/ast/test/BaseParsingHelper.kt b/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/test/ast/BaseParsingHelper.kt similarity index 99% rename from pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/ast/test/BaseParsingHelper.kt rename to pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/test/ast/BaseParsingHelper.kt index 7116146a09..4eea999bb1 100644 --- a/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/ast/test/BaseParsingHelper.kt +++ b/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/test/ast/BaseParsingHelper.kt @@ -1,7 +1,7 @@ /* * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.ast.test +package net.sourceforge.pmd.lang.test.ast import net.sourceforge.pmd.PMDConfiguration import net.sourceforge.pmd.PmdAnalysis diff --git a/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/ast/test/BaseTreeDumpTest.kt b/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/test/ast/BaseTreeDumpTest.kt similarity index 92% rename from pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/ast/test/BaseTreeDumpTest.kt rename to pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/test/ast/BaseTreeDumpTest.kt index 49af1e58ac..f522d3b16c 100644 --- a/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/ast/test/BaseTreeDumpTest.kt +++ b/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/test/ast/BaseTreeDumpTest.kt @@ -2,9 +2,9 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.ast.test +package net.sourceforge.pmd.lang.test.ast -import net.sourceforge.pmd.test.BaseTextComparisonTest +import net.sourceforge.pmd.lang.test.BaseTextComparisonTest import net.sourceforge.pmd.util.treeexport.TreeRenderer diff --git a/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/ast/test/IntelliMarker.kt b/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/test/ast/IntelliMarker.kt similarity index 93% rename from pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/ast/test/IntelliMarker.kt rename to pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/test/ast/IntelliMarker.kt index d7ad20eea0..5754bc4143 100644 --- a/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/ast/test/IntelliMarker.kt +++ b/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/test/ast/IntelliMarker.kt @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.ast.test +package net.sourceforge.pmd.lang.test.ast import org.junit.jupiter.api.TestFactory diff --git a/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/ast/test/NodeExtensions.kt b/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/test/ast/NodeExtensions.kt similarity index 97% rename from pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/ast/test/NodeExtensions.kt rename to pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/test/ast/NodeExtensions.kt index 2a132ce149..fe00fb91dc 100644 --- a/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/ast/test/NodeExtensions.kt +++ b/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/test/ast/NodeExtensions.kt @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.ast.test +package net.sourceforge.pmd.lang.test.ast import io.kotest.matchers.string.shouldContain import io.kotest.matchers.shouldNotBe diff --git a/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/ast/test/NodePrinters.kt b/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/test/ast/NodePrinters.kt similarity index 98% rename from pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/ast/test/NodePrinters.kt rename to pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/test/ast/NodePrinters.kt index 709b18c115..04a83b79dc 100644 --- a/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/ast/test/NodePrinters.kt +++ b/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/test/ast/NodePrinters.kt @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.ast.test +package net.sourceforge.pmd.lang.test.ast import net.sourceforge.pmd.lang.ast.Node import net.sourceforge.pmd.lang.document.Chars diff --git a/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/ast/test/TestUtils.kt b/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/test/ast/TestUtils.kt similarity index 98% rename from pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/ast/test/TestUtils.kt rename to pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/test/ast/TestUtils.kt index e037138889..a89d4e71bb 100644 --- a/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/ast/test/TestUtils.kt +++ b/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/test/ast/TestUtils.kt @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.ast.test +package net.sourceforge.pmd.lang.test.ast import io.kotest.assertions.withClue import io.kotest.matchers.Matcher diff --git a/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/cpd/test/CpdTextComparisonTest.kt b/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/test/cpd/CpdTextComparisonTest.kt similarity index 98% rename from pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/cpd/test/CpdTextComparisonTest.kt rename to pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/test/cpd/CpdTextComparisonTest.kt index 7e462d2c99..2d7b31c6c0 100644 --- a/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/cpd/test/CpdTextComparisonTest.kt +++ b/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/test/cpd/CpdTextComparisonTest.kt @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.cpd.test +package net.sourceforge.pmd.lang.test.cpd import io.kotest.assertions.throwables.shouldThrow import net.sourceforge.pmd.cpd.CpdCapableLanguage @@ -14,7 +14,7 @@ import net.sourceforge.pmd.lang.LanguageRegistry import net.sourceforge.pmd.lang.ast.LexException import net.sourceforge.pmd.lang.document.FileId import net.sourceforge.pmd.lang.document.TextDocument -import net.sourceforge.pmd.test.BaseTextComparisonTest +import net.sourceforge.pmd.lang.test.BaseTextComparisonTest import org.apache.commons.lang3.StringUtils /** diff --git a/pmd-lua/src/test/java/net/sourceforge/pmd/lang/lua/cpd/LuaCpdLexerTest.java b/pmd-lua/src/test/java/net/sourceforge/pmd/lang/lua/cpd/LuaCpdLexerTest.java index e41f68035d..41a65e26ed 100644 --- a/pmd-lua/src/test/java/net/sourceforge/pmd/lang/lua/cpd/LuaCpdLexerTest.java +++ b/pmd-lua/src/test/java/net/sourceforge/pmd/lang/lua/cpd/LuaCpdLexerTest.java @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.lua.cpd; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest; +import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest; class LuaCpdLexerTest extends CpdTextComparisonTest { LuaCpdLexerTest() { diff --git a/pmd-matlab/src/test/java/net/sourceforge/pmd/lang/matlab/cpd/MatlabCpdLexerTest.java b/pmd-matlab/src/test/java/net/sourceforge/pmd/lang/matlab/cpd/MatlabCpdLexerTest.java index be9b58c6f6..39b56ccfd2 100644 --- a/pmd-matlab/src/test/java/net/sourceforge/pmd/lang/matlab/cpd/MatlabCpdLexerTest.java +++ b/pmd-matlab/src/test/java/net/sourceforge/pmd/lang/matlab/cpd/MatlabCpdLexerTest.java @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.matlab.cpd; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest; +import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest; class MatlabCpdLexerTest extends CpdTextComparisonTest { diff --git a/pmd-modelica/src/test/java/net/sourceforge/pmd/lang/modelica/ModelicaParsingHelper.java b/pmd-modelica/src/test/java/net/sourceforge/pmd/lang/modelica/ModelicaParsingHelper.java index 8b90266b11..1a9eb5c2fb 100644 --- a/pmd-modelica/src/test/java/net/sourceforge/pmd/lang/modelica/ModelicaParsingHelper.java +++ b/pmd-modelica/src/test/java/net/sourceforge/pmd/lang/modelica/ModelicaParsingHelper.java @@ -5,7 +5,7 @@ package net.sourceforge.pmd.lang.modelica; -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; import net.sourceforge.pmd.lang.modelica.ast.ASTStoredDefinition; public class ModelicaParsingHelper extends BaseParsingHelper { diff --git a/pmd-modelica/src/test/kotlin/net/sourceforge/pmd/lang/modelica/ast/ModelicaCoordsTest.kt b/pmd-modelica/src/test/kotlin/net/sourceforge/pmd/lang/modelica/ast/ModelicaCoordsTest.kt index 58cb16329e..1101454fa8 100644 --- a/pmd-modelica/src/test/kotlin/net/sourceforge/pmd/lang/modelica/ast/ModelicaCoordsTest.kt +++ b/pmd-modelica/src/test/kotlin/net/sourceforge/pmd/lang/modelica/ast/ModelicaCoordsTest.kt @@ -7,10 +7,10 @@ package net.sourceforge.pmd.lang.modelica.ast import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.should import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.matchNode -import net.sourceforge.pmd.lang.ast.test.assertPosition -import net.sourceforge.pmd.lang.ast.test.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldHaveText +import net.sourceforge.pmd.lang.test.ast.matchNode +import net.sourceforge.pmd.lang.test.ast.assertPosition +import net.sourceforge.pmd.lang.test.ast.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldHaveText import net.sourceforge.pmd.lang.modelica.ModelicaParsingHelper class ModelicaCoordsTest : FunSpec({ diff --git a/pmd-objectivec/src/test/java/net/sourceforge/pmd/lang/objectivec/cpd/ObjectiveCCpdLexerTest.java b/pmd-objectivec/src/test/java/net/sourceforge/pmd/lang/objectivec/cpd/ObjectiveCCpdLexerTest.java index 5f8a923cea..37ab3380d4 100644 --- a/pmd-objectivec/src/test/java/net/sourceforge/pmd/lang/objectivec/cpd/ObjectiveCCpdLexerTest.java +++ b/pmd-objectivec/src/test/java/net/sourceforge/pmd/lang/objectivec/cpd/ObjectiveCCpdLexerTest.java @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.objectivec.cpd; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest; +import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest; class ObjectiveCCpdLexerTest extends CpdTextComparisonTest { diff --git a/pmd-perl/src/test/java/net/sourceforge/pmd/lang/perl/cpd/PerlCpdLexerTest.java b/pmd-perl/src/test/java/net/sourceforge/pmd/lang/perl/cpd/PerlCpdLexerTest.java index bb39dcdc3f..edbe1c11d9 100644 --- a/pmd-perl/src/test/java/net/sourceforge/pmd/lang/perl/cpd/PerlCpdLexerTest.java +++ b/pmd-perl/src/test/java/net/sourceforge/pmd/lang/perl/cpd/PerlCpdLexerTest.java @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.perl.cpd; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest; +import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest; /** * diff --git a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/PlsqlParsingHelper.java b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/PlsqlParsingHelper.java index 616f4d47a7..98ac1dec59 100644 --- a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/PlsqlParsingHelper.java +++ b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/PlsqlParsingHelper.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.plsql; -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; import net.sourceforge.pmd.lang.plsql.ast.ASTInput; public class PlsqlParsingHelper extends BaseParsingHelper { diff --git a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/ast/ExecuteImmediateBulkCollectTest.java b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/ast/ExecuteImmediateBulkCollectTest.java index ab1e68acd5..004a4eb830 100644 --- a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/ast/ExecuteImmediateBulkCollectTest.java +++ b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/ast/ExecuteImmediateBulkCollectTest.java @@ -6,9 +6,9 @@ package net.sourceforge.pmd.lang.plsql.ast; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; -import net.sourceforge.pmd.lang.ast.test.BaseTreeDumpTest; -import net.sourceforge.pmd.lang.ast.test.RelevantAttributePrinter; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; +import net.sourceforge.pmd.lang.test.ast.BaseTreeDumpTest; +import net.sourceforge.pmd.lang.test.ast.RelevantAttributePrinter; import net.sourceforge.pmd.lang.plsql.PlsqlParsingHelper; class ExecuteImmediateBulkCollectTest extends BaseTreeDumpTest { diff --git a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/ast/ParenthesisGroupTest.java b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/ast/ParenthesisGroupTest.java index 6ad3cdc2f3..1f058b7436 100644 --- a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/ast/ParenthesisGroupTest.java +++ b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/ast/ParenthesisGroupTest.java @@ -6,9 +6,9 @@ package net.sourceforge.pmd.lang.plsql.ast; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; -import net.sourceforge.pmd.lang.ast.test.BaseTreeDumpTest; -import net.sourceforge.pmd.lang.ast.test.RelevantAttributePrinter; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; +import net.sourceforge.pmd.lang.test.ast.BaseTreeDumpTest; +import net.sourceforge.pmd.lang.test.ast.RelevantAttributePrinter; import net.sourceforge.pmd.lang.plsql.PlsqlParsingHelper; class ParenthesisGroupTest extends BaseTreeDumpTest { 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 c36fb7503c..3756f76abc 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 @@ -6,9 +6,9 @@ package net.sourceforge.pmd.lang.plsql.ast; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; -import net.sourceforge.pmd.lang.ast.test.BaseTreeDumpTest; -import net.sourceforge.pmd.lang.ast.test.RelevantAttributePrinter; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; +import net.sourceforge.pmd.lang.test.ast.BaseTreeDumpTest; +import net.sourceforge.pmd.lang.test.ast.RelevantAttributePrinter; import net.sourceforge.pmd.lang.plsql.PlsqlParsingHelper; class PlsqlTreeDumpTest extends BaseTreeDumpTest { diff --git a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/cpd/PLSQLCpdLexerTest.java b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/cpd/PLSQLCpdLexerTest.java index 60015818b2..777d48d8ca 100644 --- a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/cpd/PLSQLCpdLexerTest.java +++ b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/cpd/PLSQLCpdLexerTest.java @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.plsql.cpd; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest; +import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest; import net.sourceforge.pmd.lang.plsql.PLSQLLanguageModule; class PLSQLCpdLexerTest extends CpdTextComparisonTest { diff --git a/pmd-python/src/test/java/net/sourceforge/pmd/lang/python/cpd/PythonCpdLexerTest.java b/pmd-python/src/test/java/net/sourceforge/pmd/lang/python/cpd/PythonCpdLexerTest.java index 9dc1305c2f..51020acafa 100644 --- a/pmd-python/src/test/java/net/sourceforge/pmd/lang/python/cpd/PythonCpdLexerTest.java +++ b/pmd-python/src/test/java/net/sourceforge/pmd/lang/python/cpd/PythonCpdLexerTest.java @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.python.cpd; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest; +import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest; class PythonCpdLexerTest extends CpdTextComparisonTest { diff --git a/pmd-ruby/src/test/java/net/sourceforge/pmd/lang/ruby/cpd/RubyCpdLexerTest.java b/pmd-ruby/src/test/java/net/sourceforge/pmd/lang/ruby/cpd/RubyCpdLexerTest.java index 871dcbb0c2..560e65743d 100644 --- a/pmd-ruby/src/test/java/net/sourceforge/pmd/lang/ruby/cpd/RubyCpdLexerTest.java +++ b/pmd-ruby/src/test/java/net/sourceforge/pmd/lang/ruby/cpd/RubyCpdLexerTest.java @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.ruby.cpd; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest; +import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest; class RubyCpdLexerTest extends CpdTextComparisonTest { diff --git a/pmd-scala-modules/pmd-scala-common/src/test/java/net/sourceforge/pmd/cpd/ScalaCpdLexerTest.java b/pmd-scala-modules/pmd-scala-common/src/test/java/net/sourceforge/pmd/cpd/ScalaCpdLexerTest.java index b4ac2eff13..709001e821 100644 --- a/pmd-scala-modules/pmd-scala-common/src/test/java/net/sourceforge/pmd/cpd/ScalaCpdLexerTest.java +++ b/pmd-scala-modules/pmd-scala-common/src/test/java/net/sourceforge/pmd/cpd/ScalaCpdLexerTest.java @@ -8,7 +8,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest; +import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest; import net.sourceforge.pmd.lang.ast.LexException; import net.sourceforge.pmd.lang.scala.ScalaLanguageModule; diff --git a/pmd-scala-modules/pmd-scala-common/src/test/java/net/sourceforge/pmd/lang/scala/ast/ScalaParsingHelper.java b/pmd-scala-modules/pmd-scala-common/src/test/java/net/sourceforge/pmd/lang/scala/ast/ScalaParsingHelper.java index f2ce0fe7ea..685d14c435 100644 --- a/pmd-scala-modules/pmd-scala-common/src/test/java/net/sourceforge/pmd/lang/scala/ast/ScalaParsingHelper.java +++ b/pmd-scala-modules/pmd-scala-common/src/test/java/net/sourceforge/pmd/lang/scala/ast/ScalaParsingHelper.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.scala.ast; -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; import net.sourceforge.pmd.lang.scala.ScalaLanguageModule; public final class ScalaParsingHelper extends BaseParsingHelper { diff --git a/pmd-scala-modules/pmd-scala-common/src/test/kotlin/net/sourceforge/pmd/lang/scala/ast/ScalaParserTests.kt b/pmd-scala-modules/pmd-scala-common/src/test/kotlin/net/sourceforge/pmd/lang/scala/ast/ScalaParserTests.kt index b0667d9163..a778bd2e2e 100644 --- a/pmd-scala-modules/pmd-scala-common/src/test/kotlin/net/sourceforge/pmd/lang/scala/ast/ScalaParserTests.kt +++ b/pmd-scala-modules/pmd-scala-common/src/test/kotlin/net/sourceforge/pmd/lang/scala/ast/ScalaParserTests.kt @@ -4,9 +4,9 @@ package net.sourceforge.pmd.lang.scala.ast -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper -import net.sourceforge.pmd.lang.ast.test.BaseTreeDumpTest -import net.sourceforge.pmd.lang.ast.test.SimpleNodePrinter +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper +import net.sourceforge.pmd.lang.test.ast.BaseTreeDumpTest +import net.sourceforge.pmd.lang.test.ast.SimpleNodePrinter import org.junit.jupiter.api.Test class ScalaParserTests : BaseTreeDumpTest(SimpleNodePrinter, ".scala") { diff --git a/pmd-scala-modules/pmd-scala-common/src/test/kotlin/net/sourceforge/pmd/lang/scala/ast/ScalaTreeTests.kt b/pmd-scala-modules/pmd-scala-common/src/test/kotlin/net/sourceforge/pmd/lang/scala/ast/ScalaTreeTests.kt index 70dd763e4c..e20c118917 100644 --- a/pmd-scala-modules/pmd-scala-common/src/test/kotlin/net/sourceforge/pmd/lang/scala/ast/ScalaTreeTests.kt +++ b/pmd-scala-modules/pmd-scala-common/src/test/kotlin/net/sourceforge/pmd/lang/scala/ast/ScalaTreeTests.kt @@ -6,9 +6,9 @@ package net.sourceforge.pmd.lang.scala.ast import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.should -import net.sourceforge.pmd.lang.ast.test.assertPosition -import net.sourceforge.pmd.lang.ast.test.matchNode -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.assertPosition +import net.sourceforge.pmd.lang.test.ast.matchNode +import net.sourceforge.pmd.lang.test.ast.shouldBe class ScalaTreeTests : FunSpec({ diff --git a/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/ast/BaseSwiftTreeDumpTest.java b/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/ast/BaseSwiftTreeDumpTest.java index caafefa012..034eb21beb 100644 --- a/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/ast/BaseSwiftTreeDumpTest.java +++ b/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/ast/BaseSwiftTreeDumpTest.java @@ -7,8 +7,8 @@ package net.sourceforge.pmd.lang.swift.ast; import org.checkerframework.checker.nullness.qual.NonNull; -import net.sourceforge.pmd.lang.ast.test.BaseTreeDumpTest; -import net.sourceforge.pmd.lang.ast.test.NodePrintersKt; +import net.sourceforge.pmd.lang.test.ast.BaseTreeDumpTest; +import net.sourceforge.pmd.lang.test.ast.NodePrintersKt; /** * diff --git a/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/ast/SwiftParsingHelper.java b/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/ast/SwiftParsingHelper.java index b0c3aaee51..efbf253913 100644 --- a/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/ast/SwiftParsingHelper.java +++ b/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/ast/SwiftParsingHelper.java @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.swift.ast; import org.checkerframework.checker.nullness.qual.NonNull; -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; import net.sourceforge.pmd.lang.swift.SwiftLanguageModule; import net.sourceforge.pmd.lang.swift.ast.SwiftParser.SwTopLevel; diff --git a/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/cpd/SwiftCpdLexerTest.java b/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/cpd/SwiftCpdLexerTest.java index 414cc3273d..fa9b0bca5e 100644 --- a/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/cpd/SwiftCpdLexerTest.java +++ b/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/cpd/SwiftCpdLexerTest.java @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.swift.cpd; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest; +import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest; import net.sourceforge.pmd.lang.swift.SwiftLanguageModule; class SwiftCpdLexerTest extends CpdTextComparisonTest { diff --git a/pmd-tsql/src/test/java/net/sourceforge/pmd/lang/tsql/cpd/TSqlCpdLexerTest.java b/pmd-tsql/src/test/java/net/sourceforge/pmd/lang/tsql/cpd/TSqlCpdLexerTest.java index 3c2f19a322..87568ca3d6 100644 --- a/pmd-tsql/src/test/java/net/sourceforge/pmd/lang/tsql/cpd/TSqlCpdLexerTest.java +++ b/pmd-tsql/src/test/java/net/sourceforge/pmd/lang/tsql/cpd/TSqlCpdLexerTest.java @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.tsql.cpd; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest; +import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest; class TSqlCpdLexerTest extends CpdTextComparisonTest { diff --git a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/ast/VfParsingHelper.java b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/ast/VfParsingHelper.java index 4749e9a77a..2907824287 100644 --- a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/ast/VfParsingHelper.java +++ b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/ast/VfParsingHelper.java @@ -7,7 +7,7 @@ package net.sourceforge.pmd.lang.vf.ast; import org.checkerframework.checker.nullness.qual.NonNull; import net.sourceforge.pmd.lang.LanguageProcessorRegistry; -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; import net.sourceforge.pmd.lang.vf.VFTestUtils; import net.sourceforge.pmd.lang.vf.VfLanguageModule; diff --git a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/cpd/VfCpdLexerTest.java b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/cpd/VfCpdLexerTest.java index 3c42acc6c9..2f9a6280ba 100644 --- a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/cpd/VfCpdLexerTest.java +++ b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/cpd/VfCpdLexerTest.java @@ -7,7 +7,7 @@ package net.sourceforge.pmd.lang.vf.cpd; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest; +import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest; class VfCpdLexerTest extends CpdTextComparisonTest { diff --git a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/VmParsingHelper.java b/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/VmParsingHelper.java index 85152ef4ba..6ce7377671 100644 --- a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/VmParsingHelper.java +++ b/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/VmParsingHelper.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.vm; -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; import net.sourceforge.pmd.lang.vm.ast.ASTTemplate; public final class VmParsingHelper extends BaseParsingHelper { diff --git a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/cpd/VmCpdLexerTest.java b/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/cpd/VmCpdLexerTest.java index 3c7eebefaf..be9fc01a2c 100644 --- a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/cpd/VmCpdLexerTest.java +++ b/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/cpd/VmCpdLexerTest.java @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.vm.cpd; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest; +import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest; import net.sourceforge.pmd.lang.vm.VmLanguageModule; class VmCpdLexerTest extends CpdTextComparisonTest { diff --git a/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/XmlParsingHelper.java b/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/XmlParsingHelper.java index 8274414d82..ea42a0e616 100644 --- a/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/XmlParsingHelper.java +++ b/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/XmlParsingHelper.java @@ -5,7 +5,7 @@ package net.sourceforge.pmd.lang.xml; import net.sourceforge.pmd.lang.PmdCapableLanguage; -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; import net.sourceforge.pmd.lang.xml.ast.internal.XmlParserImpl.RootXmlNode; /** diff --git a/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/ast/XmlCoordinatesTest.java b/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/ast/XmlCoordinatesTest.java index 02b58fc3f4..845b78fcca 100644 --- a/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/ast/XmlCoordinatesTest.java +++ b/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/ast/XmlCoordinatesTest.java @@ -7,10 +7,10 @@ package net.sourceforge.pmd.lang.xml.ast; import org.checkerframework.checker.nullness.qual.NonNull; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; -import net.sourceforge.pmd.lang.ast.test.BaseTreeDumpTest; -import net.sourceforge.pmd.lang.ast.test.CoordinatesPrinter; -import net.sourceforge.pmd.lang.ast.test.TestUtilsKt; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; +import net.sourceforge.pmd.lang.test.ast.BaseTreeDumpTest; +import net.sourceforge.pmd.lang.test.ast.CoordinatesPrinter; +import net.sourceforge.pmd.lang.test.ast.TestUtilsKt; import net.sourceforge.pmd.lang.xml.XmlParsingHelper; class XmlCoordinatesTest extends BaseTreeDumpTest { diff --git a/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/ast/XmlParserTest.java b/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/ast/XmlParserTest.java index 9ca42bcea4..6d43085f77 100644 --- a/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/ast/XmlParserTest.java +++ b/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/ast/XmlParserTest.java @@ -7,9 +7,9 @@ package net.sourceforge.pmd.lang.xml.ast; import org.checkerframework.checker.nullness.qual.NonNull; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; -import net.sourceforge.pmd.lang.ast.test.BaseTreeDumpTest; -import net.sourceforge.pmd.lang.ast.test.RelevantAttributePrinter; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; +import net.sourceforge.pmd.lang.test.ast.BaseTreeDumpTest; +import net.sourceforge.pmd.lang.test.ast.RelevantAttributePrinter; import net.sourceforge.pmd.lang.xml.XmlParsingHelper; class XmlParserTest extends BaseTreeDumpTest { diff --git a/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/cpd/XmlCPDCpdLexerTest.java b/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/cpd/XmlCPDCpdLexerTest.java index fa94b5f390..5e6c2a8f98 100644 --- a/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/cpd/XmlCPDCpdLexerTest.java +++ b/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/cpd/XmlCPDCpdLexerTest.java @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.xml.cpd; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest; +import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest; import net.sourceforge.pmd.lang.xml.XmlLanguageModule; class XmlCPDCpdLexerTest extends CpdTextComparisonTest { diff --git a/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/rule/XmlXPathRuleTest.java b/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/rule/XmlXPathRuleTest.java index a0cea77ac4..64a31dba0a 100644 --- a/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/rule/XmlXPathRuleTest.java +++ b/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/rule/XmlXPathRuleTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.xml.rule; -import static net.sourceforge.pmd.lang.ast.test.TestUtilsKt.assertSize; +import static net.sourceforge.pmd.lang.test.ast.TestUtilsKt.assertSize; import org.junit.jupiter.api.Test; From 9c5cef2566eb7c30c22909f5ea536ad75ff2b179 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 23 Feb 2024 12:34:15 +0100 Subject: [PATCH 24/52] [scala] Remove deprecated module pmd-scala, consolidate packages --- docs/pages/release_notes.md | 4 ++++ .../pmd/lang/scala/ScalaLanguageModule.java | 2 +- .../{ => lang/scala}/cpd/ScalaCpdLexer.java | 4 +++- .../scala}/cpd/ScalaTokenAdapter.java | 2 +- .../scala}/cpd/ScalaCpdLexerTest.java | 9 ++------ pmd-scala/pom.xml | 23 ------------------- pom.xml | 1 - 7 files changed, 11 insertions(+), 34 deletions(-) rename pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/{ => lang/scala}/cpd/ScalaCpdLexer.java (97%) rename pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/{ => lang/scala}/cpd/ScalaTokenAdapter.java (97%) rename pmd-scala-modules/pmd-scala-common/src/test/java/net/sourceforge/pmd/{ => lang/scala}/cpd/ScalaCpdLexerTest.java (86%) delete mode 100644 pmd-scala/pom.xml diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 7c00ac8e22..093c179208 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -338,6 +338,9 @@ in the migration guide for details. * {%jdoc lang-test::lang.test.cpd.CpdTextComparisonTest %} (moved from `net.sourceforge.pmd.cpd.test.CpdTextComparisonTest`) * {%jdoc lang-test::lang.test.ast.BaseTreeDumpTest %} (moved from `net.sourceforge.pmd.lang.ast.test.BaseTreeDumpTest`) * Any many other types have been moved from `net.sourceforge.pmd.lang.ast.test` to `net.sourceforge.pmd.lang.test`. +* pmd-scala + * {%jdoc scala::lang.scala.cpd.ScalaCpdLexer %} (moved from `net.sourceforge.pmd.lang.scala.cpd.ScalaCpdLexer`) + * {%jdoc scala::lang.scala.cpd.ScalaTokenAdapter %} (moved from `net.sourceforge.pmd.lang.scala.cpd.ScalaTokenAdapter`) **Internalized classes and interfaces and methods** @@ -668,6 +671,7 @@ The annotation `@DeprecatedUntil700` has been removed. * {%jdoc !!plsql::lang.plsql.ast.PLSQLNode %} - method `jjtAccept()` has been removed. Use {%jdoc core::lang.ast.Node#acceptVisitor(core::lang.ast.AstVisitor,P) %} instead. * pmd-scala + * The maven module `pmd-scala` has been removed. Use `pmd-scala_2.13` or `pmd-scala_2.12` instead. * {%jdoc !!scala::lang.scala.ast.ScalaNode %} * Method `accept()` has been removed. Use {%jdoc core::lang.ast.Node#acceptVisitor(core::lang.ast.AstVisitor,P) %} instead. * Method `getNode()` has been removed. The underlying node is only available in AST nodes, but not in rule implementations. diff --git a/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/ScalaLanguageModule.java b/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/ScalaLanguageModule.java index 6268b5ad95..2df08f131b 100644 --- a/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/ScalaLanguageModule.java +++ b/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/ScalaLanguageModule.java @@ -5,7 +5,7 @@ package net.sourceforge.pmd.lang.scala; import net.sourceforge.pmd.cpd.CpdLexer; -import net.sourceforge.pmd.cpd.ScalaCpdLexer; +import net.sourceforge.pmd.lang.scala.cpd.ScalaCpdLexer; import net.sourceforge.pmd.lang.LanguagePropertyBundle; import net.sourceforge.pmd.lang.LanguageRegistry; import net.sourceforge.pmd.lang.impl.SimpleLanguageModuleBase; diff --git a/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/cpd/ScalaCpdLexer.java b/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/cpd/ScalaCpdLexer.java similarity index 97% rename from pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/cpd/ScalaCpdLexer.java rename to pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/cpd/ScalaCpdLexer.java index 4ee8f45f18..5e4ea36e4d 100644 --- a/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/cpd/ScalaCpdLexer.java +++ b/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/cpd/ScalaCpdLexer.java @@ -2,10 +2,12 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.cpd; +package net.sourceforge.pmd.lang.scala.cpd; import org.apache.commons.lang3.StringUtils; +import net.sourceforge.pmd.cpd.CpdLexer; +import net.sourceforge.pmd.cpd.TokenFactory; import net.sourceforge.pmd.cpd.impl.BaseTokenFilter; import net.sourceforge.pmd.lang.LanguagePropertyBundle; import net.sourceforge.pmd.lang.LanguageVersion; diff --git a/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/cpd/ScalaTokenAdapter.java b/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/cpd/ScalaTokenAdapter.java similarity index 97% rename from pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/cpd/ScalaTokenAdapter.java rename to pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/cpd/ScalaTokenAdapter.java index 3609cd8efb..828b8bd4d1 100644 --- a/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/cpd/ScalaTokenAdapter.java +++ b/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/cpd/ScalaTokenAdapter.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.cpd; +package net.sourceforge.pmd.lang.scala.cpd; import net.sourceforge.pmd.lang.ast.GenericToken; import net.sourceforge.pmd.lang.document.Chars; diff --git a/pmd-scala-modules/pmd-scala-common/src/test/java/net/sourceforge/pmd/cpd/ScalaCpdLexerTest.java b/pmd-scala-modules/pmd-scala-common/src/test/java/net/sourceforge/pmd/lang/scala/cpd/ScalaCpdLexerTest.java similarity index 86% rename from pmd-scala-modules/pmd-scala-common/src/test/java/net/sourceforge/pmd/cpd/ScalaCpdLexerTest.java rename to pmd-scala-modules/pmd-scala-common/src/test/java/net/sourceforge/pmd/lang/scala/cpd/ScalaCpdLexerTest.java index 709001e821..57056e6355 100644 --- a/pmd-scala-modules/pmd-scala-common/src/test/java/net/sourceforge/pmd/cpd/ScalaCpdLexerTest.java +++ b/pmd-scala-modules/pmd-scala-common/src/test/java/net/sourceforge/pmd/lang/scala/cpd/ScalaCpdLexerTest.java @@ -2,15 +2,15 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.cpd; +package net.sourceforge.pmd.lang.scala.cpd; import static org.junit.jupiter.api.Assertions.assertThrows; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest; import net.sourceforge.pmd.lang.ast.LexException; import net.sourceforge.pmd.lang.scala.ScalaLanguageModule; +import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest; class ScalaCpdLexerTest extends CpdTextComparisonTest { @@ -18,11 +18,6 @@ class ScalaCpdLexerTest extends CpdTextComparisonTest { super(ScalaLanguageModule.getInstance(), ".scala"); } - @Override - protected String getResourcePrefix() { - return "../lang/scala/cpd/testdata"; - } - @Test void testSample() { doTest("sample-LiftActor"); diff --git a/pmd-scala/pom.xml b/pmd-scala/pom.xml deleted file mode 100644 index f61d17c8ae..0000000000 --- a/pmd-scala/pom.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - 4.0.0 - pmd-scala - PMD Scala - Transitional package (deprecated) - This is deprecated, use pmd-scala_2.13 directly - pom - - - net.sourceforge.pmd - pmd - 7.0.0-SNAPSHOT - ../pom.xml - - - - - ${project.groupId} - pmd-scala_2.13 - ${project.version} - - - diff --git a/pom.xml b/pom.xml index 6ec5b87af0..e37389959f 100644 --- a/pom.xml +++ b/pom.xml @@ -1275,7 +1275,6 @@ pmd-plsql pmd-python pmd-ruby - pmd-scala pmd-scala-modules/pmd-scala-common pmd-scala-modules/pmd-scala_2.13 pmd-scala-modules/pmd-scala_2.12 From 5c5456a6bfba4ca086f9fa9eab0acf010b6aeb80 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 23 Feb 2024 12:43:32 +0100 Subject: [PATCH 25/52] [xml] Consolidate packages for Pom, Wsdl, Xsl language modules --- docs/pages/release_notes.md | 4 ++++ .../pmd/lang/{ => xml}/pom/PomLanguageModule.java | 2 +- .../pmd/lang/{ => xml}/wsdl/WsdlLanguageModule.java | 2 +- .../pmd/lang/{ => xml}/xsl/XslLanguageModule.java | 2 +- .../META-INF/services/net.sourceforge.pmd.lang.Language | 6 +++--- .../net/sourceforge/pmd/lang/xml/LanguageVersionTest.java | 6 +++--- .../net/sourceforge/pmd/{ant => lang/xml}/PMDTaskTest.java | 5 ++++- .../pom/rule/errorprone/InvalidDependencyTypesTest.java | 2 +- .../errorprone/ProjectVersionAsDependencyVersionTest.java | 2 +- .../{ => xml}/xsl/rule/codestyle/UseConcatOnceTest.java | 2 +- .../xsl/rule/performance/AvoidAxisNavigationTest.java | 2 +- .../net/sourceforge/pmd/{ant => lang}/xml/pmdtasktest.xml | 0 .../pom/rule/errorprone/xml/InvalidDependencyTypes.xml | 0 .../errorprone/xml/ProjectVersionAsDependencyVersion.xml | 0 .../lang/{ => xml}/xsl/rule/codestyle/xml/UseConcatOnce.xml | 0 .../xsl/rule/performance/xml/AvoidAxisNavigation.xml | 0 16 files changed, 21 insertions(+), 14 deletions(-) rename pmd-xml/src/main/java/net/sourceforge/pmd/lang/{ => xml}/pom/PomLanguageModule.java (96%) rename pmd-xml/src/main/java/net/sourceforge/pmd/lang/{ => xml}/wsdl/WsdlLanguageModule.java (96%) rename pmd-xml/src/main/java/net/sourceforge/pmd/lang/{ => xml}/xsl/XslLanguageModule.java (96%) rename pmd-xml/src/test/java/net/sourceforge/pmd/{ant => lang/xml}/PMDTaskTest.java (71%) rename pmd-xml/src/test/java/net/sourceforge/pmd/lang/{ => xml}/pom/rule/errorprone/InvalidDependencyTypesTest.java (80%) rename pmd-xml/src/test/java/net/sourceforge/pmd/lang/{ => xml}/pom/rule/errorprone/ProjectVersionAsDependencyVersionTest.java (80%) rename pmd-xml/src/test/java/net/sourceforge/pmd/lang/{ => xml}/xsl/rule/codestyle/UseConcatOnceTest.java (79%) rename pmd-xml/src/test/java/net/sourceforge/pmd/lang/{ => xml}/xsl/rule/performance/AvoidAxisNavigationTest.java (79%) rename pmd-xml/src/test/resources/net/sourceforge/pmd/{ant => lang}/xml/pmdtasktest.xml (100%) rename pmd-xml/src/test/resources/net/sourceforge/pmd/lang/{ => xml}/pom/rule/errorprone/xml/InvalidDependencyTypes.xml (100%) rename pmd-xml/src/test/resources/net/sourceforge/pmd/lang/{ => xml}/pom/rule/errorprone/xml/ProjectVersionAsDependencyVersion.xml (100%) rename pmd-xml/src/test/resources/net/sourceforge/pmd/lang/{ => xml}/xsl/rule/codestyle/xml/UseConcatOnce.xml (100%) rename pmd-xml/src/test/resources/net/sourceforge/pmd/lang/{ => xml}/xsl/rule/performance/xml/AvoidAxisNavigation.xml (100%) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 093c179208..12382eba63 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -341,6 +341,10 @@ in the migration guide for details. * pmd-scala * {%jdoc scala::lang.scala.cpd.ScalaCpdLexer %} (moved from `net.sourceforge.pmd.lang.scala.cpd.ScalaCpdLexer`) * {%jdoc scala::lang.scala.cpd.ScalaTokenAdapter %} (moved from `net.sourceforge.pmd.lang.scala.cpd.ScalaTokenAdapter`) +* pmd-xml + * {%jdoc xml::lang.xml.pom.PomLanguageModule %} (moved from `net.sourceforge.pmd.lang.pom.PomLanguageModule`) + * {%jdoc xml::lang.xml.wsdl.WsdlLanguageModule %} (moved from `net.sourceforge.pmd.lang.wsdl.WsdlLanguageModule`) + * {%jdoc xml::lang.xml.xsl.XslLanguageModule %} (moved from `net.sourceforge.pmd.lang.xsl.XslLanguageModule`) **Internalized classes and interfaces and methods** diff --git a/pmd-xml/src/main/java/net/sourceforge/pmd/lang/pom/PomLanguageModule.java b/pmd-xml/src/main/java/net/sourceforge/pmd/lang/xml/pom/PomLanguageModule.java similarity index 96% rename from pmd-xml/src/main/java/net/sourceforge/pmd/lang/pom/PomLanguageModule.java rename to pmd-xml/src/main/java/net/sourceforge/pmd/lang/xml/pom/PomLanguageModule.java index 8031b73394..eb133f56e5 100644 --- a/pmd-xml/src/main/java/net/sourceforge/pmd/lang/pom/PomLanguageModule.java +++ b/pmd-xml/src/main/java/net/sourceforge/pmd/lang/xml/pom/PomLanguageModule.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.pom; +package net.sourceforge.pmd.lang.xml.pom; import net.sourceforge.pmd.cpd.CpdLexer; import net.sourceforge.pmd.lang.LanguagePropertyBundle; diff --git a/pmd-xml/src/main/java/net/sourceforge/pmd/lang/wsdl/WsdlLanguageModule.java b/pmd-xml/src/main/java/net/sourceforge/pmd/lang/xml/wsdl/WsdlLanguageModule.java similarity index 96% rename from pmd-xml/src/main/java/net/sourceforge/pmd/lang/wsdl/WsdlLanguageModule.java rename to pmd-xml/src/main/java/net/sourceforge/pmd/lang/xml/wsdl/WsdlLanguageModule.java index 1ae01b9bf9..b439f019d3 100644 --- a/pmd-xml/src/main/java/net/sourceforge/pmd/lang/wsdl/WsdlLanguageModule.java +++ b/pmd-xml/src/main/java/net/sourceforge/pmd/lang/xml/wsdl/WsdlLanguageModule.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.wsdl; +package net.sourceforge.pmd.lang.xml.wsdl; import net.sourceforge.pmd.cpd.CpdLexer; import net.sourceforge.pmd.lang.LanguagePropertyBundle; diff --git a/pmd-xml/src/main/java/net/sourceforge/pmd/lang/xsl/XslLanguageModule.java b/pmd-xml/src/main/java/net/sourceforge/pmd/lang/xml/xsl/XslLanguageModule.java similarity index 96% rename from pmd-xml/src/main/java/net/sourceforge/pmd/lang/xsl/XslLanguageModule.java rename to pmd-xml/src/main/java/net/sourceforge/pmd/lang/xml/xsl/XslLanguageModule.java index 6bbdbed637..422cccd853 100644 --- a/pmd-xml/src/main/java/net/sourceforge/pmd/lang/xsl/XslLanguageModule.java +++ b/pmd-xml/src/main/java/net/sourceforge/pmd/lang/xml/xsl/XslLanguageModule.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.xsl; +package net.sourceforge.pmd.lang.xml.xsl; import net.sourceforge.pmd.cpd.CpdLexer; import net.sourceforge.pmd.lang.LanguagePropertyBundle; diff --git a/pmd-xml/src/main/resources/META-INF/services/net.sourceforge.pmd.lang.Language b/pmd-xml/src/main/resources/META-INF/services/net.sourceforge.pmd.lang.Language index 35164afbd5..68439b0d58 100644 --- a/pmd-xml/src/main/resources/META-INF/services/net.sourceforge.pmd.lang.Language +++ b/pmd-xml/src/main/resources/META-INF/services/net.sourceforge.pmd.lang.Language @@ -1,4 +1,4 @@ net.sourceforge.pmd.lang.xml.XmlLanguageModule -net.sourceforge.pmd.lang.xsl.XslLanguageModule -net.sourceforge.pmd.lang.wsdl.WsdlLanguageModule -net.sourceforge.pmd.lang.pom.PomLanguageModule \ No newline at end of file +net.sourceforge.pmd.lang.xml.xsl.XslLanguageModule +net.sourceforge.pmd.lang.xml.wsdl.WsdlLanguageModule +net.sourceforge.pmd.lang.xml.pom.PomLanguageModule diff --git a/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/LanguageVersionTest.java b/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/LanguageVersionTest.java index d954a4585f..463babc041 100644 --- a/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/LanguageVersionTest.java +++ b/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/LanguageVersionTest.java @@ -8,9 +8,9 @@ import java.util.Arrays; import java.util.Collection; import net.sourceforge.pmd.AbstractLanguageVersionTest; -import net.sourceforge.pmd.lang.pom.PomLanguageModule; -import net.sourceforge.pmd.lang.wsdl.WsdlLanguageModule; -import net.sourceforge.pmd.lang.xsl.XslLanguageModule; +import net.sourceforge.pmd.lang.xml.pom.PomLanguageModule; +import net.sourceforge.pmd.lang.xml.wsdl.WsdlLanguageModule; +import net.sourceforge.pmd.lang.xml.xsl.XslLanguageModule; class LanguageVersionTest extends AbstractLanguageVersionTest { diff --git a/pmd-xml/src/test/java/net/sourceforge/pmd/ant/PMDTaskTest.java b/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/PMDTaskTest.java similarity index 71% rename from pmd-xml/src/test/java/net/sourceforge/pmd/ant/PMDTaskTest.java rename to pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/PMDTaskTest.java index 3f185454c6..f3a873ff13 100644 --- a/pmd-xml/src/test/java/net/sourceforge/pmd/ant/PMDTaskTest.java +++ b/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/PMDTaskTest.java @@ -2,13 +2,16 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.ant; +package net.sourceforge.pmd.lang.xml; import org.junit.jupiter.api.Test; +import net.sourceforge.pmd.ant.AbstractAntTestHelper; + class PMDTaskTest extends AbstractAntTestHelper { PMDTaskTest() { + super.pathToTestScript = "target/test-classes/net/sourceforge/pmd/lang/xml"; super.antTestScriptFilename = "pmdtasktest.xml"; } diff --git a/pmd-xml/src/test/java/net/sourceforge/pmd/lang/pom/rule/errorprone/InvalidDependencyTypesTest.java b/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/pom/rule/errorprone/InvalidDependencyTypesTest.java similarity index 80% rename from pmd-xml/src/test/java/net/sourceforge/pmd/lang/pom/rule/errorprone/InvalidDependencyTypesTest.java rename to pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/pom/rule/errorprone/InvalidDependencyTypesTest.java index 6b0d07f0a0..0b6dd1f036 100644 --- a/pmd-xml/src/test/java/net/sourceforge/pmd/lang/pom/rule/errorprone/InvalidDependencyTypesTest.java +++ b/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/pom/rule/errorprone/InvalidDependencyTypesTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.pom.rule.errorprone; +package net.sourceforge.pmd.lang.xml.pom.rule.errorprone; import net.sourceforge.pmd.testframework.PmdRuleTst; diff --git a/pmd-xml/src/test/java/net/sourceforge/pmd/lang/pom/rule/errorprone/ProjectVersionAsDependencyVersionTest.java b/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/pom/rule/errorprone/ProjectVersionAsDependencyVersionTest.java similarity index 80% rename from pmd-xml/src/test/java/net/sourceforge/pmd/lang/pom/rule/errorprone/ProjectVersionAsDependencyVersionTest.java rename to pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/pom/rule/errorprone/ProjectVersionAsDependencyVersionTest.java index 18b8bfc6da..78805a4fc3 100644 --- a/pmd-xml/src/test/java/net/sourceforge/pmd/lang/pom/rule/errorprone/ProjectVersionAsDependencyVersionTest.java +++ b/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/pom/rule/errorprone/ProjectVersionAsDependencyVersionTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.pom.rule.errorprone; +package net.sourceforge.pmd.lang.xml.pom.rule.errorprone; import net.sourceforge.pmd.testframework.PmdRuleTst; diff --git a/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xsl/rule/codestyle/UseConcatOnceTest.java b/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/xsl/rule/codestyle/UseConcatOnceTest.java similarity index 79% rename from pmd-xml/src/test/java/net/sourceforge/pmd/lang/xsl/rule/codestyle/UseConcatOnceTest.java rename to pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/xsl/rule/codestyle/UseConcatOnceTest.java index 6d5c00f87f..b4ea085fb1 100644 --- a/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xsl/rule/codestyle/UseConcatOnceTest.java +++ b/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/xsl/rule/codestyle/UseConcatOnceTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.xsl.rule.codestyle; +package net.sourceforge.pmd.lang.xml.xsl.rule.codestyle; import net.sourceforge.pmd.testframework.PmdRuleTst; diff --git a/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xsl/rule/performance/AvoidAxisNavigationTest.java b/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/xsl/rule/performance/AvoidAxisNavigationTest.java similarity index 79% rename from pmd-xml/src/test/java/net/sourceforge/pmd/lang/xsl/rule/performance/AvoidAxisNavigationTest.java rename to pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/xsl/rule/performance/AvoidAxisNavigationTest.java index c08d1e9c0c..741f2598fa 100644 --- a/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xsl/rule/performance/AvoidAxisNavigationTest.java +++ b/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/xsl/rule/performance/AvoidAxisNavigationTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.xsl.rule.performance; +package net.sourceforge.pmd.lang.xml.xsl.rule.performance; import net.sourceforge.pmd.testframework.PmdRuleTst; diff --git a/pmd-xml/src/test/resources/net/sourceforge/pmd/ant/xml/pmdtasktest.xml b/pmd-xml/src/test/resources/net/sourceforge/pmd/lang/xml/pmdtasktest.xml similarity index 100% rename from pmd-xml/src/test/resources/net/sourceforge/pmd/ant/xml/pmdtasktest.xml rename to pmd-xml/src/test/resources/net/sourceforge/pmd/lang/xml/pmdtasktest.xml diff --git a/pmd-xml/src/test/resources/net/sourceforge/pmd/lang/pom/rule/errorprone/xml/InvalidDependencyTypes.xml b/pmd-xml/src/test/resources/net/sourceforge/pmd/lang/xml/pom/rule/errorprone/xml/InvalidDependencyTypes.xml similarity index 100% rename from pmd-xml/src/test/resources/net/sourceforge/pmd/lang/pom/rule/errorprone/xml/InvalidDependencyTypes.xml rename to pmd-xml/src/test/resources/net/sourceforge/pmd/lang/xml/pom/rule/errorprone/xml/InvalidDependencyTypes.xml diff --git a/pmd-xml/src/test/resources/net/sourceforge/pmd/lang/pom/rule/errorprone/xml/ProjectVersionAsDependencyVersion.xml b/pmd-xml/src/test/resources/net/sourceforge/pmd/lang/xml/pom/rule/errorprone/xml/ProjectVersionAsDependencyVersion.xml similarity index 100% rename from pmd-xml/src/test/resources/net/sourceforge/pmd/lang/pom/rule/errorprone/xml/ProjectVersionAsDependencyVersion.xml rename to pmd-xml/src/test/resources/net/sourceforge/pmd/lang/xml/pom/rule/errorprone/xml/ProjectVersionAsDependencyVersion.xml diff --git a/pmd-xml/src/test/resources/net/sourceforge/pmd/lang/xsl/rule/codestyle/xml/UseConcatOnce.xml b/pmd-xml/src/test/resources/net/sourceforge/pmd/lang/xml/xsl/rule/codestyle/xml/UseConcatOnce.xml similarity index 100% rename from pmd-xml/src/test/resources/net/sourceforge/pmd/lang/xsl/rule/codestyle/xml/UseConcatOnce.xml rename to pmd-xml/src/test/resources/net/sourceforge/pmd/lang/xml/xsl/rule/codestyle/xml/UseConcatOnce.xml diff --git a/pmd-xml/src/test/resources/net/sourceforge/pmd/lang/xsl/rule/performance/xml/AvoidAxisNavigation.xml b/pmd-xml/src/test/resources/net/sourceforge/pmd/lang/xml/xsl/rule/performance/xml/AvoidAxisNavigation.xml similarity index 100% rename from pmd-xml/src/test/resources/net/sourceforge/pmd/lang/xsl/rule/performance/xml/AvoidAxisNavigation.xml rename to pmd-xml/src/test/resources/net/sourceforge/pmd/lang/xml/xsl/rule/performance/xml/AvoidAxisNavigation.xml From 845154716cd019cac5df45c1c71d15c337f5b7a3 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 23 Feb 2024 13:01:07 +0100 Subject: [PATCH 26/52] [test] Consolidate packages, move PmdRuleTst, SimpleAggregatorTst --- docs/pages/pmd/userdocs/extending/testing.md | 20 +++++++++---------- docs/pages/pmd/userdocs/migrating_to_pmd7.md | 4 ++++ docs/pages/release_notes.md | 7 +++++++ .../pmd/lang/apex/LanguageVersionTest.java | 2 +- .../pmd/lang/apex/QuickstartRulesetTest.java | 2 +- .../pmd/lang/apex/RuleSetFactoryTest.java | 2 +- .../apex/metrics/impl/AllMetricsTest.java | 2 +- ...pexAssertionsShouldIncludeMessageTest.java | 2 +- ...pexUnitTestClassShouldHaveAssertsTest.java | 2 +- .../ApexUnitTestClassShouldHaveRunAsTest.java | 2 +- ...tMethodShouldHaveIsTestAnnotationTest.java | 2 +- ...nitTestShouldNotUseSeeAllDataTrueTest.java | 2 +- .../AvoidGlobalModifierTest.java | 2 +- .../AvoidLogicInTriggerTest.java | 2 +- .../DebugsShouldUseLoggingLevelTest.java | 2 +- .../UnusedLocalVariableTest.java | 2 +- .../codestyle/ClassNamingConventionsTest.java | 2 +- .../FieldDeclarationsShouldBeAtStartTest.java | 2 +- .../codestyle/FieldNamingConventionsTest.java | 2 +- .../codestyle/ForLoopsMustUseBracesTest.java | 2 +- .../FormalParameterNamingConventionsTest.java | 2 +- .../IfElseStmtsMustUseBracesTest.java | 2 +- .../codestyle/IfStmtsMustUseBracesTest.java | 2 +- .../LocalVariableNamingConventionsTest.java | 2 +- .../MethodNamingConventionsTest.java | 2 +- .../codestyle/OneDeclarationPerLineTest.java | 2 +- .../PropertyNamingConventionsTest.java | 2 +- .../WhileLoopsMustUseBracesTest.java | 2 +- .../design/AvoidDeeplyNestedIfStmtsTest.java | 2 +- .../rule/design/CognitiveComplexityTest.java | 2 +- .../rule/design/CyclomaticComplexityTest.java | 2 +- .../rule/design/ExcessiveClassLengthTest.java | 2 +- .../design/ExcessiveParameterListTest.java | 2 +- .../rule/design/ExcessivePublicCountTest.java | 2 +- .../rule/design/NcssConstructorCountTest.java | 2 +- .../apex/rule/design/NcssMethodCountTest.java | 2 +- .../apex/rule/design/NcssTypeCountTest.java | 2 +- .../apex/rule/design/TooManyFieldsTest.java | 2 +- .../apex/rule/documentation/ApexDocTest.java | 2 +- .../apex/rule/errorprone/ApexCSRFTest.java | 2 +- .../AvoidDirectAccessTriggerMapTest.java | 2 +- .../errorprone/AvoidHardcodingIdTest.java | 2 +- .../AvoidNonExistentAnnotationsTest.java | 2 +- .../rule/errorprone/EmptyCatchBlockTest.java | 2 +- .../apex/rule/errorprone/EmptyIfStmtTest.java | 2 +- .../errorprone/EmptyStatementBlockTest.java | 2 +- .../EmptyTryOrFinallyBlockTest.java | 2 +- .../rule/errorprone/EmptyWhileStmtTest.java | 2 +- .../InaccessibleAuraEnabledGetterTest.java | 2 +- ...ethodWithSameNameAsEnclosingClassTest.java | 2 +- .../OverrideBothEqualsAndHashcodeTest.java | 2 +- .../TestMethodsMustBeInTestClassesTest.java | 2 +- .../performance/AvoidDebugStatementsTest.java | 2 +- ...agerlyLoadedDescribeSObjectResultTest.java | 2 +- .../OperationWithHighCostInLoopTest.java | 2 +- .../OperationWithLimitsInLoopTest.java | 2 +- .../apex/rule/security/ApexBadCryptoTest.java | 2 +- .../rule/security/ApexCRUDViolationTest.java | 2 +- .../security/ApexDangerousMethodsTest.java | 2 +- .../security/ApexInsecureEndpointTest.java | 2 +- .../rule/security/ApexOpenRedirectTest.java | 2 +- .../rule/security/ApexSOQLInjectionTest.java | 2 +- .../security/ApexSharingViolationsTest.java | 2 +- .../ApexSuggestUsingNamedCredTest.java | 2 +- .../security/ApexXSSFromEscapeFalseTest.java | 2 +- .../security/ApexXSSFromURLParamTest.java | 2 +- .../pmd/lang/rule/InternalApiBridge.java | 7 +++++++ .../pmd/lang/html/LanguageVersionTest.java | 2 +- .../pmd/lang/html/RuleSetFactoryTest.java | 2 +- .../bestpractices/AvoidInlineStylesTest.java | 2 +- .../UnnecessaryTypeAttributeTest.java | 2 +- .../UseAltAttributeForImagesTest.java | 2 +- .../net/sourceforge/pmd/ant/PMDTaskTest.java | 1 + .../pmd/lang/java/LanguageVersionTest.java | 6 +++--- .../pmd/lang/java/QuickstartRulesetTest.java | 2 +- .../pmd/lang/java/RuleSetFactoryTest.java | 2 +- .../java/metrics/impl/AllMetricsTest.java | 2 +- ...bstractClassWithoutAbstractMethodTest.java | 2 +- .../AccessorClassGenerationTest.java | 2 +- .../AccessorMethodGenerationTest.java | 2 +- .../ArrayIsStoredDirectlyTest.java | 2 +- .../AvoidMessageDigestFieldTest.java | 2 +- .../AvoidPrintStackTraceTest.java | 2 +- .../AvoidReassigningCatchVariablesTest.java | 2 +- .../AvoidReassigningLoopVariablesTest.java | 2 +- .../AvoidReassigningParametersTest.java | 2 +- .../AvoidStringBufferFieldTest.java | 2 +- .../AvoidUsingHardCodedIPTest.java | 2 +- .../bestpractices/CheckResultSetTest.java | 2 +- .../ConstantsInInterfaceTest.java | 2 +- .../DefaultLabelNotLastInSwitchStmtTest.java | 2 +- .../DoubleBraceInitializationTest.java | 2 +- .../ForLoopCanBeForeachTest.java | 2 +- .../ForLoopVariableCountTest.java | 2 +- .../bestpractices/GuardLogStatementTest.java | 2 +- ...it4SuitesShouldUseSuiteAnnotationTest.java | 2 +- ...Unit4TestShouldUseAfterAnnotationTest.java | 2 +- ...nit4TestShouldUseBeforeAnnotationTest.java | 2 +- ...JUnit4TestShouldUseTestAnnotationTest.java | 2 +- .../JUnit5TestShouldBePackagePrivateTest.java | 2 +- ...nitAssertionsShouldIncludeMessageTest.java | 2 +- .../JUnitTestContainsTooManyAssertsTest.java | 2 +- .../JUnitTestsShouldIncludeAssertTest.java | 2 +- .../bestpractices/JUnitUseExpectedTest.java | 2 +- .../LiteralsFirstInComparisonsTest.java | 2 +- .../rule/bestpractices/LooseCouplingTest.java | 2 +- .../MethodReturnsInternalArrayTest.java | 2 +- .../bestpractices/MissingOverrideTest.java | 2 +- .../OneDeclarationPerLineTest.java | 2 +- .../bestpractices/PreserveStackTraceTest.java | 2 +- .../PrimitiveWrapperInstantiationTest.java | 2 +- .../ReplaceEnumerationWithIteratorTest.java | 2 +- .../ReplaceHashtableWithMapTest.java | 2 +- .../ReplaceVectorWithListTest.java | 2 +- .../SimplifiableTestAssertionTest.java | 2 +- .../SwitchStmtsShouldHaveDefaultTest.java | 2 +- .../rule/bestpractices/SystemPrintlnTest.java | 2 +- .../bestpractices/UnusedAssignmentTest.java | 2 +- .../UnusedFormalParameterTest.java | 2 +- .../UnusedLocalVariableTest.java | 2 +- .../bestpractices/UnusedPrivateFieldTest.java | 2 +- .../UnusedPrivateMethodTest.java | 2 +- .../UseCollectionIsEmptyTest.java | 2 +- .../UseStandardCharsetsTest.java | 2 +- .../UseTryWithResourcesTest.java | 2 +- .../rule/bestpractices/UseVarargsTest.java | 2 +- .../WhileLoopWithLiteralBooleanTest.java | 2 +- .../codestyle/AtLeastOneConstructorTest.java | 2 +- .../rule/codestyle/AvoidDollarSignsTest.java | 2 +- .../AvoidProtectedFieldInFinalClassTest.java | 2 +- ...tedMethodInFinalClassNotExtendingTest.java | 2 +- .../codestyle/AvoidUsingNativeCodeTest.java | 2 +- .../codestyle/BooleanGetMethodNameTest.java | 2 +- .../codestyle/CallSuperInConstructorTest.java | 2 +- .../codestyle/ClassNamingConventionsTest.java | 2 +- .../CommentDefaultAccessModifierTest.java | 2 +- .../rule/codestyle/ConfusingTernaryTest.java | 2 +- .../codestyle/ControlStatementBracesTest.java | 2 +- .../codestyle/EmptyControlStatementTest.java | 2 +- ...odInAbstractClassShouldBeAbstractTest.java | 2 +- .../rule/codestyle/ExtendsObjectTest.java | 2 +- ...eclarationsShouldBeAtStartOfClassTest.java | 2 +- .../codestyle/FieldNamingConventionsTest.java | 2 +- .../FinalParameterInAbstractMethodTest.java | 2 +- .../ForLoopShouldBeWhileLoopTest.java | 2 +- .../FormalParameterNamingConventionsTest.java | 2 +- .../rule/codestyle/GenericsNamingTest.java | 2 +- .../codestyle/IdenticalCatchBranchesTest.java | 2 +- .../rule/codestyle/LinguisticNamingTest.java | 2 +- .../LocalHomeNamingConventionTest.java | 2 +- ...lInterfaceSessionNamingConventionTest.java | 2 +- .../LocalVariableCouldBeFinalTest.java | 2 +- .../LocalVariableNamingConventionsTest.java | 2 +- .../java/rule/codestyle/LongVariableTest.java | 2 +- ...MDBAndSessionBeanNamingConventionTest.java | 2 +- .../MethodArgumentCouldBeFinalTest.java | 2 +- .../MethodNamingConventionsTest.java | 2 +- .../java/rule/codestyle/NoPackageTest.java | 2 +- .../rule/codestyle/OnlyOneReturnTest.java | 2 +- .../java/rule/codestyle/PackageCaseTest.java | 2 +- .../codestyle/PrematureDeclarationTest.java | 2 +- .../RemoteInterfaceNamingConventionTest.java | 2 +- ...eSessionInterfaceNamingConventionTest.java | 2 +- .../rule/codestyle/ShortClassNameTest.java | 2 +- .../rule/codestyle/ShortMethodNameTest.java | 2 +- .../rule/codestyle/ShortVariableTest.java | 2 +- .../codestyle/TooManyStaticImportsTest.java | 2 +- ...UnnecessaryAnnotationValueElementTest.java | 2 +- .../rule/codestyle/UnnecessaryBoxingTest.java | 2 +- .../rule/codestyle/UnnecessaryCastTest.java | 2 +- .../codestyle/UnnecessaryConstructorTest.java | 2 +- .../UnnecessaryFullyQualifiedNameTest.java | 2 +- .../rule/codestyle/UnnecessaryImportTest.java | 2 +- .../UnnecessaryLocalBeforeReturnTest.java | 2 +- .../codestyle/UnnecessaryModifierTest.java | 2 +- .../rule/codestyle/UnnecessaryReturnTest.java | 2 +- .../codestyle/UnnecessarySemicolonTest.java | 2 +- .../codestyle/UseDiamondOperatorTest.java | 2 +- .../rule/codestyle/UseExplicitTypesTest.java | 2 +- .../UseShortArrayInitializerTest.java | 2 +- .../UseUnderscoresInNumericLiteralsTest.java | 2 +- .../codestyle/UselessParenthesesTest.java | 2 +- .../codestyle/UselessQualifiedThisTest.java | 2 +- .../AbstractClassWithoutAnyMethodTest.java | 2 +- .../AvoidCatchingGenericExceptionTest.java | 2 +- .../design/AvoidDeeplyNestedIfStmtsTest.java | 2 +- .../design/AvoidRethrowingExceptionTest.java | 2 +- ...hrowingNewInstanceOfSameExceptionTest.java | 2 +- ...AvoidThrowingNullPointerExceptionTest.java | 2 +- .../AvoidThrowingRawExceptionTypesTest.java | 2 +- ...idUncheckedExceptionsInSignaturesTest.java | 2 +- ...yPrivateConstructorsShouldBeFinalTest.java | 2 +- .../rule/design/CognitiveComplexityTest.java | 2 +- .../design/CollapsibleIfStatementsTest.java | 2 +- .../design/CouplingBetweenObjectsTest.java | 2 +- .../rule/design/CyclomaticComplexityTest.java | 2 +- .../lang/java/rule/design/DataClassTest.java | 2 +- .../design/DoNotExtendJavaLangErrorTest.java | 2 +- .../design/ExceptionAsFlowControlTest.java | 2 +- .../rule/design/ExcessiveImportsTest.java | 2 +- .../design/ExcessiveParameterListTest.java | 2 +- .../rule/design/ExcessivePublicCountTest.java | 2 +- .../design/FinalFieldCouldBeStaticTest.java | 2 +- .../lang/java/rule/design/GodClassTest.java | 2 +- .../java/rule/design/ImmutableFieldTest.java | 2 +- .../java/rule/design/InvalidJavaBeanTest.java | 2 +- .../java/rule/design/LawOfDemeterTest.java | 2 +- .../java/rule/design/LogicInversionTest.java | 2 +- .../rule/design/LoosePackageCouplingTest.java | 2 +- .../rule/design/MutableStaticStateTest.java | 2 +- .../java/rule/design/NPathComplexityTest.java | 2 +- .../lang/java/rule/design/NcssCountTest.java | 2 +- .../SignatureDeclareThrowsExceptionTest.java | 2 +- .../rule/design/SimplifiedTernaryTest.java | 2 +- .../SimplifyBooleanExpressionsTest.java | 2 +- .../design/SimplifyBooleanReturnsTest.java | 2 +- .../rule/design/SimplifyConditionalTest.java | 2 +- .../java/rule/design/SingularFieldTest.java | 2 +- .../java/rule/design/SwitchDensityTest.java | 2 +- .../java/rule/design/TooManyFieldsTest.java | 2 +- .../java/rule/design/TooManyMethodsTest.java | 2 +- .../design/UseObjectForClearerAPITest.java | 2 +- .../java/rule/design/UseUtilityClassTest.java | 2 +- .../design/UselessOverridingMethodTest.java | 2 +- .../documentation/CommentContentTest.java | 2 +- .../documentation/CommentRequiredTest.java | 2 +- .../rule/documentation/CommentSizeTest.java | 2 +- .../UncommentedEmptyConstructorTest.java | 2 +- .../UncommentedEmptyMethodBodyTest.java | 2 +- .../errorprone/AssignmentInOperandTest.java | 2 +- .../AssignmentToNonFinalStaticTest.java | 2 +- .../AvoidAccessibilityAlterationTest.java | 2 +- .../AvoidAssertAsIdentifierTest.java | 2 +- ...oidBranchingStatementAsLastInLoopTest.java | 2 +- .../errorprone/AvoidCallingFinalizeTest.java | 2 +- .../rule/errorprone/AvoidCatchingNPETest.java | 2 +- .../AvoidCatchingThrowableTest.java | 2 +- ...alLiteralsInBigDecimalConstructorTest.java | 2 +- .../AvoidDuplicateLiteralsTest.java | 2 +- .../errorprone/AvoidEnumAsIdentifierTest.java | 2 +- .../AvoidFieldNameMatchingMethodNameTest.java | 2 +- .../AvoidFieldNameMatchingTypeNameTest.java | 2 +- ...voidInstanceofChecksInCatchClauseTest.java | 2 +- .../AvoidLiteralsInIfConditionTest.java | 2 +- .../AvoidLosingExceptionInformationTest.java | 2 +- .../AvoidMultipleUnaryOperatorsTest.java | 2 +- .../errorprone/AvoidUsingOctalValuesTest.java | 2 +- .../rule/errorprone/BrokenNullCheckTest.java | 2 +- .../rule/errorprone/CallSuperFirstTest.java | 2 +- .../rule/errorprone/CallSuperLastTest.java | 2 +- .../rule/errorprone/CheckSkipResultTest.java | 2 +- .../ClassCastExceptionWithToArrayTest.java | 2 +- .../CloneMethodMustBePublicTest.java | 2 +- ...CloneMethodMustImplementCloneableTest.java | 2 +- ...ethodReturnTypeMustMatchClassNameTest.java | 2 +- .../rule/errorprone/CloseResourceTest.java | 2 +- .../CompareObjectsWithEqualsTest.java | 2 +- .../errorprone/ComparisonWithNaNTest.java | 2 +- ...ConstructorCallsOverridableMethodTest.java | 2 +- .../rule/errorprone/DetachedTestCaseTest.java | 2 +- ...otCallGarbageCollectionExplicitlyTest.java | 2 +- .../DoNotExtendJavaLangThrowableTest.java | 2 +- .../errorprone/DoNotHardCodeSDCardTest.java | 2 +- .../rule/errorprone/DoNotTerminateVMTest.java | 2 +- .../DoNotThrowExceptionInFinallyTest.java | 2 +- .../rule/errorprone/DontImportSunTest.java | 2 +- .../DontUseFloatTypeForLoopIndicesTest.java | 2 +- .../rule/errorprone/EmptyCatchBlockTest.java | 2 +- .../rule/errorprone/EmptyFinalizerTest.java | 2 +- .../java/rule/errorprone/EqualsNullTest.java | 2 +- .../FinalizeDoesNotCallSuperFinalizeTest.java | 2 +- .../FinalizeOnlyCallsSuperFinalizeTest.java | 2 +- .../errorprone/FinalizeOverloadedTest.java | 2 +- .../FinalizeShouldBeProtectedTest.java | 2 +- .../errorprone/IdempotentOperationsTest.java | 2 +- .../ImplicitSwitchFallThroughTest.java | 2 +- .../InstantiationToGetClassTest.java | 2 +- .../InvalidLogMessageFormatTest.java | 2 +- .../rule/errorprone/JUnitSpellingTest.java | 2 +- .../rule/errorprone/JUnitStaticSuiteTest.java | 2 +- .../errorprone/JumbledIncrementerTest.java | 2 +- ...ethodWithSameNameAsEnclosingClassTest.java | 2 +- .../errorprone/MisplacedNullCheckTest.java | 2 +- .../MissingSerialVersionUIDTest.java | 2 +- ...ticMethodInNonInstantiatableClassTest.java | 2 +- .../errorprone/MoreThanOneLoggerTest.java | 2 +- .../NonCaseLabelInSwitchStatementTest.java | 2 +- .../errorprone/NonSerializableClassTest.java | 2 +- .../errorprone/NonStaticInitializerTest.java | 2 +- .../rule/errorprone/NullAssignmentTest.java | 2 +- .../OverrideBothEqualsAndHashcodeTest.java | 2 +- .../ProperCloneImplementationTest.java | 2 +- .../rule/errorprone/ProperLoggerTest.java | 2 +- ...turnEmptyCollectionRatherThanNullTest.java | 2 +- .../ReturnFromFinallyBlockTest.java | 2 +- .../SimpleDateFormatNeedsLocaleTest.java | 2 +- .../errorprone/SingleMethodSingletonTest.java | 2 +- ...ingletonClassReturningNewInstanceTest.java | 2 +- .../StaticEJBFieldShouldBeFinalTest.java | 2 +- ...StringBufferInstantiationWithCharTest.java | 2 +- .../SuspiciousEqualsMethodNameTest.java | 2 +- .../SuspiciousHashcodeMethodNameTest.java | 2 +- .../errorprone/SuspiciousOctalEscapeTest.java | 2 +- .../TestClassWithoutTestCasesTest.java | 2 +- .../UnconditionalIfStatementTest.java | 2 +- .../UnnecessaryBooleanAssertionTest.java | 2 +- .../errorprone/UnnecessaryCaseChangeTest.java | 2 +- .../UnnecessaryConversionTemporaryTest.java | 2 +- .../UnusedNullCheckInEqualsTest.java | 2 +- .../UseCorrectExceptionLoggingTest.java | 2 +- .../UseEqualsToCompareStringsTest.java | 2 +- .../UseLocaleWithCaseConversionsTest.java | 2 +- .../errorprone/UseProperClassLoaderTest.java | 2 +- .../UselessOperationOnImmutableTest.java | 2 +- .../AvoidSynchronizedAtMethodLevelTest.java | 2 +- .../multithreading/AvoidThreadGroupTest.java | 2 +- .../AvoidUsingVolatileTest.java | 2 +- .../multithreading/DoNotUseThreadsTest.java | 2 +- .../multithreading/DontCallThreadRunTest.java | 2 +- .../DoubleCheckedLockingTest.java | 2 +- .../NonThreadSafeSingletonTest.java | 2 +- .../UnsynchronizedStaticFormatterTest.java | 2 +- .../UseConcurrentHashMapTest.java | 2 +- .../UseNotifyAllInsteadOfNotifyTest.java | 2 +- .../rule/performance/AddEmptyStringTest.java | 2 +- .../AppendCharacterWithCharTest.java | 2 +- .../rule/performance/AvoidArrayLoopsTest.java | 2 +- .../AvoidCalendarDateCreationTest.java | 2 +- .../rule/performance/AvoidFileStreamTest.java | 2 +- .../AvoidInstantiatingObjectsInLoopsTest.java | 2 +- .../BigIntegerInstantiationTest.java | 2 +- .../ConsecutiveAppendsShouldReuseTest.java | 2 +- .../ConsecutiveLiteralAppendsTest.java | 2 +- .../InefficientEmptyStringCheckTest.java | 2 +- .../InefficientStringBufferingTest.java | 2 +- ...sufficientStringBufferDeclarationTest.java | 2 +- .../OptimizableToArrayCallTest.java | 2 +- .../RedundantFieldInitializerTest.java | 2 +- .../performance/StringInstantiationTest.java | 2 +- .../rule/performance/StringToStringTest.java | 2 +- ...TooFewBranchesForASwitchStatementTest.java | 2 +- .../UseArrayListInsteadOfVectorTest.java | 2 +- .../rule/performance/UseArraysAsListTest.java | 2 +- ...OStreamsWithApacheCommonsFileItemTest.java | 2 +- .../rule/performance/UseIndexOfCharTest.java | 2 +- .../UseStringBufferForStringAppendsTest.java | 2 +- .../UseStringBufferLengthTest.java | 2 +- .../performance/UselessStringValueOfTest.java | 2 +- .../rule/security/HardCodedCryptoKeyTest.java | 2 +- .../rule/security/InsecureCryptoIvTest.java | 2 +- .../net/sourceforge/pmd/ant/PMDTaskTest.java | 2 ++ .../lang/ecmascript/LanguageVersionTest.java | 2 +- .../lang/ecmascript/RuleSetFactoryTest.java | 2 +- .../bestpractices/AvoidWithStatementTest.java | 2 +- .../bestpractices/ConsistentReturnTest.java | 2 +- .../bestpractices/GlobalVariableTest.java | 2 +- .../bestpractices/ScopeForInVariableTest.java | 2 +- .../UseBaseWithParseIntTest.java | 2 +- .../codestyle/AssignmentInOperandTest.java | 2 +- .../codestyle/ForLoopsMustUseBracesTest.java | 2 +- .../IfElseStmtsMustUseBracesTest.java | 2 +- .../codestyle/IfStmtsMustUseBracesTest.java | 2 +- .../rule/codestyle/NoElseReturnTest.java | 2 +- .../rule/codestyle/UnnecessaryBlockTest.java | 2 +- .../codestyle/UnnecessaryParenthesesTest.java | 2 +- .../rule/codestyle/UnreachableCodeTest.java | 2 +- .../WhileLoopsMustUseBracesTest.java | 2 +- .../errorprone/AvoidTrailingCommaTest.java | 2 +- .../rule/errorprone/EqualComparisonTest.java | 2 +- .../InnaccurateNumericLiteralTest.java | 2 +- .../pmd/lang/jsp/LanguageVersionTest.java | 2 +- .../pmd/lang/jsp/RuleSetFactoryTest.java | 2 +- .../DontNestJsfInJstlIterationTest.java | 2 +- .../bestpractices/NoClassAttributeTest.java | 2 +- .../bestpractices/NoHtmlCommentsTest.java | 2 +- .../rule/bestpractices/NoJspForwardTest.java | 2 +- .../codestyle/DuplicateJspImportsTest.java | 2 +- .../jsp/rule/design/NoInlineScriptTest.java | 2 +- .../design/NoInlineStyleInformationTest.java | 2 +- .../jsp/rule/design/NoLongScriptsTest.java | 2 +- .../jsp/rule/design/NoScriptletsTest.java | 2 +- .../jsp/rule/errorprone/JspEncodingTest.java | 2 +- .../IframeMissingSrcAttributeTest.java | 2 +- .../NoUnsanitizedJSPExpressionTest.java | 2 +- .../pmd/lang/kotlin/LanguageVersionTest.java | 2 +- .../pmd/lang/kotlin/RuleSetFactoryTest.java | 2 +- .../FunctionNameTooShortTest.java | 2 +- .../OverrideBothEqualsAndHashcodeTest.java | 2 +- .../lang/modelica/LanguageVersionTest.java | 2 +- .../pmd/lang/modelica/RuleSetFactoryTest.java | 2 +- .../AmbiguousResolutionTest.java | 2 +- .../ClassStartNameEqualsEndNameTest.java | 2 +- .../ConnectUsingNonConnectorTest.java | 2 +- .../pmd/lang/plsql/LanguageVersionTest.java | 2 +- .../pmd/lang/plsql/RuleSetFactoryTest.java | 2 +- .../bestpractices/TomKytesDespairTest.java | 2 +- .../rule/codestyle/AvoidTabCharacterTest.java | 2 +- .../plsql/rule/codestyle/CodeFormatTest.java | 2 +- .../rule/codestyle/ForLoopNamingTest.java | 2 +- .../plsql/rule/codestyle/LineLengthTest.java | 2 +- .../rule/codestyle/MisplacedPragmaTest.java | 2 +- .../rule/design/CyclomaticComplexityTest.java | 2 +- .../design/ExcessiveMethodLengthTest.java | 2 +- .../design/ExcessiveObjectLengthTest.java | 2 +- .../ExcessivePackageBodyLengthTest.java | 2 +- ...cessivePackageSpecificationLengthTest.java | 2 +- .../design/ExcessiveParameterListTest.java | 2 +- .../rule/design/ExcessiveTypeLengthTest.java | 2 +- .../rule/design/NPathComplexityTest.java | 2 +- .../rule/design/NcssMethodCountTest.java | 2 +- .../rule/design/NcssObjectCountTest.java | 2 +- .../plsql/rule/design/TooManyFieldsTest.java | 2 +- .../plsql/rule/design/TooManyMethodsTest.java | 2 +- .../rule/errorprone/ToDateToCharTest.java | 2 +- .../ToDateWithoutDateFormatTest.java | 2 +- .../ToTimestampWithoutDateFormatTest.java | 2 +- .../pmd/lang/scala/LanguageVersionTest.java | 2 +- .../pmd/lang/scala/RulesetFactoryTest.java | 2 +- .../pmd/lang/swift/LanguageVersionTest.java | 2 +- .../pmd/lang/swift/RuleSetFactoryTest.java | 2 +- .../ProhibitedInterfaceBuilderTest.java | 2 +- .../UnavailableFunctionTest.java | 2 +- .../swift/rule/errorprone/ForceCastTest.java | 2 +- .../swift/rule/errorprone/ForceTryTest.java | 2 +- .../{ant => test}/AbstractAntTestHelper.java | 2 +- .../AbstractLanguageVersionTest.java | 2 +- .../{testframework => test}/PmdRuleTst.java | 2 +- .../pmd/{testframework => test}/RuleTst.java | 2 +- .../SimpleAggregatorTst.java | 2 +- .../lang/rule/AbstractRuleSetFactoryTest.java | 11 +++++++--- .../{testframework => test}/RuleTstTest.java | 2 +- .../pmd/lang/vf/LanguageVersionTest.java | 2 +- .../pmd/lang/vf/RuleSetFactoryTest.java | 2 +- .../pmd/lang/vf/rule/security/VfCsrfTest.java | 2 +- .../rule/security/VfHtmlStyleTagXssTest.java | 2 +- .../vf/rule/security/VfUnescapeElTest.java | 2 +- .../pmd/lang/vm/LanguageVersionTest.java | 2 +- .../pmd/lang/vm/RuleSetFactoryTest.java | 2 +- .../AvoidReassigningParametersTest.java | 2 +- .../UnusedMacroParameterTest.java | 2 +- .../design/AvoidDeeplyNestedIfStmtsTest.java | 2 +- .../design/CollapsibleIfStatementsTest.java | 2 +- .../design/ExcessiveTemplateLengthTest.java | 2 +- .../rule/design/NoInlineJavaScriptTest.java | 2 +- .../vm/rule/design/NoInlineStylesTest.java | 2 +- .../rule/errorprone/EmptyForeachStmtTest.java | 2 +- .../vm/rule/errorprone/EmptyIfStmtTest.java | 2 +- .../pmd/lang/xml/LanguageVersionTest.java | 2 +- .../sourceforge/pmd/lang/xml/PMDTaskTest.java | 2 +- .../pmd/lang/xml/RuleSetFactoryTest.java | 2 +- .../InvalidDependencyTypesTest.java | 2 +- ...ProjectVersionAsDependencyVersionTest.java | 2 +- .../bestpractices/MissingEncodingTest.java | 2 +- .../errorprone/MistypedCDATASectionTest.java | 2 +- .../xsl/rule/codestyle/UseConcatOnceTest.java | 2 +- .../performance/AvoidAxisNavigationTest.java | 2 +- 456 files changed, 490 insertions(+), 464 deletions(-) rename pmd-test/src/main/java/net/sourceforge/pmd/{ant => test}/AbstractAntTestHelper.java (99%) rename pmd-test/src/main/java/net/sourceforge/pmd/{ => test}/AbstractLanguageVersionTest.java (99%) rename pmd-test/src/main/java/net/sourceforge/pmd/{testframework => test}/PmdRuleTst.java (94%) rename pmd-test/src/main/java/net/sourceforge/pmd/{testframework => test}/RuleTst.java (99%) rename pmd-test/src/main/java/net/sourceforge/pmd/{testframework => test}/SimpleAggregatorTst.java (96%) rename pmd-test/src/main/java/net/sourceforge/pmd/{ => test}/lang/rule/AbstractRuleSetFactoryTest.java (98%) rename pmd-test/src/test/java/net/sourceforge/pmd/{testframework => test}/RuleTstTest.java (98%) diff --git a/docs/pages/pmd/userdocs/extending/testing.md b/docs/pages/pmd/userdocs/extending/testing.md index e60652242c..d746464657 100644 --- a/docs/pages/pmd/userdocs/extending/testing.md +++ b/docs/pages/pmd/userdocs/extending/testing.md @@ -25,7 +25,7 @@ Each category-ruleset has a single abstract base test class, from which the indi We have one test class per rule, which executes all test cases for a single rule. The actual test cases are stored in separate XML files, for each rule a separate file is used. -All the test classes inherit from {% jdoc test::testframework.PmdRuleTst %}, +All the test classes inherit from {% jdoc test::test.PmdRuleTst %}, which provides the seamless integration with JUnit5. This base class determines the language, the category name and the rule name from the concrete test class. It then searches the test code on its own. E.g. the individual rule test class @@ -41,7 +41,7 @@ test case and just execute this one. ## Where to place the test code -The {% jdoc test::testframework.PmdRuleTst %} class searches the XML file, that describes the test cases +The {% jdoc test::test.PmdRuleTst %} class searches the XML file, that describes the test cases for a certain rule using the following convention: The XML file is a test resource, so it is searched in the tree under `src/test/resources`. @@ -76,13 +76,13 @@ see [Using the test framework externally](#using-the-test-framework-externally). ### Test Class: AbstractClassWithoutAbstractMethodTest -This class inherits from {% jdoc test::testframework.PmdRuleTst %} and is located in the package "bestpractices", +This class inherits from {% jdoc test::test.PmdRuleTst %} and is located in the package "bestpractices", since the rule belongs to the category "Best Practices": ``` java package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AbstractClassWithoutAbstractMethodTest extends PmdRuleTst { // no additional unit tests @@ -251,7 +251,7 @@ the rule test manually, as SimpleAggregatorTst will fail to determine it correct ``` java package com.example.pmd.rules; -import net.sourceforge.pmd.testframework.SimpleAggregatorTst; +import net.sourceforge.pmd.test.SimpleAggregatorTst; class CustomRuleTest extends SimpleAggregatorTst { @Override @@ -272,19 +272,19 @@ The test data should be placed in an XML file located in "src/test/resources" un The framework uses the [dynamic test feature](https://junit.org/junit5/docs/current/user-guide/#writing-tests-dynamic-tests) of JUnit5 under the hood, among a couple of utility classes: -* {% jdoc test::testframework.PmdRuleTst %}: This is the base class for tests in PMD's code base. It is a subclass of - {% jdoc test::testframework.RuleTst %} and just +* {% jdoc test::test.PmdRuleTst %}: This is the base class for tests in PMD's code base. It is a subclass of + {% jdoc test::test.RuleTst %} and just contains the logic to determine the test resources based on the test class name. -* {% jdoc test::testframework.SimpleAggregatorTst %}: This is a more generic base class for the test classes. +* {% jdoc test::test.SimpleAggregatorTst %}: This is a more generic base class for the test classes. It doesn't register any test cases on its own. You can register your own rule tests. - It itself is a subclass of {% jdoc test::testframework.RuleTst %}. + It itself is a subclass of {% jdoc test::test.RuleTst %}. * The maven module "pmd-test-schema" contains the logic to parse the XML files and provides a {% jdoc test-schema::test.schema.RuleTestCollection %}. This in turn contains a list of {% jdoc test-schema::test.schema.RuleTestDescriptor %}s. Each rule test descriptor describes a single test case. -* {% jdoc test::testframework.RuleTst %}: uses the {%jdoc test-schema::test.schema.TestSchemaParser %} +* {% jdoc test::test.RuleTst %}: uses the {%jdoc test-schema::test.schema.TestSchemaParser %} from module "pmd-test-schema" to parse the test cases, executes each rule test descriptor and asserts the results. It defines a test method `ruleTests()` which is a test factory and returns one dynamic test per rule test. diff --git a/docs/pages/pmd/userdocs/migrating_to_pmd7.md b/docs/pages/pmd/userdocs/migrating_to_pmd7.md index 13eda0dfd0..ec092e1261 100644 --- a/docs/pages/pmd/userdocs/migrating_to_pmd7.md +++ b/docs/pages/pmd/userdocs/migrating_to_pmd7.md @@ -115,9 +115,13 @@ Once you have reviewed your ruleset(s), you can switch to PMD 7. ### I'm using custom rules +#### Testing Ideally, you have written good tests already for your custom rules - see [Testing your rules](pmd_userdocs_extending_testing.html). This helps to identify problems early on. +The base test classes {%jdoc test::test.PmdRuleTst %} and {%jdoc test::test.SimpleAggregatorTst %} have been moved out +of package `net.sourceforge.pmd.testframework`. You'll need to adjust your imports. + #### Ruleset XML The `` tag, that defines your custom rule, is required to have a `language` attribute now. This was always the case for XPath rules, but is now a requirement for Java rules. diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 12382eba63..c61910f235 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -341,6 +341,13 @@ in the migration guide for details. * pmd-scala * {%jdoc scala::lang.scala.cpd.ScalaCpdLexer %} (moved from `net.sourceforge.pmd.lang.scala.cpd.ScalaCpdLexer`) * {%jdoc scala::lang.scala.cpd.ScalaTokenAdapter %} (moved from `net.sourceforge.pmd.lang.scala.cpd.ScalaTokenAdapter`) +* pmd-test + * {%jdoc test::test.lang.rule.AbstractRuleSetFactoryTest %} (moved from `net.sourceforge.pmd.lang.rule.AbstractRuleSetFactoryTest`) + * {%jdoc test::test.AbstractAntTestHelper %} (moved from `net.sourceforge.pmd.ant.AbstractAntTestHelper`) + * {%jdoc test::test.AbstractLanguageVersionTest %} (moved from `net.sourceforge.pmd.AbstractLanguageVersionTest`) + * {%jdoc test::test.PmdRuleTst %} (moved from `net.sourceforge.pmd.testframework.PmdRuleTst`) + * {%jdoc test::test.RuleTst %} (moved from `net.sourceforge.pmd.testframework.RuleTst`) + * {%jdoc test::test.SimpleAggregatorTst %} (moved from `net.sourceforge.pmd.testframework.SimpleAggregatorTst`) * pmd-xml * {%jdoc xml::lang.xml.pom.PomLanguageModule %} (moved from `net.sourceforge.pmd.lang.pom.PomLanguageModule`) * {%jdoc xml::lang.xml.wsdl.WsdlLanguageModule %} (moved from `net.sourceforge.pmd.lang.wsdl.WsdlLanguageModule`) diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/LanguageVersionTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/LanguageVersionTest.java index 8d899d0549..30cdbc7c69 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/LanguageVersionTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/LanguageVersionTest.java @@ -7,7 +7,7 @@ package net.sourceforge.pmd.lang.apex; import java.util.Arrays; import java.util.Collection; -import net.sourceforge.pmd.AbstractLanguageVersionTest; +import net.sourceforge.pmd.test.AbstractLanguageVersionTest; class LanguageVersionTest extends AbstractLanguageVersionTest { diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/QuickstartRulesetTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/QuickstartRulesetTest.java index d56fdaecf8..b34849d528 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/QuickstartRulesetTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/QuickstartRulesetTest.java @@ -9,7 +9,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.lang.rule.AbstractRuleSetFactoryTest; +import net.sourceforge.pmd.test.lang.rule.AbstractRuleSetFactoryTest; import net.sourceforge.pmd.lang.rule.RuleSet; import net.sourceforge.pmd.lang.rule.RuleSetLoader; diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/RuleSetFactoryTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/RuleSetFactoryTest.java index c3dd9beaa2..2017f895c2 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/RuleSetFactoryTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/RuleSetFactoryTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex; -import net.sourceforge.pmd.lang.rule.AbstractRuleSetFactoryTest; +import net.sourceforge.pmd.test.lang.rule.AbstractRuleSetFactoryTest; class RuleSetFactoryTest extends AbstractRuleSetFactoryTest { // no additional tests yet diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/metrics/impl/AllMetricsTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/metrics/impl/AllMetricsTest.java index 2936a9d81a..b568e90a14 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/metrics/impl/AllMetricsTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/metrics/impl/AllMetricsTest.java @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.apex.metrics.impl; import net.sourceforge.pmd.lang.apex.ast.ApexQualifiableNode; import net.sourceforge.pmd.lang.ast.Node; -import net.sourceforge.pmd.testframework.SimpleAggregatorTst; +import net.sourceforge.pmd.test.SimpleAggregatorTst; /** * Executes the metrics testing rules. diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/bestpractices/ApexAssertionsShouldIncludeMessageTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/bestpractices/ApexAssertionsShouldIncludeMessageTest.java index 46ab3aff19..4bf289fe69 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/bestpractices/ApexAssertionsShouldIncludeMessageTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/bestpractices/ApexAssertionsShouldIncludeMessageTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ApexAssertionsShouldIncludeMessageTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/bestpractices/ApexUnitTestClassShouldHaveAssertsTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/bestpractices/ApexUnitTestClassShouldHaveAssertsTest.java index 8da6170cb0..5fbb7c8c26 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/bestpractices/ApexUnitTestClassShouldHaveAssertsTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/bestpractices/ApexUnitTestClassShouldHaveAssertsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ApexUnitTestClassShouldHaveAssertsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/bestpractices/ApexUnitTestClassShouldHaveRunAsTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/bestpractices/ApexUnitTestClassShouldHaveRunAsTest.java index 1c20e4ad7c..cb4d8c5141 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/bestpractices/ApexUnitTestClassShouldHaveRunAsTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/bestpractices/ApexUnitTestClassShouldHaveRunAsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; public class ApexUnitTestClassShouldHaveRunAsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/bestpractices/ApexUnitTestMethodShouldHaveIsTestAnnotationTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/bestpractices/ApexUnitTestMethodShouldHaveIsTestAnnotationTest.java index 983448dce7..5917436c6c 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/bestpractices/ApexUnitTestMethodShouldHaveIsTestAnnotationTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/bestpractices/ApexUnitTestMethodShouldHaveIsTestAnnotationTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ApexUnitTestMethodShouldHaveIsTestAnnotationTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/bestpractices/ApexUnitTestShouldNotUseSeeAllDataTrueTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/bestpractices/ApexUnitTestShouldNotUseSeeAllDataTrueTest.java index 150bcfecd6..5485453809 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/bestpractices/ApexUnitTestShouldNotUseSeeAllDataTrueTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/bestpractices/ApexUnitTestShouldNotUseSeeAllDataTrueTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ApexUnitTestShouldNotUseSeeAllDataTrueTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/bestpractices/AvoidGlobalModifierTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/bestpractices/AvoidGlobalModifierTest.java index eff39e8739..9b6143c880 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/bestpractices/AvoidGlobalModifierTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/bestpractices/AvoidGlobalModifierTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidGlobalModifierTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/bestpractices/AvoidLogicInTriggerTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/bestpractices/AvoidLogicInTriggerTest.java index 21cd2021d9..e95f227e07 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/bestpractices/AvoidLogicInTriggerTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/bestpractices/AvoidLogicInTriggerTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidLogicInTriggerTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/bestpractices/DebugsShouldUseLoggingLevelTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/bestpractices/DebugsShouldUseLoggingLevelTest.java index 939ad1b510..5e9ce1c8a8 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/bestpractices/DebugsShouldUseLoggingLevelTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/bestpractices/DebugsShouldUseLoggingLevelTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class DebugsShouldUseLoggingLevelTest extends PmdRuleTst { diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/bestpractices/UnusedLocalVariableTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/bestpractices/UnusedLocalVariableTest.java index fe40d55ecc..0e42710876 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/bestpractices/UnusedLocalVariableTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/bestpractices/UnusedLocalVariableTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnusedLocalVariableTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/codestyle/ClassNamingConventionsTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/codestyle/ClassNamingConventionsTest.java index 0ebe54c2a2..3da177d181 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/codestyle/ClassNamingConventionsTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/codestyle/ClassNamingConventionsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ClassNamingConventionsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/codestyle/FieldDeclarationsShouldBeAtStartTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/codestyle/FieldDeclarationsShouldBeAtStartTest.java index 3a3224f1dc..1ad6d892b6 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/codestyle/FieldDeclarationsShouldBeAtStartTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/codestyle/FieldDeclarationsShouldBeAtStartTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class FieldDeclarationsShouldBeAtStartTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/codestyle/FieldNamingConventionsTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/codestyle/FieldNamingConventionsTest.java index cc04dbc5ca..b2e251df95 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/codestyle/FieldNamingConventionsTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/codestyle/FieldNamingConventionsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class FieldNamingConventionsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/codestyle/ForLoopsMustUseBracesTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/codestyle/ForLoopsMustUseBracesTest.java index 22891df41c..b884764b70 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/codestyle/ForLoopsMustUseBracesTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/codestyle/ForLoopsMustUseBracesTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ForLoopsMustUseBracesTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/codestyle/FormalParameterNamingConventionsTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/codestyle/FormalParameterNamingConventionsTest.java index 79561ea4a8..3642c8c0a0 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/codestyle/FormalParameterNamingConventionsTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/codestyle/FormalParameterNamingConventionsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class FormalParameterNamingConventionsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/codestyle/IfElseStmtsMustUseBracesTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/codestyle/IfElseStmtsMustUseBracesTest.java index a5b04aaf90..7331b729a2 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/codestyle/IfElseStmtsMustUseBracesTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/codestyle/IfElseStmtsMustUseBracesTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class IfElseStmtsMustUseBracesTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/codestyle/IfStmtsMustUseBracesTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/codestyle/IfStmtsMustUseBracesTest.java index 8d91dd649b..e405118d3b 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/codestyle/IfStmtsMustUseBracesTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/codestyle/IfStmtsMustUseBracesTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class IfStmtsMustUseBracesTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/codestyle/LocalVariableNamingConventionsTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/codestyle/LocalVariableNamingConventionsTest.java index 0915626fce..0c428f5c6c 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/codestyle/LocalVariableNamingConventionsTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/codestyle/LocalVariableNamingConventionsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class LocalVariableNamingConventionsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/codestyle/MethodNamingConventionsTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/codestyle/MethodNamingConventionsTest.java index 291fa815fc..a62c323436 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/codestyle/MethodNamingConventionsTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/codestyle/MethodNamingConventionsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class MethodNamingConventionsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/codestyle/OneDeclarationPerLineTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/codestyle/OneDeclarationPerLineTest.java index 37fbf81509..7a6385bb8b 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/codestyle/OneDeclarationPerLineTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/codestyle/OneDeclarationPerLineTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class OneDeclarationPerLineTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/codestyle/PropertyNamingConventionsTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/codestyle/PropertyNamingConventionsTest.java index 6e78c8d37f..96c1d7fa94 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/codestyle/PropertyNamingConventionsTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/codestyle/PropertyNamingConventionsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class PropertyNamingConventionsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/codestyle/WhileLoopsMustUseBracesTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/codestyle/WhileLoopsMustUseBracesTest.java index 03b7109932..2246058de9 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/codestyle/WhileLoopsMustUseBracesTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/codestyle/WhileLoopsMustUseBracesTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class WhileLoopsMustUseBracesTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/design/AvoidDeeplyNestedIfStmtsTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/design/AvoidDeeplyNestedIfStmtsTest.java index 5002fe75d2..bd2541ea5a 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/design/AvoidDeeplyNestedIfStmtsTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/design/AvoidDeeplyNestedIfStmtsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidDeeplyNestedIfStmtsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/design/CognitiveComplexityTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/design/CognitiveComplexityTest.java index 07ece5a9a3..f494a21ed0 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/design/CognitiveComplexityTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/design/CognitiveComplexityTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class CognitiveComplexityTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/design/CyclomaticComplexityTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/design/CyclomaticComplexityTest.java index e0c5c3696d..b55778bce9 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/design/CyclomaticComplexityTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/design/CyclomaticComplexityTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class CyclomaticComplexityTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/design/ExcessiveClassLengthTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/design/ExcessiveClassLengthTest.java index 99b4becd66..beb8138b8a 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/design/ExcessiveClassLengthTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/design/ExcessiveClassLengthTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ExcessiveClassLengthTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/design/ExcessiveParameterListTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/design/ExcessiveParameterListTest.java index 78bb4a0c43..178f7e1255 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/design/ExcessiveParameterListTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/design/ExcessiveParameterListTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ExcessiveParameterListTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/design/ExcessivePublicCountTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/design/ExcessivePublicCountTest.java index 256d0f3847..e2eae7a804 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/design/ExcessivePublicCountTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/design/ExcessivePublicCountTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ExcessivePublicCountTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/design/NcssConstructorCountTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/design/NcssConstructorCountTest.java index 100985cb5c..70bb6b81b0 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/design/NcssConstructorCountTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/design/NcssConstructorCountTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class NcssConstructorCountTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/design/NcssMethodCountTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/design/NcssMethodCountTest.java index af10fcdbfd..a334a639e7 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/design/NcssMethodCountTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/design/NcssMethodCountTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class NcssMethodCountTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/design/NcssTypeCountTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/design/NcssTypeCountTest.java index 92ec3a77be..a1147606c6 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/design/NcssTypeCountTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/design/NcssTypeCountTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class NcssTypeCountTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/design/TooManyFieldsTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/design/TooManyFieldsTest.java index cdd02ad007..27dd2cc552 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/design/TooManyFieldsTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/design/TooManyFieldsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class TooManyFieldsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/documentation/ApexDocTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/documentation/ApexDocTest.java index 080b396560..c4f0fb2356 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/documentation/ApexDocTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/documentation/ApexDocTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.documentation; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ApexDocTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/errorprone/ApexCSRFTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/errorprone/ApexCSRFTest.java index 85f7f104e0..694907f980 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/errorprone/ApexCSRFTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/errorprone/ApexCSRFTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ApexCSRFTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/errorprone/AvoidDirectAccessTriggerMapTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/errorprone/AvoidDirectAccessTriggerMapTest.java index 09f59fac05..8f9ddd1e0f 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/errorprone/AvoidDirectAccessTriggerMapTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/errorprone/AvoidDirectAccessTriggerMapTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidDirectAccessTriggerMapTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/errorprone/AvoidHardcodingIdTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/errorprone/AvoidHardcodingIdTest.java index 2a88bb417b..2896accded 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/errorprone/AvoidHardcodingIdTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/errorprone/AvoidHardcodingIdTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidHardcodingIdTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/errorprone/AvoidNonExistentAnnotationsTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/errorprone/AvoidNonExistentAnnotationsTest.java index b6519db2cd..f244db32e4 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/errorprone/AvoidNonExistentAnnotationsTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/errorprone/AvoidNonExistentAnnotationsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidNonExistentAnnotationsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/errorprone/EmptyCatchBlockTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/errorprone/EmptyCatchBlockTest.java index 1bc971edbc..329de97e77 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/errorprone/EmptyCatchBlockTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/errorprone/EmptyCatchBlockTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class EmptyCatchBlockTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/errorprone/EmptyIfStmtTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/errorprone/EmptyIfStmtTest.java index 4c131f7cd4..e21bb438ba 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/errorprone/EmptyIfStmtTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/errorprone/EmptyIfStmtTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class EmptyIfStmtTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/errorprone/EmptyStatementBlockTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/errorprone/EmptyStatementBlockTest.java index 44cad0042f..7df8c60d6b 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/errorprone/EmptyStatementBlockTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/errorprone/EmptyStatementBlockTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class EmptyStatementBlockTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/errorprone/EmptyTryOrFinallyBlockTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/errorprone/EmptyTryOrFinallyBlockTest.java index 1e68857b57..0adb332e79 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/errorprone/EmptyTryOrFinallyBlockTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/errorprone/EmptyTryOrFinallyBlockTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class EmptyTryOrFinallyBlockTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/errorprone/EmptyWhileStmtTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/errorprone/EmptyWhileStmtTest.java index a7a297124d..5f6fc34e81 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/errorprone/EmptyWhileStmtTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/errorprone/EmptyWhileStmtTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class EmptyWhileStmtTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/errorprone/InaccessibleAuraEnabledGetterTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/errorprone/InaccessibleAuraEnabledGetterTest.java index 31e1ebd383..e423dc004b 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/errorprone/InaccessibleAuraEnabledGetterTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/errorprone/InaccessibleAuraEnabledGetterTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class InaccessibleAuraEnabledGetterTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/errorprone/MethodWithSameNameAsEnclosingClassTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/errorprone/MethodWithSameNameAsEnclosingClassTest.java index 3a15b5dae8..19def64a1e 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/errorprone/MethodWithSameNameAsEnclosingClassTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/errorprone/MethodWithSameNameAsEnclosingClassTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class MethodWithSameNameAsEnclosingClassTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/errorprone/OverrideBothEqualsAndHashcodeTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/errorprone/OverrideBothEqualsAndHashcodeTest.java index 29ab1310c3..637e9f1cdf 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/errorprone/OverrideBothEqualsAndHashcodeTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/errorprone/OverrideBothEqualsAndHashcodeTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class OverrideBothEqualsAndHashcodeTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/errorprone/TestMethodsMustBeInTestClassesTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/errorprone/TestMethodsMustBeInTestClassesTest.java index 1d4f6539a5..4ea8975c09 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/errorprone/TestMethodsMustBeInTestClassesTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/errorprone/TestMethodsMustBeInTestClassesTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class TestMethodsMustBeInTestClassesTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/performance/AvoidDebugStatementsTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/performance/AvoidDebugStatementsTest.java index 38e591773e..8f9fec9c3a 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/performance/AvoidDebugStatementsTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/performance/AvoidDebugStatementsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidDebugStatementsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/performance/EagerlyLoadedDescribeSObjectResultTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/performance/EagerlyLoadedDescribeSObjectResultTest.java index ddc191c0a6..4f73dcb894 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/performance/EagerlyLoadedDescribeSObjectResultTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/performance/EagerlyLoadedDescribeSObjectResultTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class EagerlyLoadedDescribeSObjectResultTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/performance/OperationWithHighCostInLoopTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/performance/OperationWithHighCostInLoopTest.java index 6dc7ff3ba8..e61681e5ec 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/performance/OperationWithHighCostInLoopTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/performance/OperationWithHighCostInLoopTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class OperationWithHighCostInLoopTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/performance/OperationWithLimitsInLoopTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/performance/OperationWithLimitsInLoopTest.java index e80764adbc..9c13461634 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/performance/OperationWithLimitsInLoopTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/performance/OperationWithLimitsInLoopTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class OperationWithLimitsInLoopTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/security/ApexBadCryptoTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/security/ApexBadCryptoTest.java index 280a1c8cb2..988e4c1401 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/security/ApexBadCryptoTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/security/ApexBadCryptoTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.security; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ApexBadCryptoTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/security/ApexCRUDViolationTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/security/ApexCRUDViolationTest.java index 2e74b0a0ad..b8367a79e0 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/security/ApexCRUDViolationTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/security/ApexCRUDViolationTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.security; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ApexCRUDViolationTest extends PmdRuleTst { diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/security/ApexDangerousMethodsTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/security/ApexDangerousMethodsTest.java index 8796b360a4..60f2e9a0bf 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/security/ApexDangerousMethodsTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/security/ApexDangerousMethodsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.security; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ApexDangerousMethodsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/security/ApexInsecureEndpointTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/security/ApexInsecureEndpointTest.java index 000e2544c3..7189c176bd 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/security/ApexInsecureEndpointTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/security/ApexInsecureEndpointTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.security; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ApexInsecureEndpointTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/security/ApexOpenRedirectTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/security/ApexOpenRedirectTest.java index 4108b3b9a0..f16dcb4572 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/security/ApexOpenRedirectTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/security/ApexOpenRedirectTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.security; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ApexOpenRedirectTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/security/ApexSOQLInjectionTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/security/ApexSOQLInjectionTest.java index cde095f6e4..4b9381632d 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/security/ApexSOQLInjectionTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/security/ApexSOQLInjectionTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.security; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ApexSOQLInjectionTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/security/ApexSharingViolationsTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/security/ApexSharingViolationsTest.java index 2e918f1e56..b228dd48da 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/security/ApexSharingViolationsTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/security/ApexSharingViolationsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.security; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ApexSharingViolationsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/security/ApexSuggestUsingNamedCredTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/security/ApexSuggestUsingNamedCredTest.java index 442ed24f96..e13e2f4821 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/security/ApexSuggestUsingNamedCredTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/security/ApexSuggestUsingNamedCredTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.security; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ApexSuggestUsingNamedCredTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/security/ApexXSSFromEscapeFalseTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/security/ApexXSSFromEscapeFalseTest.java index 6ede53430d..4d0ad58f8a 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/security/ApexXSSFromEscapeFalseTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/security/ApexXSSFromEscapeFalseTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.security; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ApexXSSFromEscapeFalseTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/security/ApexXSSFromURLParamTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/security/ApexXSSFromURLParamTest.java index 0286092d14..283f8de051 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/security/ApexXSSFromURLParamTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/security/ApexXSSFromURLParamTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.security; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ApexXSSFromURLParamTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/InternalApiBridge.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/InternalApiBridge.java index b532eef955..802d07ccad 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/InternalApiBridge.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/InternalApiBridge.java @@ -6,9 +6,12 @@ package net.sourceforge.pmd.lang.rule; import java.util.List; +import org.checkerframework.checker.nullness.qual.NonNull; + import net.sourceforge.pmd.annotation.InternalApi; import net.sourceforge.pmd.lang.LanguageVersion; import net.sourceforge.pmd.lang.document.FileId; +import net.sourceforge.pmd.util.log.PmdReporter; /** * Internal API. @@ -36,4 +39,8 @@ public final class InternalApiBridge { public static List loadRuleSetsWithoutException(RuleSetLoader ruleSetLoader, List rulesetPaths) { return ruleSetLoader.loadRuleSetsWithoutException(rulesetPaths); } + + public static RuleSetLoader withReporter(RuleSetLoader ruleSetLoader, @NonNull PmdReporter reporter) { + return ruleSetLoader.withReporter(reporter); + } } diff --git a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/LanguageVersionTest.java b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/LanguageVersionTest.java index 0a8b032163..9315ee0525 100644 --- a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/LanguageVersionTest.java +++ b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/LanguageVersionTest.java @@ -7,7 +7,7 @@ package net.sourceforge.pmd.lang.html; import java.util.Arrays; import java.util.Collection; -import net.sourceforge.pmd.AbstractLanguageVersionTest; +import net.sourceforge.pmd.test.AbstractLanguageVersionTest; class LanguageVersionTest extends AbstractLanguageVersionTest { diff --git a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/RuleSetFactoryTest.java b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/RuleSetFactoryTest.java index f3255130e1..a79d09a0af 100644 --- a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/RuleSetFactoryTest.java +++ b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/RuleSetFactoryTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.html; -import net.sourceforge.pmd.lang.rule.AbstractRuleSetFactoryTest; +import net.sourceforge.pmd.test.lang.rule.AbstractRuleSetFactoryTest; class RuleSetFactoryTest extends AbstractRuleSetFactoryTest { // no additional tests yet diff --git a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/rule/bestpractices/AvoidInlineStylesTest.java b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/rule/bestpractices/AvoidInlineStylesTest.java index ca4314861d..e3dab36338 100644 --- a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/rule/bestpractices/AvoidInlineStylesTest.java +++ b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/rule/bestpractices/AvoidInlineStylesTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.html.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidInlineStylesTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/rule/bestpractices/UnnecessaryTypeAttributeTest.java b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/rule/bestpractices/UnnecessaryTypeAttributeTest.java index ade5f87078..aaf2915ebf 100644 --- a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/rule/bestpractices/UnnecessaryTypeAttributeTest.java +++ b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/rule/bestpractices/UnnecessaryTypeAttributeTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.html.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnnecessaryTypeAttributeTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/rule/bestpractices/UseAltAttributeForImagesTest.java b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/rule/bestpractices/UseAltAttributeForImagesTest.java index c4904a4aee..a336b2d2de 100644 --- a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/rule/bestpractices/UseAltAttributeForImagesTest.java +++ b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/rule/bestpractices/UseAltAttributeForImagesTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.html.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UseAltAttributeForImagesTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/ant/PMDTaskTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/ant/PMDTaskTest.java index b4d8e5a12c..d855a4743e 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/ant/PMDTaskTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/ant/PMDTaskTest.java @@ -14,6 +14,7 @@ import java.util.Locale; import org.junit.jupiter.api.Test; import net.sourceforge.pmd.internal.util.IOUtil; +import net.sourceforge.pmd.test.AbstractAntTestHelper; class PMDTaskTest extends AbstractAntTestHelper { diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/LanguageVersionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/LanguageVersionTest.java index 47f1619085..19511c5ae1 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/LanguageVersionTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/LanguageVersionTest.java @@ -4,13 +4,13 @@ package net.sourceforge.pmd.lang.java; -import static net.sourceforge.pmd.AbstractLanguageVersionTest.TestDescriptor.defaultVersionIs; -import static net.sourceforge.pmd.AbstractLanguageVersionTest.TestDescriptor.versionDoesNotExist; +import static net.sourceforge.pmd.test.AbstractLanguageVersionTest.TestDescriptor.defaultVersionIs; +import static net.sourceforge.pmd.test.AbstractLanguageVersionTest.TestDescriptor.versionDoesNotExist; import java.util.Arrays; import java.util.Collection; -import net.sourceforge.pmd.AbstractLanguageVersionTest; +import net.sourceforge.pmd.test.AbstractLanguageVersionTest; import net.sourceforge.pmd.lang.Language; class LanguageVersionTest extends AbstractLanguageVersionTest { diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/QuickstartRulesetTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/QuickstartRulesetTest.java index 6f3d7e4f37..5fa5b76c2a 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/QuickstartRulesetTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/QuickstartRulesetTest.java @@ -9,7 +9,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.lang.rule.AbstractRuleSetFactoryTest; +import net.sourceforge.pmd.test.lang.rule.AbstractRuleSetFactoryTest; import net.sourceforge.pmd.lang.rule.RuleSet; import net.sourceforge.pmd.lang.rule.RuleSetLoader; diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/RuleSetFactoryTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/RuleSetFactoryTest.java index eac601291e..7276d213b0 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/RuleSetFactoryTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/RuleSetFactoryTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java; -import net.sourceforge.pmd.lang.rule.AbstractRuleSetFactoryTest; +import net.sourceforge.pmd.test.lang.rule.AbstractRuleSetFactoryTest; /** * Test java's rulesets diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/metrics/impl/AllMetricsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/metrics/impl/AllMetricsTest.java index bedece59e4..b227d27b90 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/metrics/impl/AllMetricsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/metrics/impl/AllMetricsTest.java @@ -8,7 +8,7 @@ import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.java.ast.ASTExecutableDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTTypeDeclaration; import net.sourceforge.pmd.lang.java.ast.internal.PrettyPrintingUtil; -import net.sourceforge.pmd.testframework.SimpleAggregatorTst; +import net.sourceforge.pmd.test.SimpleAggregatorTst; /** * Executes the metrics testing rules. diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AbstractClassWithoutAbstractMethodTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AbstractClassWithoutAbstractMethodTest.java index b319c5e9f1..f1d3e1eb28 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AbstractClassWithoutAbstractMethodTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AbstractClassWithoutAbstractMethodTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AbstractClassWithoutAbstractMethodTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AccessorClassGenerationTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AccessorClassGenerationTest.java index 1c922fd22e..b4818807f8 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AccessorClassGenerationTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AccessorClassGenerationTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AccessorClassGenerationTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AccessorMethodGenerationTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AccessorMethodGenerationTest.java index 7ef92f4c8e..a4bff3af89 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AccessorMethodGenerationTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AccessorMethodGenerationTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AccessorMethodGenerationTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ArrayIsStoredDirectlyTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ArrayIsStoredDirectlyTest.java index 0fba328ac6..9df0a31644 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ArrayIsStoredDirectlyTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ArrayIsStoredDirectlyTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ArrayIsStoredDirectlyTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidMessageDigestFieldTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidMessageDigestFieldTest.java index df4543674d..1403fe41f3 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidMessageDigestFieldTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidMessageDigestFieldTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidMessageDigestFieldTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidPrintStackTraceTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidPrintStackTraceTest.java index 436d56f150..c3c2d9a56e 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidPrintStackTraceTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidPrintStackTraceTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidPrintStackTraceTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidReassigningCatchVariablesTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidReassigningCatchVariablesTest.java index 25ab862bfe..67fd392bde 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidReassigningCatchVariablesTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidReassigningCatchVariablesTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidReassigningCatchVariablesTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidReassigningLoopVariablesTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidReassigningLoopVariablesTest.java index a15f9742fb..b7deb6616c 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidReassigningLoopVariablesTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidReassigningLoopVariablesTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidReassigningLoopVariablesTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidReassigningParametersTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidReassigningParametersTest.java index 68ab080b7d..aa1eecf167 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidReassigningParametersTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidReassigningParametersTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidReassigningParametersTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidStringBufferFieldTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidStringBufferFieldTest.java index 1b1e7898cf..7f1b4a2e16 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidStringBufferFieldTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidStringBufferFieldTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidStringBufferFieldTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidUsingHardCodedIPTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidUsingHardCodedIPTest.java index 82d84a3c05..fe7b0ce420 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidUsingHardCodedIPTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidUsingHardCodedIPTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidUsingHardCodedIPTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/CheckResultSetTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/CheckResultSetTest.java index cba377fd59..8699d4134d 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/CheckResultSetTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/CheckResultSetTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class CheckResultSetTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ConstantsInInterfaceTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ConstantsInInterfaceTest.java index bf685f3ad7..c81183b7b6 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ConstantsInInterfaceTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ConstantsInInterfaceTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ConstantsInInterfaceTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/DefaultLabelNotLastInSwitchStmtTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/DefaultLabelNotLastInSwitchStmtTest.java index 1a407779e8..b316a1881f 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/DefaultLabelNotLastInSwitchStmtTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/DefaultLabelNotLastInSwitchStmtTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class DefaultLabelNotLastInSwitchStmtTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/DoubleBraceInitializationTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/DoubleBraceInitializationTest.java index 26eee695b6..8a6947126a 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/DoubleBraceInitializationTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/DoubleBraceInitializationTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class DoubleBraceInitializationTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ForLoopCanBeForeachTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ForLoopCanBeForeachTest.java index e0b774b80d..771debeb16 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ForLoopCanBeForeachTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ForLoopCanBeForeachTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ForLoopCanBeForeachTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ForLoopVariableCountTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ForLoopVariableCountTest.java index 5843550a3a..059c71f39d 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ForLoopVariableCountTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ForLoopVariableCountTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ForLoopVariableCountTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/GuardLogStatementTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/GuardLogStatementTest.java index 84dce65d9c..5a1979c853 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/GuardLogStatementTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/GuardLogStatementTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class GuardLogStatementTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4SuitesShouldUseSuiteAnnotationTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4SuitesShouldUseSuiteAnnotationTest.java index dc2c92f4ae..2765a69ce2 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4SuitesShouldUseSuiteAnnotationTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4SuitesShouldUseSuiteAnnotationTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class JUnit4SuitesShouldUseSuiteAnnotationTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4TestShouldUseAfterAnnotationTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4TestShouldUseAfterAnnotationTest.java index 341829e928..ea6070f9e3 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4TestShouldUseAfterAnnotationTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4TestShouldUseAfterAnnotationTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class JUnit4TestShouldUseAfterAnnotationTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4TestShouldUseBeforeAnnotationTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4TestShouldUseBeforeAnnotationTest.java index b92ab68100..d32f7a5087 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4TestShouldUseBeforeAnnotationTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4TestShouldUseBeforeAnnotationTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class JUnit4TestShouldUseBeforeAnnotationTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4TestShouldUseTestAnnotationTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4TestShouldUseTestAnnotationTest.java index 6710c145be..15b507dafb 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4TestShouldUseTestAnnotationTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4TestShouldUseTestAnnotationTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class JUnit4TestShouldUseTestAnnotationTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit5TestShouldBePackagePrivateTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit5TestShouldBePackagePrivateTest.java index bf8190b559..d39a19249b 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit5TestShouldBePackagePrivateTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit5TestShouldBePackagePrivateTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class JUnit5TestShouldBePackagePrivateTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitAssertionsShouldIncludeMessageTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitAssertionsShouldIncludeMessageTest.java index 239cce7659..e77dd78150 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitAssertionsShouldIncludeMessageTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitAssertionsShouldIncludeMessageTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class JUnitAssertionsShouldIncludeMessageTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestContainsTooManyAssertsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestContainsTooManyAssertsTest.java index c91e0ec567..30404275d4 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestContainsTooManyAssertsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestContainsTooManyAssertsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class JUnitTestContainsTooManyAssertsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestsShouldIncludeAssertTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestsShouldIncludeAssertTest.java index b638b6931a..933f3f612c 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestsShouldIncludeAssertTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestsShouldIncludeAssertTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class JUnitTestsShouldIncludeAssertTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitUseExpectedTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitUseExpectedTest.java index fccdcb4321..3ad1c36784 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitUseExpectedTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitUseExpectedTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class JUnitUseExpectedTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/LiteralsFirstInComparisonsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/LiteralsFirstInComparisonsTest.java index ad573713aa..a5720ad7f7 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/LiteralsFirstInComparisonsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/LiteralsFirstInComparisonsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class LiteralsFirstInComparisonsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/LooseCouplingTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/LooseCouplingTest.java index 2d702101d4..5578b24fd5 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/LooseCouplingTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/LooseCouplingTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class LooseCouplingTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/MethodReturnsInternalArrayTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/MethodReturnsInternalArrayTest.java index 4ac38bd990..f3646e5d54 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/MethodReturnsInternalArrayTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/MethodReturnsInternalArrayTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class MethodReturnsInternalArrayTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/MissingOverrideTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/MissingOverrideTest.java index 0d374f3810..fd9b847b62 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/MissingOverrideTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/MissingOverrideTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class MissingOverrideTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/OneDeclarationPerLineTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/OneDeclarationPerLineTest.java index 84c2a6d5b5..8c21b1715c 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/OneDeclarationPerLineTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/OneDeclarationPerLineTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class OneDeclarationPerLineTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/PreserveStackTraceTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/PreserveStackTraceTest.java index 3ee1e1f9ec..56e4f6de8b 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/PreserveStackTraceTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/PreserveStackTraceTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class PreserveStackTraceTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/PrimitiveWrapperInstantiationTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/PrimitiveWrapperInstantiationTest.java index c4c4242233..6e656beb8e 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/PrimitiveWrapperInstantiationTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/PrimitiveWrapperInstantiationTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class PrimitiveWrapperInstantiationTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ReplaceEnumerationWithIteratorTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ReplaceEnumerationWithIteratorTest.java index ae43342146..125b827b3a 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ReplaceEnumerationWithIteratorTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ReplaceEnumerationWithIteratorTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ReplaceEnumerationWithIteratorTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ReplaceHashtableWithMapTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ReplaceHashtableWithMapTest.java index 96c695b7d9..32a5a7d682 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ReplaceHashtableWithMapTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ReplaceHashtableWithMapTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ReplaceHashtableWithMapTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ReplaceVectorWithListTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ReplaceVectorWithListTest.java index 6e6c42ebfa..ef8f827443 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ReplaceVectorWithListTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ReplaceVectorWithListTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ReplaceVectorWithListTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/SimplifiableTestAssertionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/SimplifiableTestAssertionTest.java index 4e8f183411..3d40f44bd2 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/SimplifiableTestAssertionTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/SimplifiableTestAssertionTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class SimplifiableTestAssertionTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/SwitchStmtsShouldHaveDefaultTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/SwitchStmtsShouldHaveDefaultTest.java index c1e3024e73..1e413f1bde 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/SwitchStmtsShouldHaveDefaultTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/SwitchStmtsShouldHaveDefaultTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class SwitchStmtsShouldHaveDefaultTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/SystemPrintlnTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/SystemPrintlnTest.java index f56c1d553a..eb401c15bc 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/SystemPrintlnTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/SystemPrintlnTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class SystemPrintlnTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedAssignmentTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedAssignmentTest.java index e0268e6b19..0401dd83ec 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedAssignmentTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedAssignmentTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnusedAssignmentTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedFormalParameterTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedFormalParameterTest.java index 1498848b13..d50db5eed9 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedFormalParameterTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedFormalParameterTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnusedFormalParameterTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedLocalVariableTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedLocalVariableTest.java index cef06f1d28..e036436f04 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedLocalVariableTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedLocalVariableTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnusedLocalVariableTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedPrivateFieldTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedPrivateFieldTest.java index 2dbebb0d75..393832d452 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedPrivateFieldTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedPrivateFieldTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnusedPrivateFieldTest extends PmdRuleTst { diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedPrivateMethodTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedPrivateMethodTest.java index 95c69992cb..a865a70706 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedPrivateMethodTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedPrivateMethodTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnusedPrivateMethodTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseCollectionIsEmptyTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseCollectionIsEmptyTest.java index c5ff68ec34..59f03df249 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseCollectionIsEmptyTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseCollectionIsEmptyTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UseCollectionIsEmptyTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseStandardCharsetsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseStandardCharsetsTest.java index 9ca82a74bf..aca984101e 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseStandardCharsetsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseStandardCharsetsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UseStandardCharsetsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseTryWithResourcesTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseTryWithResourcesTest.java index 6ae963e5b7..07334453bd 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseTryWithResourcesTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseTryWithResourcesTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UseTryWithResourcesTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseVarargsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseVarargsTest.java index d427a9b63a..d3c6b35411 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseVarargsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseVarargsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UseVarargsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/WhileLoopWithLiteralBooleanTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/WhileLoopWithLiteralBooleanTest.java index c123e41fb9..4fe2c32ef5 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/WhileLoopWithLiteralBooleanTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/WhileLoopWithLiteralBooleanTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class WhileLoopWithLiteralBooleanTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AtLeastOneConstructorTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AtLeastOneConstructorTest.java index a01faa8ee8..0016e9ddbc 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AtLeastOneConstructorTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AtLeastOneConstructorTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AtLeastOneConstructorTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AvoidDollarSignsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AvoidDollarSignsTest.java index 3912331a26..34a6e215bb 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AvoidDollarSignsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AvoidDollarSignsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidDollarSignsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AvoidProtectedFieldInFinalClassTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AvoidProtectedFieldInFinalClassTest.java index 6f12fef002..f7776cd225 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AvoidProtectedFieldInFinalClassTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AvoidProtectedFieldInFinalClassTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidProtectedFieldInFinalClassTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AvoidProtectedMethodInFinalClassNotExtendingTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AvoidProtectedMethodInFinalClassNotExtendingTest.java index 26f19cbefb..7d7e2cfa3b 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AvoidProtectedMethodInFinalClassNotExtendingTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AvoidProtectedMethodInFinalClassNotExtendingTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidProtectedMethodInFinalClassNotExtendingTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AvoidUsingNativeCodeTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AvoidUsingNativeCodeTest.java index d6be3157ba..fae466967b 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AvoidUsingNativeCodeTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AvoidUsingNativeCodeTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidUsingNativeCodeTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/BooleanGetMethodNameTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/BooleanGetMethodNameTest.java index 4ecd11cdae..1b239e2ab1 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/BooleanGetMethodNameTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/BooleanGetMethodNameTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class BooleanGetMethodNameTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/CallSuperInConstructorTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/CallSuperInConstructorTest.java index c1df93ea1c..34310381de 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/CallSuperInConstructorTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/CallSuperInConstructorTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class CallSuperInConstructorTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ClassNamingConventionsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ClassNamingConventionsTest.java index 32796e3fd4..ca721c867a 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ClassNamingConventionsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ClassNamingConventionsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ClassNamingConventionsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/CommentDefaultAccessModifierTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/CommentDefaultAccessModifierTest.java index 57e297e29a..c6e02b62f5 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/CommentDefaultAccessModifierTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/CommentDefaultAccessModifierTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class CommentDefaultAccessModifierTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ConfusingTernaryTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ConfusingTernaryTest.java index 383ded2194..ed559d2e32 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ConfusingTernaryTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ConfusingTernaryTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ConfusingTernaryTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ControlStatementBracesTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ControlStatementBracesTest.java index 02ba0a4103..c94aed935c 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ControlStatementBracesTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ControlStatementBracesTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ControlStatementBracesTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/EmptyControlStatementTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/EmptyControlStatementTest.java index 70bbcd8897..4cb1a84298 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/EmptyControlStatementTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/EmptyControlStatementTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class EmptyControlStatementTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/EmptyMethodInAbstractClassShouldBeAbstractTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/EmptyMethodInAbstractClassShouldBeAbstractTest.java index 44de194856..27bb5620d1 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/EmptyMethodInAbstractClassShouldBeAbstractTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/EmptyMethodInAbstractClassShouldBeAbstractTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class EmptyMethodInAbstractClassShouldBeAbstractTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ExtendsObjectTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ExtendsObjectTest.java index a5b01cc926..6e66ca54e4 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ExtendsObjectTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ExtendsObjectTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ExtendsObjectTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/FieldDeclarationsShouldBeAtStartOfClassTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/FieldDeclarationsShouldBeAtStartOfClassTest.java index 2a46f0ccc8..f1c9cfcb91 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/FieldDeclarationsShouldBeAtStartOfClassTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/FieldDeclarationsShouldBeAtStartOfClassTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class FieldDeclarationsShouldBeAtStartOfClassTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/FieldNamingConventionsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/FieldNamingConventionsTest.java index ad43201f57..e4a1157bf2 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/FieldNamingConventionsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/FieldNamingConventionsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class FieldNamingConventionsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/FinalParameterInAbstractMethodTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/FinalParameterInAbstractMethodTest.java index 68a325445b..8efa889742 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/FinalParameterInAbstractMethodTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/FinalParameterInAbstractMethodTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class FinalParameterInAbstractMethodTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ForLoopShouldBeWhileLoopTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ForLoopShouldBeWhileLoopTest.java index 0e77ed8483..427e066be8 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ForLoopShouldBeWhileLoopTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ForLoopShouldBeWhileLoopTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ForLoopShouldBeWhileLoopTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/FormalParameterNamingConventionsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/FormalParameterNamingConventionsTest.java index 16f76366c5..2327c1cd2f 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/FormalParameterNamingConventionsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/FormalParameterNamingConventionsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class FormalParameterNamingConventionsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/GenericsNamingTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/GenericsNamingTest.java index 1408b7f3f2..4ed583d9fe 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/GenericsNamingTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/GenericsNamingTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class GenericsNamingTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/IdenticalCatchBranchesTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/IdenticalCatchBranchesTest.java index 9b306eb379..87875e0f14 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/IdenticalCatchBranchesTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/IdenticalCatchBranchesTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class IdenticalCatchBranchesTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LinguisticNamingTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LinguisticNamingTest.java index 2535e6a9a0..fd1466df70 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LinguisticNamingTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LinguisticNamingTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class LinguisticNamingTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalHomeNamingConventionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalHomeNamingConventionTest.java index 8f9adcc264..04fdee75ab 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalHomeNamingConventionTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalHomeNamingConventionTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class LocalHomeNamingConventionTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalInterfaceSessionNamingConventionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalInterfaceSessionNamingConventionTest.java index ff39a550b0..ff119c1a28 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalInterfaceSessionNamingConventionTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalInterfaceSessionNamingConventionTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class LocalInterfaceSessionNamingConventionTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalVariableCouldBeFinalTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalVariableCouldBeFinalTest.java index 610f44eecd..5c49860210 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalVariableCouldBeFinalTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalVariableCouldBeFinalTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class LocalVariableCouldBeFinalTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalVariableNamingConventionsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalVariableNamingConventionsTest.java index 103742c709..18753981b9 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalVariableNamingConventionsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalVariableNamingConventionsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class LocalVariableNamingConventionsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LongVariableTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LongVariableTest.java index f93806cc6a..86ad669aac 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LongVariableTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LongVariableTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class LongVariableTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/MDBAndSessionBeanNamingConventionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/MDBAndSessionBeanNamingConventionTest.java index 5a9477e98e..5104b29ffc 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/MDBAndSessionBeanNamingConventionTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/MDBAndSessionBeanNamingConventionTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class MDBAndSessionBeanNamingConventionTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/MethodArgumentCouldBeFinalTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/MethodArgumentCouldBeFinalTest.java index 589830413c..55d4325665 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/MethodArgumentCouldBeFinalTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/MethodArgumentCouldBeFinalTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class MethodArgumentCouldBeFinalTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/MethodNamingConventionsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/MethodNamingConventionsTest.java index eaa4fde1e9..67a7557ec0 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/MethodNamingConventionsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/MethodNamingConventionsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class MethodNamingConventionsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/NoPackageTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/NoPackageTest.java index df3821dc03..80badeb38c 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/NoPackageTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/NoPackageTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class NoPackageTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/OnlyOneReturnTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/OnlyOneReturnTest.java index 9cd086b1e5..bf2e0d75eb 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/OnlyOneReturnTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/OnlyOneReturnTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class OnlyOneReturnTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/PackageCaseTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/PackageCaseTest.java index cdd036a17d..f82f7071ce 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/PackageCaseTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/PackageCaseTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class PackageCaseTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/PrematureDeclarationTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/PrematureDeclarationTest.java index 16f56fc61a..7449842bd8 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/PrematureDeclarationTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/PrematureDeclarationTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class PrematureDeclarationTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/RemoteInterfaceNamingConventionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/RemoteInterfaceNamingConventionTest.java index 6985386725..99b7caad86 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/RemoteInterfaceNamingConventionTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/RemoteInterfaceNamingConventionTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class RemoteInterfaceNamingConventionTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/RemoteSessionInterfaceNamingConventionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/RemoteSessionInterfaceNamingConventionTest.java index 5e95b5525f..8c9a2dba9c 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/RemoteSessionInterfaceNamingConventionTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/RemoteSessionInterfaceNamingConventionTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class RemoteSessionInterfaceNamingConventionTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ShortClassNameTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ShortClassNameTest.java index c4ae1aff0d..cc08d111d9 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ShortClassNameTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ShortClassNameTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ShortClassNameTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ShortMethodNameTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ShortMethodNameTest.java index 9fab5587dc..77f1793eca 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ShortMethodNameTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ShortMethodNameTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ShortMethodNameTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ShortVariableTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ShortVariableTest.java index b178ba1bf7..e505d0ef49 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ShortVariableTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ShortVariableTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ShortVariableTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/TooManyStaticImportsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/TooManyStaticImportsTest.java index ae659dcfdc..6346aa9a48 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/TooManyStaticImportsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/TooManyStaticImportsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class TooManyStaticImportsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryAnnotationValueElementTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryAnnotationValueElementTest.java index 75d06a7980..051a52d508 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryAnnotationValueElementTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryAnnotationValueElementTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnnecessaryAnnotationValueElementTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryBoxingTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryBoxingTest.java index 09e83074a5..bb37cb806f 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryBoxingTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryBoxingTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnnecessaryBoxingTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryCastTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryCastTest.java index b479fdfa98..ddbca59128 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryCastTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryCastTest.java @@ -5,7 +5,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnnecessaryCastTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryConstructorTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryConstructorTest.java index 4e0c2bf4b7..b5111c5bb4 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryConstructorTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryConstructorTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnnecessaryConstructorTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryFullyQualifiedNameTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryFullyQualifiedNameTest.java index b8edf924a3..9f0c2eec0f 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryFullyQualifiedNameTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryFullyQualifiedNameTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnnecessaryFullyQualifiedNameTest extends PmdRuleTst { // Do not delete these two enums - it is needed for a test case diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryImportTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryImportTest.java index 4cdbf50000..ea4bea97d4 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryImportTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryImportTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnnecessaryImportTest extends PmdRuleTst { // these 2 methods are used for a test case, do not delete diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryLocalBeforeReturnTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryLocalBeforeReturnTest.java index d6fe2b3a65..10bf3efae5 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryLocalBeforeReturnTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryLocalBeforeReturnTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnnecessaryLocalBeforeReturnTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryModifierTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryModifierTest.java index 442d89734b..5c77459d42 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryModifierTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryModifierTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnnecessaryModifierTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryReturnTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryReturnTest.java index de89b09b55..9213d7d9f2 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryReturnTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryReturnTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnnecessaryReturnTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessarySemicolonTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessarySemicolonTest.java index 6258d531d9..9e488c285c 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessarySemicolonTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessarySemicolonTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnnecessarySemicolonTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UseDiamondOperatorTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UseDiamondOperatorTest.java index fe6f6c19b4..3148d3a690 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UseDiamondOperatorTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UseDiamondOperatorTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UseDiamondOperatorTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UseExplicitTypesTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UseExplicitTypesTest.java index e535efd39c..506bbd7095 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UseExplicitTypesTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UseExplicitTypesTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UseExplicitTypesTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UseShortArrayInitializerTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UseShortArrayInitializerTest.java index 28959ae4c0..a4cec59f39 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UseShortArrayInitializerTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UseShortArrayInitializerTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UseShortArrayInitializerTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UseUnderscoresInNumericLiteralsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UseUnderscoresInNumericLiteralsTest.java index df002dba91..71098101c0 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UseUnderscoresInNumericLiteralsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UseUnderscoresInNumericLiteralsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UseUnderscoresInNumericLiteralsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UselessParenthesesTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UselessParenthesesTest.java index 2ff2cb875e..8e4050c9aa 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UselessParenthesesTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UselessParenthesesTest.java @@ -15,7 +15,7 @@ import net.sourceforge.pmd.lang.java.JavaParsingHelper; import net.sourceforge.pmd.lang.java.ast.ASTCompilationUnit; import net.sourceforge.pmd.lang.java.ast.ASTExpression; import net.sourceforge.pmd.lang.java.rule.codestyle.UselessParenthesesRule.Necessity; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UselessParenthesesTest extends PmdRuleTst { diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UselessQualifiedThisTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UselessQualifiedThisTest.java index d4c28d5193..c7eed79cee 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UselessQualifiedThisTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UselessQualifiedThisTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UselessQualifiedThisTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AbstractClassWithoutAnyMethodTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AbstractClassWithoutAnyMethodTest.java index 2707edc916..a5d9253ee2 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AbstractClassWithoutAnyMethodTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AbstractClassWithoutAnyMethodTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AbstractClassWithoutAnyMethodTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidCatchingGenericExceptionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidCatchingGenericExceptionTest.java index 9014238a7b..32fecf59f8 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidCatchingGenericExceptionTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidCatchingGenericExceptionTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidCatchingGenericExceptionTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidDeeplyNestedIfStmtsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidDeeplyNestedIfStmtsTest.java index ffeb2eff0b..28eab0fdf1 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidDeeplyNestedIfStmtsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidDeeplyNestedIfStmtsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidDeeplyNestedIfStmtsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidRethrowingExceptionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidRethrowingExceptionTest.java index 8b4946aba8..aa3bbd57ba 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidRethrowingExceptionTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidRethrowingExceptionTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidRethrowingExceptionTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidThrowingNewInstanceOfSameExceptionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidThrowingNewInstanceOfSameExceptionTest.java index 80992fa8b8..14e7a6b7df 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidThrowingNewInstanceOfSameExceptionTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidThrowingNewInstanceOfSameExceptionTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidThrowingNewInstanceOfSameExceptionTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidThrowingNullPointerExceptionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidThrowingNullPointerExceptionTest.java index 47eace4526..c1b437ab41 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidThrowingNullPointerExceptionTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidThrowingNullPointerExceptionTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidThrowingNullPointerExceptionTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidThrowingRawExceptionTypesTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidThrowingRawExceptionTypesTest.java index be27cc8e00..8cffad6aeb 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidThrowingRawExceptionTypesTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidThrowingRawExceptionTypesTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidThrowingRawExceptionTypesTest extends PmdRuleTst { public static class Throwable extends java.lang.Throwable { diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidUncheckedExceptionsInSignaturesTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidUncheckedExceptionsInSignaturesTest.java index 0a18773aa2..146b4990f3 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidUncheckedExceptionsInSignaturesTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidUncheckedExceptionsInSignaturesTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidUncheckedExceptionsInSignaturesTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ClassWithOnlyPrivateConstructorsShouldBeFinalTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ClassWithOnlyPrivateConstructorsShouldBeFinalTest.java index 5310503f78..7328a0999f 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ClassWithOnlyPrivateConstructorsShouldBeFinalTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ClassWithOnlyPrivateConstructorsShouldBeFinalTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ClassWithOnlyPrivateConstructorsShouldBeFinalTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/CognitiveComplexityTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/CognitiveComplexityTest.java index c6c2edcebc..b20c1035a8 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/CognitiveComplexityTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/CognitiveComplexityTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class CognitiveComplexityTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/CollapsibleIfStatementsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/CollapsibleIfStatementsTest.java index 3f13ce5287..44d831ea9e 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/CollapsibleIfStatementsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/CollapsibleIfStatementsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class CollapsibleIfStatementsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/CouplingBetweenObjectsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/CouplingBetweenObjectsTest.java index 7c2948ec32..79ab664ae7 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/CouplingBetweenObjectsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/CouplingBetweenObjectsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class CouplingBetweenObjectsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/CyclomaticComplexityTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/CyclomaticComplexityTest.java index df859e7e08..7833abbb86 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/CyclomaticComplexityTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/CyclomaticComplexityTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class CyclomaticComplexityTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/DataClassTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/DataClassTest.java index af2152f439..6a7cccfdd9 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/DataClassTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/DataClassTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class DataClassTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/DoNotExtendJavaLangErrorTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/DoNotExtendJavaLangErrorTest.java index e5d9b7b301..57280be3f8 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/DoNotExtendJavaLangErrorTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/DoNotExtendJavaLangErrorTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class DoNotExtendJavaLangErrorTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ExceptionAsFlowControlTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ExceptionAsFlowControlTest.java index 292fde945d..2dbd142d27 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ExceptionAsFlowControlTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ExceptionAsFlowControlTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ExceptionAsFlowControlTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ExcessiveImportsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ExcessiveImportsTest.java index 74fd72a16c..7547ce785a 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ExcessiveImportsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ExcessiveImportsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ExcessiveImportsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ExcessiveParameterListTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ExcessiveParameterListTest.java index 6308b1fe4f..30fa157b94 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ExcessiveParameterListTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ExcessiveParameterListTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ExcessiveParameterListTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ExcessivePublicCountTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ExcessivePublicCountTest.java index 760e4807fe..7417e82f49 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ExcessivePublicCountTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ExcessivePublicCountTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ExcessivePublicCountTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/FinalFieldCouldBeStaticTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/FinalFieldCouldBeStaticTest.java index cf9d950639..71b86c4014 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/FinalFieldCouldBeStaticTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/FinalFieldCouldBeStaticTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class FinalFieldCouldBeStaticTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/GodClassTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/GodClassTest.java index dd69734923..eac3f10322 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/GodClassTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/GodClassTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class GodClassTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ImmutableFieldTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ImmutableFieldTest.java index b974fad282..eb0972d72b 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ImmutableFieldTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ImmutableFieldTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ImmutableFieldTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/InvalidJavaBeanTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/InvalidJavaBeanTest.java index dc8c949263..f50fbe1971 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/InvalidJavaBeanTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/InvalidJavaBeanTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; public class InvalidJavaBeanTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/LawOfDemeterTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/LawOfDemeterTest.java index 99e77ad459..b4e94a6e26 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/LawOfDemeterTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/LawOfDemeterTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class LawOfDemeterTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/LogicInversionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/LogicInversionTest.java index 3a4cb92739..b59044573a 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/LogicInversionTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/LogicInversionTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class LogicInversionTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/LoosePackageCouplingTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/LoosePackageCouplingTest.java index 00e0b010c9..b838934226 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/LoosePackageCouplingTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/LoosePackageCouplingTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class LoosePackageCouplingTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/MutableStaticStateTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/MutableStaticStateTest.java index cb5e29d512..df946baa86 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/MutableStaticStateTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/MutableStaticStateTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class MutableStaticStateTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/NPathComplexityTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/NPathComplexityTest.java index 98ddc7cae6..f23536ba55 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/NPathComplexityTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/NPathComplexityTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class NPathComplexityTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/NcssCountTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/NcssCountTest.java index 48e984d9ad..537485d26c 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/NcssCountTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/NcssCountTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class NcssCountTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SignatureDeclareThrowsExceptionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SignatureDeclareThrowsExceptionTest.java index d44e58ec86..d5e0bc20af 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SignatureDeclareThrowsExceptionTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SignatureDeclareThrowsExceptionTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class SignatureDeclareThrowsExceptionTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SimplifiedTernaryTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SimplifiedTernaryTest.java index 3f2a8a5daf..dc68ac28bd 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SimplifiedTernaryTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SimplifiedTernaryTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class SimplifiedTernaryTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SimplifyBooleanExpressionsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SimplifyBooleanExpressionsTest.java index 0b1a4bc204..f17434579f 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SimplifyBooleanExpressionsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SimplifyBooleanExpressionsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class SimplifyBooleanExpressionsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SimplifyBooleanReturnsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SimplifyBooleanReturnsTest.java index ab631f2194..e385db5af1 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SimplifyBooleanReturnsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SimplifyBooleanReturnsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class SimplifyBooleanReturnsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SimplifyConditionalTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SimplifyConditionalTest.java index 47400d35cf..9ad90e779d 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SimplifyConditionalTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SimplifyConditionalTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class SimplifyConditionalTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SingularFieldTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SingularFieldTest.java index 95fd5ff04c..81835c7c5b 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SingularFieldTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SingularFieldTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class SingularFieldTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SwitchDensityTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SwitchDensityTest.java index 588ab69e8d..20788f1419 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SwitchDensityTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SwitchDensityTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class SwitchDensityTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/TooManyFieldsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/TooManyFieldsTest.java index 05933e2507..9c3c33d7ee 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/TooManyFieldsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/TooManyFieldsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class TooManyFieldsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/TooManyMethodsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/TooManyMethodsTest.java index 122519449a..fa9d3db763 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/TooManyMethodsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/TooManyMethodsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class TooManyMethodsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/UseObjectForClearerAPITest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/UseObjectForClearerAPITest.java index 9a397a435a..fc4a699a0d 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/UseObjectForClearerAPITest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/UseObjectForClearerAPITest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UseObjectForClearerAPITest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/UseUtilityClassTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/UseUtilityClassTest.java index 41ff6bd799..7d023149da 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/UseUtilityClassTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/UseUtilityClassTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UseUtilityClassTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/UselessOverridingMethodTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/UselessOverridingMethodTest.java index 85ff3df3d9..ead57712d1 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/UselessOverridingMethodTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/UselessOverridingMethodTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UselessOverridingMethodTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentContentTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentContentTest.java index 322a64200a..9ecdfb0ba9 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentContentTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentContentTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.documentation; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class CommentContentTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentRequiredTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentRequiredTest.java index 4c026b25c3..5675facab9 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentRequiredTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentRequiredTest.java @@ -14,7 +14,7 @@ import org.junit.jupiter.api.Test; import net.sourceforge.pmd.lang.rule.Rule; import net.sourceforge.pmd.properties.PropertyDescriptor; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class CommentRequiredTest extends PmdRuleTst { @Test diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentSizeTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentSizeTest.java index 5d4e204836..5c7b46c604 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentSizeTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentSizeTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.documentation; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class CommentSizeTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/UncommentedEmptyConstructorTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/UncommentedEmptyConstructorTest.java index 0bb603709c..07db696d06 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/UncommentedEmptyConstructorTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/UncommentedEmptyConstructorTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.documentation; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UncommentedEmptyConstructorTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/UncommentedEmptyMethodBodyTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/UncommentedEmptyMethodBodyTest.java index 8c2095d737..cf02536ff6 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/UncommentedEmptyMethodBodyTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/UncommentedEmptyMethodBodyTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.documentation; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UncommentedEmptyMethodBodyTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AssignmentInOperandTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AssignmentInOperandTest.java index 4edf718a2d..bcc9a1a047 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AssignmentInOperandTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AssignmentInOperandTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AssignmentInOperandTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AssignmentToNonFinalStaticTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AssignmentToNonFinalStaticTest.java index 4813dfffbc..a0ec733db1 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AssignmentToNonFinalStaticTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AssignmentToNonFinalStaticTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AssignmentToNonFinalStaticTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidAccessibilityAlterationTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidAccessibilityAlterationTest.java index 03bde11b12..299773b485 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidAccessibilityAlterationTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidAccessibilityAlterationTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidAccessibilityAlterationTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidAssertAsIdentifierTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidAssertAsIdentifierTest.java index 886c08b67d..2181e84e4b 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidAssertAsIdentifierTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidAssertAsIdentifierTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidAssertAsIdentifierTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidBranchingStatementAsLastInLoopTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidBranchingStatementAsLastInLoopTest.java index 191b68987d..e220e19d13 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidBranchingStatementAsLastInLoopTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidBranchingStatementAsLastInLoopTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidBranchingStatementAsLastInLoopTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidCallingFinalizeTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidCallingFinalizeTest.java index 246bce0db7..d677bbb03e 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidCallingFinalizeTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidCallingFinalizeTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidCallingFinalizeTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidCatchingNPETest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidCatchingNPETest.java index 006cc3d84e..b232a83d67 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidCatchingNPETest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidCatchingNPETest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidCatchingNPETest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidCatchingThrowableTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidCatchingThrowableTest.java index c11ea40e2a..c8a5c0c84d 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidCatchingThrowableTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidCatchingThrowableTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidCatchingThrowableTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidDecimalLiteralsInBigDecimalConstructorTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidDecimalLiteralsInBigDecimalConstructorTest.java index 267bb84ab9..89ea4cb63c 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidDecimalLiteralsInBigDecimalConstructorTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidDecimalLiteralsInBigDecimalConstructorTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidDecimalLiteralsInBigDecimalConstructorTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidDuplicateLiteralsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidDuplicateLiteralsTest.java index d2f660a2e9..c08bad740b 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidDuplicateLiteralsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidDuplicateLiteralsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidDuplicateLiteralsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidEnumAsIdentifierTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidEnumAsIdentifierTest.java index be57423730..8b6da14263 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidEnumAsIdentifierTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidEnumAsIdentifierTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidEnumAsIdentifierTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidFieldNameMatchingMethodNameTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidFieldNameMatchingMethodNameTest.java index f8486d435e..9cea99c577 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidFieldNameMatchingMethodNameTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidFieldNameMatchingMethodNameTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidFieldNameMatchingMethodNameTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidFieldNameMatchingTypeNameTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidFieldNameMatchingTypeNameTest.java index 3edcfcf304..3583b1a557 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidFieldNameMatchingTypeNameTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidFieldNameMatchingTypeNameTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidFieldNameMatchingTypeNameTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidInstanceofChecksInCatchClauseTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidInstanceofChecksInCatchClauseTest.java index 68b781f08a..a839a4c68a 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidInstanceofChecksInCatchClauseTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidInstanceofChecksInCatchClauseTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidInstanceofChecksInCatchClauseTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidLiteralsInIfConditionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidLiteralsInIfConditionTest.java index 802b8dca59..d2a8f2c42b 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidLiteralsInIfConditionTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidLiteralsInIfConditionTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidLiteralsInIfConditionTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidLosingExceptionInformationTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidLosingExceptionInformationTest.java index d31247dec4..e1cdd89895 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidLosingExceptionInformationTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidLosingExceptionInformationTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidLosingExceptionInformationTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidMultipleUnaryOperatorsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidMultipleUnaryOperatorsTest.java index 68121b5dc5..3d2893f02c 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidMultipleUnaryOperatorsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidMultipleUnaryOperatorsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidMultipleUnaryOperatorsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidUsingOctalValuesTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidUsingOctalValuesTest.java index 968d7ca76b..9b396d1519 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidUsingOctalValuesTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidUsingOctalValuesTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidUsingOctalValuesTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/BrokenNullCheckTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/BrokenNullCheckTest.java index 2b1ba4ff7e..bf48e3784a 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/BrokenNullCheckTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/BrokenNullCheckTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class BrokenNullCheckTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CallSuperFirstTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CallSuperFirstTest.java index 311a13ff74..930906b275 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CallSuperFirstTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CallSuperFirstTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class CallSuperFirstTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CallSuperLastTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CallSuperLastTest.java index a368b2bc75..c9102640ca 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CallSuperLastTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CallSuperLastTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class CallSuperLastTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CheckSkipResultTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CheckSkipResultTest.java index 55bb58982b..26fc541489 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CheckSkipResultTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CheckSkipResultTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class CheckSkipResultTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ClassCastExceptionWithToArrayTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ClassCastExceptionWithToArrayTest.java index dfd5d2066f..502cf5ea4f 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ClassCastExceptionWithToArrayTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ClassCastExceptionWithToArrayTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ClassCastExceptionWithToArrayTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloneMethodMustBePublicTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloneMethodMustBePublicTest.java index 2a96cb6855..371d240c06 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloneMethodMustBePublicTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloneMethodMustBePublicTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class CloneMethodMustBePublicTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloneMethodMustImplementCloneableTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloneMethodMustImplementCloneableTest.java index 9aef788c64..3f37f37eaf 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloneMethodMustImplementCloneableTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloneMethodMustImplementCloneableTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class CloneMethodMustImplementCloneableTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloneMethodReturnTypeMustMatchClassNameTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloneMethodReturnTypeMustMatchClassNameTest.java index 717ac81df4..63df372d7a 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloneMethodReturnTypeMustMatchClassNameTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloneMethodReturnTypeMustMatchClassNameTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class CloneMethodReturnTypeMustMatchClassNameTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloseResourceTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloseResourceTest.java index bdbf15e7c2..20856ab956 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloseResourceTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloseResourceTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class CloseResourceTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CompareObjectsWithEqualsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CompareObjectsWithEqualsTest.java index 05acb24255..25e111a8fa 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CompareObjectsWithEqualsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CompareObjectsWithEqualsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class CompareObjectsWithEqualsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ComparisonWithNaNTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ComparisonWithNaNTest.java index 723d440e4c..1015af42ed 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ComparisonWithNaNTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ComparisonWithNaNTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ComparisonWithNaNTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ConstructorCallsOverridableMethodTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ConstructorCallsOverridableMethodTest.java index 2440994922..8420a865ab 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ConstructorCallsOverridableMethodTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ConstructorCallsOverridableMethodTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ConstructorCallsOverridableMethodTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DetachedTestCaseTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DetachedTestCaseTest.java index 74a15e36ae..f2def6539a 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DetachedTestCaseTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DetachedTestCaseTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class DetachedTestCaseTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotCallGarbageCollectionExplicitlyTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotCallGarbageCollectionExplicitlyTest.java index 4796425f69..46202e927a 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotCallGarbageCollectionExplicitlyTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotCallGarbageCollectionExplicitlyTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class DoNotCallGarbageCollectionExplicitlyTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotExtendJavaLangThrowableTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotExtendJavaLangThrowableTest.java index 7e5494958d..6a849194f6 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotExtendJavaLangThrowableTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotExtendJavaLangThrowableTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class DoNotExtendJavaLangThrowableTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotHardCodeSDCardTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotHardCodeSDCardTest.java index dd4a99f308..bdfd5d58cb 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotHardCodeSDCardTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotHardCodeSDCardTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class DoNotHardCodeSDCardTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotTerminateVMTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotTerminateVMTest.java index f6cc3a8bb1..dcb0f8f4ee 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotTerminateVMTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotTerminateVMTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class DoNotTerminateVMTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotThrowExceptionInFinallyTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotThrowExceptionInFinallyTest.java index aed669dc83..7eefe57ee0 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotThrowExceptionInFinallyTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotThrowExceptionInFinallyTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class DoNotThrowExceptionInFinallyTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DontImportSunTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DontImportSunTest.java index 1498a6db2a..f4c0ae4184 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DontImportSunTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DontImportSunTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class DontImportSunTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DontUseFloatTypeForLoopIndicesTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DontUseFloatTypeForLoopIndicesTest.java index eedf01e2d5..1572170e72 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DontUseFloatTypeForLoopIndicesTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DontUseFloatTypeForLoopIndicesTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class DontUseFloatTypeForLoopIndicesTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/EmptyCatchBlockTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/EmptyCatchBlockTest.java index a953c3e013..9a5537230b 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/EmptyCatchBlockTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/EmptyCatchBlockTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class EmptyCatchBlockTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/EmptyFinalizerTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/EmptyFinalizerTest.java index 6f7cd4674f..cd31622ab2 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/EmptyFinalizerTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/EmptyFinalizerTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class EmptyFinalizerTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/EqualsNullTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/EqualsNullTest.java index fc903ce4bb..f0cfd64e5c 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/EqualsNullTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/EqualsNullTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class EqualsNullTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/FinalizeDoesNotCallSuperFinalizeTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/FinalizeDoesNotCallSuperFinalizeTest.java index a8de36f386..d1747d4885 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/FinalizeDoesNotCallSuperFinalizeTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/FinalizeDoesNotCallSuperFinalizeTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class FinalizeDoesNotCallSuperFinalizeTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/FinalizeOnlyCallsSuperFinalizeTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/FinalizeOnlyCallsSuperFinalizeTest.java index f94cb50b83..7da75fa5c1 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/FinalizeOnlyCallsSuperFinalizeTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/FinalizeOnlyCallsSuperFinalizeTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class FinalizeOnlyCallsSuperFinalizeTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/FinalizeOverloadedTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/FinalizeOverloadedTest.java index 9df63b451b..c529f24a4a 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/FinalizeOverloadedTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/FinalizeOverloadedTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class FinalizeOverloadedTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/FinalizeShouldBeProtectedTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/FinalizeShouldBeProtectedTest.java index ddc8e610b3..e2cab4ed1a 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/FinalizeShouldBeProtectedTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/FinalizeShouldBeProtectedTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class FinalizeShouldBeProtectedTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/IdempotentOperationsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/IdempotentOperationsTest.java index b636426e8d..424df37768 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/IdempotentOperationsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/IdempotentOperationsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class IdempotentOperationsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ImplicitSwitchFallThroughTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ImplicitSwitchFallThroughTest.java index 99ad4868f7..3a14a27009 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ImplicitSwitchFallThroughTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ImplicitSwitchFallThroughTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ImplicitSwitchFallThroughTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/InstantiationToGetClassTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/InstantiationToGetClassTest.java index c85239d5ea..f575d90629 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/InstantiationToGetClassTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/InstantiationToGetClassTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class InstantiationToGetClassTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/InvalidLogMessageFormatTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/InvalidLogMessageFormatTest.java index 7e9abea98c..933231b1bc 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/InvalidLogMessageFormatTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/InvalidLogMessageFormatTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class InvalidLogMessageFormatTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/JUnitSpellingTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/JUnitSpellingTest.java index 047f7313e3..faaffea06c 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/JUnitSpellingTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/JUnitSpellingTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class JUnitSpellingTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/JUnitStaticSuiteTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/JUnitStaticSuiteTest.java index 6d7a5b846d..858cc27ba4 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/JUnitStaticSuiteTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/JUnitStaticSuiteTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class JUnitStaticSuiteTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/JumbledIncrementerTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/JumbledIncrementerTest.java index db5032bbfa..ac16e6555e 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/JumbledIncrementerTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/JumbledIncrementerTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class JumbledIncrementerTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MethodWithSameNameAsEnclosingClassTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MethodWithSameNameAsEnclosingClassTest.java index 386383efd1..fe78042cbf 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MethodWithSameNameAsEnclosingClassTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MethodWithSameNameAsEnclosingClassTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class MethodWithSameNameAsEnclosingClassTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MisplacedNullCheckTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MisplacedNullCheckTest.java index ca68722bec..3f5c5a0106 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MisplacedNullCheckTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MisplacedNullCheckTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class MisplacedNullCheckTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MissingSerialVersionUIDTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MissingSerialVersionUIDTest.java index a7358da129..bb338c5969 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MissingSerialVersionUIDTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MissingSerialVersionUIDTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class MissingSerialVersionUIDTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MissingStaticMethodInNonInstantiatableClassTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MissingStaticMethodInNonInstantiatableClassTest.java index 5cf642ed8e..cadf17f5f9 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MissingStaticMethodInNonInstantiatableClassTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MissingStaticMethodInNonInstantiatableClassTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class MissingStaticMethodInNonInstantiatableClassTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MoreThanOneLoggerTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MoreThanOneLoggerTest.java index f1deb552a7..fedc2ed326 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MoreThanOneLoggerTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MoreThanOneLoggerTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class MoreThanOneLoggerTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonCaseLabelInSwitchStatementTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonCaseLabelInSwitchStatementTest.java index d19b90912d..9d914a9552 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonCaseLabelInSwitchStatementTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonCaseLabelInSwitchStatementTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class NonCaseLabelInSwitchStatementTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonSerializableClassTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonSerializableClassTest.java index 9fc73d7ba0..5cc867bdb8 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonSerializableClassTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonSerializableClassTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class NonSerializableClassTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonStaticInitializerTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonStaticInitializerTest.java index 543bd5d56c..a971ea77c3 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonStaticInitializerTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonStaticInitializerTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class NonStaticInitializerTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NullAssignmentTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NullAssignmentTest.java index 84845a7d57..140df2e813 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NullAssignmentTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NullAssignmentTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class NullAssignmentTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/OverrideBothEqualsAndHashcodeTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/OverrideBothEqualsAndHashcodeTest.java index bed7dd18c3..7611bfaa34 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/OverrideBothEqualsAndHashcodeTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/OverrideBothEqualsAndHashcodeTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class OverrideBothEqualsAndHashcodeTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ProperCloneImplementationTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ProperCloneImplementationTest.java index caf7485fac..a6f9bbe99a 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ProperCloneImplementationTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ProperCloneImplementationTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ProperCloneImplementationTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ProperLoggerTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ProperLoggerTest.java index e301881e75..602ad8bdd5 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ProperLoggerTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ProperLoggerTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ProperLoggerTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ReturnEmptyCollectionRatherThanNullTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ReturnEmptyCollectionRatherThanNullTest.java index 88dc7a7593..499e6d6728 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ReturnEmptyCollectionRatherThanNullTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ReturnEmptyCollectionRatherThanNullTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ReturnEmptyCollectionRatherThanNullTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ReturnFromFinallyBlockTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ReturnFromFinallyBlockTest.java index 3a53638de2..b3e87a6011 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ReturnFromFinallyBlockTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ReturnFromFinallyBlockTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ReturnFromFinallyBlockTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SimpleDateFormatNeedsLocaleTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SimpleDateFormatNeedsLocaleTest.java index efe247e0c8..51199fb499 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SimpleDateFormatNeedsLocaleTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SimpleDateFormatNeedsLocaleTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class SimpleDateFormatNeedsLocaleTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SingleMethodSingletonTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SingleMethodSingletonTest.java index ff818721ae..e77ffe6cb0 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SingleMethodSingletonTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SingleMethodSingletonTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class SingleMethodSingletonTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SingletonClassReturningNewInstanceTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SingletonClassReturningNewInstanceTest.java index 838a2b4cd6..2b178c9b72 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SingletonClassReturningNewInstanceTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SingletonClassReturningNewInstanceTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class SingletonClassReturningNewInstanceTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/StaticEJBFieldShouldBeFinalTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/StaticEJBFieldShouldBeFinalTest.java index cfabdd6c67..0b3916d131 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/StaticEJBFieldShouldBeFinalTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/StaticEJBFieldShouldBeFinalTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class StaticEJBFieldShouldBeFinalTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/StringBufferInstantiationWithCharTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/StringBufferInstantiationWithCharTest.java index 60250e0167..f33dfcfd38 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/StringBufferInstantiationWithCharTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/StringBufferInstantiationWithCharTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class StringBufferInstantiationWithCharTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SuspiciousEqualsMethodNameTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SuspiciousEqualsMethodNameTest.java index 9536facef4..0193d8d266 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SuspiciousEqualsMethodNameTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SuspiciousEqualsMethodNameTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class SuspiciousEqualsMethodNameTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SuspiciousHashcodeMethodNameTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SuspiciousHashcodeMethodNameTest.java index 9d234b5800..6e341e0ebd 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SuspiciousHashcodeMethodNameTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SuspiciousHashcodeMethodNameTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class SuspiciousHashcodeMethodNameTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SuspiciousOctalEscapeTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SuspiciousOctalEscapeTest.java index 36a97b83ba..5c17a20755 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SuspiciousOctalEscapeTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SuspiciousOctalEscapeTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class SuspiciousOctalEscapeTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/TestClassWithoutTestCasesTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/TestClassWithoutTestCasesTest.java index 39f0f4fc47..b0a4edebce 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/TestClassWithoutTestCasesTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/TestClassWithoutTestCasesTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class TestClassWithoutTestCasesTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnconditionalIfStatementTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnconditionalIfStatementTest.java index e9fb6da5a1..6485314b6c 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnconditionalIfStatementTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnconditionalIfStatementTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnconditionalIfStatementTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnnecessaryBooleanAssertionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnnecessaryBooleanAssertionTest.java index e652838fc1..87621208a9 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnnecessaryBooleanAssertionTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnnecessaryBooleanAssertionTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnnecessaryBooleanAssertionTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnnecessaryCaseChangeTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnnecessaryCaseChangeTest.java index c2e0d37c4c..1a39ba29be 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnnecessaryCaseChangeTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnnecessaryCaseChangeTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnnecessaryCaseChangeTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnnecessaryConversionTemporaryTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnnecessaryConversionTemporaryTest.java index 4a08348e6b..54dfa6fc6c 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnnecessaryConversionTemporaryTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnnecessaryConversionTemporaryTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnnecessaryConversionTemporaryTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnusedNullCheckInEqualsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnusedNullCheckInEqualsTest.java index eaea9ff7e5..03383eca02 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnusedNullCheckInEqualsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnusedNullCheckInEqualsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnusedNullCheckInEqualsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UseCorrectExceptionLoggingTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UseCorrectExceptionLoggingTest.java index 8c735a1623..deda76b27e 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UseCorrectExceptionLoggingTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UseCorrectExceptionLoggingTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UseCorrectExceptionLoggingTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UseEqualsToCompareStringsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UseEqualsToCompareStringsTest.java index cca09e5922..482ed8de75 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UseEqualsToCompareStringsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UseEqualsToCompareStringsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UseEqualsToCompareStringsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UseLocaleWithCaseConversionsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UseLocaleWithCaseConversionsTest.java index 7c000a37b2..d592198d36 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UseLocaleWithCaseConversionsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UseLocaleWithCaseConversionsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UseLocaleWithCaseConversionsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UseProperClassLoaderTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UseProperClassLoaderTest.java index 7c968906b3..c310e27248 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UseProperClassLoaderTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UseProperClassLoaderTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UseProperClassLoaderTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UselessOperationOnImmutableTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UselessOperationOnImmutableTest.java index cee396363f..eb8596e34e 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UselessOperationOnImmutableTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UselessOperationOnImmutableTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UselessOperationOnImmutableTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/AvoidSynchronizedAtMethodLevelTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/AvoidSynchronizedAtMethodLevelTest.java index 5552da8928..dd623cd341 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/AvoidSynchronizedAtMethodLevelTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/AvoidSynchronizedAtMethodLevelTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.multithreading; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidSynchronizedAtMethodLevelTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/AvoidThreadGroupTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/AvoidThreadGroupTest.java index 322be8e579..0c06cbd520 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/AvoidThreadGroupTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/AvoidThreadGroupTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.multithreading; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidThreadGroupTest extends PmdRuleTst { // Used by AvoidThreadGroup test cases diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/AvoidUsingVolatileTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/AvoidUsingVolatileTest.java index 76a2a33966..5b34e87a17 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/AvoidUsingVolatileTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/AvoidUsingVolatileTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.multithreading; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidUsingVolatileTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/DoNotUseThreadsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/DoNotUseThreadsTest.java index a1ee5cbb12..dc8b383e6b 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/DoNotUseThreadsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/DoNotUseThreadsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.multithreading; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class DoNotUseThreadsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/DontCallThreadRunTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/DontCallThreadRunTest.java index 6c19a37681..53120d9528 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/DontCallThreadRunTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/DontCallThreadRunTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.multithreading; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class DontCallThreadRunTest extends PmdRuleTst { // Used by DontCallThreadRun test cases diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/DoubleCheckedLockingTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/DoubleCheckedLockingTest.java index 2dd1f220dc..903ad31b5f 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/DoubleCheckedLockingTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/DoubleCheckedLockingTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.multithreading; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class DoubleCheckedLockingTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/NonThreadSafeSingletonTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/NonThreadSafeSingletonTest.java index 5de60a32d9..b3ff3d7dba 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/NonThreadSafeSingletonTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/NonThreadSafeSingletonTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.multithreading; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class NonThreadSafeSingletonTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/UnsynchronizedStaticFormatterTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/UnsynchronizedStaticFormatterTest.java index 6581d6ae33..0d3f1cbd57 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/UnsynchronizedStaticFormatterTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/UnsynchronizedStaticFormatterTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.multithreading; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnsynchronizedStaticFormatterTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/UseConcurrentHashMapTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/UseConcurrentHashMapTest.java index 30b6abe091..2959aeaee6 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/UseConcurrentHashMapTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/UseConcurrentHashMapTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.multithreading; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UseConcurrentHashMapTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/UseNotifyAllInsteadOfNotifyTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/UseNotifyAllInsteadOfNotifyTest.java index d9c2cde3f2..5a93c3355b 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/UseNotifyAllInsteadOfNotifyTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/UseNotifyAllInsteadOfNotifyTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.multithreading; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UseNotifyAllInsteadOfNotifyTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AddEmptyStringTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AddEmptyStringTest.java index 6d774c1f03..37fddac850 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AddEmptyStringTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AddEmptyStringTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AddEmptyStringTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AppendCharacterWithCharTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AppendCharacterWithCharTest.java index b2def502e2..46ece8b851 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AppendCharacterWithCharTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AppendCharacterWithCharTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AppendCharacterWithCharTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AvoidArrayLoopsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AvoidArrayLoopsTest.java index 9dc04979f6..a0bca3e5f5 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AvoidArrayLoopsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AvoidArrayLoopsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidArrayLoopsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AvoidCalendarDateCreationTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AvoidCalendarDateCreationTest.java index c065428ce7..dfbab65527 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AvoidCalendarDateCreationTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AvoidCalendarDateCreationTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidCalendarDateCreationTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AvoidFileStreamTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AvoidFileStreamTest.java index 1fb6565a3b..5df006ff24 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AvoidFileStreamTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AvoidFileStreamTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidFileStreamTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AvoidInstantiatingObjectsInLoopsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AvoidInstantiatingObjectsInLoopsTest.java index 88ebdd345a..852c358a13 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AvoidInstantiatingObjectsInLoopsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AvoidInstantiatingObjectsInLoopsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidInstantiatingObjectsInLoopsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/BigIntegerInstantiationTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/BigIntegerInstantiationTest.java index 08343bb36d..61670a7828 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/BigIntegerInstantiationTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/BigIntegerInstantiationTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class BigIntegerInstantiationTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/ConsecutiveAppendsShouldReuseTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/ConsecutiveAppendsShouldReuseTest.java index 9a15a27b88..d0579e70f7 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/ConsecutiveAppendsShouldReuseTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/ConsecutiveAppendsShouldReuseTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ConsecutiveAppendsShouldReuseTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/ConsecutiveLiteralAppendsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/ConsecutiveLiteralAppendsTest.java index e93c5fc95f..7c8a188152 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/ConsecutiveLiteralAppendsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/ConsecutiveLiteralAppendsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ConsecutiveLiteralAppendsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/InefficientEmptyStringCheckTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/InefficientEmptyStringCheckTest.java index 223946a1be..480a307698 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/InefficientEmptyStringCheckTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/InefficientEmptyStringCheckTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class InefficientEmptyStringCheckTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/InefficientStringBufferingTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/InefficientStringBufferingTest.java index ff0675aafa..54ffe496af 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/InefficientStringBufferingTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/InefficientStringBufferingTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class InefficientStringBufferingTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/InsufficientStringBufferDeclarationTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/InsufficientStringBufferDeclarationTest.java index 91d0e92985..e98a01ad11 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/InsufficientStringBufferDeclarationTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/InsufficientStringBufferDeclarationTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class InsufficientStringBufferDeclarationTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/OptimizableToArrayCallTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/OptimizableToArrayCallTest.java index d0c1e11209..e5f1e92834 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/OptimizableToArrayCallTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/OptimizableToArrayCallTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class OptimizableToArrayCallTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/RedundantFieldInitializerTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/RedundantFieldInitializerTest.java index d8b57190f4..515a3ea422 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/RedundantFieldInitializerTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/RedundantFieldInitializerTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class RedundantFieldInitializerTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/StringInstantiationTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/StringInstantiationTest.java index 1f0b88431f..893a5a4332 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/StringInstantiationTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/StringInstantiationTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class StringInstantiationTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/StringToStringTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/StringToStringTest.java index 826f9d275f..54ceb4ad7d 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/StringToStringTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/StringToStringTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class StringToStringTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/TooFewBranchesForASwitchStatementTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/TooFewBranchesForASwitchStatementTest.java index 7a34936d2d..3916959a96 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/TooFewBranchesForASwitchStatementTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/TooFewBranchesForASwitchStatementTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class TooFewBranchesForASwitchStatementTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseArrayListInsteadOfVectorTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseArrayListInsteadOfVectorTest.java index 6a6f20f34b..57a489e815 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseArrayListInsteadOfVectorTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseArrayListInsteadOfVectorTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UseArrayListInsteadOfVectorTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseArraysAsListTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseArraysAsListTest.java index 6a8a9908f8..db1b6dc67b 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseArraysAsListTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseArraysAsListTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UseArraysAsListTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseIOStreamsWithApacheCommonsFileItemTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseIOStreamsWithApacheCommonsFileItemTest.java index 6f10cf35c6..53cca44137 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseIOStreamsWithApacheCommonsFileItemTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseIOStreamsWithApacheCommonsFileItemTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UseIOStreamsWithApacheCommonsFileItemTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseIndexOfCharTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseIndexOfCharTest.java index 68837b160e..fdb10da98c 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseIndexOfCharTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseIndexOfCharTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UseIndexOfCharTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseStringBufferForStringAppendsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseStringBufferForStringAppendsTest.java index 1cc6ed59a2..f7b764b30b 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseStringBufferForStringAppendsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseStringBufferForStringAppendsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UseStringBufferForStringAppendsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseStringBufferLengthTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseStringBufferLengthTest.java index af3368b481..a79cf05c1a 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseStringBufferLengthTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseStringBufferLengthTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UseStringBufferLengthTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UselessStringValueOfTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UselessStringValueOfTest.java index b18c5b6b9b..4ddf1ee025 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UselessStringValueOfTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UselessStringValueOfTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UselessStringValueOfTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/security/HardCodedCryptoKeyTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/security/HardCodedCryptoKeyTest.java index 09046eec59..df2d6542ad 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/security/HardCodedCryptoKeyTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/security/HardCodedCryptoKeyTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.security; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class HardCodedCryptoKeyTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/security/InsecureCryptoIvTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/security/InsecureCryptoIvTest.java index a502887680..019b3e8dd0 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/security/InsecureCryptoIvTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/security/InsecureCryptoIvTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.security; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class InsecureCryptoIvTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/ant/PMDTaskTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/ant/PMDTaskTest.java index 79bc52e1f5..eaee7817c1 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/ant/PMDTaskTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/ant/PMDTaskTest.java @@ -6,6 +6,8 @@ package net.sourceforge.pmd.ant; import org.junit.jupiter.api.Test; +import net.sourceforge.pmd.test.AbstractAntTestHelper; + class PMDTaskTest extends AbstractAntTestHelper { PMDTaskTest() { diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/LanguageVersionTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/LanguageVersionTest.java index de8217aae9..c835b51951 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/LanguageVersionTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/LanguageVersionTest.java @@ -7,7 +7,7 @@ package net.sourceforge.pmd.lang.ecmascript; import java.util.Arrays; import java.util.Collection; -import net.sourceforge.pmd.AbstractLanguageVersionTest; +import net.sourceforge.pmd.test.AbstractLanguageVersionTest; class LanguageVersionTest extends AbstractLanguageVersionTest { diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/RuleSetFactoryTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/RuleSetFactoryTest.java index 32b1211d9d..61cfb5bfc0 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/RuleSetFactoryTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/RuleSetFactoryTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.ecmascript; -import net.sourceforge.pmd.lang.rule.AbstractRuleSetFactoryTest; +import net.sourceforge.pmd.test.lang.rule.AbstractRuleSetFactoryTest; /** * Test javascript's rulesets diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/AvoidWithStatementTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/AvoidWithStatementTest.java index 5d308cf576..be636f6ca7 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/AvoidWithStatementTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/AvoidWithStatementTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.ecmascript.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidWithStatementTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/ConsistentReturnTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/ConsistentReturnTest.java index 65afa849ce..0d2066ec8b 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/ConsistentReturnTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/ConsistentReturnTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.ecmascript.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ConsistentReturnTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/GlobalVariableTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/GlobalVariableTest.java index 0645d97bd6..e949d1e498 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/GlobalVariableTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/GlobalVariableTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.ecmascript.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class GlobalVariableTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/ScopeForInVariableTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/ScopeForInVariableTest.java index 03052f13ed..390b61c5f0 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/ScopeForInVariableTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/ScopeForInVariableTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.ecmascript.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ScopeForInVariableTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/UseBaseWithParseIntTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/UseBaseWithParseIntTest.java index c3dc0e1f8a..b6aab8d246 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/UseBaseWithParseIntTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/UseBaseWithParseIntTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.ecmascript.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UseBaseWithParseIntTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/AssignmentInOperandTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/AssignmentInOperandTest.java index 09d7db44c8..8d83dfa58c 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/AssignmentInOperandTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/AssignmentInOperandTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.ecmascript.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AssignmentInOperandTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/ForLoopsMustUseBracesTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/ForLoopsMustUseBracesTest.java index 1ad9afc710..c992b704b9 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/ForLoopsMustUseBracesTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/ForLoopsMustUseBracesTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.ecmascript.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ForLoopsMustUseBracesTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/IfElseStmtsMustUseBracesTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/IfElseStmtsMustUseBracesTest.java index b122d7a4b6..d2afcf84f1 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/IfElseStmtsMustUseBracesTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/IfElseStmtsMustUseBracesTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.ecmascript.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class IfElseStmtsMustUseBracesTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/IfStmtsMustUseBracesTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/IfStmtsMustUseBracesTest.java index 0d8595570d..e5d996f654 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/IfStmtsMustUseBracesTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/IfStmtsMustUseBracesTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.ecmascript.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class IfStmtsMustUseBracesTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/NoElseReturnTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/NoElseReturnTest.java index 92b91cd7d7..abbe38ecbb 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/NoElseReturnTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/NoElseReturnTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.ecmascript.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class NoElseReturnTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/UnnecessaryBlockTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/UnnecessaryBlockTest.java index 53c6ceb9c4..97390b04c5 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/UnnecessaryBlockTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/UnnecessaryBlockTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.ecmascript.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnnecessaryBlockTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/UnnecessaryParenthesesTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/UnnecessaryParenthesesTest.java index c94b0b9e40..b50f4927af 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/UnnecessaryParenthesesTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/UnnecessaryParenthesesTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.ecmascript.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnnecessaryParenthesesTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/UnreachableCodeTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/UnreachableCodeTest.java index e60cb484c9..438e03aa2f 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/UnreachableCodeTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/UnreachableCodeTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.ecmascript.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnreachableCodeTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/WhileLoopsMustUseBracesTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/WhileLoopsMustUseBracesTest.java index d681626c2c..4878c6aac6 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/WhileLoopsMustUseBracesTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/WhileLoopsMustUseBracesTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.ecmascript.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class WhileLoopsMustUseBracesTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/errorprone/AvoidTrailingCommaTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/errorprone/AvoidTrailingCommaTest.java index d865674576..2406d43308 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/errorprone/AvoidTrailingCommaTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/errorprone/AvoidTrailingCommaTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.ecmascript.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidTrailingCommaTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/errorprone/EqualComparisonTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/errorprone/EqualComparisonTest.java index 86e1b9defc..b794703157 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/errorprone/EqualComparisonTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/errorprone/EqualComparisonTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.ecmascript.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class EqualComparisonTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/errorprone/InnaccurateNumericLiteralTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/errorprone/InnaccurateNumericLiteralTest.java index 4cdd66abbd..73cbf9e509 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/errorprone/InnaccurateNumericLiteralTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/errorprone/InnaccurateNumericLiteralTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.ecmascript.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class InnaccurateNumericLiteralTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/LanguageVersionTest.java b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/LanguageVersionTest.java index eb2eb31267..303be4dbd6 100644 --- a/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/LanguageVersionTest.java +++ b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/LanguageVersionTest.java @@ -7,7 +7,7 @@ package net.sourceforge.pmd.lang.jsp; import java.util.Arrays; import java.util.Collection; -import net.sourceforge.pmd.AbstractLanguageVersionTest; +import net.sourceforge.pmd.test.AbstractLanguageVersionTest; class LanguageVersionTest extends AbstractLanguageVersionTest { diff --git a/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/RuleSetFactoryTest.java b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/RuleSetFactoryTest.java index 531bde227b..e9e19c024c 100644 --- a/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/RuleSetFactoryTest.java +++ b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/RuleSetFactoryTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.jsp; -import net.sourceforge.pmd.lang.rule.AbstractRuleSetFactoryTest; +import net.sourceforge.pmd.test.lang.rule.AbstractRuleSetFactoryTest; /** * Test jsp's rulesets diff --git a/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/rule/bestpractices/DontNestJsfInJstlIterationTest.java b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/rule/bestpractices/DontNestJsfInJstlIterationTest.java index 285d9aca99..9947b4b753 100644 --- a/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/rule/bestpractices/DontNestJsfInJstlIterationTest.java +++ b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/rule/bestpractices/DontNestJsfInJstlIterationTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.jsp.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class DontNestJsfInJstlIterationTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/rule/bestpractices/NoClassAttributeTest.java b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/rule/bestpractices/NoClassAttributeTest.java index 32aed17829..672db299c7 100644 --- a/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/rule/bestpractices/NoClassAttributeTest.java +++ b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/rule/bestpractices/NoClassAttributeTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.jsp.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class NoClassAttributeTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/rule/bestpractices/NoHtmlCommentsTest.java b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/rule/bestpractices/NoHtmlCommentsTest.java index 2433b7b9e7..3832823a05 100644 --- a/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/rule/bestpractices/NoHtmlCommentsTest.java +++ b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/rule/bestpractices/NoHtmlCommentsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.jsp.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class NoHtmlCommentsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/rule/bestpractices/NoJspForwardTest.java b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/rule/bestpractices/NoJspForwardTest.java index 7dc9cedd19..a76a1aea75 100644 --- a/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/rule/bestpractices/NoJspForwardTest.java +++ b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/rule/bestpractices/NoJspForwardTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.jsp.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class NoJspForwardTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/rule/codestyle/DuplicateJspImportsTest.java b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/rule/codestyle/DuplicateJspImportsTest.java index 80de35ba95..3beab29c65 100644 --- a/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/rule/codestyle/DuplicateJspImportsTest.java +++ b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/rule/codestyle/DuplicateJspImportsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.jsp.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class DuplicateJspImportsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/rule/design/NoInlineScriptTest.java b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/rule/design/NoInlineScriptTest.java index aadd16a811..f0bf436d1b 100644 --- a/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/rule/design/NoInlineScriptTest.java +++ b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/rule/design/NoInlineScriptTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.jsp.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class NoInlineScriptTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/rule/design/NoInlineStyleInformationTest.java b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/rule/design/NoInlineStyleInformationTest.java index 946daafaf8..e7333d6da4 100644 --- a/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/rule/design/NoInlineStyleInformationTest.java +++ b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/rule/design/NoInlineStyleInformationTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.jsp.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class NoInlineStyleInformationTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/rule/design/NoLongScriptsTest.java b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/rule/design/NoLongScriptsTest.java index 79ad52d4e3..fef126e2c5 100644 --- a/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/rule/design/NoLongScriptsTest.java +++ b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/rule/design/NoLongScriptsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.jsp.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class NoLongScriptsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/rule/design/NoScriptletsTest.java b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/rule/design/NoScriptletsTest.java index 9e98971cd3..6723f8fabe 100644 --- a/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/rule/design/NoScriptletsTest.java +++ b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/rule/design/NoScriptletsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.jsp.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class NoScriptletsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/rule/errorprone/JspEncodingTest.java b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/rule/errorprone/JspEncodingTest.java index d14fb6b962..fc2bfc86f2 100644 --- a/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/rule/errorprone/JspEncodingTest.java +++ b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/rule/errorprone/JspEncodingTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.jsp.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class JspEncodingTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/rule/security/IframeMissingSrcAttributeTest.java b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/rule/security/IframeMissingSrcAttributeTest.java index fab1bea703..6eb20112d8 100644 --- a/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/rule/security/IframeMissingSrcAttributeTest.java +++ b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/rule/security/IframeMissingSrcAttributeTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.jsp.rule.security; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class IframeMissingSrcAttributeTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/rule/security/NoUnsanitizedJSPExpressionTest.java b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/rule/security/NoUnsanitizedJSPExpressionTest.java index 4fdb59501c..21f79ed3d6 100644 --- a/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/rule/security/NoUnsanitizedJSPExpressionTest.java +++ b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/rule/security/NoUnsanitizedJSPExpressionTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.jsp.rule.security; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class NoUnsanitizedJSPExpressionTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-kotlin/src/test/java/net/sourceforge/pmd/lang/kotlin/LanguageVersionTest.java b/pmd-kotlin/src/test/java/net/sourceforge/pmd/lang/kotlin/LanguageVersionTest.java index 3e94f483bf..ba4d734a05 100644 --- a/pmd-kotlin/src/test/java/net/sourceforge/pmd/lang/kotlin/LanguageVersionTest.java +++ b/pmd-kotlin/src/test/java/net/sourceforge/pmd/lang/kotlin/LanguageVersionTest.java @@ -7,7 +7,7 @@ package net.sourceforge.pmd.lang.kotlin; import java.util.Arrays; import java.util.Collection; -import net.sourceforge.pmd.AbstractLanguageVersionTest; +import net.sourceforge.pmd.test.AbstractLanguageVersionTest; class LanguageVersionTest extends AbstractLanguageVersionTest { diff --git a/pmd-kotlin/src/test/java/net/sourceforge/pmd/lang/kotlin/RuleSetFactoryTest.java b/pmd-kotlin/src/test/java/net/sourceforge/pmd/lang/kotlin/RuleSetFactoryTest.java index 190b8401ef..d90e854b6c 100644 --- a/pmd-kotlin/src/test/java/net/sourceforge/pmd/lang/kotlin/RuleSetFactoryTest.java +++ b/pmd-kotlin/src/test/java/net/sourceforge/pmd/lang/kotlin/RuleSetFactoryTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.kotlin; -import net.sourceforge.pmd.lang.rule.AbstractRuleSetFactoryTest; +import net.sourceforge.pmd.test.lang.rule.AbstractRuleSetFactoryTest; class RuleSetFactoryTest extends AbstractRuleSetFactoryTest { // no additional tests yet diff --git a/pmd-kotlin/src/test/java/net/sourceforge/pmd/lang/kotlin/rule/bestpractices/FunctionNameTooShortTest.java b/pmd-kotlin/src/test/java/net/sourceforge/pmd/lang/kotlin/rule/bestpractices/FunctionNameTooShortTest.java index 1d26e10589..24d80ce15e 100644 --- a/pmd-kotlin/src/test/java/net/sourceforge/pmd/lang/kotlin/rule/bestpractices/FunctionNameTooShortTest.java +++ b/pmd-kotlin/src/test/java/net/sourceforge/pmd/lang/kotlin/rule/bestpractices/FunctionNameTooShortTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.kotlin.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class FunctionNameTooShortTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-kotlin/src/test/java/net/sourceforge/pmd/lang/kotlin/rule/errorprone/OverrideBothEqualsAndHashcodeTest.java b/pmd-kotlin/src/test/java/net/sourceforge/pmd/lang/kotlin/rule/errorprone/OverrideBothEqualsAndHashcodeTest.java index 673aa3946e..8e8a35b270 100644 --- a/pmd-kotlin/src/test/java/net/sourceforge/pmd/lang/kotlin/rule/errorprone/OverrideBothEqualsAndHashcodeTest.java +++ b/pmd-kotlin/src/test/java/net/sourceforge/pmd/lang/kotlin/rule/errorprone/OverrideBothEqualsAndHashcodeTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.kotlin.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class OverrideBothEqualsAndHashcodeTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-modelica/src/test/java/net/sourceforge/pmd/lang/modelica/LanguageVersionTest.java b/pmd-modelica/src/test/java/net/sourceforge/pmd/lang/modelica/LanguageVersionTest.java index 74c79e1e35..f09c75c2ba 100644 --- a/pmd-modelica/src/test/java/net/sourceforge/pmd/lang/modelica/LanguageVersionTest.java +++ b/pmd-modelica/src/test/java/net/sourceforge/pmd/lang/modelica/LanguageVersionTest.java @@ -7,7 +7,7 @@ package net.sourceforge.pmd.lang.modelica; import java.util.Arrays; import java.util.Collection; -import net.sourceforge.pmd.AbstractLanguageVersionTest; +import net.sourceforge.pmd.test.AbstractLanguageVersionTest; class LanguageVersionTest extends AbstractLanguageVersionTest { diff --git a/pmd-modelica/src/test/java/net/sourceforge/pmd/lang/modelica/RuleSetFactoryTest.java b/pmd-modelica/src/test/java/net/sourceforge/pmd/lang/modelica/RuleSetFactoryTest.java index 53fc1834d1..fe3902f6de 100644 --- a/pmd-modelica/src/test/java/net/sourceforge/pmd/lang/modelica/RuleSetFactoryTest.java +++ b/pmd-modelica/src/test/java/net/sourceforge/pmd/lang/modelica/RuleSetFactoryTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.modelica; -import net.sourceforge.pmd.lang.rule.AbstractRuleSetFactoryTest; +import net.sourceforge.pmd.test.lang.rule.AbstractRuleSetFactoryTest; class RuleSetFactoryTest extends AbstractRuleSetFactoryTest { // no additional tests yet diff --git a/pmd-modelica/src/test/java/net/sourceforge/pmd/lang/modelica/rule/bestpractices/AmbiguousResolutionTest.java b/pmd-modelica/src/test/java/net/sourceforge/pmd/lang/modelica/rule/bestpractices/AmbiguousResolutionTest.java index 53652d299b..201788ca19 100644 --- a/pmd-modelica/src/test/java/net/sourceforge/pmd/lang/modelica/rule/bestpractices/AmbiguousResolutionTest.java +++ b/pmd-modelica/src/test/java/net/sourceforge/pmd/lang/modelica/rule/bestpractices/AmbiguousResolutionTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.modelica.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AmbiguousResolutionTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-modelica/src/test/java/net/sourceforge/pmd/lang/modelica/rule/bestpractices/ClassStartNameEqualsEndNameTest.java b/pmd-modelica/src/test/java/net/sourceforge/pmd/lang/modelica/rule/bestpractices/ClassStartNameEqualsEndNameTest.java index e02c11b19d..edebad3f18 100644 --- a/pmd-modelica/src/test/java/net/sourceforge/pmd/lang/modelica/rule/bestpractices/ClassStartNameEqualsEndNameTest.java +++ b/pmd-modelica/src/test/java/net/sourceforge/pmd/lang/modelica/rule/bestpractices/ClassStartNameEqualsEndNameTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.modelica.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ClassStartNameEqualsEndNameTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-modelica/src/test/java/net/sourceforge/pmd/lang/modelica/rule/bestpractices/ConnectUsingNonConnectorTest.java b/pmd-modelica/src/test/java/net/sourceforge/pmd/lang/modelica/rule/bestpractices/ConnectUsingNonConnectorTest.java index 31a860a80a..67b2348d79 100644 --- a/pmd-modelica/src/test/java/net/sourceforge/pmd/lang/modelica/rule/bestpractices/ConnectUsingNonConnectorTest.java +++ b/pmd-modelica/src/test/java/net/sourceforge/pmd/lang/modelica/rule/bestpractices/ConnectUsingNonConnectorTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.modelica.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ConnectUsingNonConnectorTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/LanguageVersionTest.java b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/LanguageVersionTest.java index c9e3d8a20a..85ad70e843 100644 --- a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/LanguageVersionTest.java +++ b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/LanguageVersionTest.java @@ -7,7 +7,7 @@ package net.sourceforge.pmd.lang.plsql; import java.util.Arrays; import java.util.Collection; -import net.sourceforge.pmd.AbstractLanguageVersionTest; +import net.sourceforge.pmd.test.AbstractLanguageVersionTest; class LanguageVersionTest extends AbstractLanguageVersionTest { diff --git a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/RuleSetFactoryTest.java b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/RuleSetFactoryTest.java index fbf61181a6..9e1b17520b 100644 --- a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/RuleSetFactoryTest.java +++ b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/RuleSetFactoryTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.plsql; -import net.sourceforge.pmd.lang.rule.AbstractRuleSetFactoryTest; +import net.sourceforge.pmd.test.lang.rule.AbstractRuleSetFactoryTest; /** * Test plsql's rulesets diff --git a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/bestpractices/TomKytesDespairTest.java b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/bestpractices/TomKytesDespairTest.java index 64a423e233..37d924c615 100644 --- a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/bestpractices/TomKytesDespairTest.java +++ b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/bestpractices/TomKytesDespairTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.plsql.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class TomKytesDespairTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/codestyle/AvoidTabCharacterTest.java b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/codestyle/AvoidTabCharacterTest.java index 636f854a35..a5956b6ff1 100644 --- a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/codestyle/AvoidTabCharacterTest.java +++ b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/codestyle/AvoidTabCharacterTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.plsql.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidTabCharacterTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/codestyle/CodeFormatTest.java b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/codestyle/CodeFormatTest.java index 7f047772e5..1f159c060e 100644 --- a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/codestyle/CodeFormatTest.java +++ b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/codestyle/CodeFormatTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.plsql.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class CodeFormatTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/codestyle/ForLoopNamingTest.java b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/codestyle/ForLoopNamingTest.java index 1d8591a22a..a558d99427 100644 --- a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/codestyle/ForLoopNamingTest.java +++ b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/codestyle/ForLoopNamingTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.plsql.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ForLoopNamingTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/codestyle/LineLengthTest.java b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/codestyle/LineLengthTest.java index 40c5e9de7e..3e60f684a2 100644 --- a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/codestyle/LineLengthTest.java +++ b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/codestyle/LineLengthTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.plsql.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class LineLengthTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/codestyle/MisplacedPragmaTest.java b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/codestyle/MisplacedPragmaTest.java index 9b41c0468e..93868afc24 100644 --- a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/codestyle/MisplacedPragmaTest.java +++ b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/codestyle/MisplacedPragmaTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.plsql.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class MisplacedPragmaTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/design/CyclomaticComplexityTest.java b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/design/CyclomaticComplexityTest.java index d010d2bfa2..55681426ef 100644 --- a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/design/CyclomaticComplexityTest.java +++ b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/design/CyclomaticComplexityTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.plsql.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class CyclomaticComplexityTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/design/ExcessiveMethodLengthTest.java b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/design/ExcessiveMethodLengthTest.java index 3ebc558d4a..05c012e36e 100644 --- a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/design/ExcessiveMethodLengthTest.java +++ b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/design/ExcessiveMethodLengthTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.plsql.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ExcessiveMethodLengthTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/design/ExcessiveObjectLengthTest.java b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/design/ExcessiveObjectLengthTest.java index 4c794cfaa9..c7087894eb 100644 --- a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/design/ExcessiveObjectLengthTest.java +++ b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/design/ExcessiveObjectLengthTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.plsql.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ExcessiveObjectLengthTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/design/ExcessivePackageBodyLengthTest.java b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/design/ExcessivePackageBodyLengthTest.java index 78adcc1eb2..380e6230b6 100644 --- a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/design/ExcessivePackageBodyLengthTest.java +++ b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/design/ExcessivePackageBodyLengthTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.plsql.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ExcessivePackageBodyLengthTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/design/ExcessivePackageSpecificationLengthTest.java b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/design/ExcessivePackageSpecificationLengthTest.java index b8a642a1b5..15147ca728 100644 --- a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/design/ExcessivePackageSpecificationLengthTest.java +++ b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/design/ExcessivePackageSpecificationLengthTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.plsql.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ExcessivePackageSpecificationLengthTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/design/ExcessiveParameterListTest.java b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/design/ExcessiveParameterListTest.java index fda74a8d80..2b55d6800f 100644 --- a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/design/ExcessiveParameterListTest.java +++ b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/design/ExcessiveParameterListTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.plsql.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ExcessiveParameterListTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/design/ExcessiveTypeLengthTest.java b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/design/ExcessiveTypeLengthTest.java index 3d96d024ba..136ef873e4 100644 --- a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/design/ExcessiveTypeLengthTest.java +++ b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/design/ExcessiveTypeLengthTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.plsql.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ExcessiveTypeLengthTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/design/NPathComplexityTest.java b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/design/NPathComplexityTest.java index 6714824a8a..7ea85366ad 100644 --- a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/design/NPathComplexityTest.java +++ b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/design/NPathComplexityTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.plsql.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class NPathComplexityTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/design/NcssMethodCountTest.java b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/design/NcssMethodCountTest.java index f8032c9396..d1354c3f01 100644 --- a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/design/NcssMethodCountTest.java +++ b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/design/NcssMethodCountTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.plsql.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class NcssMethodCountTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/design/NcssObjectCountTest.java b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/design/NcssObjectCountTest.java index 8075fbd624..3d5034ef2e 100644 --- a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/design/NcssObjectCountTest.java +++ b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/design/NcssObjectCountTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.plsql.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class NcssObjectCountTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/design/TooManyFieldsTest.java b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/design/TooManyFieldsTest.java index 36126a01f5..09fc17ad94 100644 --- a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/design/TooManyFieldsTest.java +++ b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/design/TooManyFieldsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.plsql.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class TooManyFieldsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/design/TooManyMethodsTest.java b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/design/TooManyMethodsTest.java index 17e3237791..5d7b9e24e8 100644 --- a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/design/TooManyMethodsTest.java +++ b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/design/TooManyMethodsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.plsql.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class TooManyMethodsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/errorprone/ToDateToCharTest.java b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/errorprone/ToDateToCharTest.java index 044a86be62..986da1dd6d 100644 --- a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/errorprone/ToDateToCharTest.java +++ b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/errorprone/ToDateToCharTest.java @@ -8,7 +8,7 @@ import java.util.Collections; import java.util.List; import net.sourceforge.pmd.lang.rule.Rule; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ToDateToCharTest extends PmdRuleTst { // No additional unit tests diff --git a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/errorprone/ToDateWithoutDateFormatTest.java b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/errorprone/ToDateWithoutDateFormatTest.java index a70adbc735..7c75ad1d5b 100644 --- a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/errorprone/ToDateWithoutDateFormatTest.java +++ b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/errorprone/ToDateWithoutDateFormatTest.java @@ -8,7 +8,7 @@ import java.util.Collections; import java.util.List; import net.sourceforge.pmd.lang.rule.Rule; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ToDateWithoutDateFormatTest extends PmdRuleTst { // No additional unit tests diff --git a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/errorprone/ToTimestampWithoutDateFormatTest.java b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/errorprone/ToTimestampWithoutDateFormatTest.java index 730292e731..45a227884c 100644 --- a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/errorprone/ToTimestampWithoutDateFormatTest.java +++ b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/rule/errorprone/ToTimestampWithoutDateFormatTest.java @@ -8,7 +8,7 @@ import java.util.Collections; import java.util.List; import net.sourceforge.pmd.lang.rule.Rule; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ToTimestampWithoutDateFormatTest extends PmdRuleTst { // No additional unit tests diff --git a/pmd-scala-modules/pmd-scala-common/src/test/java/net/sourceforge/pmd/lang/scala/LanguageVersionTest.java b/pmd-scala-modules/pmd-scala-common/src/test/java/net/sourceforge/pmd/lang/scala/LanguageVersionTest.java index c7b906aa40..c68489cad7 100644 --- a/pmd-scala-modules/pmd-scala-common/src/test/java/net/sourceforge/pmd/lang/scala/LanguageVersionTest.java +++ b/pmd-scala-modules/pmd-scala-common/src/test/java/net/sourceforge/pmd/lang/scala/LanguageVersionTest.java @@ -7,7 +7,7 @@ package net.sourceforge.pmd.lang.scala; import java.util.Arrays; import java.util.Collection; -import net.sourceforge.pmd.AbstractLanguageVersionTest; +import net.sourceforge.pmd.test.AbstractLanguageVersionTest; class LanguageVersionTest extends AbstractLanguageVersionTest { diff --git a/pmd-scala-modules/pmd-scala-common/src/test/java/net/sourceforge/pmd/lang/scala/RulesetFactoryTest.java b/pmd-scala-modules/pmd-scala-common/src/test/java/net/sourceforge/pmd/lang/scala/RulesetFactoryTest.java index a7965850f3..ba6dac0f71 100644 --- a/pmd-scala-modules/pmd-scala-common/src/test/java/net/sourceforge/pmd/lang/scala/RulesetFactoryTest.java +++ b/pmd-scala-modules/pmd-scala-common/src/test/java/net/sourceforge/pmd/lang/scala/RulesetFactoryTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.scala; -import net.sourceforge.pmd.lang.rule.AbstractRuleSetFactoryTest; +import net.sourceforge.pmd.test.lang.rule.AbstractRuleSetFactoryTest; /** * Test scala rulesets diff --git a/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/LanguageVersionTest.java b/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/LanguageVersionTest.java index 203431069d..cd27506bcd 100644 --- a/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/LanguageVersionTest.java +++ b/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/LanguageVersionTest.java @@ -7,7 +7,7 @@ package net.sourceforge.pmd.lang.swift; import java.util.Arrays; import java.util.Collection; -import net.sourceforge.pmd.AbstractLanguageVersionTest; +import net.sourceforge.pmd.test.AbstractLanguageVersionTest; class LanguageVersionTest extends AbstractLanguageVersionTest { diff --git a/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/RuleSetFactoryTest.java b/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/RuleSetFactoryTest.java index 320fbf91a5..27add5aaef 100644 --- a/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/RuleSetFactoryTest.java +++ b/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/RuleSetFactoryTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.swift; -import net.sourceforge.pmd.lang.rule.AbstractRuleSetFactoryTest; +import net.sourceforge.pmd.test.lang.rule.AbstractRuleSetFactoryTest; class RuleSetFactoryTest extends AbstractRuleSetFactoryTest { // no additional unit tests diff --git a/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/rule/bestpractices/ProhibitedInterfaceBuilderTest.java b/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/rule/bestpractices/ProhibitedInterfaceBuilderTest.java index d5771bc4c8..76a14465bf 100644 --- a/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/rule/bestpractices/ProhibitedInterfaceBuilderTest.java +++ b/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/rule/bestpractices/ProhibitedInterfaceBuilderTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.swift.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ProhibitedInterfaceBuilderTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/rule/bestpractices/UnavailableFunctionTest.java b/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/rule/bestpractices/UnavailableFunctionTest.java index 08bda9b025..f8b0f5bc2c 100644 --- a/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/rule/bestpractices/UnavailableFunctionTest.java +++ b/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/rule/bestpractices/UnavailableFunctionTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.swift.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnavailableFunctionTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/rule/errorprone/ForceCastTest.java b/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/rule/errorprone/ForceCastTest.java index 93212509bb..7255f6bbc5 100644 --- a/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/rule/errorprone/ForceCastTest.java +++ b/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/rule/errorprone/ForceCastTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.swift.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ForceCastTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/rule/errorprone/ForceTryTest.java b/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/rule/errorprone/ForceTryTest.java index 14668e37f6..ddca99ad3d 100644 --- a/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/rule/errorprone/ForceTryTest.java +++ b/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/rule/errorprone/ForceTryTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.swift.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ForceTryTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-test/src/main/java/net/sourceforge/pmd/ant/AbstractAntTestHelper.java b/pmd-test/src/main/java/net/sourceforge/pmd/test/AbstractAntTestHelper.java similarity index 99% rename from pmd-test/src/main/java/net/sourceforge/pmd/ant/AbstractAntTestHelper.java rename to pmd-test/src/main/java/net/sourceforge/pmd/test/AbstractAntTestHelper.java index f6e3f3eef2..66becd81dd 100644 --- a/pmd-test/src/main/java/net/sourceforge/pmd/ant/AbstractAntTestHelper.java +++ b/pmd-test/src/main/java/net/sourceforge/pmd/test/AbstractAntTestHelper.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.ant; +package net.sourceforge.pmd.test; import static java.io.File.separator; import static org.hamcrest.MatcherAssert.assertThat; diff --git a/pmd-test/src/main/java/net/sourceforge/pmd/AbstractLanguageVersionTest.java b/pmd-test/src/main/java/net/sourceforge/pmd/test/AbstractLanguageVersionTest.java similarity index 99% rename from pmd-test/src/main/java/net/sourceforge/pmd/AbstractLanguageVersionTest.java rename to pmd-test/src/main/java/net/sourceforge/pmd/test/AbstractLanguageVersionTest.java index 9121161096..54ec50a108 100644 --- a/pmd-test/src/main/java/net/sourceforge/pmd/AbstractLanguageVersionTest.java +++ b/pmd-test/src/main/java/net/sourceforge/pmd/test/AbstractLanguageVersionTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd; +package net.sourceforge.pmd.test; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; diff --git a/pmd-test/src/main/java/net/sourceforge/pmd/testframework/PmdRuleTst.java b/pmd-test/src/main/java/net/sourceforge/pmd/test/PmdRuleTst.java similarity index 94% rename from pmd-test/src/main/java/net/sourceforge/pmd/testframework/PmdRuleTst.java rename to pmd-test/src/main/java/net/sourceforge/pmd/test/PmdRuleTst.java index b9bd7f5555..0e7764693b 100644 --- a/pmd-test/src/main/java/net/sourceforge/pmd/testframework/PmdRuleTst.java +++ b/pmd-test/src/main/java/net/sourceforge/pmd/test/PmdRuleTst.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.testframework; +package net.sourceforge.pmd.test; import java.util.Collections; import java.util.List; diff --git a/pmd-test/src/main/java/net/sourceforge/pmd/testframework/RuleTst.java b/pmd-test/src/main/java/net/sourceforge/pmd/test/RuleTst.java similarity index 99% rename from pmd-test/src/main/java/net/sourceforge/pmd/testframework/RuleTst.java rename to pmd-test/src/main/java/net/sourceforge/pmd/test/RuleTst.java index bb0719095e..7802e4cd9f 100644 --- a/pmd-test/src/main/java/net/sourceforge/pmd/testframework/RuleTst.java +++ b/pmd-test/src/main/java/net/sourceforge/pmd/test/RuleTst.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.testframework; +package net.sourceforge.pmd.test; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.fail; diff --git a/pmd-test/src/main/java/net/sourceforge/pmd/testframework/SimpleAggregatorTst.java b/pmd-test/src/main/java/net/sourceforge/pmd/test/SimpleAggregatorTst.java similarity index 96% rename from pmd-test/src/main/java/net/sourceforge/pmd/testframework/SimpleAggregatorTst.java rename to pmd-test/src/main/java/net/sourceforge/pmd/test/SimpleAggregatorTst.java index 1d067dfb74..db2e3f8daa 100644 --- a/pmd-test/src/main/java/net/sourceforge/pmd/testframework/SimpleAggregatorTst.java +++ b/pmd-test/src/main/java/net/sourceforge/pmd/test/SimpleAggregatorTst.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.testframework; +package net.sourceforge.pmd.test; import java.util.ArrayList; import java.util.List; diff --git a/pmd-test/src/main/java/net/sourceforge/pmd/lang/rule/AbstractRuleSetFactoryTest.java b/pmd-test/src/main/java/net/sourceforge/pmd/test/lang/rule/AbstractRuleSetFactoryTest.java similarity index 98% rename from pmd-test/src/main/java/net/sourceforge/pmd/lang/rule/AbstractRuleSetFactoryTest.java rename to pmd-test/src/main/java/net/sourceforge/pmd/test/lang/rule/AbstractRuleSetFactoryTest.java index 99100db008..f611484ac8 100644 --- a/pmd-test/src/main/java/net/sourceforge/pmd/lang/rule/AbstractRuleSetFactoryTest.java +++ b/pmd-test/src/main/java/net/sourceforge/pmd/test/lang/rule/AbstractRuleSetFactoryTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.rule; +package net.sourceforge.pmd.test.lang.rule; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.emptyString; @@ -45,6 +45,12 @@ import org.xml.sax.helpers.DefaultHandler; import net.sourceforge.pmd.internal.util.IOUtil; import net.sourceforge.pmd.lang.Language; import net.sourceforge.pmd.lang.LanguageRegistry; +import net.sourceforge.pmd.lang.rule.InternalApiBridge; +import net.sourceforge.pmd.lang.rule.Rule; +import net.sourceforge.pmd.lang.rule.RuleReference; +import net.sourceforge.pmd.lang.rule.RuleSet; +import net.sourceforge.pmd.lang.rule.RuleSetLoader; +import net.sourceforge.pmd.lang.rule.RuleSetWriter; import net.sourceforge.pmd.lang.rule.xpath.XPathRule; import net.sourceforge.pmd.properties.PropertyDescriptor; import net.sourceforge.pmd.util.log.internal.MessageReporterBase; @@ -355,8 +361,7 @@ public abstract class AbstractRuleSetFactoryTest { } } - RuleSet ruleSet = new RuleSetLoader() - .withReporter(new Reporter()) + RuleSet ruleSet = InternalApiBridge.withReporter(new RuleSetLoader(), new Reporter()) .loadFromResource(ruleSetFileName); assertThat("There should be no warnings while loading the ruleset", diff --git a/pmd-test/src/test/java/net/sourceforge/pmd/testframework/RuleTstTest.java b/pmd-test/src/test/java/net/sourceforge/pmd/test/RuleTstTest.java similarity index 98% rename from pmd-test/src/test/java/net/sourceforge/pmd/testframework/RuleTstTest.java rename to pmd-test/src/test/java/net/sourceforge/pmd/test/RuleTstTest.java index b10d6a3962..3321a7895b 100644 --- a/pmd-test/src/test/java/net/sourceforge/pmd/testframework/RuleTstTest.java +++ b/pmd-test/src/test/java/net/sourceforge/pmd/test/RuleTstTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.testframework; +package net.sourceforge.pmd.test; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.ArgumentMatchers.any; diff --git a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/LanguageVersionTest.java b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/LanguageVersionTest.java index f1020ad052..b595f07ad7 100644 --- a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/LanguageVersionTest.java +++ b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/LanguageVersionTest.java @@ -7,7 +7,7 @@ package net.sourceforge.pmd.lang.vf; import java.util.Arrays; import java.util.Collection; -import net.sourceforge.pmd.AbstractLanguageVersionTest; +import net.sourceforge.pmd.test.AbstractLanguageVersionTest; import net.sourceforge.pmd.lang.apex.ApexLanguageModule; class LanguageVersionTest extends AbstractLanguageVersionTest { diff --git a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/RuleSetFactoryTest.java b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/RuleSetFactoryTest.java index 4023f74ed7..a70c934d67 100644 --- a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/RuleSetFactoryTest.java +++ b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/RuleSetFactoryTest.java @@ -5,7 +5,7 @@ package net.sourceforge.pmd.lang.vf; import net.sourceforge.pmd.lang.apex.ApexLanguageModule; -import net.sourceforge.pmd.lang.rule.AbstractRuleSetFactoryTest; +import net.sourceforge.pmd.test.lang.rule.AbstractRuleSetFactoryTest; class RuleSetFactoryTest extends AbstractRuleSetFactoryTest { RuleSetFactoryTest() { diff --git a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/rule/security/VfCsrfTest.java b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/rule/security/VfCsrfTest.java index deff451dc8..d48fd98e3c 100644 --- a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/rule/security/VfCsrfTest.java +++ b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/rule/security/VfCsrfTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.vf.rule.security; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class VfCsrfTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/rule/security/VfHtmlStyleTagXssTest.java b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/rule/security/VfHtmlStyleTagXssTest.java index 07c8242e8b..1071c6a987 100644 --- a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/rule/security/VfHtmlStyleTagXssTest.java +++ b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/rule/security/VfHtmlStyleTagXssTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.vf.rule.security; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class VfHtmlStyleTagXssTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/rule/security/VfUnescapeElTest.java b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/rule/security/VfUnescapeElTest.java index 5046d28f62..d9adf67898 100644 --- a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/rule/security/VfUnescapeElTest.java +++ b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/rule/security/VfUnescapeElTest.java @@ -17,7 +17,7 @@ import net.sourceforge.pmd.lang.vf.VFTestUtils; import net.sourceforge.pmd.lang.vf.ast.VfParsingHelper; import net.sourceforge.pmd.reporting.Report; import net.sourceforge.pmd.reporting.RuleViolation; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class VfUnescapeElTest extends PmdRuleTst { private static final String EXPECTED_RULE_MESSAGE = "Avoid unescaped user controlled content in EL"; diff --git a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/LanguageVersionTest.java b/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/LanguageVersionTest.java index 0f2b715e44..bd51aaae2f 100644 --- a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/LanguageVersionTest.java +++ b/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/LanguageVersionTest.java @@ -7,7 +7,7 @@ package net.sourceforge.pmd.lang.vm; import java.util.Arrays; import java.util.Collection; -import net.sourceforge.pmd.AbstractLanguageVersionTest; +import net.sourceforge.pmd.test.AbstractLanguageVersionTest; class LanguageVersionTest extends AbstractLanguageVersionTest { diff --git a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/RuleSetFactoryTest.java b/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/RuleSetFactoryTest.java index 63278e21d7..b549df0edd 100644 --- a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/RuleSetFactoryTest.java +++ b/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/RuleSetFactoryTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.vm; -import net.sourceforge.pmd.lang.rule.AbstractRuleSetFactoryTest; +import net.sourceforge.pmd.test.lang.rule.AbstractRuleSetFactoryTest; /** * Test velocity's rulesets. diff --git a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/bestpractices/AvoidReassigningParametersTest.java b/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/bestpractices/AvoidReassigningParametersTest.java index 4fb9224dae..3b14ac5628 100644 --- a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/bestpractices/AvoidReassigningParametersTest.java +++ b/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/bestpractices/AvoidReassigningParametersTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.vm.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidReassigningParametersTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/bestpractices/UnusedMacroParameterTest.java b/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/bestpractices/UnusedMacroParameterTest.java index 997bea144e..b9f961adb2 100644 --- a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/bestpractices/UnusedMacroParameterTest.java +++ b/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/bestpractices/UnusedMacroParameterTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.vm.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnusedMacroParameterTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/AvoidDeeplyNestedIfStmtsTest.java b/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/AvoidDeeplyNestedIfStmtsTest.java index 698bc4711f..720ffeaa50 100644 --- a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/AvoidDeeplyNestedIfStmtsTest.java +++ b/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/AvoidDeeplyNestedIfStmtsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.vm.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidDeeplyNestedIfStmtsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/CollapsibleIfStatementsTest.java b/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/CollapsibleIfStatementsTest.java index 9eb705dabb..a5053b4c86 100644 --- a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/CollapsibleIfStatementsTest.java +++ b/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/CollapsibleIfStatementsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.vm.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class CollapsibleIfStatementsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/ExcessiveTemplateLengthTest.java b/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/ExcessiveTemplateLengthTest.java index 64142b26ca..bb77ea067e 100644 --- a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/ExcessiveTemplateLengthTest.java +++ b/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/ExcessiveTemplateLengthTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.vm.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ExcessiveTemplateLengthTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/NoInlineJavaScriptTest.java b/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/NoInlineJavaScriptTest.java index 42a2739945..a2ca069449 100644 --- a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/NoInlineJavaScriptTest.java +++ b/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/NoInlineJavaScriptTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.vm.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class NoInlineJavaScriptTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/NoInlineStylesTest.java b/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/NoInlineStylesTest.java index 2d5c7b65b4..1f9592a738 100644 --- a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/NoInlineStylesTest.java +++ b/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/NoInlineStylesTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.vm.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class NoInlineStylesTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/errorprone/EmptyForeachStmtTest.java b/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/errorprone/EmptyForeachStmtTest.java index 56a4b90477..ccd9182e67 100644 --- a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/errorprone/EmptyForeachStmtTest.java +++ b/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/errorprone/EmptyForeachStmtTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.vm.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class EmptyForeachStmtTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/errorprone/EmptyIfStmtTest.java b/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/errorprone/EmptyIfStmtTest.java index 63fe618db2..034e362b8f 100644 --- a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/errorprone/EmptyIfStmtTest.java +++ b/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/errorprone/EmptyIfStmtTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.vm.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class EmptyIfStmtTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/LanguageVersionTest.java b/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/LanguageVersionTest.java index 463babc041..0a4bfe7f68 100644 --- a/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/LanguageVersionTest.java +++ b/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/LanguageVersionTest.java @@ -7,7 +7,7 @@ package net.sourceforge.pmd.lang.xml; import java.util.Arrays; import java.util.Collection; -import net.sourceforge.pmd.AbstractLanguageVersionTest; +import net.sourceforge.pmd.test.AbstractLanguageVersionTest; import net.sourceforge.pmd.lang.xml.pom.PomLanguageModule; import net.sourceforge.pmd.lang.xml.wsdl.WsdlLanguageModule; import net.sourceforge.pmd.lang.xml.xsl.XslLanguageModule; diff --git a/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/PMDTaskTest.java b/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/PMDTaskTest.java index f3a873ff13..bb270df6b8 100644 --- a/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/PMDTaskTest.java +++ b/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/PMDTaskTest.java @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.xml; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.ant.AbstractAntTestHelper; +import net.sourceforge.pmd.test.AbstractAntTestHelper; class PMDTaskTest extends AbstractAntTestHelper { diff --git a/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/RuleSetFactoryTest.java b/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/RuleSetFactoryTest.java index 4d4ce31948..c98dba1c9d 100644 --- a/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/RuleSetFactoryTest.java +++ b/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/RuleSetFactoryTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.xml; -import net.sourceforge.pmd.lang.rule.AbstractRuleSetFactoryTest; +import net.sourceforge.pmd.test.lang.rule.AbstractRuleSetFactoryTest; /** * Test xml's and xslt's rulesets diff --git a/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/pom/rule/errorprone/InvalidDependencyTypesTest.java b/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/pom/rule/errorprone/InvalidDependencyTypesTest.java index 0b6dd1f036..10c6674a36 100644 --- a/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/pom/rule/errorprone/InvalidDependencyTypesTest.java +++ b/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/pom/rule/errorprone/InvalidDependencyTypesTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.xml.pom.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class InvalidDependencyTypesTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/pom/rule/errorprone/ProjectVersionAsDependencyVersionTest.java b/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/pom/rule/errorprone/ProjectVersionAsDependencyVersionTest.java index 78805a4fc3..8011eb18a0 100644 --- a/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/pom/rule/errorprone/ProjectVersionAsDependencyVersionTest.java +++ b/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/pom/rule/errorprone/ProjectVersionAsDependencyVersionTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.xml.pom.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ProjectVersionAsDependencyVersionTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/rule/bestpractices/MissingEncodingTest.java b/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/rule/bestpractices/MissingEncodingTest.java index ba1fd2964b..499d979dfb 100644 --- a/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/rule/bestpractices/MissingEncodingTest.java +++ b/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/rule/bestpractices/MissingEncodingTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.xml.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class MissingEncodingTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/rule/errorprone/MistypedCDATASectionTest.java b/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/rule/errorprone/MistypedCDATASectionTest.java index d83318a1d0..bc78d8d8d8 100644 --- a/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/rule/errorprone/MistypedCDATASectionTest.java +++ b/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/rule/errorprone/MistypedCDATASectionTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.xml.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class MistypedCDATASectionTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/xsl/rule/codestyle/UseConcatOnceTest.java b/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/xsl/rule/codestyle/UseConcatOnceTest.java index b4ea085fb1..b9b36aed24 100644 --- a/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/xsl/rule/codestyle/UseConcatOnceTest.java +++ b/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/xsl/rule/codestyle/UseConcatOnceTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.xml.xsl.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UseConcatOnceTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/xsl/rule/performance/AvoidAxisNavigationTest.java b/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/xsl/rule/performance/AvoidAxisNavigationTest.java index 741f2598fa..ee4fbc514e 100644 --- a/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/xsl/rule/performance/AvoidAxisNavigationTest.java +++ b/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/xsl/rule/performance/AvoidAxisNavigationTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.xml.xsl.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidAxisNavigationTest extends PmdRuleTst { // no additional unit tests From 9d5e229704f35eb82994f4672f81409fc52346d9 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 23 Feb 2024 14:37:22 +0100 Subject: [PATCH 27/52] [core] Consolidate test packages Fix CpdAnalysisTest Add test cases of PMDFilelistTest into FileCollectorTest Moved ZipFileTest as FileCollectorZipTest Remove unnecessary test resources --- .../sourceforge/pmd/PmdConfigurationTest.java | 6 +- .../sourceforge/pmd/cli/PMDFilelistTest.java | 161 ------------------ .../sourceforge/pmd/cpd/CpdAnalysisTest.java | 69 ++++++-- .../pmd/lang/document/FileCollectorTest.java | 131 ++++++++++++++ .../document/FileCollectorZipTest.java} | 11 +- .../impl}/PmdRunnableTest.java | 3 +- .../pmd/{cli => }/auxclasspath-empty.cp | 0 .../sourceforge/pmd/{cli => }/auxclasspath.cp | 0 .../pmd/cli/cpd/encodingTest/File1.java | 7 - .../pmd/cli/cpd/encodingTest/File2.java | 7 - .../files/file_with_ISO-8859-1_encoding.java | 8 - .../pmd/cli/cpd/files/file_with_utf8_bom.java | 8 - .../pmd/cli/cpd/files/real-file.txt | 0 .../net/sourceforge/pmd/cli/filelist.txt | 1 - .../net/sourceforge/pmd/cli/filelist2.txt | 3 - .../net/sourceforge/pmd/cli/filelist3.txt | 1 - .../net/sourceforge/pmd/cli/filelist4.txt | 4 - .../net/sourceforge/pmd/cli/ignorelist.txt | 1 - .../files/dup1.java => cpd/files/dup1.txt} | 0 .../files/dup2.java => cpd/files/dup2.txt} | 0 .../files/file_with_ISO-8859-1_encoding.java | 8 - .../pmd/cpd/files/file_with_utf8_bom.java | 8 - .../document/filecollectortest/filelist.txt | 1 + .../document/filecollectortest/filelist2.txt | 3 + .../document/filecollectortest/filelist3.txt | 1 + .../document/filecollectortest/filelist4.txt | 4 + .../document/filecollectortest/ignorelist.txt | 1 + .../otherSrc/somefile.dummy | 0 .../filecollectortest}/src/anotherfile.dummy | 0 .../filecollectortest}/src/somefile.dummy | 0 .../filecollectortest}/src/somefile1.dummy | 0 .../filecollectortest}/src/somefile2.dummy | 0 .../filecollectortest}/src/somefile3.dummy | 0 .../filecollectortest}/src/somefile4.dummy | 0 .../filecollectorziptest}/zipWithSources.zip | Bin 35 files changed, 202 insertions(+), 245 deletions(-) delete mode 100644 pmd-core/src/test/java/net/sourceforge/pmd/cli/PMDFilelistTest.java rename pmd-core/src/test/java/net/sourceforge/pmd/{cli/ZipFileTest.java => lang/document/FileCollectorZipTest.java} (92%) rename pmd-core/src/test/java/net/sourceforge/pmd/{processor => lang/impl}/PmdRunnableTest.java (98%) rename pmd-core/src/test/resources/net/sourceforge/pmd/{cli => }/auxclasspath-empty.cp (100%) rename pmd-core/src/test/resources/net/sourceforge/pmd/{cli => }/auxclasspath.cp (100%) delete mode 100644 pmd-core/src/test/resources/net/sourceforge/pmd/cli/cpd/encodingTest/File1.java delete mode 100644 pmd-core/src/test/resources/net/sourceforge/pmd/cli/cpd/encodingTest/File2.java delete mode 100644 pmd-core/src/test/resources/net/sourceforge/pmd/cli/cpd/files/file_with_ISO-8859-1_encoding.java delete mode 100644 pmd-core/src/test/resources/net/sourceforge/pmd/cli/cpd/files/file_with_utf8_bom.java delete mode 100644 pmd-core/src/test/resources/net/sourceforge/pmd/cli/cpd/files/real-file.txt delete mode 100644 pmd-core/src/test/resources/net/sourceforge/pmd/cli/filelist.txt delete mode 100644 pmd-core/src/test/resources/net/sourceforge/pmd/cli/filelist2.txt delete mode 100644 pmd-core/src/test/resources/net/sourceforge/pmd/cli/filelist3.txt delete mode 100644 pmd-core/src/test/resources/net/sourceforge/pmd/cli/filelist4.txt delete mode 100644 pmd-core/src/test/resources/net/sourceforge/pmd/cli/ignorelist.txt rename pmd-core/src/test/resources/net/sourceforge/pmd/{cli/cpd/files/dup1.java => cpd/files/dup1.txt} (100%) rename pmd-core/src/test/resources/net/sourceforge/pmd/{cli/cpd/files/dup2.java => cpd/files/dup2.txt} (100%) delete mode 100644 pmd-core/src/test/resources/net/sourceforge/pmd/cpd/files/file_with_ISO-8859-1_encoding.java delete mode 100644 pmd-core/src/test/resources/net/sourceforge/pmd/cpd/files/file_with_utf8_bom.java create mode 100644 pmd-core/src/test/resources/net/sourceforge/pmd/lang/document/filecollectortest/filelist.txt create mode 100644 pmd-core/src/test/resources/net/sourceforge/pmd/lang/document/filecollectortest/filelist2.txt create mode 100644 pmd-core/src/test/resources/net/sourceforge/pmd/lang/document/filecollectortest/filelist3.txt create mode 100644 pmd-core/src/test/resources/net/sourceforge/pmd/lang/document/filecollectortest/filelist4.txt create mode 100644 pmd-core/src/test/resources/net/sourceforge/pmd/lang/document/filecollectortest/ignorelist.txt rename pmd-core/src/test/resources/net/sourceforge/pmd/{cli => lang/document/filecollectortest}/otherSrc/somefile.dummy (100%) rename pmd-core/src/test/resources/net/sourceforge/pmd/{cli => lang/document/filecollectortest}/src/anotherfile.dummy (100%) rename pmd-core/src/test/resources/net/sourceforge/pmd/{cli => lang/document/filecollectortest}/src/somefile.dummy (100%) rename pmd-core/src/test/resources/net/sourceforge/pmd/{cli => lang/document/filecollectortest}/src/somefile1.dummy (100%) rename pmd-core/src/test/resources/net/sourceforge/pmd/{cli => lang/document/filecollectortest}/src/somefile2.dummy (100%) rename pmd-core/src/test/resources/net/sourceforge/pmd/{cli => lang/document/filecollectortest}/src/somefile3.dummy (100%) rename pmd-core/src/test/resources/net/sourceforge/pmd/{cli => lang/document/filecollectortest}/src/somefile4.dummy (100%) rename pmd-core/src/test/resources/net/sourceforge/pmd/{cli => lang/document/filecollectorziptest}/zipWithSources.zip (100%) diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/PmdConfigurationTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/PmdConfigurationTest.java index bfa53973fc..9b382142d4 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/PmdConfigurationTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/PmdConfigurationTest.java @@ -71,7 +71,7 @@ class PmdConfigurationTest { @Test void auxClasspathWithRelativeFileEmpty() { - String relativeFilePath = "src/test/resources/net/sourceforge/pmd/cli/auxclasspath-empty.cp"; + String relativeFilePath = "src/test/resources/net/sourceforge/pmd/auxclasspath-empty.cp"; PMDConfiguration configuration = new PMDConfiguration(); configuration.prependAuxClasspath("file:" + relativeFilePath); URL[] urls = ((ClasspathClassLoader) configuration.getClassLoader()).getURLs(); @@ -80,7 +80,7 @@ class PmdConfigurationTest { @Test void auxClasspathWithRelativeFileEmpty2() { - String relativeFilePath = "./src/test/resources/net/sourceforge/pmd/cli/auxclasspath-empty.cp"; + String relativeFilePath = "./src/test/resources/net/sourceforge/pmd/auxclasspath-empty.cp"; PMDConfiguration configuration = new PMDConfiguration(); configuration.prependAuxClasspath("file:" + relativeFilePath); URL[] urls = ((ClasspathClassLoader) configuration.getClassLoader()).getURLs(); @@ -92,7 +92,7 @@ class PmdConfigurationTest { final String FILE_SCHEME = "file"; String currentWorkingDirectory = new File("").getAbsoluteFile().toURI().getPath(); - String relativeFilePath = "src/test/resources/net/sourceforge/pmd/cli/auxclasspath.cp"; + String relativeFilePath = "src/test/resources/net/sourceforge/pmd/auxclasspath.cp"; PMDConfiguration configuration = new PMDConfiguration(); configuration.prependAuxClasspath("file:" + relativeFilePath); URL[] urls = ((ClasspathClassLoader) configuration.getClassLoader()).getURLs(); diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/cli/PMDFilelistTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/cli/PMDFilelistTest.java deleted file mode 100644 index 19b6b7eed1..0000000000 --- a/pmd-core/src/test/java/net/sourceforge/pmd/cli/PMDFilelistTest.java +++ /dev/null @@ -1,161 +0,0 @@ -/** - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -package net.sourceforge.pmd.cli; - -import static net.sourceforge.pmd.internal.util.FileCollectionUtil.collectFileList; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.equalTo; -import static org.hamcrest.Matchers.hasSize; -import static org.hamcrest.Matchers.is; - -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.List; - -import org.checkerframework.checker.nullness.qual.NonNull; -import org.junit.jupiter.api.Test; - -import net.sourceforge.pmd.PMDConfiguration; -import net.sourceforge.pmd.PmdAnalysis; -import net.sourceforge.pmd.internal.util.FileCollectionUtil; -import net.sourceforge.pmd.internal.util.IOUtil; -import net.sourceforge.pmd.lang.LanguageRegistry; -import net.sourceforge.pmd.lang.LanguageVersionDiscoverer; -import net.sourceforge.pmd.lang.document.FileCollector; -import net.sourceforge.pmd.lang.document.InternalApiBridge; -import net.sourceforge.pmd.lang.document.TextFile; -import net.sourceforge.pmd.util.log.PmdReporter; - -class PMDFilelistTest { - - private static final Path RESOURCES = Paths.get("src/test/resources/net/sourceforge/pmd/cli/"); - - private @NonNull FileCollector newCollector() { - return InternalApiBridge.newCollector(new LanguageVersionDiscoverer(LanguageRegistry.PMD), PmdReporter.quiet()); - } - - @Test - void testGetApplicableFiles() { - FileCollector collector = newCollector(); - - collectFileList(collector, RESOURCES.resolve("filelist.txt")); - - List applicableFiles = collector.getCollectedFiles(); - assertThat(applicableFiles, hasSize(2)); - assertThat(applicableFiles.get(0).getFileId().getFileName(), equalTo("anotherfile.dummy")); - assertThat(applicableFiles.get(1).getFileId().getFileName(), equalTo("somefile.dummy")); - } - - @Test - void testGetApplicableFilesMultipleLines() { - FileCollector collector = newCollector(); - - collectFileList(collector, RESOURCES.resolve("filelist2.txt")); - - List applicableFiles = collector.getCollectedFiles(); - // note: the file has 3 entries, but one is duplicated, resulting in 2 individual files - assertThat(applicableFiles, hasSize(2)); - assertFilenameIs(applicableFiles.get(0), "anotherfile.dummy"); - assertFilenameIs(applicableFiles.get(1), "somefile.dummy"); - } - - private static void assertFilenameIs(TextFile textFile, String suffix) { - assertThat(textFile.getFileId().getFileName(), is(suffix)); - } - - @Test - void testGetApplicableFilesWithIgnores() { - FileCollector collector = newCollector(); - - PMDConfiguration configuration = new PMDConfiguration(); - configuration.setInputFilePath(RESOURCES.resolve("filelist3.txt")); - configuration.setIgnoreFilePath(RESOURCES.resolve("ignorelist.txt")); - FileCollectionUtil.collectFiles(configuration, collector); - - List applicableFiles = collector.getCollectedFiles(); - assertThat(applicableFiles, hasSize(2)); - assertFilenameIs(applicableFiles.get(0), "somefile2.dummy"); - assertFilenameIs(applicableFiles.get(1), "somefile4.dummy"); - } - - @Test - void testRelativizeWith() { - PMDConfiguration conf = new PMDConfiguration(); - conf.setInputFilePath(RESOURCES.resolve("filelist2.txt")); - conf.addRelativizeRoot(Paths.get("src/test/resources")); - try (PmdAnalysis pmd = PmdAnalysis.create(conf)) { - List files = pmd.files().getCollectedFiles(); - assertThat(files, hasSize(2)); - assertHasName(files.get(0), IOUtil.normalizePath("net/sourceforge/pmd/cli/src/anotherfile.dummy"), pmd); - assertHasName(files.get(1), IOUtil.normalizePath("net/sourceforge/pmd/cli/src/somefile.dummy"), pmd); - } - } - - public static void assertHasName(TextFile textFile, String expected, PmdAnalysis pmd) { - assertThat(pmd.fileNameRenderer().getDisplayName(textFile), equalTo(expected)); - } - - @Test - void testRelativizeWithOtherDir() { - PMDConfiguration conf = new PMDConfiguration(); - conf.setInputFilePath(RESOURCES.resolve("filelist4.txt")); - conf.addRelativizeRoot(RESOURCES.resolve("src")); - try (PmdAnalysis pmd = PmdAnalysis.create(conf)) { - List files = pmd.files().getCollectedFiles(); - assertThat(files, hasSize(3)); - assertHasName(files.get(0), ".." + IOUtil.normalizePath("/otherSrc/somefile.dummy"), pmd); - assertHasName(files.get(1), "anotherfile.dummy", pmd); - assertHasName(files.get(2), "somefile.dummy", pmd); - } - } - - @Test - void testRelativizeWithSeveralDirs() { - PMDConfiguration conf = new PMDConfiguration(); - conf.setInputFilePath(RESOURCES.resolve("filelist4.txt")); - conf.addRelativizeRoot(RESOURCES.resolve("src")); - conf.addRelativizeRoot(RESOURCES.resolve("otherSrc")); - try (PmdAnalysis pmd = PmdAnalysis.create(conf)) { - List files = pmd.files().getCollectedFiles(); - assertThat(files, hasSize(3)); - assertHasName(files.get(0), "somefile.dummy", pmd); - assertHasName(files.get(1), "anotherfile.dummy", pmd); - assertHasName(files.get(2), "somefile.dummy", pmd); - } - } - - @Test - void testUseAbsolutePaths() { - PMDConfiguration conf = new PMDConfiguration(); - conf.setInputFilePath(RESOURCES.resolve("filelist4.txt")); - conf.addRelativizeRoot(RESOURCES.toAbsolutePath().getRoot()); - try (PmdAnalysis pmd = PmdAnalysis.create(conf)) { - List files = pmd.files().getCollectedFiles(); - assertThat(files, hasSize(3)); - assertHasName(files.get(0), RESOURCES.resolve("otherSrc/somefile.dummy").toAbsolutePath().toString(), pmd); - assertHasName(files.get(1), RESOURCES.resolve("src/anotherfile.dummy").toAbsolutePath().toString(), pmd); - assertHasName(files.get(2), RESOURCES.resolve("src/somefile.dummy").toAbsolutePath().toString(), pmd); - } - } - - - @Test - void testGetApplicableFilesWithDirAndIgnores() { - PMDConfiguration configuration = new PMDConfiguration(); - configuration.addInputPath(RESOURCES.resolve("src")); - configuration.setIgnoreFilePath(RESOURCES.resolve("ignorelist.txt")); - - FileCollector collector = newCollector(); - FileCollectionUtil.collectFiles(configuration, collector); - - List applicableFiles = collector.getCollectedFiles(); - assertThat(applicableFiles, hasSize(4)); - assertFilenameIs(applicableFiles.get(0), "anotherfile.dummy"); - assertFilenameIs(applicableFiles.get(1), "somefile.dummy"); - assertFilenameIs(applicableFiles.get(2), "somefile2.dummy"); - assertFilenameIs(applicableFiles.get(3), "somefile4.dummy"); - } - -} diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/cpd/CpdAnalysisTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/cpd/CpdAnalysisTest.java index 88014e79ba..bffa3fa499 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/cpd/CpdAnalysisTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/cpd/CpdAnalysisTest.java @@ -5,10 +5,13 @@ package net.sourceforge.pmd.cpd; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; import static org.junit.jupiter.api.Assumptions.assumeTrue; import java.io.File; +import java.nio.file.Path; import java.nio.file.Paths; import java.util.List; @@ -70,10 +73,10 @@ class CpdAnalysisTest { void testFileSectionWithBrokenSymlinks() throws Exception { prepareSymLinks(); - NoFileAssertListener listener = new NoFileAssertListener(0); + FileCountAssertListener listener = new FileCountAssertListener(0); try (CpdAnalysis cpd = CpdAnalysis.create(config)) { cpd.setCpdListener(listener); - cpd.files().addFile(Paths.get(BASE_TEST_RESOURCE_PATH, "this-is-a-broken-sym-link-for-test")); + assertFalse(cpd.files().addFile(Paths.get(BASE_TEST_RESOURCE_PATH, "this-is-a-broken-sym-link-for-test"))); cpd.performAnalysis(); } @@ -91,11 +94,28 @@ class CpdAnalysisTest { void testFileAddedAsSymlinkAndReal() throws Exception { prepareSymLinks(); - NoFileAssertListener listener = new NoFileAssertListener(1); + FileCountAssertListener listener = new FileCountAssertListener(1); try (CpdAnalysis cpd = CpdAnalysis.create(config)) { cpd.setCpdListener(listener); - cpd.files().addFile(Paths.get(BASE_TEST_RESOURCE_PATH, "real-file.txt")); - cpd.files().addFile(Paths.get(BASE_TEST_RESOURCE_PATH, "symlink-for-real-file.txt")); + assertTrue(cpd.files().addFile(Paths.get(BASE_TEST_RESOURCE_PATH, "real-file.txt"))); + assertFalse(cpd.files().addFile(Paths.get(BASE_TEST_RESOURCE_PATH, "symlink-for-real-file.txt"))); + cpd.performAnalysis(); + } + + listener.verify(); + } + + /** + * A file should be not be added via a sym link. + */ + @Test + void testNoFileAddedAsSymlink() throws Exception { + prepareSymLinks(); + + FileCountAssertListener listener = new FileCountAssertListener(0); + try (CpdAnalysis cpd = CpdAnalysis.create(config)) { + cpd.setCpdListener(listener); + assertFalse(cpd.files().addFile(Paths.get(BASE_TEST_RESOURCE_PATH, "symlink-for-real-file.txt"))); cpd.performAnalysis(); } @@ -111,10 +131,10 @@ class CpdAnalysisTest { */ @Test void testFileAddedWithRelativePath() throws Exception { - NoFileAssertListener listener = new NoFileAssertListener(1); + FileCountAssertListener listener = new FileCountAssertListener(1); try (CpdAnalysis cpd = CpdAnalysis.create(config)) { cpd.setCpdListener(listener); - cpd.files().addFile(Paths.get("./" + BASE_TEST_RESOURCE_PATH, "real-file.txt")); + assertTrue(cpd.files().addFile(Paths.get("./" + BASE_TEST_RESOURCE_PATH, "real-file.txt"))); cpd.performAnalysis(); } @@ -128,31 +148,46 @@ class CpdAnalysisTest { */ @Test void testFileOrderRelevance() throws Exception { + Path dup1 = Paths.get("./" + BASE_TEST_RESOURCE_PATH, "dup1.txt"); + Path dup2 = Paths.get("./" + BASE_TEST_RESOURCE_PATH, "dup2.txt"); + try (CpdAnalysis cpd = CpdAnalysis.create(config)) { - cpd.files().addFile(Paths.get("./" + BASE_TEST_RESOURCE_PATH, "dup2.java")); - cpd.files().addFile(Paths.get("./" + BASE_TEST_RESOURCE_PATH, "dup1.java")); + assertTrue(cpd.files().addFile(dup2)); + assertTrue(cpd.files().addFile(dup1)); cpd.performAnalysis(report -> { - - List matches = report.getMatches(); + assertFalse(matches.isEmpty()); for (Match match : matches) { - // the file added first was dup2. - assertEquals("dup2.java", match.getFirstMark().getFileId().getFileName()); - assertEquals("dup1.java", match.getSecondMark().getFileId().getFileName()); + // the file added first was dup2, but we sort now the files alphabetically, so dup1 is the first. + assertEquals("dup1.txt", match.getFirstMark().getFileId().getFileName()); + assertEquals("dup2.txt", match.getSecondMark().getFileId().getFileName()); + } + }); + } + // now the other way round + try (CpdAnalysis cpd = CpdAnalysis.create(config)) { + assertTrue(cpd.files().addFile(dup1)); + assertTrue(cpd.files().addFile(dup2)); + cpd.performAnalysis(report -> { + List matches = report.getMatches(); + assertFalse(matches.isEmpty()); + for (Match match : matches) { + // dup1.txt is still the first + assertEquals("dup1.txt", match.getFirstMark().getFileId().getFileName()); + assertEquals("dup2.txt", match.getSecondMark().getFileId().getFileName()); } }); } - } /** * Simple listener that fails, if too many files were added and not skipped. */ - private static class NoFileAssertListener implements CPDListener { + private static class FileCountAssertListener implements CPDListener { private int expectedFilesCount; private int files; - NoFileAssertListener(int expectedFilesCount) { + FileCountAssertListener(int expectedFilesCount) { this.expectedFilesCount = expectedFilesCount; this.files = 0; } diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/lang/document/FileCollectorTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/lang/document/FileCollectorTest.java index c1d6996e9c..a276b5147c 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/lang/document/FileCollectorTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/lang/document/FileCollectorTest.java @@ -4,7 +4,12 @@ package net.sourceforge.pmd.lang.document; +import static net.sourceforge.pmd.internal.util.FileCollectionUtil.collectFileList; import static net.sourceforge.pmd.util.CollectionUtil.listOf; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.hasSize; +import static org.hamcrest.Matchers.is; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -12,11 +17,16 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; +import java.nio.file.Paths; import java.util.List; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; +import net.sourceforge.pmd.PMDConfiguration; +import net.sourceforge.pmd.PmdAnalysis; +import net.sourceforge.pmd.internal.util.FileCollectionUtil; +import net.sourceforge.pmd.internal.util.IOUtil; import net.sourceforge.pmd.lang.DummyLanguageModule; import net.sourceforge.pmd.lang.Language; import net.sourceforge.pmd.lang.LanguageRegistry; @@ -28,6 +38,7 @@ import net.sourceforge.pmd.util.CollectionUtil; * @author ClĂ©ment Fournier */ class FileCollectorTest { + private static final Path RESOURCES = Paths.get("src/test/resources/net/sourceforge/pmd/lang/document/filecollectortest/"); @TempDir private Path tempFolder; @@ -90,7 +101,127 @@ class FileCollectorTest { assertCollected(collector, listOf(FileId.fromPath(foo), FileId.fromPath(bar))); } + @Test + void testGetApplicableFiles() { + FileCollector collector = newCollector(); + collectFileList(collector, RESOURCES.resolve("filelist.txt")); + + List applicableFiles = collector.getCollectedFiles(); + assertThat(applicableFiles, hasSize(2)); + assertThat(applicableFiles.get(0).getFileId().getFileName(), equalTo("anotherfile.dummy")); + assertThat(applicableFiles.get(1).getFileId().getFileName(), equalTo("somefile.dummy")); + } + + @Test + void testGetApplicableFilesMultipleLines() { + FileCollector collector = newCollector(); + + collectFileList(collector, RESOURCES.resolve("filelist2.txt")); + + List applicableFiles = collector.getCollectedFiles(); + // note: the file has 3 entries, but one is duplicated, resulting in 2 individual files + assertThat(applicableFiles, hasSize(2)); + assertFilenameIs(applicableFiles.get(0), "anotherfile.dummy"); + assertFilenameIs(applicableFiles.get(1), "somefile.dummy"); + } + + @Test + void testGetApplicableFilesWithIgnores() { + FileCollector collector = newCollector(); + + PMDConfiguration configuration = new PMDConfiguration(); + configuration.setInputFilePath(RESOURCES.resolve("filelist3.txt")); + configuration.setIgnoreFilePath(RESOURCES.resolve("ignorelist.txt")); + FileCollectionUtil.collectFiles(configuration, collector); + + List applicableFiles = collector.getCollectedFiles(); + assertThat(applicableFiles, hasSize(2)); + assertFilenameIs(applicableFiles.get(0), "somefile2.dummy"); + assertFilenameIs(applicableFiles.get(1), "somefile4.dummy"); + } + + @Test + void testRelativizeWith() { + PMDConfiguration conf = new PMDConfiguration(); + conf.setInputFilePath(RESOURCES.resolve("filelist2.txt")); + conf.addRelativizeRoot(Paths.get("src/test/resources")); + try (PmdAnalysis pmd = PmdAnalysis.create(conf)) { + List files = pmd.files().getCollectedFiles(); + assertThat(files, hasSize(2)); + assertHasName(files.get(0), IOUtil.normalizePath("net/sourceforge/pmd/lang/document/filecollectortest/src/anotherfile.dummy"), pmd); + assertHasName(files.get(1), IOUtil.normalizePath("net/sourceforge/pmd/lang/document/filecollectortest/src/somefile.dummy"), pmd); + } + } + + @Test + void testRelativizeWithOtherDir() { + PMDConfiguration conf = new PMDConfiguration(); + conf.setInputFilePath(RESOURCES.resolve("filelist4.txt")); + conf.addRelativizeRoot(RESOURCES.resolve("src")); + try (PmdAnalysis pmd = PmdAnalysis.create(conf)) { + List files = pmd.files().getCollectedFiles(); + assertThat(files, hasSize(3)); + assertHasName(files.get(0), ".." + IOUtil.normalizePath("/otherSrc/somefile.dummy"), pmd); + assertHasName(files.get(1), "anotherfile.dummy", pmd); + assertHasName(files.get(2), "somefile.dummy", pmd); + } + } + + @Test + void testRelativizeWithSeveralDirs() { + PMDConfiguration conf = new PMDConfiguration(); + conf.setInputFilePath(RESOURCES.resolve("filelist4.txt")); + conf.addRelativizeRoot(RESOURCES.resolve("src")); + conf.addRelativizeRoot(RESOURCES.resolve("otherSrc")); + try (PmdAnalysis pmd = PmdAnalysis.create(conf)) { + List files = pmd.files().getCollectedFiles(); + assertThat(files, hasSize(3)); + assertHasName(files.get(0), "somefile.dummy", pmd); + assertHasName(files.get(1), "anotherfile.dummy", pmd); + assertHasName(files.get(2), "somefile.dummy", pmd); + } + } + + @Test + void testUseAbsolutePaths() { + PMDConfiguration conf = new PMDConfiguration(); + conf.setInputFilePath(RESOURCES.resolve("filelist4.txt")); + conf.addRelativizeRoot(RESOURCES.toAbsolutePath().getRoot()); + try (PmdAnalysis pmd = PmdAnalysis.create(conf)) { + List files = pmd.files().getCollectedFiles(); + assertThat(files, hasSize(3)); + assertHasName(files.get(0), RESOURCES.resolve("otherSrc/somefile.dummy").toAbsolutePath().toString(), pmd); + assertHasName(files.get(1), RESOURCES.resolve("src/anotherfile.dummy").toAbsolutePath().toString(), pmd); + assertHasName(files.get(2), RESOURCES.resolve("src/somefile.dummy").toAbsolutePath().toString(), pmd); + } + } + + + @Test + void testGetApplicableFilesWithDirAndIgnores() { + PMDConfiguration configuration = new PMDConfiguration(); + configuration.addInputPath(RESOURCES.resolve("src")); + configuration.setIgnoreFilePath(RESOURCES.resolve("ignorelist.txt")); + + FileCollector collector = newCollector(); + FileCollectionUtil.collectFiles(configuration, collector); + + List applicableFiles = collector.getCollectedFiles(); + assertThat(applicableFiles, hasSize(4)); + assertFilenameIs(applicableFiles.get(0), "anotherfile.dummy"); + assertFilenameIs(applicableFiles.get(1), "somefile.dummy"); + assertFilenameIs(applicableFiles.get(2), "somefile2.dummy"); + assertFilenameIs(applicableFiles.get(3), "somefile4.dummy"); + } + + public static void assertHasName(TextFile textFile, String expected, PmdAnalysis pmd) { + assertThat(pmd.fileNameRenderer().getDisplayName(textFile), equalTo(expected)); + } + + private static void assertFilenameIs(TextFile textFile, String suffix) { + assertThat(textFile.getFileId().getFileName(), is(suffix)); + } private Path newFile(Path root, String path) throws IOException { Path resolved = root.resolve(path); diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/cli/ZipFileTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/lang/document/FileCollectorZipTest.java similarity index 92% rename from pmd-core/src/test/java/net/sourceforge/pmd/cli/ZipFileTest.java rename to pmd-core/src/test/java/net/sourceforge/pmd/lang/document/FileCollectorZipTest.java index 98eba5562a..634e2859a1 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/cli/ZipFileTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/lang/document/FileCollectorZipTest.java @@ -2,9 +2,9 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.cli; +package net.sourceforge.pmd.lang.document; -import static net.sourceforge.pmd.cli.PMDFilelistTest.assertHasName; +import static net.sourceforge.pmd.lang.document.FileCollectorTest.assertHasName; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasSize; @@ -21,11 +21,10 @@ import org.junit.jupiter.api.Test; import net.sourceforge.pmd.PMDConfiguration; import net.sourceforge.pmd.PmdAnalysis; import net.sourceforge.pmd.internal.util.IOUtil; -import net.sourceforge.pmd.lang.document.TextFile; -class ZipFileTest { +class FileCollectorZipTest { - private static final String ZIP_PATH = "src/test/resources/net/sourceforge/pmd/cli/zipWithSources.zip"; + private static final String ZIP_PATH = "src/test/resources/net/sourceforge/pmd/lang/document/filecollectorziptest/zipWithSources.zip"; private final Path zipPath = Paths.get(ZIP_PATH); @Test @@ -66,7 +65,7 @@ class ZipFileTest { try (PmdAnalysis pmd = PmdAnalysis.create(conf)) { List files = pmd.files().getCollectedFiles(); assertThat(files, hasSize(3)); - String baseZipPath = IOUtil.normalizePath("net/sourceforge/pmd/cli/zipWithSources.zip"); + String baseZipPath = IOUtil.normalizePath("net/sourceforge/pmd/lang/document/filecollectorziptest/zipWithSources.zip"); assertHasName(files.get(0), baseZipPath + "!/otherSrc/somefile.dummy", pmd); assertHasName(files.get(1), baseZipPath + "!/src/somefile.dummy", pmd); assertHasName(files.get(2), baseZipPath + "!/src/somefile1.dummy", pmd); diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/processor/PmdRunnableTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/lang/impl/PmdRunnableTest.java similarity index 98% rename from pmd-core/src/test/java/net/sourceforge/pmd/processor/PmdRunnableTest.java rename to pmd-core/src/test/java/net/sourceforge/pmd/lang/impl/PmdRunnableTest.java index 78e2f0cf8c..7ca1db22f5 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/processor/PmdRunnableTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/lang/impl/PmdRunnableTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.processor; +package net.sourceforge.pmd.lang.impl; import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.MatcherAssert.assertThat; @@ -34,7 +34,6 @@ import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.ast.Parser; import net.sourceforge.pmd.lang.ast.RootNode; import net.sourceforge.pmd.lang.document.FileId; -import net.sourceforge.pmd.lang.impl.SimpleLanguageModuleBase; import net.sourceforge.pmd.lang.rule.AbstractRule; import net.sourceforge.pmd.lang.rule.Rule; import net.sourceforge.pmd.lang.rule.RuleSet; diff --git a/pmd-core/src/test/resources/net/sourceforge/pmd/cli/auxclasspath-empty.cp b/pmd-core/src/test/resources/net/sourceforge/pmd/auxclasspath-empty.cp similarity index 100% rename from pmd-core/src/test/resources/net/sourceforge/pmd/cli/auxclasspath-empty.cp rename to pmd-core/src/test/resources/net/sourceforge/pmd/auxclasspath-empty.cp diff --git a/pmd-core/src/test/resources/net/sourceforge/pmd/cli/auxclasspath.cp b/pmd-core/src/test/resources/net/sourceforge/pmd/auxclasspath.cp similarity index 100% rename from pmd-core/src/test/resources/net/sourceforge/pmd/cli/auxclasspath.cp rename to pmd-core/src/test/resources/net/sourceforge/pmd/auxclasspath.cp diff --git a/pmd-core/src/test/resources/net/sourceforge/pmd/cli/cpd/encodingTest/File1.java b/pmd-core/src/test/resources/net/sourceforge/pmd/cli/cpd/encodingTest/File1.java deleted file mode 100644 index 0f0ddeee13..0000000000 --- a/pmd-core/src/test/resources/net/sourceforge/pmd/cli/cpd/encodingTest/File1.java +++ /dev/null @@ -1,7 +0,0 @@ -public class File1 { - public void dup() { - for (int i = 0; i < 10; i++) { - System.out.println(i + "ä"); - } - } -} \ No newline at end of file diff --git a/pmd-core/src/test/resources/net/sourceforge/pmd/cli/cpd/encodingTest/File2.java b/pmd-core/src/test/resources/net/sourceforge/pmd/cli/cpd/encodingTest/File2.java deleted file mode 100644 index 12fab4b42f..0000000000 --- a/pmd-core/src/test/resources/net/sourceforge/pmd/cli/cpd/encodingTest/File2.java +++ /dev/null @@ -1,7 +0,0 @@ -public class File2 { - public void dup() { - for (int j = 0; j < 10; j++) { - System.out.println(j + "ä"); - } - } -} \ No newline at end of file diff --git a/pmd-core/src/test/resources/net/sourceforge/pmd/cli/cpd/files/file_with_ISO-8859-1_encoding.java b/pmd-core/src/test/resources/net/sourceforge/pmd/cli/cpd/files/file_with_ISO-8859-1_encoding.java deleted file mode 100644 index d7f62ea9ed..0000000000 --- a/pmd-core/src/test/resources/net/sourceforge/pmd/cli/cpd/files/file_with_ISO-8859-1_encoding.java +++ /dev/null @@ -1,8 +0,0 @@ -/** - * This file is using ISO-8859-1 (Latin-1) encoding. - * - * ä - */ -public class FileWith_ISO8859-1_Encoding { - -} diff --git a/pmd-core/src/test/resources/net/sourceforge/pmd/cli/cpd/files/file_with_utf8_bom.java b/pmd-core/src/test/resources/net/sourceforge/pmd/cli/cpd/files/file_with_utf8_bom.java deleted file mode 100644 index 566bf55d83..0000000000 --- a/pmd-core/src/test/resources/net/sourceforge/pmd/cli/cpd/files/file_with_utf8_bom.java +++ /dev/null @@ -1,8 +0,0 @@ -/** - * This file is using UTF-8 with BOM encoding. - * - * ä - */ -public class FileWith_UTF-8-BOM_Encoding { - -} diff --git a/pmd-core/src/test/resources/net/sourceforge/pmd/cli/cpd/files/real-file.txt b/pmd-core/src/test/resources/net/sourceforge/pmd/cli/cpd/files/real-file.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/pmd-core/src/test/resources/net/sourceforge/pmd/cli/filelist.txt b/pmd-core/src/test/resources/net/sourceforge/pmd/cli/filelist.txt deleted file mode 100644 index cc7f4823b5..0000000000 --- a/pmd-core/src/test/resources/net/sourceforge/pmd/cli/filelist.txt +++ /dev/null @@ -1 +0,0 @@ -src/test/resources/net/sourceforge/pmd/cli/src/somefile.dummy,src/test/resources/net/sourceforge/pmd/cli/src/anotherfile.dummy \ No newline at end of file diff --git a/pmd-core/src/test/resources/net/sourceforge/pmd/cli/filelist2.txt b/pmd-core/src/test/resources/net/sourceforge/pmd/cli/filelist2.txt deleted file mode 100644 index 7897f05369..0000000000 --- a/pmd-core/src/test/resources/net/sourceforge/pmd/cli/filelist2.txt +++ /dev/null @@ -1,3 +0,0 @@ -src/test/resources/net/sourceforge/pmd/cli/src/somefile.dummy, -src/test/resources/net/sourceforge/pmd/cli/src/anotherfile.dummy -src/test/resources/net/sourceforge/pmd/cli/src/somefile.dummy \ No newline at end of file diff --git a/pmd-core/src/test/resources/net/sourceforge/pmd/cli/filelist3.txt b/pmd-core/src/test/resources/net/sourceforge/pmd/cli/filelist3.txt deleted file mode 100644 index e34bdbb543..0000000000 --- a/pmd-core/src/test/resources/net/sourceforge/pmd/cli/filelist3.txt +++ /dev/null @@ -1 +0,0 @@ -src/test/resources/net/sourceforge/pmd/cli/src/somefile1.dummy,src/test/resources/net/sourceforge/pmd/cli/src/somefile2.dummy,src/test/resources/net/sourceforge/pmd/cli/src/somefile3.dummy,src/test/resources/net/sourceforge/pmd/cli/src/somefile4.dummy \ No newline at end of file diff --git a/pmd-core/src/test/resources/net/sourceforge/pmd/cli/filelist4.txt b/pmd-core/src/test/resources/net/sourceforge/pmd/cli/filelist4.txt deleted file mode 100644 index 9f7ddef003..0000000000 --- a/pmd-core/src/test/resources/net/sourceforge/pmd/cli/filelist4.txt +++ /dev/null @@ -1,4 +0,0 @@ -src/test/resources/net/sourceforge/pmd/cli/src/somefile.dummy, -src/test/resources/net/sourceforge/pmd/cli/otherSrc/somefile.dummy, -src/test/resources/net/sourceforge/pmd/cli/src/anotherfile.dummy -src/test/resources/net/sourceforge/pmd/cli/src/somefile.dummy diff --git a/pmd-core/src/test/resources/net/sourceforge/pmd/cli/ignorelist.txt b/pmd-core/src/test/resources/net/sourceforge/pmd/cli/ignorelist.txt deleted file mode 100644 index e606537e12..0000000000 --- a/pmd-core/src/test/resources/net/sourceforge/pmd/cli/ignorelist.txt +++ /dev/null @@ -1 +0,0 @@ -src/test/resources/net/sourceforge/pmd/cli/src/somefile3.dummy,src/test/resources/net/sourceforge/pmd/cli/src/somefile1.dummy \ No newline at end of file diff --git a/pmd-core/src/test/resources/net/sourceforge/pmd/cli/cpd/files/dup1.java b/pmd-core/src/test/resources/net/sourceforge/pmd/cpd/files/dup1.txt similarity index 100% rename from pmd-core/src/test/resources/net/sourceforge/pmd/cli/cpd/files/dup1.java rename to pmd-core/src/test/resources/net/sourceforge/pmd/cpd/files/dup1.txt diff --git a/pmd-core/src/test/resources/net/sourceforge/pmd/cli/cpd/files/dup2.java b/pmd-core/src/test/resources/net/sourceforge/pmd/cpd/files/dup2.txt similarity index 100% rename from pmd-core/src/test/resources/net/sourceforge/pmd/cli/cpd/files/dup2.java rename to pmd-core/src/test/resources/net/sourceforge/pmd/cpd/files/dup2.txt diff --git a/pmd-core/src/test/resources/net/sourceforge/pmd/cpd/files/file_with_ISO-8859-1_encoding.java b/pmd-core/src/test/resources/net/sourceforge/pmd/cpd/files/file_with_ISO-8859-1_encoding.java deleted file mode 100644 index 1b77e3ef98..0000000000 --- a/pmd-core/src/test/resources/net/sourceforge/pmd/cpd/files/file_with_ISO-8859-1_encoding.java +++ /dev/null @@ -1,8 +0,0 @@ -/** - * This file is using ISO-8859-1 (Latin-1) encoding. - * - * ä (this is an a-umlaut U+00E4) - */ -public class FileWith_ISO8859-1_Encoding { - -} diff --git a/pmd-core/src/test/resources/net/sourceforge/pmd/cpd/files/file_with_utf8_bom.java b/pmd-core/src/test/resources/net/sourceforge/pmd/cpd/files/file_with_utf8_bom.java deleted file mode 100644 index 30fd5d2b2b..0000000000 --- a/pmd-core/src/test/resources/net/sourceforge/pmd/cpd/files/file_with_utf8_bom.java +++ /dev/null @@ -1,8 +0,0 @@ -/** - * This file is using UTF-8 with BOM encoding. - * - * ä (this is an a-umlaut U+00E4) - */ -public class FileWith_UTF-8-BOM_Encoding { - -} diff --git a/pmd-core/src/test/resources/net/sourceforge/pmd/lang/document/filecollectortest/filelist.txt b/pmd-core/src/test/resources/net/sourceforge/pmd/lang/document/filecollectortest/filelist.txt new file mode 100644 index 0000000000..e352128ed2 --- /dev/null +++ b/pmd-core/src/test/resources/net/sourceforge/pmd/lang/document/filecollectortest/filelist.txt @@ -0,0 +1 @@ +src/test/resources/net/sourceforge/pmd/lang/document/filecollectortest/src/somefile.dummy,src/test/resources/net/sourceforge/pmd/lang/document/filecollectortest/src/anotherfile.dummy diff --git a/pmd-core/src/test/resources/net/sourceforge/pmd/lang/document/filecollectortest/filelist2.txt b/pmd-core/src/test/resources/net/sourceforge/pmd/lang/document/filecollectortest/filelist2.txt new file mode 100644 index 0000000000..b25bbf9185 --- /dev/null +++ b/pmd-core/src/test/resources/net/sourceforge/pmd/lang/document/filecollectortest/filelist2.txt @@ -0,0 +1,3 @@ +src/test/resources/net/sourceforge/pmd/lang/document/filecollectortest/src/somefile.dummy, +src/test/resources/net/sourceforge/pmd/lang/document/filecollectortest/src/anotherfile.dummy +src/test/resources/net/sourceforge/pmd/lang/document/filecollectortest/src/somefile.dummy diff --git a/pmd-core/src/test/resources/net/sourceforge/pmd/lang/document/filecollectortest/filelist3.txt b/pmd-core/src/test/resources/net/sourceforge/pmd/lang/document/filecollectortest/filelist3.txt new file mode 100644 index 0000000000..b198d7c07f --- /dev/null +++ b/pmd-core/src/test/resources/net/sourceforge/pmd/lang/document/filecollectortest/filelist3.txt @@ -0,0 +1 @@ +src/test/resources/net/sourceforge/pmd/lang/document/filecollectortest/src/somefile1.dummy,src/test/resources/net/sourceforge/pmd/lang/document/filecollectortest/src/somefile2.dummy,src/test/resources/net/sourceforge/pmd/lang/document/filecollectortest/src/somefile3.dummy,src/test/resources/net/sourceforge/pmd/lang/document/filecollectortest/src/somefile4.dummy diff --git a/pmd-core/src/test/resources/net/sourceforge/pmd/lang/document/filecollectortest/filelist4.txt b/pmd-core/src/test/resources/net/sourceforge/pmd/lang/document/filecollectortest/filelist4.txt new file mode 100644 index 0000000000..bab25a8ad9 --- /dev/null +++ b/pmd-core/src/test/resources/net/sourceforge/pmd/lang/document/filecollectortest/filelist4.txt @@ -0,0 +1,4 @@ +src/test/resources/net/sourceforge/pmd/lang/document/filecollectortest/src/somefile.dummy, +src/test/resources/net/sourceforge/pmd/lang/document/filecollectortest/otherSrc/somefile.dummy, +src/test/resources/net/sourceforge/pmd/lang/document/filecollectortest/src/anotherfile.dummy +src/test/resources/net/sourceforge/pmd/lang/document/filecollectortest/src/somefile.dummy diff --git a/pmd-core/src/test/resources/net/sourceforge/pmd/lang/document/filecollectortest/ignorelist.txt b/pmd-core/src/test/resources/net/sourceforge/pmd/lang/document/filecollectortest/ignorelist.txt new file mode 100644 index 0000000000..5575131795 --- /dev/null +++ b/pmd-core/src/test/resources/net/sourceforge/pmd/lang/document/filecollectortest/ignorelist.txt @@ -0,0 +1 @@ +src/test/resources/net/sourceforge/pmd/lang/document/filecollectortest/src/somefile3.dummy,src/test/resources/net/sourceforge/pmd/lang/document/filecollectortest/src/somefile1.dummy diff --git a/pmd-core/src/test/resources/net/sourceforge/pmd/cli/otherSrc/somefile.dummy b/pmd-core/src/test/resources/net/sourceforge/pmd/lang/document/filecollectortest/otherSrc/somefile.dummy similarity index 100% rename from pmd-core/src/test/resources/net/sourceforge/pmd/cli/otherSrc/somefile.dummy rename to pmd-core/src/test/resources/net/sourceforge/pmd/lang/document/filecollectortest/otherSrc/somefile.dummy diff --git a/pmd-core/src/test/resources/net/sourceforge/pmd/cli/src/anotherfile.dummy b/pmd-core/src/test/resources/net/sourceforge/pmd/lang/document/filecollectortest/src/anotherfile.dummy similarity index 100% rename from pmd-core/src/test/resources/net/sourceforge/pmd/cli/src/anotherfile.dummy rename to pmd-core/src/test/resources/net/sourceforge/pmd/lang/document/filecollectortest/src/anotherfile.dummy diff --git a/pmd-core/src/test/resources/net/sourceforge/pmd/cli/src/somefile.dummy b/pmd-core/src/test/resources/net/sourceforge/pmd/lang/document/filecollectortest/src/somefile.dummy similarity index 100% rename from pmd-core/src/test/resources/net/sourceforge/pmd/cli/src/somefile.dummy rename to pmd-core/src/test/resources/net/sourceforge/pmd/lang/document/filecollectortest/src/somefile.dummy diff --git a/pmd-core/src/test/resources/net/sourceforge/pmd/cli/src/somefile1.dummy b/pmd-core/src/test/resources/net/sourceforge/pmd/lang/document/filecollectortest/src/somefile1.dummy similarity index 100% rename from pmd-core/src/test/resources/net/sourceforge/pmd/cli/src/somefile1.dummy rename to pmd-core/src/test/resources/net/sourceforge/pmd/lang/document/filecollectortest/src/somefile1.dummy diff --git a/pmd-core/src/test/resources/net/sourceforge/pmd/cli/src/somefile2.dummy b/pmd-core/src/test/resources/net/sourceforge/pmd/lang/document/filecollectortest/src/somefile2.dummy similarity index 100% rename from pmd-core/src/test/resources/net/sourceforge/pmd/cli/src/somefile2.dummy rename to pmd-core/src/test/resources/net/sourceforge/pmd/lang/document/filecollectortest/src/somefile2.dummy diff --git a/pmd-core/src/test/resources/net/sourceforge/pmd/cli/src/somefile3.dummy b/pmd-core/src/test/resources/net/sourceforge/pmd/lang/document/filecollectortest/src/somefile3.dummy similarity index 100% rename from pmd-core/src/test/resources/net/sourceforge/pmd/cli/src/somefile3.dummy rename to pmd-core/src/test/resources/net/sourceforge/pmd/lang/document/filecollectortest/src/somefile3.dummy diff --git a/pmd-core/src/test/resources/net/sourceforge/pmd/cli/src/somefile4.dummy b/pmd-core/src/test/resources/net/sourceforge/pmd/lang/document/filecollectortest/src/somefile4.dummy similarity index 100% rename from pmd-core/src/test/resources/net/sourceforge/pmd/cli/src/somefile4.dummy rename to pmd-core/src/test/resources/net/sourceforge/pmd/lang/document/filecollectortest/src/somefile4.dummy diff --git a/pmd-core/src/test/resources/net/sourceforge/pmd/cli/zipWithSources.zip b/pmd-core/src/test/resources/net/sourceforge/pmd/lang/document/filecollectorziptest/zipWithSources.zip similarity index 100% rename from pmd-core/src/test/resources/net/sourceforge/pmd/cli/zipWithSources.zip rename to pmd-core/src/test/resources/net/sourceforge/pmd/lang/document/filecollectorziptest/zipWithSources.zip From 414c119be15c693bfcb1e5a810c4decaf63fd53f Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 23 Feb 2024 14:41:50 +0100 Subject: [PATCH 28/52] [apex] Move metrics tests into internal package --- .../apex/metrics/{impl => internal}/AllMetricsTest.java | 2 +- .../{impl => internal}/CognitiveComplexityTestRule.java | 2 +- .../lang/apex/metrics/{impl => internal}/CycloTestRule.java | 2 +- .../lang/apex/metrics/{impl => internal}/WmcTestRule.java | 2 +- .../{impl => internal}/xml/CognitiveComplexityTest.xml | 0 .../lang/apex/metrics/{impl => internal}/xml/CycloTest.xml | 0 .../lang/apex/metrics/{impl => internal}/xml/WmcTest.xml | 0 pmd-apex/src/test/resources/rulesets/apex/metrics_test.xml | 6 +++--- 8 files changed, 7 insertions(+), 7 deletions(-) rename pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/metrics/{impl => internal}/AllMetricsTest.java (94%) rename pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/metrics/{impl => internal}/CognitiveComplexityTestRule.java (93%) rename pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/metrics/{impl => internal}/CycloTestRule.java (94%) rename pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/metrics/{impl => internal}/WmcTestRule.java (91%) rename pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/metrics/{impl => internal}/xml/CognitiveComplexityTest.xml (100%) rename pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/metrics/{impl => internal}/xml/CycloTest.xml (100%) rename pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/metrics/{impl => internal}/xml/WmcTest.xml (100%) diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/metrics/impl/AllMetricsTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/metrics/internal/AllMetricsTest.java similarity index 94% rename from pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/metrics/impl/AllMetricsTest.java rename to pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/metrics/internal/AllMetricsTest.java index b568e90a14..f3d9d791ed 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/metrics/impl/AllMetricsTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/metrics/internal/AllMetricsTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.apex.metrics.impl; +package net.sourceforge.pmd.lang.apex.metrics.internal; import net.sourceforge.pmd.lang.apex.ast.ApexQualifiableNode; import net.sourceforge.pmd.lang.ast.Node; diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/metrics/impl/CognitiveComplexityTestRule.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/metrics/internal/CognitiveComplexityTestRule.java similarity index 93% rename from pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/metrics/impl/CognitiveComplexityTestRule.java rename to pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/metrics/internal/CognitiveComplexityTestRule.java index b2eaec826f..dcfd7fb034 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/metrics/impl/CognitiveComplexityTestRule.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/metrics/internal/CognitiveComplexityTestRule.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.apex.metrics.impl; +package net.sourceforge.pmd.lang.apex.metrics.internal; import net.sourceforge.pmd.lang.apex.ast.ASTMethod; import net.sourceforge.pmd.lang.apex.metrics.ApexMetrics; diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/metrics/impl/CycloTestRule.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/metrics/internal/CycloTestRule.java similarity index 94% rename from pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/metrics/impl/CycloTestRule.java rename to pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/metrics/internal/CycloTestRule.java index 68151b6853..447ff4dfb3 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/metrics/impl/CycloTestRule.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/metrics/internal/CycloTestRule.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.apex.metrics.impl; +package net.sourceforge.pmd.lang.apex.metrics.internal; import net.sourceforge.pmd.lang.apex.ast.ASTMethod; import net.sourceforge.pmd.lang.apex.ast.ASTUserClassOrInterface; diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/metrics/impl/WmcTestRule.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/metrics/internal/WmcTestRule.java similarity index 91% rename from pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/metrics/impl/WmcTestRule.java rename to pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/metrics/internal/WmcTestRule.java index a10dfca088..ebda680adc 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/metrics/impl/WmcTestRule.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/metrics/internal/WmcTestRule.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.apex.metrics.impl; +package net.sourceforge.pmd.lang.apex.metrics.internal; import net.sourceforge.pmd.lang.apex.metrics.ApexMetrics; import net.sourceforge.pmd.lang.ast.Node; diff --git a/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/metrics/impl/xml/CognitiveComplexityTest.xml b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/metrics/internal/xml/CognitiveComplexityTest.xml similarity index 100% rename from pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/metrics/impl/xml/CognitiveComplexityTest.xml rename to pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/metrics/internal/xml/CognitiveComplexityTest.xml diff --git a/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/metrics/impl/xml/CycloTest.xml b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/metrics/internal/xml/CycloTest.xml similarity index 100% rename from pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/metrics/impl/xml/CycloTest.xml rename to pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/metrics/internal/xml/CycloTest.xml diff --git a/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/metrics/impl/xml/WmcTest.xml b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/metrics/internal/xml/WmcTest.xml similarity index 100% rename from pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/metrics/impl/xml/WmcTest.xml rename to pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/metrics/internal/xml/WmcTest.xml diff --git a/pmd-apex/src/test/resources/rulesets/apex/metrics_test.xml b/pmd-apex/src/test/resources/rulesets/apex/metrics_test.xml index 2064793b70..5b6641fb8a 100644 --- a/pmd-apex/src/test/resources/rulesets/apex/metrics_test.xml +++ b/pmd-apex/src/test/resources/rulesets/apex/metrics_test.xml @@ -12,19 +12,19 @@ + class="net.sourceforge.pmd.lang.apex.metrics.internal.CycloTestRule"> + class="net.sourceforge.pmd.lang.apex.metrics.internal.WmcTestRule"> + class="net.sourceforge.pmd.lang.apex.metrics.internal.CognitiveComplexityTestRule"> From 194f7595333b4c8ef3b22c457002c7be5078bf03 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 23 Feb 2024 14:46:47 +0100 Subject: [PATCH 29/52] [dist] Move test classes into correct package --- .../pmd/{it => dist}/AbstractBinaryDistributionTest.java | 2 +- .../test/java/net/sourceforge/pmd/{it => dist}/AllRulesIT.java | 2 +- .../java/net/sourceforge/pmd/{it => dist}/AnalysisCacheIT.java | 2 +- .../src/test/java/net/sourceforge/pmd/{it => dist}/AntIT.java | 2 +- .../net/sourceforge/pmd/{it => dist}/BinaryDistributionIT.java | 2 +- .../test/java/net/sourceforge/pmd/{it => dist}/CpdExecutor.java | 2 +- .../java/net/sourceforge/pmd/{it => dist}/ExecutionResult.java | 2 +- .../test/java/net/sourceforge/pmd/{it => dist}/PMDExecutor.java | 2 +- .../net/sourceforge/pmd/{it => dist}/SourceDistributionIT.java | 2 +- .../java/net/sourceforge/pmd/{it => dist}/ZipFileExtractor.java | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) rename pmd-dist/src/test/java/net/sourceforge/pmd/{it => dist}/AbstractBinaryDistributionTest.java (97%) rename pmd-dist/src/test/java/net/sourceforge/pmd/{it => dist}/AllRulesIT.java (98%) rename pmd-dist/src/test/java/net/sourceforge/pmd/{it => dist}/AnalysisCacheIT.java (98%) rename pmd-dist/src/test/java/net/sourceforge/pmd/{it => dist}/AntIT.java (99%) rename pmd-dist/src/test/java/net/sourceforge/pmd/{it => dist}/BinaryDistributionIT.java (99%) rename pmd-dist/src/test/java/net/sourceforge/pmd/{it => dist}/CpdExecutor.java (96%) rename pmd-dist/src/test/java/net/sourceforge/pmd/{it => dist}/ExecutionResult.java (99%) rename pmd-dist/src/test/java/net/sourceforge/pmd/{it => dist}/PMDExecutor.java (99%) rename pmd-dist/src/test/java/net/sourceforge/pmd/{it => dist}/SourceDistributionIT.java (97%) rename pmd-dist/src/test/java/net/sourceforge/pmd/{it => dist}/ZipFileExtractor.java (98%) diff --git a/pmd-dist/src/test/java/net/sourceforge/pmd/it/AbstractBinaryDistributionTest.java b/pmd-dist/src/test/java/net/sourceforge/pmd/dist/AbstractBinaryDistributionTest.java similarity index 97% rename from pmd-dist/src/test/java/net/sourceforge/pmd/it/AbstractBinaryDistributionTest.java rename to pmd-dist/src/test/java/net/sourceforge/pmd/dist/AbstractBinaryDistributionTest.java index 7a26392ff0..f92653a18f 100644 --- a/pmd-dist/src/test/java/net/sourceforge/pmd/it/AbstractBinaryDistributionTest.java +++ b/pmd-dist/src/test/java/net/sourceforge/pmd/dist/AbstractBinaryDistributionTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.it; +package net.sourceforge.pmd.dist; import java.io.File; import java.io.IOException; diff --git a/pmd-dist/src/test/java/net/sourceforge/pmd/it/AllRulesIT.java b/pmd-dist/src/test/java/net/sourceforge/pmd/dist/AllRulesIT.java similarity index 98% rename from pmd-dist/src/test/java/net/sourceforge/pmd/it/AllRulesIT.java rename to pmd-dist/src/test/java/net/sourceforge/pmd/dist/AllRulesIT.java index 9a32b681a1..6e5b85b720 100644 --- a/pmd-dist/src/test/java/net/sourceforge/pmd/it/AllRulesIT.java +++ b/pmd-dist/src/test/java/net/sourceforge/pmd/dist/AllRulesIT.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.it; +package net.sourceforge.pmd.dist; import static org.hamcrest.Matchers.containsString; diff --git a/pmd-dist/src/test/java/net/sourceforge/pmd/it/AnalysisCacheIT.java b/pmd-dist/src/test/java/net/sourceforge/pmd/dist/AnalysisCacheIT.java similarity index 98% rename from pmd-dist/src/test/java/net/sourceforge/pmd/it/AnalysisCacheIT.java rename to pmd-dist/src/test/java/net/sourceforge/pmd/dist/AnalysisCacheIT.java index b9a4478ec3..d27dff76e9 100644 --- a/pmd-dist/src/test/java/net/sourceforge/pmd/it/AnalysisCacheIT.java +++ b/pmd-dist/src/test/java/net/sourceforge/pmd/dist/AnalysisCacheIT.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.it; +package net.sourceforge.pmd.dist; import static org.hamcrest.Matchers.containsString; import static org.junit.jupiter.api.Assertions.assertTrue; diff --git a/pmd-dist/src/test/java/net/sourceforge/pmd/it/AntIT.java b/pmd-dist/src/test/java/net/sourceforge/pmd/dist/AntIT.java similarity index 99% rename from pmd-dist/src/test/java/net/sourceforge/pmd/it/AntIT.java rename to pmd-dist/src/test/java/net/sourceforge/pmd/dist/AntIT.java index e220d9d816..d52070662f 100644 --- a/pmd-dist/src/test/java/net/sourceforge/pmd/it/AntIT.java +++ b/pmd-dist/src/test/java/net/sourceforge/pmd/dist/AntIT.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.it; +package net.sourceforge.pmd.dist; import static org.hamcrest.Matchers.containsString; diff --git a/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java b/pmd-dist/src/test/java/net/sourceforge/pmd/dist/BinaryDistributionIT.java similarity index 99% rename from pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java rename to pmd-dist/src/test/java/net/sourceforge/pmd/dist/BinaryDistributionIT.java index 57c5de0638..1ebde8ba68 100644 --- a/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java +++ b/pmd-dist/src/test/java/net/sourceforge/pmd/dist/BinaryDistributionIT.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.it; +package net.sourceforge.pmd.dist; import static net.sourceforge.pmd.util.CollectionUtil.listOf; import static org.hamcrest.MatcherAssert.assertThat; diff --git a/pmd-dist/src/test/java/net/sourceforge/pmd/it/CpdExecutor.java b/pmd-dist/src/test/java/net/sourceforge/pmd/dist/CpdExecutor.java similarity index 96% rename from pmd-dist/src/test/java/net/sourceforge/pmd/it/CpdExecutor.java rename to pmd-dist/src/test/java/net/sourceforge/pmd/dist/CpdExecutor.java index 4875c560d5..742426f1fd 100644 --- a/pmd-dist/src/test/java/net/sourceforge/pmd/it/CpdExecutor.java +++ b/pmd-dist/src/test/java/net/sourceforge/pmd/dist/CpdExecutor.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.it; +package net.sourceforge.pmd.dist; import java.nio.file.Path; import java.util.Arrays; diff --git a/pmd-dist/src/test/java/net/sourceforge/pmd/it/ExecutionResult.java b/pmd-dist/src/test/java/net/sourceforge/pmd/dist/ExecutionResult.java similarity index 99% rename from pmd-dist/src/test/java/net/sourceforge/pmd/it/ExecutionResult.java rename to pmd-dist/src/test/java/net/sourceforge/pmd/dist/ExecutionResult.java index 1f69621d96..3b54753bf1 100644 --- a/pmd-dist/src/test/java/net/sourceforge/pmd/it/ExecutionResult.java +++ b/pmd-dist/src/test/java/net/sourceforge/pmd/dist/ExecutionResult.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.it; +package net.sourceforge.pmd.dist; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; diff --git a/pmd-dist/src/test/java/net/sourceforge/pmd/it/PMDExecutor.java b/pmd-dist/src/test/java/net/sourceforge/pmd/dist/PMDExecutor.java similarity index 99% rename from pmd-dist/src/test/java/net/sourceforge/pmd/it/PMDExecutor.java rename to pmd-dist/src/test/java/net/sourceforge/pmd/dist/PMDExecutor.java index c851505fc6..84cd11a402 100644 --- a/pmd-dist/src/test/java/net/sourceforge/pmd/it/PMDExecutor.java +++ b/pmd-dist/src/test/java/net/sourceforge/pmd/dist/PMDExecutor.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.it; +package net.sourceforge.pmd.dist; import java.io.IOException; import java.io.Reader; diff --git a/pmd-dist/src/test/java/net/sourceforge/pmd/it/SourceDistributionIT.java b/pmd-dist/src/test/java/net/sourceforge/pmd/dist/SourceDistributionIT.java similarity index 97% rename from pmd-dist/src/test/java/net/sourceforge/pmd/it/SourceDistributionIT.java rename to pmd-dist/src/test/java/net/sourceforge/pmd/dist/SourceDistributionIT.java index fea767d6b2..6ae1f4ba52 100644 --- a/pmd-dist/src/test/java/net/sourceforge/pmd/it/SourceDistributionIT.java +++ b/pmd-dist/src/test/java/net/sourceforge/pmd/dist/SourceDistributionIT.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.it; +package net.sourceforge.pmd.dist; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; diff --git a/pmd-dist/src/test/java/net/sourceforge/pmd/it/ZipFileExtractor.java b/pmd-dist/src/test/java/net/sourceforge/pmd/dist/ZipFileExtractor.java similarity index 98% rename from pmd-dist/src/test/java/net/sourceforge/pmd/it/ZipFileExtractor.java rename to pmd-dist/src/test/java/net/sourceforge/pmd/dist/ZipFileExtractor.java index 053e84db70..301e8078b4 100644 --- a/pmd-dist/src/test/java/net/sourceforge/pmd/it/ZipFileExtractor.java +++ b/pmd-dist/src/test/java/net/sourceforge/pmd/dist/ZipFileExtractor.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.it; +package net.sourceforge.pmd.dist; import static org.junit.jupiter.api.Assertions.assertTrue; From a00916b4f0765f057daba14f6d6f54dc04c2f16c Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 23 Feb 2024 14:54:22 +0100 Subject: [PATCH 30/52] [java] Consolidate test packages --- .../net/sourceforge/pmd/{ => lang/java}/ExcludeLinesTest.java | 3 +-- .../java/net/sourceforge/pmd/{ => lang/java}/FooRule.java | 2 +- .../pmd/{ => lang/java}/LanguageVersionDiscovererTest.java | 4 ++-- .../pmd/{coverage => lang/java}/PMDCoverageTest.java | 3 +-- .../net/sourceforge/pmd/{ant => lang/java}/PMDTaskTest.java | 3 ++- .../java/net/sourceforge/pmd/{ => lang/java}/ReportTest.java | 3 +-- .../net/sourceforge/pmd/lang/java/SuppressWarningsTest.java | 1 - .../pmd/{ => lang/java}/ant/classpathtest/ruleset.xml | 0 .../pmd/{ => lang/java}/ant/xml/custom_ruleset.xml | 0 .../sourceforge/pmd/{ => lang/java}/ant/xml/pmdtasktest.xml | 4 +--- 10 files changed, 9 insertions(+), 14 deletions(-) rename pmd-java/src/test/java/net/sourceforge/pmd/{ => lang/java}/ExcludeLinesTest.java (96%) rename pmd-java/src/test/java/net/sourceforge/pmd/{ => lang/java}/FooRule.java (96%) rename pmd-java/src/test/java/net/sourceforge/pmd/{ => lang/java}/LanguageVersionDiscovererTest.java (96%) rename pmd-java/src/test/java/net/sourceforge/pmd/{coverage => lang/java}/PMDCoverageTest.java (97%) rename pmd-java/src/test/java/net/sourceforge/pmd/{ant => lang/java}/PMDTaskTest.java (97%) rename pmd-java/src/test/java/net/sourceforge/pmd/{ => lang/java}/ReportTest.java (96%) rename pmd-java/src/test/resources/net/sourceforge/pmd/{ => lang/java}/ant/classpathtest/ruleset.xml (100%) rename pmd-java/src/test/resources/net/sourceforge/pmd/{ => lang/java}/ant/xml/custom_ruleset.xml (100%) rename pmd-java/src/test/resources/net/sourceforge/pmd/{ => lang/java}/ant/xml/pmdtasktest.xml (96%) diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/ExcludeLinesTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ExcludeLinesTest.java similarity index 96% rename from pmd-java/src/test/java/net/sourceforge/pmd/ExcludeLinesTest.java rename to pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ExcludeLinesTest.java index 1a4385924d..f8be02dc22 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/ExcludeLinesTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ExcludeLinesTest.java @@ -2,14 +2,13 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd; +package net.sourceforge.pmd.lang.java; import static net.sourceforge.pmd.lang.test.ast.TestUtilsKt.assertSize; import static net.sourceforge.pmd.lang.test.ast.TestUtilsKt.assertSuppressed; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.lang.java.BaseParserTest; import net.sourceforge.pmd.lang.java.ast.ASTVariableId; import net.sourceforge.pmd.lang.java.rule.AbstractJavaRule; import net.sourceforge.pmd.lang.rule.Rule; diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/FooRule.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/FooRule.java similarity index 96% rename from pmd-java/src/test/java/net/sourceforge/pmd/FooRule.java rename to pmd-java/src/test/java/net/sourceforge/pmd/lang/java/FooRule.java index 8c16cc9e74..7875410bdd 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/FooRule.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/FooRule.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd; +package net.sourceforge.pmd.lang.java; import net.sourceforge.pmd.lang.java.ast.ASTClassDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTVariableId; diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/LanguageVersionDiscovererTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/LanguageVersionDiscovererTest.java similarity index 96% rename from pmd-java/src/test/java/net/sourceforge/pmd/LanguageVersionDiscovererTest.java rename to pmd-java/src/test/java/net/sourceforge/pmd/lang/java/LanguageVersionDiscovererTest.java index 4b190e8689..77ff85c6c7 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/LanguageVersionDiscovererTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/LanguageVersionDiscovererTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd; +package net.sourceforge.pmd.lang.java; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -11,11 +11,11 @@ import java.io.File; import org.junit.jupiter.api.Test; +import net.sourceforge.pmd.PMDConfiguration; import net.sourceforge.pmd.lang.Language; import net.sourceforge.pmd.lang.LanguageRegistry; import net.sourceforge.pmd.lang.LanguageVersion; import net.sourceforge.pmd.lang.LanguageVersionDiscoverer; -import net.sourceforge.pmd.lang.java.JavaLanguageModule; class LanguageVersionDiscovererTest { diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/coverage/PMDCoverageTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/PMDCoverageTest.java similarity index 97% rename from pmd-java/src/test/java/net/sourceforge/pmd/coverage/PMDCoverageTest.java rename to pmd-java/src/test/java/net/sourceforge/pmd/lang/java/PMDCoverageTest.java index ff9265a678..5202134e26 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/coverage/PMDCoverageTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/PMDCoverageTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.coverage; +package net.sourceforge.pmd.lang.java; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; @@ -25,7 +25,6 @@ import net.sourceforge.pmd.PMDConfiguration; import net.sourceforge.pmd.PmdAnalysis; import net.sourceforge.pmd.internal.util.IOUtil; import net.sourceforge.pmd.lang.LanguageVersion; -import net.sourceforge.pmd.lang.java.JavaLanguageModule; import com.github.stefanbirkner.systemlambda.SystemLambda; diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/ant/PMDTaskTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/PMDTaskTest.java similarity index 97% rename from pmd-java/src/test/java/net/sourceforge/pmd/ant/PMDTaskTest.java rename to pmd-java/src/test/java/net/sourceforge/pmd/lang/java/PMDTaskTest.java index d855a4743e..268b850b11 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/ant/PMDTaskTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/PMDTaskTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.ant; +package net.sourceforge.pmd.lang.java; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -19,6 +19,7 @@ import net.sourceforge.pmd.test.AbstractAntTestHelper; class PMDTaskTest extends AbstractAntTestHelper { PMDTaskTest() { + pathToTestScript = "target/test-classes/net/sourceforge/pmd/lang/java/ant/xml"; antTestScriptFilename = "pmdtasktest.xml"; } diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/ReportTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ReportTest.java similarity index 96% rename from pmd-java/src/test/java/net/sourceforge/pmd/ReportTest.java rename to pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ReportTest.java index a69985f815..2e6befc748 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/ReportTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ReportTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd; +package net.sourceforge.pmd.lang.java; import static net.sourceforge.pmd.lang.test.ast.TestUtilsKt.assertSize; import static net.sourceforge.pmd.lang.test.ast.TestUtilsKt.assertSuppressed; @@ -13,7 +13,6 @@ import java.util.regex.Pattern; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.lang.java.JavaParsingHelper; import net.sourceforge.pmd.lang.rule.Rule; import net.sourceforge.pmd.reporting.Report; diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/SuppressWarningsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/SuppressWarningsTest.java index 6eac1121fb..40a023f965 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/SuppressWarningsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/SuppressWarningsTest.java @@ -9,7 +9,6 @@ import static net.sourceforge.pmd.lang.test.ast.TestUtilsKt.assertSize; import org.checkerframework.checker.nullness.qual.NonNull; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.FooRule; import net.sourceforge.pmd.lang.java.ast.ASTClassDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTCompilationUnit; import net.sourceforge.pmd.lang.java.rule.AbstractJavaRule; diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/ant/classpathtest/ruleset.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ant/classpathtest/ruleset.xml similarity index 100% rename from pmd-java/src/test/resources/net/sourceforge/pmd/ant/classpathtest/ruleset.xml rename to pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ant/classpathtest/ruleset.xml diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/ant/xml/custom_ruleset.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ant/xml/custom_ruleset.xml similarity index 100% rename from pmd-java/src/test/resources/net/sourceforge/pmd/ant/xml/custom_ruleset.xml rename to pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ant/xml/custom_ruleset.xml diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/ant/xml/pmdtasktest.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ant/xml/pmdtasktest.xml similarity index 96% rename from pmd-java/src/test/resources/net/sourceforge/pmd/ant/xml/pmdtasktest.xml rename to pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ant/xml/pmdtasktest.xml index a1abe53864..4378af2f1e 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/ant/xml/pmdtasktest.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ant/xml/pmdtasktest.xml @@ -101,9 +101,7 @@ - - - + From 36cfde473512f7268dd06f04fe1f1e5c42175aed Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 23 Feb 2024 15:02:40 +0100 Subject: [PATCH 31/52] [javascript] Consolidate test packages --- .../sourceforge/pmd/{ant => lang/ecmascript}/PMDTaskTest.java | 3 ++- .../net/sourceforge/pmd/{ => lang/ecmascript}/ReportTest.java | 2 +- .../src/test/resources/net/sourceforge/pmd/cli/ExampleFile.js | 4 ---- .../pmd/{ => lang/ecmascript}/ant/xml/pmdtasktest.xml | 2 +- .../sourceforge/pmd/{ => lang/ecmascript}/ant/xml/ruleset.xml | 0 5 files changed, 4 insertions(+), 7 deletions(-) rename pmd-javascript/src/test/java/net/sourceforge/pmd/{ant => lang/ecmascript}/PMDTaskTest.java (82%) rename pmd-javascript/src/test/java/net/sourceforge/pmd/{ => lang/ecmascript}/ReportTest.java (96%) delete mode 100644 pmd-javascript/src/test/resources/net/sourceforge/pmd/cli/ExampleFile.js rename pmd-javascript/src/test/resources/net/sourceforge/pmd/{ => lang/ecmascript}/ant/xml/pmdtasktest.xml (91%) rename pmd-javascript/src/test/resources/net/sourceforge/pmd/{ => lang/ecmascript}/ant/xml/ruleset.xml (100%) diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/ant/PMDTaskTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/PMDTaskTest.java similarity index 82% rename from pmd-javascript/src/test/java/net/sourceforge/pmd/ant/PMDTaskTest.java rename to pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/PMDTaskTest.java index eaee7817c1..c77cdb9cce 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/ant/PMDTaskTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/PMDTaskTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.ant; +package net.sourceforge.pmd.lang.ecmascript; import org.junit.jupiter.api.Test; @@ -11,6 +11,7 @@ import net.sourceforge.pmd.test.AbstractAntTestHelper; class PMDTaskTest extends AbstractAntTestHelper { PMDTaskTest() { + super.pathToTestScript = "target/test-classes/net/sourceforge/pmd/lang/ecmascript/ant/xml"; super.antTestScriptFilename = "pmdtasktest.xml"; } diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/ReportTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/ReportTest.java similarity index 96% rename from pmd-javascript/src/test/java/net/sourceforge/pmd/ReportTest.java rename to pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/ReportTest.java index 398f596df5..be7fc68b18 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/ReportTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/ReportTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd; +package net.sourceforge.pmd.lang.ecmascript; import static net.sourceforge.pmd.lang.test.ast.TestUtilsKt.assertSize; import static net.sourceforge.pmd.lang.test.ast.TestUtilsKt.assertSuppressed; diff --git a/pmd-javascript/src/test/resources/net/sourceforge/pmd/cli/ExampleFile.js b/pmd-javascript/src/test/resources/net/sourceforge/pmd/cli/ExampleFile.js deleted file mode 100644 index 2b5c200d55..0000000000 --- a/pmd-javascript/src/test/resources/net/sourceforge/pmd/cli/ExampleFile.js +++ /dev/null @@ -1,4 +0,0 @@ -/** - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ -// just some js file for net.sourceforge.pmd.cli.CLITest diff --git a/pmd-javascript/src/test/resources/net/sourceforge/pmd/ant/xml/pmdtasktest.xml b/pmd-javascript/src/test/resources/net/sourceforge/pmd/lang/ecmascript/ant/xml/pmdtasktest.xml similarity index 91% rename from pmd-javascript/src/test/resources/net/sourceforge/pmd/ant/xml/pmdtasktest.xml rename to pmd-javascript/src/test/resources/net/sourceforge/pmd/lang/ecmascript/ant/xml/pmdtasktest.xml index 529d3cb514..c01e130009 100644 --- a/pmd-javascript/src/test/resources/net/sourceforge/pmd/ant/xml/pmdtasktest.xml +++ b/pmd-javascript/src/test/resources/net/sourceforge/pmd/lang/ecmascript/ant/xml/pmdtasktest.xml @@ -6,7 +6,7 @@ - + diff --git a/pmd-javascript/src/test/resources/net/sourceforge/pmd/ant/xml/ruleset.xml b/pmd-javascript/src/test/resources/net/sourceforge/pmd/lang/ecmascript/ant/xml/ruleset.xml similarity index 100% rename from pmd-javascript/src/test/resources/net/sourceforge/pmd/ant/xml/ruleset.xml rename to pmd-javascript/src/test/resources/net/sourceforge/pmd/lang/ecmascript/ant/xml/ruleset.xml From 5f6d357fc36a048d56c578818ccb13872208f71d Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 23 Feb 2024 15:04:05 +0100 Subject: [PATCH 32/52] [jsp] Consolidate test packages --- .../pmd/{ => lang/jsp}/LanguageVersionDiscovererTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename pmd-jsp/src/test/java/net/sourceforge/pmd/{ => lang/jsp}/LanguageVersionDiscovererTest.java (97%) diff --git a/pmd-jsp/src/test/java/net/sourceforge/pmd/LanguageVersionDiscovererTest.java b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/LanguageVersionDiscovererTest.java similarity index 97% rename from pmd-jsp/src/test/java/net/sourceforge/pmd/LanguageVersionDiscovererTest.java rename to pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/LanguageVersionDiscovererTest.java index 4f2e0a60bb..ceb1147568 100644 --- a/pmd-jsp/src/test/java/net/sourceforge/pmd/LanguageVersionDiscovererTest.java +++ b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/LanguageVersionDiscovererTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd; +package net.sourceforge.pmd.lang.jsp; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotEquals; From 80b143627760e0f94f8174ca83245bd04e3ace7c Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 23 Feb 2024 15:05:37 +0100 Subject: [PATCH 33/52] [plsql] Consolidate test packages --- .../pmd/{ => lang/plsql}/LanguageVersionDiscovererTest.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) rename pmd-plsql/src/test/java/net/sourceforge/pmd/{ => lang/plsql}/LanguageVersionDiscovererTest.java (91%) diff --git a/pmd-plsql/src/test/java/net/sourceforge/pmd/LanguageVersionDiscovererTest.java b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/LanguageVersionDiscovererTest.java similarity index 91% rename from pmd-plsql/src/test/java/net/sourceforge/pmd/LanguageVersionDiscovererTest.java rename to pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/LanguageVersionDiscovererTest.java index 68dbb37432..65ec52e055 100644 --- a/pmd-plsql/src/test/java/net/sourceforge/pmd/LanguageVersionDiscovererTest.java +++ b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/LanguageVersionDiscovererTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd; +package net.sourceforge.pmd.lang.plsql; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -13,7 +13,6 @@ import org.junit.jupiter.api.Test; import net.sourceforge.pmd.lang.LanguageRegistry; import net.sourceforge.pmd.lang.LanguageVersion; import net.sourceforge.pmd.lang.LanguageVersionDiscoverer; -import net.sourceforge.pmd.lang.plsql.AbstractPLSQLParserTst; class LanguageVersionDiscovererTest extends AbstractPLSQLParserTst { From 4bee79712a1d58c62bf087843c4469c53f9208a8 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 23 Feb 2024 15:07:52 +0100 Subject: [PATCH 34/52] [visualforce] Consolidate test packages --- .../pmd/{ => lang/vf}/LanguageVersionDiscovererTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename pmd-visualforce/src/test/java/net/sourceforge/pmd/{ => lang/vf}/LanguageVersionDiscovererTest.java (97%) diff --git a/pmd-visualforce/src/test/java/net/sourceforge/pmd/LanguageVersionDiscovererTest.java b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/LanguageVersionDiscovererTest.java similarity index 97% rename from pmd-visualforce/src/test/java/net/sourceforge/pmd/LanguageVersionDiscovererTest.java rename to pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/LanguageVersionDiscovererTest.java index cbeec9046d..ffd51877d9 100644 --- a/pmd-visualforce/src/test/java/net/sourceforge/pmd/LanguageVersionDiscovererTest.java +++ b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/LanguageVersionDiscovererTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd; +package net.sourceforge.pmd.lang.vf; import static java.util.Collections.singleton; import static org.junit.jupiter.api.Assertions.assertEquals; From d21e5c95d0296b1b53d178f5b344c933eaca92b4 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 23 Feb 2024 15:47:37 +0100 Subject: [PATCH 35/52] [visualforce] Rename package and language id from vf to visualforce --- .../pmd/languages/language_properties.md | 6 ++--- docs/pages/pmd/languages/visualforce.md | 24 ++++++++++++------- docs/pages/pmd/userdocs/migrating_to_pmd7.md | 1 + docs/pages/release_notes.md | 19 +++++++++++++++ .../pmd/dist/BinaryDistributionIT.java | 7 +++--- .../resources/rulesets/all-visualforce.xml | 16 ++++++------- .../lang/rule/AbstractRuleSetFactoryTest.java | 2 +- pmd-visualforce/etc/grammar/Vf.jjt | 2 +- pmd-visualforce/pom.xml | 2 +- .../lang/{vf => visualforce}/DataType.java | 2 +- .../lang/{vf => visualforce}/VfHandler.java | 4 ++-- .../{vf => visualforce}/VfLanguageModule.java | 6 ++--- .../VfLanguageProperties.java | 2 +- .../{vf => visualforce}/ast/ASTArguments.java | 2 +- .../{vf => visualforce}/ast/ASTAttribute.java | 2 +- .../ast/ASTAttributeValue.java | 2 +- .../{vf => visualforce}/ast/ASTCData.java | 2 +- .../ast/ASTCompilationUnit.java | 2 +- .../{vf => visualforce}/ast/ASTContent.java | 2 +- .../ast/ASTDeclaration.java | 2 +- .../ast/ASTDoctypeDeclaration.java | 2 +- .../ast/ASTDoctypeExternalId.java | 2 +- .../ast/ASTDotExpression.java | 2 +- .../ast/ASTElExpression.java | 2 +- .../{vf => visualforce}/ast/ASTElement.java | 2 +- .../ast/ASTExpression.java | 2 +- .../ast/ASTHtmlScript.java | 2 +- .../ast/ASTIdentifier.java | 2 +- .../{vf => visualforce}/ast/ASTLiteral.java | 2 +- .../ast/ASTNegationExpression.java | 2 +- .../lang/{vf => visualforce}/ast/ASTText.java | 2 +- .../ast/AbstractVFDataNode.java | 4 ++-- .../ast/AbstractVfNode.java | 2 +- .../ast/ApexClassPropertyTypes.java | 4 ++-- .../ast/ApexClassPropertyTypesVisitor.java | 2 +- .../ast/InternalApiBridge.java | 4 ++-- .../ast/ObjectFieldTypes.java | 4 ++-- .../ast/OpenTagRegister.java | 2 +- .../ast/SalesforceFieldTypes.java | 4 ++-- .../ast/VfExpressionTypeVisitor.java | 8 +++---- .../lang/{vf => visualforce}/ast/VfNode.java | 2 +- .../{vf => visualforce}/ast/VfParser.java | 4 ++-- .../{vf => visualforce}/ast/VfTypedNode.java | 4 ++-- .../ast/VfVisitorBase.java | 2 +- .../{vf => visualforce}/cpd/VfCpdLexer.java | 4 ++-- .../rule/AbstractVfRule.java | 4 ++-- .../rule/security/VfCsrfRule.java | 12 +++++----- .../rule/security/VfHtmlStyleTagXssRule.java | 16 ++++++------- .../rule/security/VfUnescapeElRule.java | 22 ++++++++--------- .../security/internal/ElEscapeDetector.java | 20 ++++++++-------- .../net.sourceforge.pmd.lang.Language | 2 +- .../category/vf/categories.properties | 17 ------------- .../{vf => visualforce}/bestpractices.xml | 0 .../visualforce/categories.properties | 17 +++++++++++++ .../{vf => visualforce}/codestyle.xml | 0 .../category/{vf => visualforce}/design.xml | 0 .../{vf => visualforce}/documentation.xml | 0 .../{vf => visualforce}/errorprone.xml | 0 .../{vf => visualforce}/multithreading.xml | 0 .../{vf => visualforce}/performance.xml | 0 .../category/{vf => visualforce}/security.xml | 18 +++++++------- .../{vf => visualforce}/DataTypeTest.java | 2 +- .../LanguageVersionDiscovererTest.java | 4 ++-- .../LanguageVersionTest.java | 2 +- .../RuleSetFactoryTest.java | 2 +- .../lang/{vf => visualforce}/VFTestUtils.java | 2 +- .../ast/ASTExpressionTest.java | 2 +- .../ast/AbstractVfTest.java | 2 +- .../ast/ApexClassPropertyTypesTest.java | 8 +++---- .../ApexClassPropertyTypesVisitorTest.java | 4 ++-- .../ast/ObjectFieldTypesTest.java | 8 +++---- .../ast/OpenTagRegisterTest.java | 2 +- .../ast/VfDocStyleTest.java | 2 +- .../ast/VfExpressionTypeVisitorTest.java | 6 ++--- .../ast/VfPageStyleTest.java | 2 +- .../{vf => visualforce}/ast/VfParserTest.java | 2 +- .../ast/VfParsingHelper.java | 6 ++--- .../cpd/VfCpdLexerTest.java | 4 ++-- .../rule/security/VfCsrfTest.java | 2 +- .../rule/security/VfHtmlStyleTagXssTest.java | 2 +- ...HtmlXssStyleTagUrlPatternMatchingTest.java | 2 +- .../rule/security/VfUnescapeElTest.java | 8 +++---- .../metadata/sfdx/classes/ApexController.cls | 0 .../metadata/sfdx/pages/SomePage.page | 0 .../metadata/sfdx/classes/ApexController.cls | 0 .../metadata/mdapi/objects/Account.object | 0 .../metadata/mdapi/pages/SomePage.page | 0 .../Account/fields/Checkbox__c.field-meta.xml | 0 .../Account/fields/DateTime__c.field-meta.xml | 0 .../fields/LongTextArea__c.field-meta.xml | 0 .../Account/fields/Picklist__c.field-meta.xml | 0 .../Account/fields/TextArea__c.field-meta.xml | 0 .../Account/fields/Text__c.field-meta.xml | 0 .../metadata/sfdx/pages/SomePage.page | 0 .../metadata/sfdx/classes/ApexController.cls | 0 .../Account/fields/Checkbox__c.field-meta.xml | 0 .../Account/fields/DateTime__c.field-meta.xml | 0 .../fields/LongTextArea__c.field-meta.xml | 0 .../Account/fields/Picklist__c.field-meta.xml | 0 .../Account/fields/TextArea__c.field-meta.xml | 0 .../Account/fields/Text__c.field-meta.xml | 0 .../metadata/sfdx/pages/ApexController.page | 0 .../metadata/sfdx/pages/StandardAccount.page | 0 .../cpd/testdata/SampleUnescapeElWithTab.page | 0 .../cpd/testdata/SampleUnescapeElWithTab.txt | 0 .../metadata/mdapi/objects/Account.object | 0 .../metadata/mdapi/pages/StandardAccount.page | 0 .../metadata/sfdx/classes/ApexController.cls | 0 .../metadata/sfdx/classes/ApexExtension1.cls | 0 .../metadata/sfdx/classes/ApexExtension2.cls | 0 .../Account/fields/Checkbox__c.field-meta.xml | 0 .../Account/fields/DateTime__c.field-meta.xml | 0 .../fields/LongTextArea__c.field-meta.xml | 0 .../Account/fields/Picklist__c.field-meta.xml | 0 .../Account/fields/TextArea__c.field-meta.xml | 0 .../Account/fields/Text__c.field-meta.xml | 0 .../metadata/sfdx/pages/ApexController.page | 0 .../metadata/sfdx/pages/StandardAccount.page | 0 .../pages/StandardAccountWithExtensions.page | 0 .../rule/security/xml/VfCsrf.xml | 0 .../rule/security/xml/VfHtmlStyleTagXss.xml | 0 .../rule/security/xml/VfUnescapeEl.xml | 0 122 files changed, 204 insertions(+), 177 deletions(-) rename pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/{vf => visualforce}/DataType.java (98%) rename pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/{vf => visualforce}/VfHandler.java (82%) rename pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/{vf => visualforce}/VfLanguageModule.java (90%) rename pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/{vf => visualforce}/VfLanguageProperties.java (97%) rename pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/{vf => visualforce}/ast/ASTArguments.java (87%) rename pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/{vf => visualforce}/ast/ASTAttribute.java (96%) rename pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/{vf => visualforce}/ast/ASTAttributeValue.java (87%) rename pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/{vf => visualforce}/ast/ASTCData.java (87%) rename pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/{vf => visualforce}/ast/ASTCompilationUnit.java (94%) rename pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/{vf => visualforce}/ast/ASTContent.java (87%) rename pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/{vf => visualforce}/ast/ASTDeclaration.java (91%) rename pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/{vf => visualforce}/ast/ASTDoctypeDeclaration.java (92%) rename pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/{vf => visualforce}/ast/ASTDoctypeExternalId.java (95%) rename pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/{vf => visualforce}/ast/ASTDotExpression.java (87%) rename pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/{vf => visualforce}/ast/ASTElExpression.java (87%) rename pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/{vf => visualforce}/ast/ASTElement.java (97%) rename pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/{vf => visualforce}/ast/ASTExpression.java (99%) rename pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/{vf => visualforce}/ast/ASTHtmlScript.java (87%) rename pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/{vf => visualforce}/ast/ASTIdentifier.java (87%) rename pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/{vf => visualforce}/ast/ASTLiteral.java (87%) rename pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/{vf => visualforce}/ast/ASTNegationExpression.java (88%) rename pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/{vf => visualforce}/ast/ASTText.java (87%) rename pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/{vf => visualforce}/ast/AbstractVFDataNode.java (82%) rename pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/{vf => visualforce}/ast/AbstractVfNode.java (95%) rename pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/{vf => visualforce}/ast/ApexClassPropertyTypes.java (97%) rename pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/{vf => visualforce}/ast/ApexClassPropertyTypesVisitor.java (98%) rename pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/{vf => visualforce}/ast/InternalApiBridge.java (86%) rename pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/{vf => visualforce}/ast/ObjectFieldTypes.java (99%) rename pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/{vf => visualforce}/ast/OpenTagRegister.java (98%) rename pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/{vf => visualforce}/ast/SalesforceFieldTypes.java (97%) rename pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/{vf => visualforce}/ast/VfExpressionTypeVisitor.java (95%) rename pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/{vf => visualforce}/ast/VfNode.java (80%) rename pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/{vf => visualforce}/ast/VfParser.java (91%) rename pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/{vf => visualforce}/ast/VfTypedNode.java (85%) rename pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/{vf => visualforce}/ast/VfVisitorBase.java (83%) rename pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/{vf => visualforce}/cpd/VfCpdLexer.java (92%) rename pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/{vf => visualforce}/rule/AbstractVfRule.java (84%) rename pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/{vf => visualforce}/rule/security/VfCsrfRule.java (81%) rename pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/{vf => visualforce}/rule/security/VfHtmlStyleTagXssRule.java (92%) rename pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/{vf => visualforce}/rule/security/VfUnescapeElRule.java (93%) rename pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/{vf => visualforce}/rule/security/internal/ElEscapeDetector.java (96%) delete mode 100644 pmd-visualforce/src/main/resources/category/vf/categories.properties rename pmd-visualforce/src/main/resources/category/{vf => visualforce}/bestpractices.xml (100%) create mode 100644 pmd-visualforce/src/main/resources/category/visualforce/categories.properties rename pmd-visualforce/src/main/resources/category/{vf => visualforce}/codestyle.xml (100%) rename pmd-visualforce/src/main/resources/category/{vf => visualforce}/design.xml (100%) rename pmd-visualforce/src/main/resources/category/{vf => visualforce}/documentation.xml (100%) rename pmd-visualforce/src/main/resources/category/{vf => visualforce}/errorprone.xml (100%) rename pmd-visualforce/src/main/resources/category/{vf => visualforce}/multithreading.xml (100%) rename pmd-visualforce/src/main/resources/category/{vf => visualforce}/performance.xml (100%) rename pmd-visualforce/src/main/resources/category/{vf => visualforce}/security.xml (78%) rename pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/{vf => visualforce}/DataTypeTest.java (96%) rename pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/{vf => visualforce}/LanguageVersionDiscovererTest.java (92%) rename pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/{vf => visualforce}/LanguageVersionTest.java (93%) rename pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/{vf => visualforce}/RuleSetFactoryTest.java (89%) rename pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/{vf => visualforce}/VFTestUtils.java (98%) rename pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/{vf => visualforce}/ast/ASTExpressionTest.java (99%) rename pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/{vf => visualforce}/ast/AbstractVfTest.java (83%) rename pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/{vf => visualforce}/ast/ApexClassPropertyTypesTest.java (94%) rename pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/{vf => visualforce}/ast/ApexClassPropertyTypesVisitorTest.java (95%) rename pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/{vf => visualforce}/ast/ObjectFieldTypesTest.java (96%) rename pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/{vf => visualforce}/ast/OpenTagRegisterTest.java (98%) rename pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/{vf => visualforce}/ast/VfDocStyleTest.java (99%) rename pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/{vf => visualforce}/ast/VfExpressionTypeVisitorTest.java (97%) rename pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/{vf => visualforce}/ast/VfPageStyleTest.java (98%) rename pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/{vf => visualforce}/ast/VfParserTest.java (97%) rename pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/{vf => visualforce}/ast/VfParsingHelper.java (84%) rename pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/{vf => visualforce}/cpd/VfCpdLexerTest.java (80%) rename pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/{vf => visualforce}/rule/security/VfCsrfTest.java (77%) rename pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/{vf => visualforce}/rule/security/VfHtmlStyleTagXssTest.java (78%) rename pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/{vf => visualforce}/rule/security/VfHtmlXssStyleTagUrlPatternMatchingTest.java (97%) rename pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/{vf => visualforce}/rule/security/VfUnescapeElTest.java (94%) rename pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/{vf => visualforce}/ast/ApexClassPropertyTypes/metadata/sfdx/classes/ApexController.cls (100%) rename pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/{vf => visualforce}/ast/ApexClassPropertyTypes/metadata/sfdx/pages/SomePage.page (100%) rename pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/{vf => visualforce}/ast/ApexClassPropertyTypesVisitor/metadata/sfdx/classes/ApexController.cls (100%) rename pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/{vf => visualforce}/ast/ObjectFieldTypes/metadata/mdapi/objects/Account.object (100%) rename pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/{vf => visualforce}/ast/ObjectFieldTypes/metadata/mdapi/pages/SomePage.page (100%) rename pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/{vf => visualforce}/ast/ObjectFieldTypes/metadata/sfdx/objects/Account/fields/Checkbox__c.field-meta.xml (100%) rename pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/{vf => visualforce}/ast/ObjectFieldTypes/metadata/sfdx/objects/Account/fields/DateTime__c.field-meta.xml (100%) rename pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/{vf => visualforce}/ast/ObjectFieldTypes/metadata/sfdx/objects/Account/fields/LongTextArea__c.field-meta.xml (100%) rename pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/{vf => visualforce}/ast/ObjectFieldTypes/metadata/sfdx/objects/Account/fields/Picklist__c.field-meta.xml (100%) rename pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/{vf => visualforce}/ast/ObjectFieldTypes/metadata/sfdx/objects/Account/fields/TextArea__c.field-meta.xml (100%) rename pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/{vf => visualforce}/ast/ObjectFieldTypes/metadata/sfdx/objects/Account/fields/Text__c.field-meta.xml (100%) rename pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/{vf => visualforce}/ast/ObjectFieldTypes/metadata/sfdx/pages/SomePage.page (100%) rename pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/{vf => visualforce}/ast/VfExpressionTypeVisitor/metadata/sfdx/classes/ApexController.cls (100%) rename pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/{vf => visualforce}/ast/VfExpressionTypeVisitor/metadata/sfdx/objects/Account/fields/Checkbox__c.field-meta.xml (100%) rename pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/{vf => visualforce}/ast/VfExpressionTypeVisitor/metadata/sfdx/objects/Account/fields/DateTime__c.field-meta.xml (100%) rename pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/{vf => visualforce}/ast/VfExpressionTypeVisitor/metadata/sfdx/objects/Account/fields/LongTextArea__c.field-meta.xml (100%) rename pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/{vf => visualforce}/ast/VfExpressionTypeVisitor/metadata/sfdx/objects/Account/fields/Picklist__c.field-meta.xml (100%) rename pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/{vf => visualforce}/ast/VfExpressionTypeVisitor/metadata/sfdx/objects/Account/fields/TextArea__c.field-meta.xml (100%) rename pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/{vf => visualforce}/ast/VfExpressionTypeVisitor/metadata/sfdx/objects/Account/fields/Text__c.field-meta.xml (100%) rename pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/{vf => visualforce}/ast/VfExpressionTypeVisitor/metadata/sfdx/pages/ApexController.page (100%) rename pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/{vf => visualforce}/ast/VfExpressionTypeVisitor/metadata/sfdx/pages/StandardAccount.page (100%) rename pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/{vf => visualforce}/cpd/testdata/SampleUnescapeElWithTab.page (100%) rename pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/{vf => visualforce}/cpd/testdata/SampleUnescapeElWithTab.txt (100%) rename pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/{vf => visualforce}/rule/security/VfUnescapeEl/metadata/mdapi/objects/Account.object (100%) rename pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/{vf => visualforce}/rule/security/VfUnescapeEl/metadata/mdapi/pages/StandardAccount.page (100%) rename pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/{vf => visualforce}/rule/security/VfUnescapeEl/metadata/sfdx/classes/ApexController.cls (100%) rename pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/{vf => visualforce}/rule/security/VfUnescapeEl/metadata/sfdx/classes/ApexExtension1.cls (100%) rename pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/{vf => visualforce}/rule/security/VfUnescapeEl/metadata/sfdx/classes/ApexExtension2.cls (100%) rename pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/{vf => visualforce}/rule/security/VfUnescapeEl/metadata/sfdx/objects/Account/fields/Checkbox__c.field-meta.xml (100%) rename pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/{vf => visualforce}/rule/security/VfUnescapeEl/metadata/sfdx/objects/Account/fields/DateTime__c.field-meta.xml (100%) rename pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/{vf => visualforce}/rule/security/VfUnescapeEl/metadata/sfdx/objects/Account/fields/LongTextArea__c.field-meta.xml (100%) rename pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/{vf => visualforce}/rule/security/VfUnescapeEl/metadata/sfdx/objects/Account/fields/Picklist__c.field-meta.xml (100%) rename pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/{vf => visualforce}/rule/security/VfUnescapeEl/metadata/sfdx/objects/Account/fields/TextArea__c.field-meta.xml (100%) rename pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/{vf => visualforce}/rule/security/VfUnescapeEl/metadata/sfdx/objects/Account/fields/Text__c.field-meta.xml (100%) rename pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/{vf => visualforce}/rule/security/VfUnescapeEl/metadata/sfdx/pages/ApexController.page (100%) rename pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/{vf => visualforce}/rule/security/VfUnescapeEl/metadata/sfdx/pages/StandardAccount.page (100%) rename pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/{vf => visualforce}/rule/security/VfUnescapeEl/metadata/sfdx/pages/StandardAccountWithExtensions.page (100%) rename pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/{vf => visualforce}/rule/security/xml/VfCsrf.xml (100%) rename pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/{vf => visualforce}/rule/security/xml/VfHtmlStyleTagXss.xml (100%) rename pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/{vf => visualforce}/rule/security/xml/VfUnescapeEl.xml (100%) diff --git a/docs/pages/pmd/languages/language_properties.md b/docs/pages/pmd/languages/language_properties.md index 9520ae1fd0..bb8a35c6e2 100644 --- a/docs/pages/pmd/languages/language_properties.md +++ b/docs/pages/pmd/languages/language_properties.md @@ -2,7 +2,7 @@ title: Language configuration permalink: pmd_languages_configuration.html author: ClĂ©ment Fournier -last_updated: August 2023 (7.0.0) +last_updated: February 2024 (7.0.0) tags: [languages] keywords: [pmd, cpd, options, command, auxclasspath, language, properties] summary: "Summary of language configuration options and properties" @@ -114,13 +114,13 @@ The Java language can be configured with the following properties: or relative to the Visualforce directory. Default is `../classes`. Specifying an empty string will disable data type resolution for Apex Controller properties. - Environment variable: `PMD_VF_APEX_DIRECTORIES` + Environment variable: `PMD_VISUALFORCE_APEX_DIRECTORIES` - `objectsDirectories`: Comma separated list of directories for Custom Objects. Absolute or relative to the Visualforce directory. Default is `../objects`. Specifying an empty string will disable data type resolution for Custom Object fields. - Environment variable: `PMD_VF_OBJECTS_DIRECTORIES` + Environment variable: `PMD_VISUALFORCE_OBJECTS_DIRECTORIES` ## CPP language properties diff --git a/docs/pages/pmd/languages/visualforce.md b/docs/pages/pmd/languages/visualforce.md index ecb56a9f9e..0bffab4e5b 100644 --- a/docs/pages/pmd/languages/visualforce.md +++ b/docs/pages/pmd/languages/visualforce.md @@ -10,7 +10,13 @@ summary: "Visualforce-specific features and guidance" > [Visualforce](https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/) consists of a tag-based markup > language that gives developers way to build applications and customize the Salesforce user interface. -{% include language_info.html name='Salesforce Visualforce' id='vf' implementation='visualforce::lang.vf.VfLanguageModule' supports_pmd=true supports_cpd=true since='5.6.0' %} +{% include language_info.html name='Salesforce Visualforce' id='visualforce' implementation='visualforce::lang.visualforce.VfLanguageModule' supports_pmd=true supports_cpd=true since='5.6.0' %} + +{% capture vf_id_note %} +The language id of Visualforce was in PMD 6 just "vf". In PMD 7, this has been changed to "visualforce". Also the +package name of the classes has been changed from vf to "visualforce". +{% endcapture %} +{% include note.html content=vf_id_note %} ## Language Properties @@ -26,33 +32,33 @@ like {% rule vf/security/VfUnescapeEl %}. This can be configured using two language properties, which can be set as environment variables: -* `PMD_VF_APEX_DIRECTORIES`: Comma separated list of directories for Apex classes. Absolute or relative +* `PMD_VISUALFORCE_APEX_DIRECTORIES`: Comma separated list of directories for Apex classes. Absolute or relative to the Visualforce directory. Default is `../classes`. Specifying an empty string will disable data type resolution for Apex Controller properties. -* `PMD_VF_OBJECTS_DIRECTORIES`: Comma separated list of directories for Custom Objects. Absolute or relative +* `PMD_VISUALFORCE_OBJECTS_DIRECTORIES`: Comma separated list of directories for Custom Objects. Absolute or relative to the Visualforce directory. Default is `../objects`. Specifying an empty string will disable data type resolution for Custom Object fields. {% include warning.html content=" These env vars have changed from PMD 6 to PMD 7: -* `PMD_VF_APEXDIRECTORIES` ➡️ `PMD_VF_APEX_DIRECTORIES` -* `PMD_VF_OBJECTSDIRECTORIES` ➡️ `PMD_VF_OBJECTS_DIRECTORIES` +* `PMD_VF_APEXDIRECTORIES` ➡️ `PMD_VISUALFORCE_APEX_DIRECTORIES` +* `PMD_VF_OBJECTSDIRECTORIES` ➡️ `PMD_VISUALFORCE_OBJECTS_DIRECTORIES` "%} ### Sample usage ``` -PMD_VF_APEXDIRECTORIES=../classes \ -PMD_VF_OBJECTSDIRECTORIES=../objects \ +PMD_VISUALFORCE_APEXDIRECTORIES=../classes \ +PMD_VISUALFORCE_OBJECTSDIRECTORIES=../objects \ pmd check -d $GITHUB_WORKSPACE/force-app/main/default/pages \ - -R category/vf/security.xml/VfUnescapeEl -f text + -R category/visualforce/security.xml/VfUnescapeEl -f text ``` If you run with debug logging turned on, you might see log messages like this: ``` -Okt. 14, 2021 11:30:44 AM net.sourceforge.pmd.lang.vf.VfExpressionTypeVisitor visit +Okt. 14, 2021 11:30:44 AM net.sourceforge.pmd.lang.visualforce.VfExpressionTypeVisitor visit FINE: Unable to determine type for: Account.NotFoundField__c ``` diff --git a/docs/pages/pmd/userdocs/migrating_to_pmd7.md b/docs/pages/pmd/userdocs/migrating_to_pmd7.md index ec092e1261..0255d60404 100644 --- a/docs/pages/pmd/userdocs/migrating_to_pmd7.md +++ b/docs/pages/pmd/userdocs/migrating_to_pmd7.md @@ -74,6 +74,7 @@ You might encounter additionally the following types of problems: see [Release downloads](#release-downloads). * Some CLI options have been removed, because they have been deprecated. See [CLI Changes](#cli-changes) for details. * If you call CPD programmatically, the API has changed, see [New Programmatic API for CPD](pmd_release_notes_pmd7.html#new-programmatic-api-for-cpd). +* If you use Visualforce, then you need to change "vf" to "visualforce", e.g. `category/vf/security.xml` ➡️ `category/visualforce/security.xml` The following topics describe well known migration challenges in more detail. diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index c61910f235..f169f6bb7e 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -116,6 +116,17 @@ See [#3766](https://github.com/pmd/pmd/issues/3766) for details. Contributors: [Aaron Hurst](https://github.com/aaronhurst-google) (@aaronhurst-google), [Edward Klimoshenko](https://github.com/eklimo) (@eklimo) +##### Changed: Visualforce + +There was an inconsistency between the naming of the maven module and the language id. The language id +used the abbreviation "vf", while the maven module used the longer name "visualforce". This has been +solved by renaming the language module to its full name "visualforce". The java packages have +been renamed as well. + +If you import rules, you also need to adjust the paths, e.g. + +* `category/vf/security.xml` ➡️ `category/visualforce/security.xml` + ##### Changed: HTML support Support for HTML was introduced in PMD 6.55.0 as an experimental feature. With PMD 7.0.0 this @@ -139,6 +150,10 @@ Experimental Kotlin support has been promoted as stable API now. * {% rule java/codestyle/EmptyControlStatement %}: The rule has a new property to allow empty blocks when they contain a comment (`allowCommentedBlocks`). +**Renamed Rulesets** + +* `category/vf/security.xml` ➡️ `category/visualforce/security.xml` + **Removed Rules** The following previously deprecated rules have been finally removed: @@ -352,6 +367,10 @@ in the migration guide for details. * {%jdoc xml::lang.xml.pom.PomLanguageModule %} (moved from `net.sourceforge.pmd.lang.pom.PomLanguageModule`) * {%jdoc xml::lang.xml.wsdl.WsdlLanguageModule %} (moved from `net.sourceforge.pmd.lang.wsdl.WsdlLanguageModule`) * {%jdoc xml::lang.xml.xsl.XslLanguageModule %} (moved from `net.sourceforge.pmd.lang.xsl.XslLanguageModule`) +* pmd-visualforce + * The package `net.sourceforge.pmd.lang.vf` has been renamed to {%jdoc_package visualforce::lang.visualforce %}. + * The language id of visualforce has been changed to `visualforce` (it was previously just "vf") + * The ruleset changed: `category/vf/security.xml` ➡️ `category/visualforce/security.xml` **Internalized classes and interfaces and methods** diff --git a/pmd-dist/src/test/java/net/sourceforge/pmd/dist/BinaryDistributionIT.java b/pmd-dist/src/test/java/net/sourceforge/pmd/dist/BinaryDistributionIT.java index 1ebde8ba68..d3119b7823 100644 --- a/pmd-dist/src/test/java/net/sourceforge/pmd/dist/BinaryDistributionIT.java +++ b/pmd-dist/src/test/java/net/sourceforge/pmd/dist/BinaryDistributionIT.java @@ -34,7 +34,7 @@ class BinaryDistributionIT extends AbstractBinaryDistributionTest { "julia", "kotlin", "lua", "matlab", "modelica", "objectivec", "perl", "php", "plsql", "pom", "python", "ruby", "scala", "swift", - "tsql", "typescript", "vf", "vm", "wsdl", "xml", "xsl" + "tsql", "typescript", "visualforce", "vm", "wsdl", "xml", "xsl" ); private static final List SUPPORTED_LANGUAGES_PMD = listOf( @@ -60,8 +60,9 @@ class BinaryDistributionIT extends AbstractBinaryDistributionTest { "scala-2.10", "scala-2.11", "scala-2.12", "scala-2.13", "swift-4.2", "swift-5.0", "swift-5.1", "swift-5.2", "swift-5.3", "swift-5.4", "swift-5.5", "swift-5.6", - "swift-5.7", "swift-5.8", "swift-5.9", "vf-52", "vf-53", "vf-54", "vf-55", "vf-56", - "vf-57", "vf-58", "vf-59", + "swift-5.7", "swift-5.8", "swift-5.9", + "visualforce-52", "visualforce-53", "visualforce-54", "visualforce-55", "visualforce-56", + "visualforce-57", "visualforce-58", "visualforce-59", "vm-2.0", "vm-2.1", "vm-2.2", "vm-2.3", "wsdl-1.1", "wsdl-2.0", "xml-1.0", "xml-1.1", "xsl-1.0", "xsl-2.0", "xsl-3.0" diff --git a/pmd-dist/src/test/resources/rulesets/all-visualforce.xml b/pmd-dist/src/test/resources/rulesets/all-visualforce.xml index ff68553962..abec7befc7 100644 --- a/pmd-dist/src/test/resources/rulesets/all-visualforce.xml +++ b/pmd-dist/src/test/resources/rulesets/all-visualforce.xml @@ -6,13 +6,13 @@ xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd"> Every Visualforce Rule in PMD - - - - - - - - + + + + + + + + diff --git a/pmd-test/src/main/java/net/sourceforge/pmd/test/lang/rule/AbstractRuleSetFactoryTest.java b/pmd-test/src/main/java/net/sourceforge/pmd/test/lang/rule/AbstractRuleSetFactoryTest.java index f611484ac8..44ea55ca4f 100644 --- a/pmd-test/src/main/java/net/sourceforge/pmd/test/lang/rule/AbstractRuleSetFactoryTest.java +++ b/pmd-test/src/main/java/net/sourceforge/pmd/test/lang/rule/AbstractRuleSetFactoryTest.java @@ -338,7 +338,7 @@ public abstract class AbstractRuleSetFactoryTest { if (input == null) { // this might happen if a language is only support by CPD, but not // by PMD - System.err.println("No ruleset found for language " + language); + System.err.println("No rulesets found for language " + language + " at " + propertiesPath); return Collections.emptyList(); } try (InputStream is = input) { diff --git a/pmd-visualforce/etc/grammar/Vf.jjt b/pmd-visualforce/etc/grammar/Vf.jjt index 09ce8bb1b3..6fa854e7c3 100644 --- a/pmd-visualforce/etc/grammar/Vf.jjt +++ b/pmd-visualforce/etc/grammar/Vf.jjt @@ -11,7 +11,7 @@ options { } PARSER_BEGIN(VfParserImpl) -package net.sourceforge.pmd.lang.vf.ast; +package net.sourceforge.pmd.lang.visualforce.ast; public class VfParserImpl { diff --git a/pmd-visualforce/pom.xml b/pmd-visualforce/pom.xml index f54f52a63f..fea99b1726 100644 --- a/pmd-visualforce/pom.xml +++ b/pmd-visualforce/pom.xml @@ -49,7 +49,7 @@ - + diff --git a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/DataType.java b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/DataType.java similarity index 98% rename from pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/DataType.java rename to pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/DataType.java index 4c59a71c86..c33a0a1c9a 100644 --- a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/DataType.java +++ b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/DataType.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf; +package net.sourceforge.pmd.lang.visualforce; import java.util.Arrays; import java.util.HashMap; diff --git a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/VfHandler.java b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/VfHandler.java similarity index 82% rename from pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/VfHandler.java rename to pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/VfHandler.java index 71a4a4e73a..0592e7a426 100644 --- a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/VfHandler.java +++ b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/VfHandler.java @@ -2,11 +2,11 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf; +package net.sourceforge.pmd.lang.visualforce; import net.sourceforge.pmd.lang.LanguageVersionHandler; import net.sourceforge.pmd.lang.ast.Parser; -import net.sourceforge.pmd.lang.vf.ast.VfParser; +import net.sourceforge.pmd.lang.visualforce.ast.VfParser; public class VfHandler implements LanguageVersionHandler { diff --git a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/VfLanguageModule.java b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/VfLanguageModule.java similarity index 90% rename from pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/VfLanguageModule.java rename to pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/VfLanguageModule.java index 7baeea127c..204bd20e90 100644 --- a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/VfLanguageModule.java +++ b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/VfLanguageModule.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf; +package net.sourceforge.pmd.lang.visualforce; import net.sourceforge.pmd.cpd.CpdCapableLanguage; import net.sourceforge.pmd.cpd.CpdLexer; @@ -10,13 +10,13 @@ import net.sourceforge.pmd.lang.LanguagePropertyBundle; import net.sourceforge.pmd.lang.LanguageRegistry; import net.sourceforge.pmd.lang.apex.ApexLanguageModule; import net.sourceforge.pmd.lang.impl.SimpleLanguageModuleBase; -import net.sourceforge.pmd.lang.vf.cpd.VfCpdLexer; +import net.sourceforge.pmd.lang.visualforce.cpd.VfCpdLexer; /** * @author sergey.gorbaty */ public class VfLanguageModule extends SimpleLanguageModuleBase implements CpdCapableLanguage { - static final String ID = "vf"; + static final String ID = "visualforce"; static final String NAME = "Salesforce Visualforce"; public VfLanguageModule() { diff --git a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/VfLanguageProperties.java b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/VfLanguageProperties.java similarity index 97% rename from pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/VfLanguageProperties.java rename to pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/VfLanguageProperties.java index 445e6d3f1f..a7cda2bd43 100644 --- a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/VfLanguageProperties.java +++ b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/VfLanguageProperties.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf; +package net.sourceforge.pmd.lang.visualforce; import java.nio.file.Paths; import java.util.List; diff --git a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTArguments.java b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTArguments.java similarity index 87% rename from pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTArguments.java rename to pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTArguments.java index 5ec460b05f..016e07292c 100644 --- a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTArguments.java +++ b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTArguments.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf.ast; +package net.sourceforge.pmd.lang.visualforce.ast; public final class ASTArguments extends AbstractVfNode { diff --git a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTAttribute.java b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTAttribute.java similarity index 96% rename from pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTAttribute.java rename to pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTAttribute.java index 00e1b814d0..d66c9ad43f 100644 --- a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTAttribute.java +++ b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTAttribute.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf.ast; +package net.sourceforge.pmd.lang.visualforce.ast; public final class ASTAttribute extends AbstractVfNode { diff --git a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTAttributeValue.java b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTAttributeValue.java similarity index 87% rename from pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTAttributeValue.java rename to pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTAttributeValue.java index a35c4ac732..089b4cab94 100644 --- a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTAttributeValue.java +++ b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTAttributeValue.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf.ast; +package net.sourceforge.pmd.lang.visualforce.ast; public final class ASTAttributeValue extends AbstractVfNode { diff --git a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTCData.java b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTCData.java similarity index 87% rename from pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTCData.java rename to pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTCData.java index 3f49a48f14..948e023d5d 100644 --- a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTCData.java +++ b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTCData.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf.ast; +package net.sourceforge.pmd.lang.visualforce.ast; public final class ASTCData extends AbstractVfNode { diff --git a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTCompilationUnit.java b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTCompilationUnit.java similarity index 94% rename from pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTCompilationUnit.java rename to pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTCompilationUnit.java index b9c7507792..c8b1b54c9c 100644 --- a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTCompilationUnit.java +++ b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTCompilationUnit.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf.ast; +package net.sourceforge.pmd.lang.visualforce.ast; import net.sourceforge.pmd.lang.ast.AstInfo; import net.sourceforge.pmd.lang.ast.Parser.ParserTask; diff --git a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTContent.java b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTContent.java similarity index 87% rename from pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTContent.java rename to pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTContent.java index 6d8bd29293..b8a13759da 100644 --- a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTContent.java +++ b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTContent.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf.ast; +package net.sourceforge.pmd.lang.visualforce.ast; public final class ASTContent extends AbstractVfNode { diff --git a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTDeclaration.java b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTDeclaration.java similarity index 91% rename from pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTDeclaration.java rename to pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTDeclaration.java index 4fc4ecb6c1..f0e16d5905 100644 --- a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTDeclaration.java +++ b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTDeclaration.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf.ast; +package net.sourceforge.pmd.lang.visualforce.ast; public final class ASTDeclaration extends AbstractVfNode { diff --git a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTDoctypeDeclaration.java b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTDoctypeDeclaration.java similarity index 92% rename from pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTDoctypeDeclaration.java rename to pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTDoctypeDeclaration.java index e74b064799..94519f9d48 100644 --- a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTDoctypeDeclaration.java +++ b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTDoctypeDeclaration.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf.ast; +package net.sourceforge.pmd.lang.visualforce.ast; public final class ASTDoctypeDeclaration extends AbstractVfNode { diff --git a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTDoctypeExternalId.java b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTDoctypeExternalId.java similarity index 95% rename from pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTDoctypeExternalId.java rename to pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTDoctypeExternalId.java index f115fc1231..da4f59e53e 100644 --- a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTDoctypeExternalId.java +++ b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTDoctypeExternalId.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf.ast; +package net.sourceforge.pmd.lang.visualforce.ast; public final class ASTDoctypeExternalId extends AbstractVfNode { diff --git a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTDotExpression.java b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTDotExpression.java similarity index 87% rename from pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTDotExpression.java rename to pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTDotExpression.java index 938afeae0d..1708b7aabd 100644 --- a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTDotExpression.java +++ b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTDotExpression.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf.ast; +package net.sourceforge.pmd.lang.visualforce.ast; public final class ASTDotExpression extends AbstractVfNode { diff --git a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTElExpression.java b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTElExpression.java similarity index 87% rename from pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTElExpression.java rename to pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTElExpression.java index ec00917ce7..302a2c52ef 100644 --- a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTElExpression.java +++ b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTElExpression.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf.ast; +package net.sourceforge.pmd.lang.visualforce.ast; public final class ASTElExpression extends AbstractVfNode { ASTElExpression(int id) { diff --git a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTElement.java b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTElement.java similarity index 97% rename from pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTElement.java rename to pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTElement.java index b1c7cc3ddd..fe7641d89f 100644 --- a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTElement.java +++ b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTElement.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf.ast; +package net.sourceforge.pmd.lang.visualforce.ast; public final class ASTElement extends AbstractVfNode { diff --git a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTExpression.java b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTExpression.java similarity index 99% rename from pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTExpression.java rename to pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTExpression.java index a0f04e73aa..460a9f0158 100644 --- a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTExpression.java +++ b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTExpression.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf.ast; +package net.sourceforge.pmd.lang.visualforce.ast; import java.util.IdentityHashMap; import java.util.LinkedList; diff --git a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTHtmlScript.java b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTHtmlScript.java similarity index 87% rename from pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTHtmlScript.java rename to pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTHtmlScript.java index ed7ba549d5..e638c3e629 100644 --- a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTHtmlScript.java +++ b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTHtmlScript.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf.ast; +package net.sourceforge.pmd.lang.visualforce.ast; public final class ASTHtmlScript extends AbstractVfNode { diff --git a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTIdentifier.java b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTIdentifier.java similarity index 87% rename from pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTIdentifier.java rename to pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTIdentifier.java index 496c68da43..d642d1fde3 100644 --- a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTIdentifier.java +++ b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTIdentifier.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf.ast; +package net.sourceforge.pmd.lang.visualforce.ast; public final class ASTIdentifier extends AbstractVFDataNode { diff --git a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTLiteral.java b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTLiteral.java similarity index 87% rename from pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTLiteral.java rename to pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTLiteral.java index c35099148c..6a18b7bfe0 100644 --- a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTLiteral.java +++ b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTLiteral.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf.ast; +package net.sourceforge.pmd.lang.visualforce.ast; public final class ASTLiteral extends AbstractVFDataNode { diff --git a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTNegationExpression.java b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTNegationExpression.java similarity index 88% rename from pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTNegationExpression.java rename to pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTNegationExpression.java index bfebeba44b..dc361a0dc8 100644 --- a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTNegationExpression.java +++ b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTNegationExpression.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf.ast; +package net.sourceforge.pmd.lang.visualforce.ast; public final class ASTNegationExpression extends AbstractVfNode { ASTNegationExpression(int id) { diff --git a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTText.java b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTText.java similarity index 87% rename from pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTText.java rename to pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTText.java index d68b0bee19..9ebbc479bc 100644 --- a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ASTText.java +++ b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ASTText.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf.ast; +package net.sourceforge.pmd.lang.visualforce.ast; public final class ASTText extends AbstractVfNode { diff --git a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/AbstractVFDataNode.java b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/AbstractVFDataNode.java similarity index 82% rename from pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/AbstractVFDataNode.java rename to pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/AbstractVFDataNode.java index 94a7a4b951..da97aa944e 100644 --- a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/AbstractVFDataNode.java +++ b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/AbstractVFDataNode.java @@ -2,9 +2,9 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf.ast; +package net.sourceforge.pmd.lang.visualforce.ast; -import net.sourceforge.pmd.lang.vf.DataType; +import net.sourceforge.pmd.lang.visualforce.DataType; /** * Represents a node that displays a piece of data. diff --git a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/AbstractVfNode.java b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/AbstractVfNode.java similarity index 95% rename from pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/AbstractVfNode.java rename to pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/AbstractVfNode.java index b1d81fb908..5cbe07444d 100644 --- a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/AbstractVfNode.java +++ b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/AbstractVfNode.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf.ast; +package net.sourceforge.pmd.lang.visualforce.ast; import net.sourceforge.pmd.lang.ast.AstVisitor; import net.sourceforge.pmd.lang.ast.impl.javacc.AbstractJjtreeNode; diff --git a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ApexClassPropertyTypes.java b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ApexClassPropertyTypes.java similarity index 97% rename from pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ApexClassPropertyTypes.java rename to pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ApexClassPropertyTypes.java index a7b2ebb6a8..027379e340 100644 --- a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ApexClassPropertyTypes.java +++ b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ApexClassPropertyTypes.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf.ast; +package net.sourceforge.pmd.lang.visualforce.ast; import java.io.IOException; import java.nio.charset.StandardCharsets; @@ -25,7 +25,7 @@ import net.sourceforge.pmd.lang.ast.Parser.ParserTask; import net.sourceforge.pmd.lang.ast.SemanticErrorReporter; import net.sourceforge.pmd.lang.document.TextDocument; import net.sourceforge.pmd.lang.document.TextFile; -import net.sourceforge.pmd.lang.vf.DataType; +import net.sourceforge.pmd.lang.visualforce.DataType; /** * Responsible for storing a mapping of Apex Class properties that can be referenced from Visualforce to the type of the diff --git a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ApexClassPropertyTypesVisitor.java b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ApexClassPropertyTypesVisitor.java similarity index 98% rename from pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ApexClassPropertyTypesVisitor.java rename to pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ApexClassPropertyTypesVisitor.java index f63468d4bf..96661a0a74 100644 --- a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ApexClassPropertyTypesVisitor.java +++ b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ApexClassPropertyTypesVisitor.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf.ast; +package net.sourceforge.pmd.lang.visualforce.ast; import java.util.ArrayList; import java.util.Collections; diff --git a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/InternalApiBridge.java b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/InternalApiBridge.java similarity index 86% rename from pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/InternalApiBridge.java rename to pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/InternalApiBridge.java index 4f14298af3..a696f4c55c 100644 --- a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/InternalApiBridge.java +++ b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/InternalApiBridge.java @@ -2,10 +2,10 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf.ast; +package net.sourceforge.pmd.lang.visualforce.ast; import net.sourceforge.pmd.annotation.InternalApi; -import net.sourceforge.pmd.lang.vf.DataType; +import net.sourceforge.pmd.lang.visualforce.DataType; /** * Internal API. diff --git a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ObjectFieldTypes.java b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ObjectFieldTypes.java similarity index 99% rename from pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ObjectFieldTypes.java rename to pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ObjectFieldTypes.java index fb37e37c6a..99024924cd 100644 --- a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/ObjectFieldTypes.java +++ b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/ObjectFieldTypes.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf.ast; +package net.sourceforge.pmd.lang.visualforce.ast; import java.io.IOException; import java.nio.file.Files; @@ -31,7 +31,7 @@ import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.xml.sax.SAXException; -import net.sourceforge.pmd.lang.vf.DataType; +import net.sourceforge.pmd.lang.visualforce.DataType; /** * Responsible for storing a mapping of Fields that can be referenced from Visualforce to the type of the field. diff --git a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/OpenTagRegister.java b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/OpenTagRegister.java similarity index 98% rename from pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/OpenTagRegister.java rename to pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/OpenTagRegister.java index efc1c33bd7..f198a738c6 100644 --- a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/OpenTagRegister.java +++ b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/OpenTagRegister.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf.ast; +package net.sourceforge.pmd.lang.visualforce.ast; import java.util.ArrayList; import java.util.List; diff --git a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/SalesforceFieldTypes.java b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/SalesforceFieldTypes.java similarity index 97% rename from pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/SalesforceFieldTypes.java rename to pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/SalesforceFieldTypes.java index a61286a309..4dd76d424e 100644 --- a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/SalesforceFieldTypes.java +++ b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/SalesforceFieldTypes.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf.ast; +package net.sourceforge.pmd.lang.visualforce.ast; import java.nio.file.Path; import java.nio.file.Paths; @@ -15,7 +15,7 @@ import java.util.Map; import java.util.Set; import net.sourceforge.pmd.lang.document.FileId; -import net.sourceforge.pmd.lang.vf.DataType; +import net.sourceforge.pmd.lang.visualforce.DataType; /** * Responsible for storing a mapping of Fields that can be referenced from Visualforce to the type of the field. The diff --git a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/VfExpressionTypeVisitor.java b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/VfExpressionTypeVisitor.java similarity index 95% rename from pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/VfExpressionTypeVisitor.java rename to pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/VfExpressionTypeVisitor.java index 0177ebce33..0200f86856 100644 --- a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/VfExpressionTypeVisitor.java +++ b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/VfExpressionTypeVisitor.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf.ast; +package net.sourceforge.pmd.lang.visualforce.ast; import java.util.ArrayList; import java.util.IdentityHashMap; @@ -15,12 +15,12 @@ import org.slf4j.LoggerFactory; import net.sourceforge.pmd.lang.ast.Parser.ParserTask; import net.sourceforge.pmd.lang.document.FileId; -import net.sourceforge.pmd.lang.vf.DataType; -import net.sourceforge.pmd.lang.vf.VfLanguageProperties; +import net.sourceforge.pmd.lang.visualforce.DataType; +import net.sourceforge.pmd.lang.visualforce.VfLanguageProperties; /** * Visits {@link ASTExpression} nodes and stores type information for - * {@link net.sourceforge.pmd.lang.vf.ast.ASTIdentifier} children that represent an IdentifierDotted construct. An + * {@link net.sourceforge.pmd.lang.visualforce.ast.ASTIdentifier} children that represent an IdentifierDotted construct. An * IdentifierDotted is of the form {@code MyObject__c.MyField__c}. */ class VfExpressionTypeVisitor extends VfVisitorBase { diff --git a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/VfNode.java b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/VfNode.java similarity index 80% rename from pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/VfNode.java rename to pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/VfNode.java index b8cc32a2c2..05d72eb56e 100644 --- a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/VfNode.java +++ b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/VfNode.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf.ast; +package net.sourceforge.pmd.lang.visualforce.ast; import net.sourceforge.pmd.lang.ast.impl.javacc.JjtreeNode; diff --git a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/VfParser.java b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/VfParser.java similarity index 91% rename from pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/VfParser.java rename to pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/VfParser.java index 6220c3a357..85bc01afb2 100644 --- a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/VfParser.java +++ b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/VfParser.java @@ -2,13 +2,13 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf.ast; +package net.sourceforge.pmd.lang.visualforce.ast; import net.sourceforge.pmd.lang.ast.ParseException; import net.sourceforge.pmd.lang.ast.impl.javacc.CharStream; import net.sourceforge.pmd.lang.ast.impl.javacc.JavaccTokenDocument.TokenDocumentBehavior; import net.sourceforge.pmd.lang.ast.impl.javacc.JjtreeParserAdapter; -import net.sourceforge.pmd.lang.vf.VfLanguageProperties; +import net.sourceforge.pmd.lang.visualforce.VfLanguageProperties; /** * Parser for the VisualForce language. diff --git a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/VfTypedNode.java b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/VfTypedNode.java similarity index 85% rename from pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/VfTypedNode.java rename to pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/VfTypedNode.java index 8d0d74b6d1..eb173e1227 100644 --- a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/VfTypedNode.java +++ b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/VfTypedNode.java @@ -2,9 +2,9 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf.ast; +package net.sourceforge.pmd.lang.visualforce.ast; -import net.sourceforge.pmd.lang.vf.DataType; +import net.sourceforge.pmd.lang.visualforce.DataType; /** * Represents a node that displays a piece of data. diff --git a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/VfVisitorBase.java b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/VfVisitorBase.java similarity index 83% rename from pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/VfVisitorBase.java rename to pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/VfVisitorBase.java index 3315fe1f5d..36a4a8aa4d 100644 --- a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/VfVisitorBase.java +++ b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/ast/VfVisitorBase.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf.ast; +package net.sourceforge.pmd.lang.visualforce.ast; import net.sourceforge.pmd.lang.ast.AstVisitorBase; diff --git a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/cpd/VfCpdLexer.java b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/cpd/VfCpdLexer.java similarity index 92% rename from pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/cpd/VfCpdLexer.java rename to pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/cpd/VfCpdLexer.java index 4fc1a99109..7ef243a4d8 100644 --- a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/cpd/VfCpdLexer.java +++ b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/cpd/VfCpdLexer.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf.cpd; +package net.sourceforge.pmd.lang.visualforce.cpd; import net.sourceforge.pmd.cpd.impl.JavaccCpdLexer; import net.sourceforge.pmd.lang.TokenManager; @@ -13,7 +13,7 @@ import net.sourceforge.pmd.lang.ast.impl.javacc.JavaccTokenDocument; import net.sourceforge.pmd.lang.ast.impl.javacc.JavaccTokenDocument.TokenDocumentBehavior; import net.sourceforge.pmd.lang.ast.impl.javacc.MalformedSourceException; import net.sourceforge.pmd.lang.document.TextDocument; -import net.sourceforge.pmd.lang.vf.ast.VfTokenKinds; +import net.sourceforge.pmd.lang.visualforce.ast.VfTokenKinds; /** *

Note: This class has been called VfTokenizer in PMD 6

. diff --git a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/rule/AbstractVfRule.java b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/rule/AbstractVfRule.java similarity index 84% rename from pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/rule/AbstractVfRule.java rename to pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/rule/AbstractVfRule.java index fc9cea2057..e62c0f9d42 100644 --- a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/rule/AbstractVfRule.java +++ b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/rule/AbstractVfRule.java @@ -2,11 +2,11 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf.rule; +package net.sourceforge.pmd.lang.visualforce.rule; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.rule.AbstractRule; -import net.sourceforge.pmd.lang.vf.ast.VfVisitor; +import net.sourceforge.pmd.lang.visualforce.ast.VfVisitor; import net.sourceforge.pmd.reporting.RuleContext; public abstract class AbstractVfRule extends AbstractRule implements VfVisitor { diff --git a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/rule/security/VfCsrfRule.java b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/rule/security/VfCsrfRule.java similarity index 81% rename from pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/rule/security/VfCsrfRule.java rename to pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/rule/security/VfCsrfRule.java index 6066046de3..ca47f05ab4 100644 --- a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/rule/security/VfCsrfRule.java +++ b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/rule/security/VfCsrfRule.java @@ -2,16 +2,16 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf.rule.security; +package net.sourceforge.pmd.lang.visualforce.rule.security; import java.util.List; import java.util.Locale; -import net.sourceforge.pmd.lang.vf.ast.ASTAttribute; -import net.sourceforge.pmd.lang.vf.ast.ASTElExpression; -import net.sourceforge.pmd.lang.vf.ast.ASTElement; -import net.sourceforge.pmd.lang.vf.ast.ASTIdentifier; -import net.sourceforge.pmd.lang.vf.rule.AbstractVfRule; +import net.sourceforge.pmd.lang.visualforce.ast.ASTAttribute; +import net.sourceforge.pmd.lang.visualforce.ast.ASTElExpression; +import net.sourceforge.pmd.lang.visualforce.ast.ASTElement; +import net.sourceforge.pmd.lang.visualforce.ast.ASTIdentifier; +import net.sourceforge.pmd.lang.visualforce.rule.AbstractVfRule; /** * @author sergey.gorbaty diff --git a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/rule/security/VfHtmlStyleTagXssRule.java b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/rule/security/VfHtmlStyleTagXssRule.java similarity index 92% rename from pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/rule/security/VfHtmlStyleTagXssRule.java rename to pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/rule/security/VfHtmlStyleTagXssRule.java index 9ede3d00cf..dcdadc1975 100644 --- a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/rule/security/VfHtmlStyleTagXssRule.java +++ b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/rule/security/VfHtmlStyleTagXssRule.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf.rule.security; +package net.sourceforge.pmd.lang.visualforce.rule.security; import java.util.EnumSet; import java.util.Set; @@ -11,13 +11,13 @@ import java.util.regex.Pattern; import org.checkerframework.checker.nullness.qual.NonNull; import net.sourceforge.pmd.lang.rule.RuleTargetSelector; -import net.sourceforge.pmd.lang.vf.ast.ASTContent; -import net.sourceforge.pmd.lang.vf.ast.ASTElExpression; -import net.sourceforge.pmd.lang.vf.ast.ASTElement; -import net.sourceforge.pmd.lang.vf.ast.ASTText; -import net.sourceforge.pmd.lang.vf.ast.VfNode; -import net.sourceforge.pmd.lang.vf.rule.AbstractVfRule; -import net.sourceforge.pmd.lang.vf.rule.security.internal.ElEscapeDetector; +import net.sourceforge.pmd.lang.visualforce.ast.ASTContent; +import net.sourceforge.pmd.lang.visualforce.ast.ASTElExpression; +import net.sourceforge.pmd.lang.visualforce.ast.ASTElement; +import net.sourceforge.pmd.lang.visualforce.ast.ASTText; +import net.sourceforge.pmd.lang.visualforce.ast.VfNode; +import net.sourceforge.pmd.lang.visualforce.rule.AbstractVfRule; +import net.sourceforge.pmd.lang.visualforce.rule.security.internal.ElEscapeDetector; public class VfHtmlStyleTagXssRule extends AbstractVfRule { diff --git a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/rule/security/VfUnescapeElRule.java b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/rule/security/VfUnescapeElRule.java similarity index 93% rename from pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/rule/security/VfUnescapeElRule.java rename to pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/rule/security/VfUnescapeElRule.java index 3b0375b4ce..c528b3eb92 100644 --- a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/rule/security/VfUnescapeElRule.java +++ b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/rule/security/VfUnescapeElRule.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf.rule.security; +package net.sourceforge.pmd.lang.visualforce.rule.security; import java.util.EnumSet; import java.util.HashSet; @@ -12,16 +12,16 @@ import java.util.Set; import java.util.regex.Pattern; import net.sourceforge.pmd.lang.ast.Node; -import net.sourceforge.pmd.lang.vf.ast.ASTAttribute; -import net.sourceforge.pmd.lang.vf.ast.ASTContent; -import net.sourceforge.pmd.lang.vf.ast.ASTElExpression; -import net.sourceforge.pmd.lang.vf.ast.ASTElement; -import net.sourceforge.pmd.lang.vf.ast.ASTExpression; -import net.sourceforge.pmd.lang.vf.ast.ASTHtmlScript; -import net.sourceforge.pmd.lang.vf.ast.ASTLiteral; -import net.sourceforge.pmd.lang.vf.ast.ASTText; -import net.sourceforge.pmd.lang.vf.rule.AbstractVfRule; -import net.sourceforge.pmd.lang.vf.rule.security.internal.ElEscapeDetector; +import net.sourceforge.pmd.lang.visualforce.ast.ASTAttribute; +import net.sourceforge.pmd.lang.visualforce.ast.ASTContent; +import net.sourceforge.pmd.lang.visualforce.ast.ASTElExpression; +import net.sourceforge.pmd.lang.visualforce.ast.ASTElement; +import net.sourceforge.pmd.lang.visualforce.ast.ASTExpression; +import net.sourceforge.pmd.lang.visualforce.ast.ASTHtmlScript; +import net.sourceforge.pmd.lang.visualforce.ast.ASTLiteral; +import net.sourceforge.pmd.lang.visualforce.ast.ASTText; +import net.sourceforge.pmd.lang.visualforce.rule.AbstractVfRule; +import net.sourceforge.pmd.lang.visualforce.rule.security.internal.ElEscapeDetector; /** diff --git a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/rule/security/internal/ElEscapeDetector.java b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/rule/security/internal/ElEscapeDetector.java similarity index 96% rename from pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/rule/security/internal/ElEscapeDetector.java rename to pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/rule/security/internal/ElEscapeDetector.java index 3214f19171..5fad98694d 100644 --- a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/rule/security/internal/ElEscapeDetector.java +++ b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/visualforce/rule/security/internal/ElEscapeDetector.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf.rule.security.internal; +package net.sourceforge.pmd.lang.visualforce.rule.security.internal; import java.util.ArrayList; import java.util.Arrays; @@ -12,15 +12,15 @@ import java.util.List; import java.util.Locale; import java.util.Set; -import net.sourceforge.pmd.lang.vf.DataType; -import net.sourceforge.pmd.lang.vf.ast.ASTArguments; -import net.sourceforge.pmd.lang.vf.ast.ASTDotExpression; -import net.sourceforge.pmd.lang.vf.ast.ASTElExpression; -import net.sourceforge.pmd.lang.vf.ast.ASTExpression; -import net.sourceforge.pmd.lang.vf.ast.ASTIdentifier; -import net.sourceforge.pmd.lang.vf.ast.ASTNegationExpression; -import net.sourceforge.pmd.lang.vf.ast.VfNode; -import net.sourceforge.pmd.lang.vf.ast.VfTypedNode; +import net.sourceforge.pmd.lang.visualforce.DataType; +import net.sourceforge.pmd.lang.visualforce.ast.ASTArguments; +import net.sourceforge.pmd.lang.visualforce.ast.ASTDotExpression; +import net.sourceforge.pmd.lang.visualforce.ast.ASTElExpression; +import net.sourceforge.pmd.lang.visualforce.ast.ASTExpression; +import net.sourceforge.pmd.lang.visualforce.ast.ASTIdentifier; +import net.sourceforge.pmd.lang.visualforce.ast.ASTNegationExpression; +import net.sourceforge.pmd.lang.visualforce.ast.VfNode; +import net.sourceforge.pmd.lang.visualforce.ast.VfTypedNode; /** * Helps detect visualforce encoding in EL Expressions diff --git a/pmd-visualforce/src/main/resources/META-INF/services/net.sourceforge.pmd.lang.Language b/pmd-visualforce/src/main/resources/META-INF/services/net.sourceforge.pmd.lang.Language index 0b147b5f34..69f800e142 100644 --- a/pmd-visualforce/src/main/resources/META-INF/services/net.sourceforge.pmd.lang.Language +++ b/pmd-visualforce/src/main/resources/META-INF/services/net.sourceforge.pmd.lang.Language @@ -1 +1 @@ -net.sourceforge.pmd.lang.vf.VfLanguageModule +net.sourceforge.pmd.lang.visualforce.VfLanguageModule diff --git a/pmd-visualforce/src/main/resources/category/vf/categories.properties b/pmd-visualforce/src/main/resources/category/vf/categories.properties deleted file mode 100644 index e7764fe4ff..0000000000 --- a/pmd-visualforce/src/main/resources/category/vf/categories.properties +++ /dev/null @@ -1,17 +0,0 @@ -# -# BSD-style license; for more info see http://pmd.sourceforge.net/license.html -# - -rulesets.filenames=\ - category/vf/security.xml - -# -# categories without rules -# -# category/vf/bestpractices.xml -# category/vf/codestyle.xml -# category/vf/design.xml -# category/vf/documentation.xml -# category/vf/errorprone.xml -# category/vf/multithreading.xml -# category/vf/performance.xml diff --git a/pmd-visualforce/src/main/resources/category/vf/bestpractices.xml b/pmd-visualforce/src/main/resources/category/visualforce/bestpractices.xml similarity index 100% rename from pmd-visualforce/src/main/resources/category/vf/bestpractices.xml rename to pmd-visualforce/src/main/resources/category/visualforce/bestpractices.xml diff --git a/pmd-visualforce/src/main/resources/category/visualforce/categories.properties b/pmd-visualforce/src/main/resources/category/visualforce/categories.properties new file mode 100644 index 0000000000..0e45b7622e --- /dev/null +++ b/pmd-visualforce/src/main/resources/category/visualforce/categories.properties @@ -0,0 +1,17 @@ +# +# BSD-style license; for more info see http://pmd.sourceforge.net/license.html +# + +rulesets.filenames=\ + category/visualforce/security.xml + +# +# categories without rules +# +# category/visualforce/bestpractices.xml +# category/visualforce/codestyle.xml +# category/visualforce/design.xml +# category/visualforce/documentation.xml +# category/visualforce/errorprone.xml +# category/visualforce/multithreading.xml +# category/visualforce/performance.xml diff --git a/pmd-visualforce/src/main/resources/category/vf/codestyle.xml b/pmd-visualforce/src/main/resources/category/visualforce/codestyle.xml similarity index 100% rename from pmd-visualforce/src/main/resources/category/vf/codestyle.xml rename to pmd-visualforce/src/main/resources/category/visualforce/codestyle.xml diff --git a/pmd-visualforce/src/main/resources/category/vf/design.xml b/pmd-visualforce/src/main/resources/category/visualforce/design.xml similarity index 100% rename from pmd-visualforce/src/main/resources/category/vf/design.xml rename to pmd-visualforce/src/main/resources/category/visualforce/design.xml diff --git a/pmd-visualforce/src/main/resources/category/vf/documentation.xml b/pmd-visualforce/src/main/resources/category/visualforce/documentation.xml similarity index 100% rename from pmd-visualforce/src/main/resources/category/vf/documentation.xml rename to pmd-visualforce/src/main/resources/category/visualforce/documentation.xml diff --git a/pmd-visualforce/src/main/resources/category/vf/errorprone.xml b/pmd-visualforce/src/main/resources/category/visualforce/errorprone.xml similarity index 100% rename from pmd-visualforce/src/main/resources/category/vf/errorprone.xml rename to pmd-visualforce/src/main/resources/category/visualforce/errorprone.xml diff --git a/pmd-visualforce/src/main/resources/category/vf/multithreading.xml b/pmd-visualforce/src/main/resources/category/visualforce/multithreading.xml similarity index 100% rename from pmd-visualforce/src/main/resources/category/vf/multithreading.xml rename to pmd-visualforce/src/main/resources/category/visualforce/multithreading.xml diff --git a/pmd-visualforce/src/main/resources/category/vf/performance.xml b/pmd-visualforce/src/main/resources/category/visualforce/performance.xml similarity index 100% rename from pmd-visualforce/src/main/resources/category/vf/performance.xml rename to pmd-visualforce/src/main/resources/category/visualforce/performance.xml diff --git a/pmd-visualforce/src/main/resources/category/vf/security.xml b/pmd-visualforce/src/main/resources/category/visualforce/security.xml similarity index 78% rename from pmd-visualforce/src/main/resources/category/vf/security.xml rename to pmd-visualforce/src/main/resources/category/visualforce/security.xml index 6325ba6fc1..a81f19cd65 100644 --- a/pmd-visualforce/src/main/resources/category/vf/security.xml +++ b/pmd-visualforce/src/main/resources/category/visualforce/security.xml @@ -10,11 +10,11 @@ Rules that flag potential security flaws. + class="net.sourceforge.pmd.lang.visualforce.rule.security.VfCsrfRule" + externalInfoUrl="${pmd.website.baseurl}/pmd_rules_visualforce_security.html#vfcsrf"> Avoid calling VF action upon page load as the action becomes vulnerable to CSRF. @@ -27,11 +27,11 @@ Avoid calling VF action upon page load as the action becomes vulnerable to CSRF. + class="net.sourceforge.pmd.lang.visualforce.rule.security.VfHtmlStyleTagXssRule" + externalInfoUrl="${pmd.website.baseurl}/pmd_rules_visualforce_security.html#vfhtmlstyletagxss"> Checks for the correct encoding in `<style/>` tags in Visualforce pages. @@ -62,11 +62,11 @@ See also {% rule "VfUnescapeEl" %} to check escaping in other places on Visualfo + class="net.sourceforge.pmd.lang.visualforce.rule.security.VfUnescapeElRule" + externalInfoUrl="${pmd.website.baseurl}/pmd_rules_visualforce_security.html#vfunescapeel"> Avoid unescaped user controlled content in EL as it results in XSS. diff --git a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/DataTypeTest.java b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/DataTypeTest.java similarity index 96% rename from pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/DataTypeTest.java rename to pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/DataTypeTest.java index 87a5b30f15..b323fa226c 100644 --- a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/DataTypeTest.java +++ b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/DataTypeTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf; +package net.sourceforge.pmd.lang.visualforce; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; diff --git a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/LanguageVersionDiscovererTest.java b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/LanguageVersionDiscovererTest.java similarity index 92% rename from pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/LanguageVersionDiscovererTest.java rename to pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/LanguageVersionDiscovererTest.java index ffd51877d9..1fe24ad8b9 100644 --- a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/LanguageVersionDiscovererTest.java +++ b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/LanguageVersionDiscovererTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf; +package net.sourceforge.pmd.lang.visualforce; import static java.util.Collections.singleton; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -14,7 +14,7 @@ import org.junit.jupiter.api.Test; import net.sourceforge.pmd.lang.LanguageRegistry; import net.sourceforge.pmd.lang.LanguageVersion; import net.sourceforge.pmd.lang.LanguageVersionDiscoverer; -import net.sourceforge.pmd.lang.vf.ast.AbstractVfTest; +import net.sourceforge.pmd.lang.visualforce.ast.AbstractVfTest; /** * @author sergey.gorbaty diff --git a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/LanguageVersionTest.java b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/LanguageVersionTest.java similarity index 93% rename from pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/LanguageVersionTest.java rename to pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/LanguageVersionTest.java index b595f07ad7..42742da5be 100644 --- a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/LanguageVersionTest.java +++ b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/LanguageVersionTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf; +package net.sourceforge.pmd.lang.visualforce; import java.util.Arrays; import java.util.Collection; diff --git a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/RuleSetFactoryTest.java b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/RuleSetFactoryTest.java similarity index 89% rename from pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/RuleSetFactoryTest.java rename to pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/RuleSetFactoryTest.java index a70c934d67..1fd91dbf85 100644 --- a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/RuleSetFactoryTest.java +++ b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/RuleSetFactoryTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf; +package net.sourceforge.pmd.lang.visualforce; import net.sourceforge.pmd.lang.apex.ApexLanguageModule; import net.sourceforge.pmd.test.lang.rule.AbstractRuleSetFactoryTest; diff --git a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/VFTestUtils.java b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/VFTestUtils.java similarity index 98% rename from pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/VFTestUtils.java rename to pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/VFTestUtils.java index f4e9ac998b..783498f77d 100644 --- a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/VFTestUtils.java +++ b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/VFTestUtils.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf; +package net.sourceforge.pmd.lang.visualforce; import static net.sourceforge.pmd.util.CollectionUtil.setOf; diff --git a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/ast/ASTExpressionTest.java b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/ast/ASTExpressionTest.java similarity index 99% rename from pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/ast/ASTExpressionTest.java rename to pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/ast/ASTExpressionTest.java index 5df0bd3aa8..6454f010fb 100644 --- a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/ast/ASTExpressionTest.java +++ b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/ast/ASTExpressionTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf.ast; +package net.sourceforge.pmd.lang.visualforce.ast; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; diff --git a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/ast/AbstractVfTest.java b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/ast/AbstractVfTest.java similarity index 83% rename from pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/ast/AbstractVfTest.java rename to pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/ast/AbstractVfTest.java index b81876d42a..1a3c4cc03f 100644 --- a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/ast/AbstractVfTest.java +++ b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/ast/AbstractVfTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf.ast; +package net.sourceforge.pmd.lang.visualforce.ast; public abstract class AbstractVfTest { diff --git a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/ast/ApexClassPropertyTypesTest.java b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/ast/ApexClassPropertyTypesTest.java similarity index 94% rename from pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/ast/ApexClassPropertyTypesTest.java rename to pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/ast/ApexClassPropertyTypesTest.java index 8145fa0943..a2bf28cbd1 100644 --- a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/ast/ApexClassPropertyTypesTest.java +++ b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/ast/ApexClassPropertyTypesTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf.ast; +package net.sourceforge.pmd.lang.visualforce.ast; import static net.sourceforge.pmd.util.CollectionUtil.listOf; import static org.junit.jupiter.api.Assertions.assertNull; @@ -17,9 +17,9 @@ import org.junit.jupiter.api.Test; import net.sourceforge.pmd.lang.LanguageProcessorRegistry; import net.sourceforge.pmd.lang.document.FileId; -import net.sourceforge.pmd.lang.vf.DataType; -import net.sourceforge.pmd.lang.vf.VFTestUtils; -import net.sourceforge.pmd.lang.vf.VfLanguageProperties; +import net.sourceforge.pmd.lang.visualforce.DataType; +import net.sourceforge.pmd.lang.visualforce.VFTestUtils; +import net.sourceforge.pmd.lang.visualforce.VfLanguageProperties; class ApexClassPropertyTypesTest { private static final Map EXPECTED_DATA_TYPES; diff --git a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/ast/ApexClassPropertyTypesVisitorTest.java b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/ast/ApexClassPropertyTypesVisitorTest.java similarity index 95% rename from pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/ast/ApexClassPropertyTypesVisitorTest.java rename to pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/ast/ApexClassPropertyTypesVisitorTest.java index dfca1d9689..708ce6cce4 100644 --- a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/ast/ApexClassPropertyTypesVisitorTest.java +++ b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/ast/ApexClassPropertyTypesVisitorTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf.ast; +package net.sourceforge.pmd.lang.visualforce.ast; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; @@ -17,7 +17,7 @@ import org.apache.commons.lang3.tuple.Pair; import org.junit.jupiter.api.Test; import net.sourceforge.pmd.lang.LanguageProcessorRegistry; -import net.sourceforge.pmd.lang.vf.VFTestUtils; +import net.sourceforge.pmd.lang.visualforce.VFTestUtils; class ApexClassPropertyTypesVisitorTest { diff --git a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/ast/ObjectFieldTypesTest.java b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/ast/ObjectFieldTypesTest.java similarity index 96% rename from pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/ast/ObjectFieldTypesTest.java rename to pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/ast/ObjectFieldTypesTest.java index dd091c470d..3e1adc4ab0 100644 --- a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/ast/ObjectFieldTypesTest.java +++ b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/ast/ObjectFieldTypesTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf.ast; +package net.sourceforge.pmd.lang.visualforce.ast; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; @@ -18,9 +18,9 @@ import java.util.Map; import org.junit.jupiter.api.Test; import net.sourceforge.pmd.lang.document.FileId; -import net.sourceforge.pmd.lang.vf.DataType; -import net.sourceforge.pmd.lang.vf.VFTestUtils; -import net.sourceforge.pmd.lang.vf.VfLanguageProperties; +import net.sourceforge.pmd.lang.visualforce.DataType; +import net.sourceforge.pmd.lang.visualforce.VFTestUtils; +import net.sourceforge.pmd.lang.visualforce.VfLanguageProperties; class ObjectFieldTypesTest { private static final Map EXPECTED_SFDX_DATA_TYPES; diff --git a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/ast/OpenTagRegisterTest.java b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/ast/OpenTagRegisterTest.java similarity index 98% rename from pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/ast/OpenTagRegisterTest.java rename to pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/ast/OpenTagRegisterTest.java index 9d61d5d62e..327ec073be 100644 --- a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/ast/OpenTagRegisterTest.java +++ b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/ast/OpenTagRegisterTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf.ast; +package net.sourceforge.pmd.lang.visualforce.ast; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; diff --git a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/ast/VfDocStyleTest.java b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/ast/VfDocStyleTest.java similarity index 99% rename from pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/ast/VfDocStyleTest.java rename to pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/ast/VfDocStyleTest.java index e4a9a7615d..18f76c452a 100644 --- a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/ast/VfDocStyleTest.java +++ b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/ast/VfDocStyleTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf.ast; +package net.sourceforge.pmd.lang.visualforce.ast; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; diff --git a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/ast/VfExpressionTypeVisitorTest.java b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/ast/VfExpressionTypeVisitorTest.java similarity index 97% rename from pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/ast/VfExpressionTypeVisitorTest.java rename to pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/ast/VfExpressionTypeVisitorTest.java index ee0f32644c..bbce49d8db 100644 --- a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/ast/VfExpressionTypeVisitorTest.java +++ b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/ast/VfExpressionTypeVisitorTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf.ast; +package net.sourceforge.pmd.lang.visualforce.ast; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; @@ -20,8 +20,8 @@ import org.junit.jupiter.api.Test; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.ast.NodeStream; -import net.sourceforge.pmd.lang.vf.DataType; -import net.sourceforge.pmd.lang.vf.VFTestUtils; +import net.sourceforge.pmd.lang.visualforce.DataType; +import net.sourceforge.pmd.lang.visualforce.VFTestUtils; import net.sourceforge.pmd.util.treeexport.XmlTreeRenderer; class VfExpressionTypeVisitorTest { diff --git a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/ast/VfPageStyleTest.java b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/ast/VfPageStyleTest.java similarity index 98% rename from pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/ast/VfPageStyleTest.java rename to pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/ast/VfPageStyleTest.java index 954bb4d1ad..fe0e9468e4 100644 --- a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/ast/VfPageStyleTest.java +++ b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/ast/VfPageStyleTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf.ast; +package net.sourceforge.pmd.lang.visualforce.ast; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/ast/VfParserTest.java b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/ast/VfParserTest.java similarity index 97% rename from pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/ast/VfParserTest.java rename to pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/ast/VfParserTest.java index 117b948842..b0c90249bb 100644 --- a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/ast/VfParserTest.java +++ b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/ast/VfParserTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf.ast; +package net.sourceforge.pmd.lang.visualforce.ast; import static org.junit.jupiter.api.Assertions.assertThrows; diff --git a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/ast/VfParsingHelper.java b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/ast/VfParsingHelper.java similarity index 84% rename from pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/ast/VfParsingHelper.java rename to pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/ast/VfParsingHelper.java index 2907824287..b306ae8768 100644 --- a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/ast/VfParsingHelper.java +++ b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/ast/VfParsingHelper.java @@ -2,14 +2,14 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf.ast; +package net.sourceforge.pmd.lang.visualforce.ast; import org.checkerframework.checker.nullness.qual.NonNull; import net.sourceforge.pmd.lang.LanguageProcessorRegistry; import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; -import net.sourceforge.pmd.lang.vf.VFTestUtils; -import net.sourceforge.pmd.lang.vf.VfLanguageModule; +import net.sourceforge.pmd.lang.visualforce.VFTestUtils; +import net.sourceforge.pmd.lang.visualforce.VfLanguageModule; public final class VfParsingHelper extends BaseParsingHelper { diff --git a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/cpd/VfCpdLexerTest.java b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/cpd/VfCpdLexerTest.java similarity index 80% rename from pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/cpd/VfCpdLexerTest.java rename to pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/cpd/VfCpdLexerTest.java index 2f9a6280ba..dfe6a00e5b 100644 --- a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/cpd/VfCpdLexerTest.java +++ b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/cpd/VfCpdLexerTest.java @@ -3,7 +3,7 @@ */ -package net.sourceforge.pmd.lang.vf.cpd; +package net.sourceforge.pmd.lang.visualforce.cpd; import org.junit.jupiter.api.Test; @@ -12,7 +12,7 @@ import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest; class VfCpdLexerTest extends CpdTextComparisonTest { VfCpdLexerTest() { - super("vf", ".page"); + super("visualforce", ".page"); } @Test diff --git a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/rule/security/VfCsrfTest.java b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/rule/security/VfCsrfTest.java similarity index 77% rename from pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/rule/security/VfCsrfTest.java rename to pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/rule/security/VfCsrfTest.java index d48fd98e3c..f0bcf75fe0 100644 --- a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/rule/security/VfCsrfTest.java +++ b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/rule/security/VfCsrfTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf.rule.security; +package net.sourceforge.pmd.lang.visualforce.rule.security; import net.sourceforge.pmd.test.PmdRuleTst; diff --git a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/rule/security/VfHtmlStyleTagXssTest.java b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/rule/security/VfHtmlStyleTagXssTest.java similarity index 78% rename from pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/rule/security/VfHtmlStyleTagXssTest.java rename to pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/rule/security/VfHtmlStyleTagXssTest.java index 1071c6a987..f47d3b5a9e 100644 --- a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/rule/security/VfHtmlStyleTagXssTest.java +++ b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/rule/security/VfHtmlStyleTagXssTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf.rule.security; +package net.sourceforge.pmd.lang.visualforce.rule.security; import net.sourceforge.pmd.test.PmdRuleTst; diff --git a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/rule/security/VfHtmlXssStyleTagUrlPatternMatchingTest.java b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/rule/security/VfHtmlXssStyleTagUrlPatternMatchingTest.java similarity index 97% rename from pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/rule/security/VfHtmlXssStyleTagUrlPatternMatchingTest.java rename to pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/rule/security/VfHtmlXssStyleTagUrlPatternMatchingTest.java index 32be69030b..00afa413fb 100644 --- a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/rule/security/VfHtmlXssStyleTagUrlPatternMatchingTest.java +++ b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/rule/security/VfHtmlXssStyleTagUrlPatternMatchingTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf.rule.security; +package net.sourceforge.pmd.lang.visualforce.rule.security; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; diff --git a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/rule/security/VfUnescapeElTest.java b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/rule/security/VfUnescapeElTest.java similarity index 94% rename from pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/rule/security/VfUnescapeElTest.java rename to pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/rule/security/VfUnescapeElTest.java index d9adf67898..bc8e1ab1c5 100644 --- a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/rule/security/VfUnescapeElTest.java +++ b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/visualforce/rule/security/VfUnescapeElTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vf.rule.security; +package net.sourceforge.pmd.lang.visualforce.rule.security; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -13,8 +13,8 @@ import java.util.List; import org.junit.jupiter.api.Test; import net.sourceforge.pmd.lang.rule.Rule; -import net.sourceforge.pmd.lang.vf.VFTestUtils; -import net.sourceforge.pmd.lang.vf.ast.VfParsingHelper; +import net.sourceforge.pmd.lang.visualforce.VFTestUtils; +import net.sourceforge.pmd.lang.visualforce.ast.VfParsingHelper; import net.sourceforge.pmd.reporting.Report; import net.sourceforge.pmd.reporting.RuleViolation; import net.sourceforge.pmd.test.PmdRuleTst; @@ -107,7 +107,7 @@ class VfUnescapeElTest extends PmdRuleTst { * Runs a rule against a Visualforce page on the file system. */ private Report runRule(Path vfPagePath) { - Rule rule = findRule("category/vf/security.xml", "VfUnescapeEl"); + Rule rule = findRule("category/visualforce/security.xml", "VfUnescapeEl"); return VfParsingHelper.DEFAULT.executeRuleOnFile(rule, vfPagePath); } } diff --git a/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/ast/ApexClassPropertyTypes/metadata/sfdx/classes/ApexController.cls b/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/ast/ApexClassPropertyTypes/metadata/sfdx/classes/ApexController.cls similarity index 100% rename from pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/ast/ApexClassPropertyTypes/metadata/sfdx/classes/ApexController.cls rename to pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/ast/ApexClassPropertyTypes/metadata/sfdx/classes/ApexController.cls diff --git a/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/ast/ApexClassPropertyTypes/metadata/sfdx/pages/SomePage.page b/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/ast/ApexClassPropertyTypes/metadata/sfdx/pages/SomePage.page similarity index 100% rename from pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/ast/ApexClassPropertyTypes/metadata/sfdx/pages/SomePage.page rename to pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/ast/ApexClassPropertyTypes/metadata/sfdx/pages/SomePage.page diff --git a/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/ast/ApexClassPropertyTypesVisitor/metadata/sfdx/classes/ApexController.cls b/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/ast/ApexClassPropertyTypesVisitor/metadata/sfdx/classes/ApexController.cls similarity index 100% rename from pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/ast/ApexClassPropertyTypesVisitor/metadata/sfdx/classes/ApexController.cls rename to pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/ast/ApexClassPropertyTypesVisitor/metadata/sfdx/classes/ApexController.cls diff --git a/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/ast/ObjectFieldTypes/metadata/mdapi/objects/Account.object b/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/ast/ObjectFieldTypes/metadata/mdapi/objects/Account.object similarity index 100% rename from pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/ast/ObjectFieldTypes/metadata/mdapi/objects/Account.object rename to pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/ast/ObjectFieldTypes/metadata/mdapi/objects/Account.object diff --git a/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/ast/ObjectFieldTypes/metadata/mdapi/pages/SomePage.page b/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/ast/ObjectFieldTypes/metadata/mdapi/pages/SomePage.page similarity index 100% rename from pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/ast/ObjectFieldTypes/metadata/mdapi/pages/SomePage.page rename to pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/ast/ObjectFieldTypes/metadata/mdapi/pages/SomePage.page diff --git a/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/ast/ObjectFieldTypes/metadata/sfdx/objects/Account/fields/Checkbox__c.field-meta.xml b/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/ast/ObjectFieldTypes/metadata/sfdx/objects/Account/fields/Checkbox__c.field-meta.xml similarity index 100% rename from pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/ast/ObjectFieldTypes/metadata/sfdx/objects/Account/fields/Checkbox__c.field-meta.xml rename to pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/ast/ObjectFieldTypes/metadata/sfdx/objects/Account/fields/Checkbox__c.field-meta.xml diff --git a/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/ast/ObjectFieldTypes/metadata/sfdx/objects/Account/fields/DateTime__c.field-meta.xml b/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/ast/ObjectFieldTypes/metadata/sfdx/objects/Account/fields/DateTime__c.field-meta.xml similarity index 100% rename from pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/ast/ObjectFieldTypes/metadata/sfdx/objects/Account/fields/DateTime__c.field-meta.xml rename to pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/ast/ObjectFieldTypes/metadata/sfdx/objects/Account/fields/DateTime__c.field-meta.xml diff --git a/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/ast/ObjectFieldTypes/metadata/sfdx/objects/Account/fields/LongTextArea__c.field-meta.xml b/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/ast/ObjectFieldTypes/metadata/sfdx/objects/Account/fields/LongTextArea__c.field-meta.xml similarity index 100% rename from pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/ast/ObjectFieldTypes/metadata/sfdx/objects/Account/fields/LongTextArea__c.field-meta.xml rename to pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/ast/ObjectFieldTypes/metadata/sfdx/objects/Account/fields/LongTextArea__c.field-meta.xml diff --git a/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/ast/ObjectFieldTypes/metadata/sfdx/objects/Account/fields/Picklist__c.field-meta.xml b/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/ast/ObjectFieldTypes/metadata/sfdx/objects/Account/fields/Picklist__c.field-meta.xml similarity index 100% rename from pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/ast/ObjectFieldTypes/metadata/sfdx/objects/Account/fields/Picklist__c.field-meta.xml rename to pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/ast/ObjectFieldTypes/metadata/sfdx/objects/Account/fields/Picklist__c.field-meta.xml diff --git a/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/ast/ObjectFieldTypes/metadata/sfdx/objects/Account/fields/TextArea__c.field-meta.xml b/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/ast/ObjectFieldTypes/metadata/sfdx/objects/Account/fields/TextArea__c.field-meta.xml similarity index 100% rename from pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/ast/ObjectFieldTypes/metadata/sfdx/objects/Account/fields/TextArea__c.field-meta.xml rename to pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/ast/ObjectFieldTypes/metadata/sfdx/objects/Account/fields/TextArea__c.field-meta.xml diff --git a/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/ast/ObjectFieldTypes/metadata/sfdx/objects/Account/fields/Text__c.field-meta.xml b/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/ast/ObjectFieldTypes/metadata/sfdx/objects/Account/fields/Text__c.field-meta.xml similarity index 100% rename from pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/ast/ObjectFieldTypes/metadata/sfdx/objects/Account/fields/Text__c.field-meta.xml rename to pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/ast/ObjectFieldTypes/metadata/sfdx/objects/Account/fields/Text__c.field-meta.xml diff --git a/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/ast/ObjectFieldTypes/metadata/sfdx/pages/SomePage.page b/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/ast/ObjectFieldTypes/metadata/sfdx/pages/SomePage.page similarity index 100% rename from pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/ast/ObjectFieldTypes/metadata/sfdx/pages/SomePage.page rename to pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/ast/ObjectFieldTypes/metadata/sfdx/pages/SomePage.page diff --git a/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/ast/VfExpressionTypeVisitor/metadata/sfdx/classes/ApexController.cls b/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/ast/VfExpressionTypeVisitor/metadata/sfdx/classes/ApexController.cls similarity index 100% rename from pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/ast/VfExpressionTypeVisitor/metadata/sfdx/classes/ApexController.cls rename to pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/ast/VfExpressionTypeVisitor/metadata/sfdx/classes/ApexController.cls diff --git a/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/ast/VfExpressionTypeVisitor/metadata/sfdx/objects/Account/fields/Checkbox__c.field-meta.xml b/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/ast/VfExpressionTypeVisitor/metadata/sfdx/objects/Account/fields/Checkbox__c.field-meta.xml similarity index 100% rename from pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/ast/VfExpressionTypeVisitor/metadata/sfdx/objects/Account/fields/Checkbox__c.field-meta.xml rename to pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/ast/VfExpressionTypeVisitor/metadata/sfdx/objects/Account/fields/Checkbox__c.field-meta.xml diff --git a/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/ast/VfExpressionTypeVisitor/metadata/sfdx/objects/Account/fields/DateTime__c.field-meta.xml b/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/ast/VfExpressionTypeVisitor/metadata/sfdx/objects/Account/fields/DateTime__c.field-meta.xml similarity index 100% rename from pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/ast/VfExpressionTypeVisitor/metadata/sfdx/objects/Account/fields/DateTime__c.field-meta.xml rename to pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/ast/VfExpressionTypeVisitor/metadata/sfdx/objects/Account/fields/DateTime__c.field-meta.xml diff --git a/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/ast/VfExpressionTypeVisitor/metadata/sfdx/objects/Account/fields/LongTextArea__c.field-meta.xml b/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/ast/VfExpressionTypeVisitor/metadata/sfdx/objects/Account/fields/LongTextArea__c.field-meta.xml similarity index 100% rename from pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/ast/VfExpressionTypeVisitor/metadata/sfdx/objects/Account/fields/LongTextArea__c.field-meta.xml rename to pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/ast/VfExpressionTypeVisitor/metadata/sfdx/objects/Account/fields/LongTextArea__c.field-meta.xml diff --git a/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/ast/VfExpressionTypeVisitor/metadata/sfdx/objects/Account/fields/Picklist__c.field-meta.xml b/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/ast/VfExpressionTypeVisitor/metadata/sfdx/objects/Account/fields/Picklist__c.field-meta.xml similarity index 100% rename from pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/ast/VfExpressionTypeVisitor/metadata/sfdx/objects/Account/fields/Picklist__c.field-meta.xml rename to pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/ast/VfExpressionTypeVisitor/metadata/sfdx/objects/Account/fields/Picklist__c.field-meta.xml diff --git a/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/ast/VfExpressionTypeVisitor/metadata/sfdx/objects/Account/fields/TextArea__c.field-meta.xml b/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/ast/VfExpressionTypeVisitor/metadata/sfdx/objects/Account/fields/TextArea__c.field-meta.xml similarity index 100% rename from pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/ast/VfExpressionTypeVisitor/metadata/sfdx/objects/Account/fields/TextArea__c.field-meta.xml rename to pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/ast/VfExpressionTypeVisitor/metadata/sfdx/objects/Account/fields/TextArea__c.field-meta.xml diff --git a/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/ast/VfExpressionTypeVisitor/metadata/sfdx/objects/Account/fields/Text__c.field-meta.xml b/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/ast/VfExpressionTypeVisitor/metadata/sfdx/objects/Account/fields/Text__c.field-meta.xml similarity index 100% rename from pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/ast/VfExpressionTypeVisitor/metadata/sfdx/objects/Account/fields/Text__c.field-meta.xml rename to pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/ast/VfExpressionTypeVisitor/metadata/sfdx/objects/Account/fields/Text__c.field-meta.xml diff --git a/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/ast/VfExpressionTypeVisitor/metadata/sfdx/pages/ApexController.page b/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/ast/VfExpressionTypeVisitor/metadata/sfdx/pages/ApexController.page similarity index 100% rename from pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/ast/VfExpressionTypeVisitor/metadata/sfdx/pages/ApexController.page rename to pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/ast/VfExpressionTypeVisitor/metadata/sfdx/pages/ApexController.page diff --git a/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/ast/VfExpressionTypeVisitor/metadata/sfdx/pages/StandardAccount.page b/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/ast/VfExpressionTypeVisitor/metadata/sfdx/pages/StandardAccount.page similarity index 100% rename from pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/ast/VfExpressionTypeVisitor/metadata/sfdx/pages/StandardAccount.page rename to pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/ast/VfExpressionTypeVisitor/metadata/sfdx/pages/StandardAccount.page diff --git a/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/cpd/testdata/SampleUnescapeElWithTab.page b/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/cpd/testdata/SampleUnescapeElWithTab.page similarity index 100% rename from pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/cpd/testdata/SampleUnescapeElWithTab.page rename to pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/cpd/testdata/SampleUnescapeElWithTab.page diff --git a/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/cpd/testdata/SampleUnescapeElWithTab.txt b/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/cpd/testdata/SampleUnescapeElWithTab.txt similarity index 100% rename from pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/cpd/testdata/SampleUnescapeElWithTab.txt rename to pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/cpd/testdata/SampleUnescapeElWithTab.txt diff --git a/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/rule/security/VfUnescapeEl/metadata/mdapi/objects/Account.object b/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/rule/security/VfUnescapeEl/metadata/mdapi/objects/Account.object similarity index 100% rename from pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/rule/security/VfUnescapeEl/metadata/mdapi/objects/Account.object rename to pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/rule/security/VfUnescapeEl/metadata/mdapi/objects/Account.object diff --git a/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/rule/security/VfUnescapeEl/metadata/mdapi/pages/StandardAccount.page b/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/rule/security/VfUnescapeEl/metadata/mdapi/pages/StandardAccount.page similarity index 100% rename from pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/rule/security/VfUnescapeEl/metadata/mdapi/pages/StandardAccount.page rename to pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/rule/security/VfUnescapeEl/metadata/mdapi/pages/StandardAccount.page diff --git a/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/rule/security/VfUnescapeEl/metadata/sfdx/classes/ApexController.cls b/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/rule/security/VfUnescapeEl/metadata/sfdx/classes/ApexController.cls similarity index 100% rename from pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/rule/security/VfUnescapeEl/metadata/sfdx/classes/ApexController.cls rename to pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/rule/security/VfUnescapeEl/metadata/sfdx/classes/ApexController.cls diff --git a/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/rule/security/VfUnescapeEl/metadata/sfdx/classes/ApexExtension1.cls b/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/rule/security/VfUnescapeEl/metadata/sfdx/classes/ApexExtension1.cls similarity index 100% rename from pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/rule/security/VfUnescapeEl/metadata/sfdx/classes/ApexExtension1.cls rename to pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/rule/security/VfUnescapeEl/metadata/sfdx/classes/ApexExtension1.cls diff --git a/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/rule/security/VfUnescapeEl/metadata/sfdx/classes/ApexExtension2.cls b/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/rule/security/VfUnescapeEl/metadata/sfdx/classes/ApexExtension2.cls similarity index 100% rename from pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/rule/security/VfUnescapeEl/metadata/sfdx/classes/ApexExtension2.cls rename to pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/rule/security/VfUnescapeEl/metadata/sfdx/classes/ApexExtension2.cls diff --git a/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/rule/security/VfUnescapeEl/metadata/sfdx/objects/Account/fields/Checkbox__c.field-meta.xml b/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/rule/security/VfUnescapeEl/metadata/sfdx/objects/Account/fields/Checkbox__c.field-meta.xml similarity index 100% rename from pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/rule/security/VfUnescapeEl/metadata/sfdx/objects/Account/fields/Checkbox__c.field-meta.xml rename to pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/rule/security/VfUnescapeEl/metadata/sfdx/objects/Account/fields/Checkbox__c.field-meta.xml diff --git a/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/rule/security/VfUnescapeEl/metadata/sfdx/objects/Account/fields/DateTime__c.field-meta.xml b/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/rule/security/VfUnescapeEl/metadata/sfdx/objects/Account/fields/DateTime__c.field-meta.xml similarity index 100% rename from pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/rule/security/VfUnescapeEl/metadata/sfdx/objects/Account/fields/DateTime__c.field-meta.xml rename to pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/rule/security/VfUnescapeEl/metadata/sfdx/objects/Account/fields/DateTime__c.field-meta.xml diff --git a/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/rule/security/VfUnescapeEl/metadata/sfdx/objects/Account/fields/LongTextArea__c.field-meta.xml b/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/rule/security/VfUnescapeEl/metadata/sfdx/objects/Account/fields/LongTextArea__c.field-meta.xml similarity index 100% rename from pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/rule/security/VfUnescapeEl/metadata/sfdx/objects/Account/fields/LongTextArea__c.field-meta.xml rename to pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/rule/security/VfUnescapeEl/metadata/sfdx/objects/Account/fields/LongTextArea__c.field-meta.xml diff --git a/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/rule/security/VfUnescapeEl/metadata/sfdx/objects/Account/fields/Picklist__c.field-meta.xml b/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/rule/security/VfUnescapeEl/metadata/sfdx/objects/Account/fields/Picklist__c.field-meta.xml similarity index 100% rename from pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/rule/security/VfUnescapeEl/metadata/sfdx/objects/Account/fields/Picklist__c.field-meta.xml rename to pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/rule/security/VfUnescapeEl/metadata/sfdx/objects/Account/fields/Picklist__c.field-meta.xml diff --git a/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/rule/security/VfUnescapeEl/metadata/sfdx/objects/Account/fields/TextArea__c.field-meta.xml b/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/rule/security/VfUnescapeEl/metadata/sfdx/objects/Account/fields/TextArea__c.field-meta.xml similarity index 100% rename from pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/rule/security/VfUnescapeEl/metadata/sfdx/objects/Account/fields/TextArea__c.field-meta.xml rename to pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/rule/security/VfUnescapeEl/metadata/sfdx/objects/Account/fields/TextArea__c.field-meta.xml diff --git a/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/rule/security/VfUnescapeEl/metadata/sfdx/objects/Account/fields/Text__c.field-meta.xml b/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/rule/security/VfUnescapeEl/metadata/sfdx/objects/Account/fields/Text__c.field-meta.xml similarity index 100% rename from pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/rule/security/VfUnescapeEl/metadata/sfdx/objects/Account/fields/Text__c.field-meta.xml rename to pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/rule/security/VfUnescapeEl/metadata/sfdx/objects/Account/fields/Text__c.field-meta.xml diff --git a/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/rule/security/VfUnescapeEl/metadata/sfdx/pages/ApexController.page b/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/rule/security/VfUnescapeEl/metadata/sfdx/pages/ApexController.page similarity index 100% rename from pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/rule/security/VfUnescapeEl/metadata/sfdx/pages/ApexController.page rename to pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/rule/security/VfUnescapeEl/metadata/sfdx/pages/ApexController.page diff --git a/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/rule/security/VfUnescapeEl/metadata/sfdx/pages/StandardAccount.page b/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/rule/security/VfUnescapeEl/metadata/sfdx/pages/StandardAccount.page similarity index 100% rename from pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/rule/security/VfUnescapeEl/metadata/sfdx/pages/StandardAccount.page rename to pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/rule/security/VfUnescapeEl/metadata/sfdx/pages/StandardAccount.page diff --git a/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/rule/security/VfUnescapeEl/metadata/sfdx/pages/StandardAccountWithExtensions.page b/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/rule/security/VfUnescapeEl/metadata/sfdx/pages/StandardAccountWithExtensions.page similarity index 100% rename from pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/rule/security/VfUnescapeEl/metadata/sfdx/pages/StandardAccountWithExtensions.page rename to pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/rule/security/VfUnescapeEl/metadata/sfdx/pages/StandardAccountWithExtensions.page diff --git a/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/rule/security/xml/VfCsrf.xml b/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/rule/security/xml/VfCsrf.xml similarity index 100% rename from pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/rule/security/xml/VfCsrf.xml rename to pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/rule/security/xml/VfCsrf.xml diff --git a/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/rule/security/xml/VfHtmlStyleTagXss.xml b/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/rule/security/xml/VfHtmlStyleTagXss.xml similarity index 100% rename from pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/rule/security/xml/VfHtmlStyleTagXss.xml rename to pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/rule/security/xml/VfHtmlStyleTagXss.xml diff --git a/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/rule/security/xml/VfUnescapeEl.xml b/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/rule/security/xml/VfUnescapeEl.xml similarity index 100% rename from pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/rule/security/xml/VfUnescapeEl.xml rename to pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/visualforce/rule/security/xml/VfUnescapeEl.xml From 1aa6112aaeeea50e5b830bfad31cd94a3a720644 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 23 Feb 2024 16:32:35 +0100 Subject: [PATCH 36/52] [velocity] Rename package and language id from vm to velocity Also change prefix from Vm to Vtl --- docs/_data/sidebars/pmd_sidebar.yml | 2 +- docs/_plugins/jdoc_namespace_tag.rb | 2 +- docs/pages/pmd/languages/velocity.md | 18 ++++++++++++ docs/pages/pmd/languages/vm.md | 12 -------- docs/pages/pmd/userdocs/migrating_to_pmd7.md | 1 + docs/pages/release_notes.md | 26 +++++++++++++++-- docs/pages/release_notes_pmd7.md | 16 +++++------ .../net/sourceforge/pmd/dist/AllRulesIT.java | 2 +- .../pmd/dist/BinaryDistributionIT.java | 9 +++--- .../test/resources/rulesets/all-velocity.xml | 18 ++++++++++++ .../rulesets/all-velocitytemplate.xml | 18 ------------ .../helloworld.vm | 0 pmd-languages-deps/pom.xml | 2 +- {pmd-vm => pmd-velocity}/.gitignore | 0 .../etc/grammar/Vtl.jjt | 12 ++++---- .../pmd-velocity-checkstyle-suppressions.xml | 0 {pmd-vm => pmd-velocity}/pom.xml | 10 +++---- .../pmd/lang/velocity/VtlHandler.java | 18 ++++++++++++ .../pmd/lang/velocity/VtlLanguageModule.java | 18 ++++++------ .../pmd/lang/velocity}/ast/ASTAddNode.java | 4 +-- .../pmd/lang/velocity}/ast/ASTBlock.java | 6 ++-- .../pmd/lang/velocity}/ast/ASTDirective.java | 6 ++-- .../pmd/lang/velocity}/ast/ASTDivNode.java | 4 +-- .../pmd/lang/velocity}/ast/ASTEscape.java | 6 ++-- .../pmd/lang/velocity}/ast/ASTMathNode.java | 4 +-- .../pmd/lang/velocity}/ast/ASTMethod.java | 6 ++-- .../pmd/lang/velocity}/ast/ASTModNode.java | 4 +-- .../pmd/lang/velocity}/ast/ASTMulNode.java | 4 +-- .../pmd/lang/velocity}/ast/ASTReference.java | 6 ++-- .../lang/velocity}/ast/ASTStringLiteral.java | 6 ++-- .../lang/velocity}/ast/ASTSubtractNode.java | 4 +-- .../pmd/lang/velocity}/ast/ASTTemplate.java | 6 ++-- .../lang/velocity/ast/AbstractVtlNode.java | 14 +++++----- .../pmd/lang/velocity}/ast/NodeUtils.java | 4 +-- .../pmd/lang/velocity/ast/VtlNode.java | 4 +-- .../pmd/lang/velocity/ast/VtlParser.java | 12 ++++---- .../pmd/lang/velocity/ast/VtlVisitorBase.java | 12 ++++++++ .../pmd/lang/velocity/cpd/VtlCpdLexer.java | 8 +++--- .../lang/velocity/rule/AbstractVtlRule.java | 6 ++-- .../AvoidReassigningParametersRule.java | 12 ++++---- .../UnusedMacroParameterRule.java | 14 +++++----- .../design/AvoidDeeplyNestedIfStmtsRule.java | 18 ++++++------ .../design/CollapsibleIfStatementsRule.java | 20 ++++++------- .../design/ExcessiveTemplateLengthRule.java | 8 +++--- .../rule/design/NoInlineJavaScriptRule.java | 8 +++--- .../rule/errorprone/EmptyForeachStmtRule.java | 10 +++---- .../rule/errorprone/EmptyIfStmtRule.java | 18 ++++++------ .../net.sourceforge.pmd.lang.Language | 1 + .../category/velocity}/bestpractices.xml | 12 ++++---- .../category/velocity/categories.properties | 17 +++++++++++ .../category/velocity}/codestyle.xml | 0 .../resources/category/velocity}/design.xml | 28 +++++++++---------- .../category/velocity}/documentation.xml | 0 .../category/velocity}/errorprone.xml | 12 ++++---- .../category/velocity}/multithreading.xml | 0 .../category/velocity}/performance.xml | 0 .../resources/category/velocity}/security.xml | 0 .../lang/velocity}/LanguageVersionTest.java | 6 ++-- .../lang/velocity}/RuleSetFactoryTest.java | 2 +- .../pmd/lang/velocity/VtlParserTest.java | 10 +++---- .../pmd/lang/velocity/VtlParsingHelper.java | 22 +++++++++++++++ .../lang/velocity/cpd/VtlCpdLexerTest.java | 10 +++---- .../AvoidReassigningParametersTest.java | 2 +- .../UnusedMacroParameterTest.java | 2 +- .../design/AvoidDeeplyNestedIfStmtsTest.java | 2 +- .../design/CollapsibleIfStatementsTest.java | 2 +- .../design/ExcessiveTemplateLengthTest.java | 2 +- .../rule/design/NoInlineJavaScriptTest.java | 2 +- .../rule/design/NoInlineStylesTest.java | 2 +- .../rule/errorprone/EmptyForeachStmtTest.java | 2 +- .../rule/errorprone/EmptyIfStmtTest.java | 2 +- .../lang/velocity}/cpd/testdata/sample_vm.txt | 0 .../lang/velocity}/cpd/testdata/sample_vm.vm | 0 .../xml/AvoidReassigningParameters.xml | 0 .../xml/UnusedMacroParameter.xml | 0 .../design/xml/AvoidDeeplyNestedIfStmts.xml | 0 .../design/xml/CollapsibleIfStatements.xml | 0 .../design/xml/ExcessiveTemplateLength.xml | 0 .../rule/design/xml/NoInlineJavaScript.xml | 0 .../rule/design/xml/NoInlineStyles.xml | 0 .../rule/errorprone/xml/EmptyForeachStmt.xml | 0 .../rule/errorprone/xml/EmptyIfStmt.xml | 0 .../sourceforge/pmd/lang/vm/VmHandler.java | 23 --------------- .../pmd/lang/vm/ast/VmVisitorBase.java | 12 -------- .../net.sourceforge.pmd.lang.Language | 1 - .../category/vm/categories.properties | 17 ----------- .../pmd/lang/vm/VmParsingHelper.java | 22 --------------- pom.xml | 2 +- 88 files changed, 329 insertions(+), 304 deletions(-) create mode 100644 docs/pages/pmd/languages/velocity.md delete mode 100644 docs/pages/pmd/languages/vm.md create mode 100644 pmd-dist/src/test/resources/rulesets/all-velocity.xml delete mode 100644 pmd-dist/src/test/resources/rulesets/all-velocitytemplate.xml rename pmd-dist/src/test/resources/sample-source/{velocitytemplate => velocity}/helloworld.vm (100%) rename {pmd-vm => pmd-velocity}/.gitignore (100%) rename pmd-vm/etc/grammar/Vm.jjt => pmd-velocity/etc/grammar/Vtl.jjt (99%) rename pmd-vm/pmd-vm-checkstyle-suppressions.xml => pmd-velocity/pmd-velocity-checkstyle-suppressions.xml (100%) rename {pmd-vm => pmd-velocity}/pom.xml (94%) create mode 100644 pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/VtlHandler.java rename pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/VmLanguageModule.java => pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/VtlLanguageModule.java (65%) rename {pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm => pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity}/ast/ASTAddNode.java (91%) rename {pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm => pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity}/ast/ASTBlock.java (70%) rename {pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm => pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity}/ast/ASTDirective.java (94%) rename {pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm => pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity}/ast/ASTDivNode.java (91%) rename {pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm => pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity}/ast/ASTEscape.java (87%) rename {pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm => pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity}/ast/ASTMathNode.java (93%) rename {pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm => pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity}/ast/ASTMethod.java (88%) rename {pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm => pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity}/ast/ASTModNode.java (90%) rename {pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm => pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity}/ast/ASTMulNode.java (91%) rename {pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm => pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity}/ast/ASTReference.java (93%) rename {pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm => pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity}/ast/ASTStringLiteral.java (87%) rename {pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm => pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity}/ast/ASTSubtractNode.java (91%) rename {pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm => pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity}/ast/ASTTemplate.java (74%) rename pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/AbstractVmNode.java => pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/AbstractVtlNode.java (79%) rename {pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm => pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity}/ast/NodeUtils.java (97%) rename pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/VmNode.java => pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/VtlNode.java (59%) rename pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/VmParser.java => pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/VtlParser.java (81%) create mode 100644 pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/VtlVisitorBase.java rename pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/cpd/VmCpdLexer.java => pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/cpd/VtlCpdLexer.java (71%) rename pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/rule/AbstractVmRule.java => pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/rule/AbstractVtlRule.java (71%) rename {pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm => pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity}/rule/bestpractices/AvoidReassigningParametersRule.java (71%) rename {pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm => pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity}/rule/bestpractices/UnusedMacroParameterRule.java (83%) rename {pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm => pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity}/rule/design/AvoidDeeplyNestedIfStmtsRule.java (71%) rename {pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm => pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity}/rule/design/CollapsibleIfStatementsRule.java (80%) rename {pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm => pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity}/rule/design/ExcessiveTemplateLengthRule.java (83%) rename {pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm => pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity}/rule/design/NoInlineJavaScriptRule.java (77%) rename {pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm => pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity}/rule/errorprone/EmptyForeachStmtRule.java (53%) rename {pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm => pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity}/rule/errorprone/EmptyIfStmtRule.java (56%) create mode 100644 pmd-velocity/src/main/resources/META-INF/services/net.sourceforge.pmd.lang.Language rename {pmd-vm/src/main/resources/category/vm => pmd-velocity/src/main/resources/category/velocity}/bestpractices.xml (67%) create mode 100644 pmd-velocity/src/main/resources/category/velocity/categories.properties rename {pmd-vm/src/main/resources/category/vm => pmd-velocity/src/main/resources/category/velocity}/codestyle.xml (100%) rename {pmd-vm/src/main/resources/category/vm => pmd-velocity/src/main/resources/category/velocity}/design.xml (66%) rename {pmd-vm/src/main/resources/category/vm => pmd-velocity/src/main/resources/category/velocity}/documentation.xml (100%) rename {pmd-vm/src/main/resources/category/vm => pmd-velocity/src/main/resources/category/velocity}/errorprone.xml (67%) rename {pmd-vm/src/main/resources/category/vm => pmd-velocity/src/main/resources/category/velocity}/multithreading.xml (100%) rename {pmd-vm/src/main/resources/category/vm => pmd-velocity/src/main/resources/category/velocity}/performance.xml (100%) rename {pmd-vm/src/main/resources/category/vm => pmd-velocity/src/main/resources/category/velocity}/security.xml (100%) rename {pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm => pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity}/LanguageVersionTest.java (60%) rename {pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm => pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity}/RuleSetFactoryTest.java (87%) rename pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/VmParserTest.java => pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity/VtlParserTest.java (85%) create mode 100644 pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity/VtlParsingHelper.java rename pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/cpd/VmCpdLexerTest.java => pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity/cpd/VtlCpdLexerTest.java (52%) rename {pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm => pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity}/rule/bestpractices/AvoidReassigningParametersTest.java (78%) rename {pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm => pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity}/rule/bestpractices/UnusedMacroParameterTest.java (78%) rename {pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm => pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity}/rule/design/AvoidDeeplyNestedIfStmtsTest.java (80%) rename {pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm => pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity}/rule/design/CollapsibleIfStatementsTest.java (80%) rename {pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm => pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity}/rule/design/ExcessiveTemplateLengthTest.java (80%) rename {pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm => pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity}/rule/design/NoInlineJavaScriptTest.java (79%) rename {pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm => pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity}/rule/design/NoInlineStylesTest.java (79%) rename {pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm => pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity}/rule/errorprone/EmptyForeachStmtTest.java (78%) rename {pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm => pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity}/rule/errorprone/EmptyIfStmtTest.java (78%) rename {pmd-vm/src/test/resources/net/sourceforge/pmd/lang/vm => pmd-velocity/src/test/resources/net/sourceforge/pmd/lang/velocity}/cpd/testdata/sample_vm.txt (100%) rename {pmd-vm/src/test/resources/net/sourceforge/pmd/lang/vm => pmd-velocity/src/test/resources/net/sourceforge/pmd/lang/velocity}/cpd/testdata/sample_vm.vm (100%) rename {pmd-vm/src/test/resources/net/sourceforge/pmd/lang/vm => pmd-velocity/src/test/resources/net/sourceforge/pmd/lang/velocity}/rule/bestpractices/xml/AvoidReassigningParameters.xml (100%) rename {pmd-vm/src/test/resources/net/sourceforge/pmd/lang/vm => pmd-velocity/src/test/resources/net/sourceforge/pmd/lang/velocity}/rule/bestpractices/xml/UnusedMacroParameter.xml (100%) rename {pmd-vm/src/test/resources/net/sourceforge/pmd/lang/vm => pmd-velocity/src/test/resources/net/sourceforge/pmd/lang/velocity}/rule/design/xml/AvoidDeeplyNestedIfStmts.xml (100%) rename {pmd-vm/src/test/resources/net/sourceforge/pmd/lang/vm => pmd-velocity/src/test/resources/net/sourceforge/pmd/lang/velocity}/rule/design/xml/CollapsibleIfStatements.xml (100%) rename {pmd-vm/src/test/resources/net/sourceforge/pmd/lang/vm => pmd-velocity/src/test/resources/net/sourceforge/pmd/lang/velocity}/rule/design/xml/ExcessiveTemplateLength.xml (100%) rename {pmd-vm/src/test/resources/net/sourceforge/pmd/lang/vm => pmd-velocity/src/test/resources/net/sourceforge/pmd/lang/velocity}/rule/design/xml/NoInlineJavaScript.xml (100%) rename {pmd-vm/src/test/resources/net/sourceforge/pmd/lang/vm => pmd-velocity/src/test/resources/net/sourceforge/pmd/lang/velocity}/rule/design/xml/NoInlineStyles.xml (100%) rename {pmd-vm/src/test/resources/net/sourceforge/pmd/lang/vm => pmd-velocity/src/test/resources/net/sourceforge/pmd/lang/velocity}/rule/errorprone/xml/EmptyForeachStmt.xml (100%) rename {pmd-vm/src/test/resources/net/sourceforge/pmd/lang/vm => pmd-velocity/src/test/resources/net/sourceforge/pmd/lang/velocity}/rule/errorprone/xml/EmptyIfStmt.xml (100%) delete mode 100644 pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/VmHandler.java delete mode 100644 pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/VmVisitorBase.java delete mode 100644 pmd-vm/src/main/resources/META-INF/services/net.sourceforge.pmd.lang.Language delete mode 100644 pmd-vm/src/main/resources/category/vm/categories.properties delete mode 100644 pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/VmParsingHelper.java diff --git a/docs/_data/sidebars/pmd_sidebar.yml b/docs/_data/sidebars/pmd_sidebar.yml index 22741aaf1b..247c6fae94 100644 --- a/docs/_data/sidebars/pmd_sidebar.yml +++ b/docs/_data/sidebars/pmd_sidebar.yml @@ -502,7 +502,7 @@ entries: url: /pmd_languages_visualforce.html output: web, pdf - title: Velocity Template Language (VTL) - url: /pmd_languages_vm.html + url: /pmd_languages_velocity.html output: web, pdf - title: XML and XML dialects url: /pmd_languages_xml.html diff --git a/docs/_plugins/jdoc_namespace_tag.rb b/docs/_plugins/jdoc_namespace_tag.rb index 88a85e7bbb..6e697fb948 100644 --- a/docs/_plugins/jdoc_namespace_tag.rb +++ b/docs/_plugins/jdoc_namespace_tag.rb @@ -104,7 +104,7 @@ class JDocNamespaceDeclaration < Liquid::Tag 'javascript', 'jsp', 'julia', 'kotlin', 'lang-test', 'lua', 'matlab', 'objectivec', 'perl', 'php', 'plsql', 'python', 'ruby', 'scala', 'swift', 'test', 'test-schema', 'tsql', 'ui', - 'modelica', 'visualforce', 'vm', 'xml'].flat_map {|m| [m, "pmd-" + m]} + 'modelica', 'visualforce', 'velocity', 'xml'].flat_map {|m| [m, "pmd-" + m]} def self.make_base_namespaces res = {} diff --git a/docs/pages/pmd/languages/velocity.md b/docs/pages/pmd/languages/velocity.md new file mode 100644 index 0000000000..d454aaed8f --- /dev/null +++ b/docs/pages/pmd/languages/velocity.md @@ -0,0 +1,18 @@ +--- +title: Velocity Template Language (VTL) support +permalink: pmd_languages_velocity.html +last_updated: February 2024 (7.0.0) +tags: [languages, PmdCapableLanguage, CpdCapableLanguage] +summary: "VTL-specific features and guidance" +--- + +> [Velocity](https://velocity.apache.org/engine/devel/vtl-reference.html) is a Java-based template engine. +> It permits web page designers to reference methods defined in Java code. + +{% include language_info.html name='Velocity Template Language (VTL)' id='velocity' implementation='velocity::lang.velocity.VmLanguageModule' supports_pmd=true supports_cpd=true since='5.1.0' %} + +{% capture id_change_note %} +The language id of the Velocity module was in PMD 6 just "vm". In PMD 7, this has been changed to "velocity". Also the +package name of the classes has been changed from vm to "velocity". +{% endcapture %} +{% include note.html content=id_change_note %} diff --git a/docs/pages/pmd/languages/vm.md b/docs/pages/pmd/languages/vm.md deleted file mode 100644 index 11f62468d1..0000000000 --- a/docs/pages/pmd/languages/vm.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: Velocity Template Language (VTL) support -permalink: pmd_languages_vm.html -last_updated: September 2023 (7.0.0) -tags: [languages, PmdCapableLanguage, CpdCapableLanguage] -summary: "VTL-specific features and guidance" ---- - -> [Velocity](https://velocity.apache.org/engine/devel/vtl-reference.html) is a Java-based template engine. -> It permits web page designers to reference methods defined in Java code. - -{% include language_info.html name='Velocity Template Language (VTL)' id='vm' implementation='vm::lang.vm.VmLanguageModule' supports_pmd=true supports_cpd=true since='5.1.0' %} diff --git a/docs/pages/pmd/userdocs/migrating_to_pmd7.md b/docs/pages/pmd/userdocs/migrating_to_pmd7.md index 0255d60404..bbad4b0f5b 100644 --- a/docs/pages/pmd/userdocs/migrating_to_pmd7.md +++ b/docs/pages/pmd/userdocs/migrating_to_pmd7.md @@ -75,6 +75,7 @@ You might encounter additionally the following types of problems: * Some CLI options have been removed, because they have been deprecated. See [CLI Changes](#cli-changes) for details. * If you call CPD programmatically, the API has changed, see [New Programmatic API for CPD](pmd_release_notes_pmd7.html#new-programmatic-api-for-cpd). * If you use Visualforce, then you need to change "vf" to "visualforce", e.g. `category/vf/security.xml` ➡️ `category/visualforce/security.xml` +* If you use Velocity, then you need to change "vm" to "velocity", e.g. `category/vm/...` ➡️ `category/velocity/...` The following topics describe well known migration challenges in more detail. diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index f169f6bb7e..425493360e 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -136,6 +136,15 @@ is now considered stable. Experimental Kotlin support has been promoted as stable API now. +##### Changed: Velocity Template Language (VTL) + +The module was named just "vm" which was not a good name. It module and language id and +package names have been renamed to "velocity". + +If you import rules, you also need to ajdust the paths, e.g. + +* `category/vm/...` ➡️ `category/velocity/...` + #### Rule Changes **New Rules** @@ -153,6 +162,9 @@ Experimental Kotlin support has been promoted as stable API now. **Renamed Rulesets** * `category/vf/security.xml` ➡️ `category/visualforce/security.xml` +* `category/vm/bestpractices.xml` ➡️ `category/velocity/bestpractices.xml` +* `category/vm/design.xml` ➡️ `category/velocity/design.xml` +* `category/vm/errorprone.xml` ➡️ `category/velocity/errorprone.xml` **Removed Rules** @@ -371,6 +383,16 @@ in the migration guide for details. * The package `net.sourceforge.pmd.lang.vf` has been renamed to {%jdoc_package visualforce::lang.visualforce %}. * The language id of visualforce has been changed to `visualforce` (it was previously just "vf") * The ruleset changed: `category/vf/security.xml` ➡️ `category/visualforce/security.xml` +* pmd-velocity (renamed from pmd-vm) + * The package `net.sourceforge.pmd.lang.vm` has been renamed to {%jdoc_package velocity::lang.velocity %}. + * The language id of the Velocity module has been changed to `velocity` (it was previously just "vm") + * The rulesets changed: `category/vm/...` ➡️ `category/velocity/...` + * Many classes used the prefix `Vm`, e.g. `VmLanguageModule`. This has been changed to be `Vtl`: + * {%jdoc velocity::lang.velocity.VtlLanguageModule %} + * {%jdoc velocity::lang.velocity.ast.VtlNode %} + * {%jdoc velocity::lang.velocity.ast.VtlParser %} + * {%jdoc velocity::lang.velocity.cpd.VtlCpdLexer %} + * {%jdoc velocity::lang.velocity.rule.AbstractVtlRule %} **Internalized classes and interfaces and methods** @@ -716,10 +738,10 @@ The annotation `@DeprecatedUntil700` has been removed. * {%jdoc !!visualforce::lang.vf.DataType %} - method `fromBasicType(BasicType)` has been removed. Use {%jdoc visualforce::lang.vf.DataType#fromTypeName(java.lang.String) %} instead. * pmd-vm - * {%jdoc !!vm::lang.vm.ast.VmNode %} - method `jjtAccept()` has been removed. + * {%jdoc !!velocity::lang.vm.ast.VmNode %} - method `jjtAccept()` has been removed. Use {%jdoc core::lang.ast.Node#acceptVisitor(core::lang.ast.AstVisitor,P) %} instead. * `net.sourceforge.pmd.lang.vm.ast.VmParserVisitor` - Use {%jdoc vm::lang.vm.ast.VmVisitor %} or {%jdoc vm::lang.vm.ast.VmVisitorBase %} instead. + Use {%jdoc velocity::lang.vm.ast.VmVisitor %} or {%jdoc velocity::lang.vm.ast.VmVisitorBase %} instead. * `net.sourceforge.pmd.lang.vm.ast.VmParserVisitorAdapter` **Removed classes, interfaces and methods (not previously deprecated)** diff --git a/docs/pages/release_notes_pmd7.md b/docs/pages/release_notes_pmd7.md index 444cdd1232..a0ddd27183 100644 --- a/docs/pages/release_notes_pmd7.md +++ b/docs/pages/release_notes_pmd7.md @@ -1705,7 +1705,7 @@ These deprecations have already been rolled out in a previous version for the following languages: * Java: {% jdoc_package java::lang.java.ast %} * Java Server Pages: {% jdoc_package jsp::lang.jsp.ast %} -* Velocity Template Language: {% jdoc_package vm::lang.vm.ast %} +* Velocity Template Language: {% jdoc_package velocity::lang.vm.ast %} Outside of these packages, these changes also concern the following TokenManager implementations, and their corresponding Parser if it exists (in the same package): @@ -1720,7 +1720,7 @@ implementations, and their corresponding Parser if it exists (in the same packag * {% jdoc plsql::lang.plsql.PLSQLTokenManager %} * {% jdoc python::lang.python.PythonTokenManager %} * {% jdoc visualforce::lang.vf.VfTokenManager %} -* {% jdoc vm::lang.vm.VmTokenManager %} +* {% jdoc velocity::lang.vm.VmTokenManager %} In the **Java AST** the following attributes are deprecated and will issue a warning when used in XPath rules: @@ -1855,19 +1855,19 @@ The following usages are now deprecated **in the VM AST** (with other languages Those constructors will be made package private with 7.0.0. * **Subclassing of abstract node classes, or usage of their type**. The base classes are internal API and will be hidden in version 7.0.0. You should not couple your code to them. - * In the meantime you should use interfaces like {% jdoc vm::lang.vm.ast.VmNode %} or + * In the meantime you should use interfaces like {% jdoc velocity::lang.vm.ast.VmNode %} or {% jdoc core::lang.ast.Node %}, or the other published interfaces in this package, to refer to nodes generically. * Concrete node classes will **be made final** with 7.0.0. * Setters found in any node class or interface. **Rules should consider the AST immutable**. We will make those setters package private with 7.0.0. -* The package {% jdoc_package vm::lang.vm.directive %} as well as the classes - {% jdoc vm::lang.vm.util.DirectiveMapper %} and {% jdoc vm::lang.vm.util.LogUtil %} are deprecated +* The package {% jdoc_package velocity::lang.vm.directive %} as well as the classes + {% jdoc velocity::lang.vm.util.DirectiveMapper %} and {% jdoc velocity::lang.vm.util.LogUtil %} are deprecated for removal. They were only used internally during parsing. -* The class {% jdoc vm::lang.vm.VmParser %} is deprecated and should not be used directly. +* The class {% jdoc velocity::lang.vm.VmParser %} is deprecated and should not be used directly. Use {% jdoc !!core::lang.LanguageVersionHandler#getParser(ParserOptions) %} instead. -Please look at {% jdoc_package vm::lang.vm.ast %} to find out the full list of deprecations. +Please look at {% jdoc_package velocity::lang.vm.ast %} to find out the full list of deprecations. **PLSQL AST** @@ -2077,7 +2077,7 @@ of deprecations. * {% jdoc !q!jsp::lang.jsp.ast.DumpFacade %} * {% jdoc !q!plsql::lang.plsql.ast.DumpFacade %} * {% jdoc !q!visualforce::lang.vf.ast.DumpFacade %} - * {% jdoc !q!vm::lang.vm.ast.AbstractVmNode#dump(String, boolean, Writer) %} + * {% jdoc !q!velocity::lang.vm.ast.AbstractVmNode#dump(String, boolean, Writer) %} * {% jdoc !q!xml::lang.xml.ast.DumpFacade %} * The method {% jdoc !c!core::lang.LanguageVersionHandler#getDumpFacade(Writer, String, boolean) %} will be removed as well. It is deprecated, along with all its implementations in the subclasses of {% jdoc core::lang.LanguageVersionHandler %}. diff --git a/pmd-dist/src/test/java/net/sourceforge/pmd/dist/AllRulesIT.java b/pmd-dist/src/test/java/net/sourceforge/pmd/dist/AllRulesIT.java index 6e5b85b720..fbce76013c 100644 --- a/pmd-dist/src/test/java/net/sourceforge/pmd/dist/AllRulesIT.java +++ b/pmd-dist/src/test/java/net/sourceforge/pmd/dist/AllRulesIT.java @@ -18,7 +18,7 @@ class AllRulesIT extends AbstractBinaryDistributionTest { static Iterable languagesToTest() { // note: scala and wsdl have no rules return Arrays.asList("java", "apex", "html", "javascript", "jsp", "modelica", - "plsql", "pom", "visualforce", "velocitytemplate", "xml", "xsl"); + "plsql", "pom", "visualforce", "velocity", "xml", "xsl"); } @ParameterizedTest diff --git a/pmd-dist/src/test/java/net/sourceforge/pmd/dist/BinaryDistributionIT.java b/pmd-dist/src/test/java/net/sourceforge/pmd/dist/BinaryDistributionIT.java index d3119b7823..8e2f82a2cf 100644 --- a/pmd-dist/src/test/java/net/sourceforge/pmd/dist/BinaryDistributionIT.java +++ b/pmd-dist/src/test/java/net/sourceforge/pmd/dist/BinaryDistributionIT.java @@ -34,7 +34,7 @@ class BinaryDistributionIT extends AbstractBinaryDistributionTest { "julia", "kotlin", "lua", "matlab", "modelica", "objectivec", "perl", "php", "plsql", "pom", "python", "ruby", "scala", "swift", - "tsql", "typescript", "visualforce", "vm", "wsdl", "xml", "xsl" + "tsql", "typescript", "velocity", "visualforce", "wsdl", "xml", "xsl" ); private static final List SUPPORTED_LANGUAGES_PMD = listOf( @@ -61,11 +61,12 @@ class BinaryDistributionIT extends AbstractBinaryDistributionTest { "swift-4.2", "swift-5.0", "swift-5.1", "swift-5.2", "swift-5.3", "swift-5.4", "swift-5.5", "swift-5.6", "swift-5.7", "swift-5.8", "swift-5.9", + "velocity-2.0", "velocity-2.1", "velocity-2.2", "velocity-2.3", "visualforce-52", "visualforce-53", "visualforce-54", "visualforce-55", "visualforce-56", "visualforce-57", "visualforce-58", "visualforce-59", - "vm-2.0", "vm-2.1", "vm-2.2", "vm-2.3", "wsdl-1.1", - "wsdl-2.0", "xml-1.0", "xml-1.1", "xsl-1.0", "xsl-2.0", - "xsl-3.0" + "wsdl-1.1", "wsdl-2.0", + "xml-1.0", "xml-1.1", + "xsl-1.0", "xsl-2.0", "xsl-3.0" ); private final String srcDir = new File(".", "src/test/resources/sample-source/java/").getAbsolutePath(); diff --git a/pmd-dist/src/test/resources/rulesets/all-velocity.xml b/pmd-dist/src/test/resources/rulesets/all-velocity.xml new file mode 100644 index 0000000000..0c8e9a5ff1 --- /dev/null +++ b/pmd-dist/src/test/resources/rulesets/all-velocity.xml @@ -0,0 +1,18 @@ + + + + Every Velocity Template Language Rule in PMD + + + + + + + + + + + diff --git a/pmd-dist/src/test/resources/rulesets/all-velocitytemplate.xml b/pmd-dist/src/test/resources/rulesets/all-velocitytemplate.xml deleted file mode 100644 index 7918dde8b7..0000000000 --- a/pmd-dist/src/test/resources/rulesets/all-velocitytemplate.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - Every Velocity Template Language Rule in PMD - - - - - - - - - - - diff --git a/pmd-dist/src/test/resources/sample-source/velocitytemplate/helloworld.vm b/pmd-dist/src/test/resources/sample-source/velocity/helloworld.vm similarity index 100% rename from pmd-dist/src/test/resources/sample-source/velocitytemplate/helloworld.vm rename to pmd-dist/src/test/resources/sample-source/velocity/helloworld.vm diff --git a/pmd-languages-deps/pom.xml b/pmd-languages-deps/pom.xml index 617cace44a..6a6df7118b 100644 --- a/pmd-languages-deps/pom.xml +++ b/pmd-languages-deps/pom.xml @@ -154,7 +154,7 @@
net.sourceforge.pmd - pmd-vm + pmd-velocity ${project.version} diff --git a/pmd-vm/.gitignore b/pmd-velocity/.gitignore similarity index 100% rename from pmd-vm/.gitignore rename to pmd-velocity/.gitignore diff --git a/pmd-vm/etc/grammar/Vm.jjt b/pmd-velocity/etc/grammar/Vtl.jjt similarity index 99% rename from pmd-vm/etc/grammar/Vm.jjt rename to pmd-velocity/etc/grammar/Vtl.jjt index aee65bcc95..74804d4dd0 100644 --- a/pmd-vm/etc/grammar/Vm.jjt +++ b/pmd-velocity/etc/grammar/Vtl.jjt @@ -33,8 +33,8 @@ options } -PARSER_BEGIN(VmParserImpl) -package net.sourceforge.pmd.lang.vm.ast; +PARSER_BEGIN(VtlParserImpl) +package net.sourceforge.pmd.lang.velocity.ast; import java.io.IOException; import java.util.ArrayList; @@ -59,7 +59,7 @@ import net.sourceforge.pmd.lang.ast.impl.javacc.JavaccToken; * @author Henning P. Schmiedehausen * @version $Id$ */ -public class VmParserImpl +public class VtlParserImpl { private void throwParseException(String message) { throw new ParseException(message).withLocation(token); @@ -109,7 +109,7 @@ public class VmParserImpl } } -PARSER_END(VmParserImpl) +PARSER_END(VtlParserImpl) TOKEN_MGR_DECLS: { @@ -1101,7 +1101,7 @@ void DirectiveArg() #void : {} * Supports the Pluggable Directives * #foo( arg+ ) */ -VmNode Directive() : +VtlNode Directive() : { JavaccToken t = null; int argPos = 0; @@ -1117,7 +1117,7 @@ VmNode Directive() : ((t = ) | (t = )) { String directiveName; - if (t.kind == VmTokenKinds.BRACKETED_WORD) + if (t.kind == VtlTokenKinds.BRACKETED_WORD) { directiveName = t.getImage().substring(2, t.getImage().length() - 1); } diff --git a/pmd-vm/pmd-vm-checkstyle-suppressions.xml b/pmd-velocity/pmd-velocity-checkstyle-suppressions.xml similarity index 100% rename from pmd-vm/pmd-vm-checkstyle-suppressions.xml rename to pmd-velocity/pmd-velocity-checkstyle-suppressions.xml diff --git a/pmd-vm/pom.xml b/pmd-velocity/pom.xml similarity index 94% rename from pmd-vm/pom.xml rename to pmd-velocity/pom.xml index 493832e65d..fbc05bd757 100644 --- a/pmd-vm/pom.xml +++ b/pmd-velocity/pom.xml @@ -1,8 +1,8 @@ 4.0.0 - pmd-vm - PMD Velocity + pmd-velocity + PMD Velocity Template Language (VTL) net.sourceforge.pmd @@ -44,8 +44,8 @@ - - + + @@ -75,7 +75,7 @@ org.apache.maven.plugins maven-checkstyle-plugin - pmd-vm-checkstyle-suppressions.xml + pmd-velocity-checkstyle-suppressions.xml diff --git a/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/VtlHandler.java b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/VtlHandler.java new file mode 100644 index 0000000000..3dd78109c9 --- /dev/null +++ b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/VtlHandler.java @@ -0,0 +1,18 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +package net.sourceforge.pmd.lang.velocity; + +import net.sourceforge.pmd.lang.AbstractPmdLanguageVersionHandler; +import net.sourceforge.pmd.lang.ast.Parser; +import net.sourceforge.pmd.lang.velocity.ast.VtlParser; + +public class VtlHandler extends AbstractPmdLanguageVersionHandler { + + @Override + public Parser getParser() { + return new VtlParser(); + } + +} diff --git a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/VmLanguageModule.java b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/VtlLanguageModule.java similarity index 65% rename from pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/VmLanguageModule.java rename to pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/VtlLanguageModule.java index 7f1ddd8544..81f06392df 100644 --- a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/VmLanguageModule.java +++ b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/VtlLanguageModule.java @@ -2,37 +2,37 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vm; +package net.sourceforge.pmd.lang.velocity; import net.sourceforge.pmd.cpd.CpdLexer; import net.sourceforge.pmd.lang.LanguagePropertyBundle; import net.sourceforge.pmd.lang.LanguageRegistry; import net.sourceforge.pmd.lang.impl.SimpleLanguageModuleBase; -import net.sourceforge.pmd.lang.vm.cpd.VmCpdLexer; +import net.sourceforge.pmd.lang.velocity.cpd.VtlCpdLexer; /** * Created by christoferdutz on 20.09.14. */ -public class VmLanguageModule extends SimpleLanguageModuleBase { - static final String ID = "vm"; +public class VtlLanguageModule extends SimpleLanguageModuleBase { + static final String ID = "velocity"; static final String NAME = "Velocity Template Language (VTL)"; - public VmLanguageModule() { + public VtlLanguageModule() { super(LanguageMetadata.withId(ID).name(NAME) .extensions("vm") .addVersion("2.0") .addVersion("2.1") .addVersion("2.2") .addDefaultVersion("2.3"), - new VmHandler()); + new VtlHandler()); } - public static VmLanguageModule getInstance() { - return (VmLanguageModule) LanguageRegistry.PMD.getLanguageById(ID); + public static VtlLanguageModule getInstance() { + return (VtlLanguageModule) LanguageRegistry.PMD.getLanguageById(ID); } @Override public CpdLexer createCpdLexer(LanguagePropertyBundle bundle) { - return new VmCpdLexer(); + return new VtlCpdLexer(); } } diff --git a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/ASTAddNode.java b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/ASTAddNode.java similarity index 91% rename from pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/ASTAddNode.java rename to pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/ASTAddNode.java index 95b1e6d156..ce9bee041a 100644 --- a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/ASTAddNode.java +++ b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/ASTAddNode.java @@ -1,5 +1,5 @@ -package net.sourceforge.pmd.lang.vm.ast; +package net.sourceforge.pmd.lang.velocity.ast; /* * Licensed to the Apache Software Foundation (ASF) under one @@ -39,7 +39,7 @@ public final class ASTAddNode extends ASTMathNode { @Override - protected R acceptVmVisitor(VmVisitor visitor, P data) { + protected R acceptVtlVisitor(VtlVisitor visitor, P data) { return visitor.visit(this, data); } } diff --git a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/ASTBlock.java b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/ASTBlock.java similarity index 70% rename from pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/ASTBlock.java rename to pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/ASTBlock.java index 0294f55153..5279d6671c 100644 --- a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/ASTBlock.java +++ b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/ASTBlock.java @@ -2,11 +2,11 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vm.ast; +package net.sourceforge.pmd.lang.velocity.ast; import org.apache.commons.lang3.StringUtils; -public final class ASTBlock extends AbstractVmNode { +public final class ASTBlock extends AbstractVtlNode { ASTBlock(int id) { super(id); @@ -14,7 +14,7 @@ public final class ASTBlock extends AbstractVmNode { @Override - protected R acceptVmVisitor(VmVisitor visitor, P data) { + protected R acceptVtlVisitor(VtlVisitor visitor, P data) { return visitor.visit(this, data); } diff --git a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/ASTDirective.java b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/ASTDirective.java similarity index 94% rename from pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/ASTDirective.java rename to pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/ASTDirective.java index eedab86303..bb1ca820b3 100644 --- a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/ASTDirective.java +++ b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/ASTDirective.java @@ -1,5 +1,5 @@ -package net.sourceforge.pmd.lang.vm.ast; +package net.sourceforge.pmd.lang.velocity.ast; import java.util.Collections; import java.util.HashSet; @@ -37,7 +37,7 @@ import java.util.Set; * @author Kasper Nielsen * @version $Id: ASTDirective.java 724825 2008-12-09 18:56:06Z nbubna $ */ -public final class ASTDirective extends AbstractVmNode { +public final class ASTDirective extends AbstractVtlNode { private static final Set DIRECTIVE_NAMES; private static final Set BLOCK_DIRECTIVES; @@ -73,7 +73,7 @@ public final class ASTDirective extends AbstractVmNode { } @Override - protected R acceptVmVisitor(VmVisitor visitor, P data) { + protected R acceptVtlVisitor(VtlVisitor visitor, P data) { return visitor.visit(this, data); } diff --git a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/ASTDivNode.java b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/ASTDivNode.java similarity index 91% rename from pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/ASTDivNode.java rename to pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/ASTDivNode.java index c0bc618f79..f6a1b0d4f1 100644 --- a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/ASTDivNode.java +++ b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/ASTDivNode.java @@ -1,5 +1,5 @@ -package net.sourceforge.pmd.lang.vm.ast; +package net.sourceforge.pmd.lang.velocity.ast; /* * Licensed to the Apache Software Foundation (ASF) under one @@ -40,7 +40,7 @@ public final class ASTDivNode extends ASTMathNode { @Override - protected R acceptVmVisitor(VmVisitor visitor, P data) { + protected R acceptVtlVisitor(VtlVisitor visitor, P data) { return visitor.visit(this, data); } } diff --git a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/ASTEscape.java b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/ASTEscape.java similarity index 87% rename from pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/ASTEscape.java rename to pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/ASTEscape.java index 37101a3690..bf141b1eaf 100644 --- a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/ASTEscape.java +++ b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/ASTEscape.java @@ -1,5 +1,5 @@ -package net.sourceforge.pmd.lang.vm.ast; +package net.sourceforge.pmd.lang.velocity.ast; /* * Licensed to the Apache Software Foundation (ASF) under one @@ -29,7 +29,7 @@ package net.sourceforge.pmd.lang.vm.ast; * @author Geir Magnusson Jr. * @version $Id: ASTEscape.java 517553 2007-03-13 06:09:58Z wglass $ */ -public final class ASTEscape extends AbstractVmNode { +public final class ASTEscape extends AbstractVtlNode { /** Used by the parser. */ private String val; @@ -48,7 +48,7 @@ public final class ASTEscape extends AbstractVmNode { } @Override - protected R acceptVmVisitor(VmVisitor visitor, P data) { + protected R acceptVtlVisitor(VtlVisitor visitor, P data) { return visitor.visit(this, data); } diff --git a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/ASTMathNode.java b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/ASTMathNode.java similarity index 93% rename from pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/ASTMathNode.java rename to pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/ASTMathNode.java index d8a29b52f7..f219a397c5 100644 --- a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/ASTMathNode.java +++ b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/ASTMathNode.java @@ -1,4 +1,4 @@ -package net.sourceforge.pmd.lang.vm.ast; +package net.sourceforge.pmd.lang.velocity.ast; /* * Licensed to the Apache Software Foundation (ASF) under one @@ -32,7 +32,7 @@ package net.sourceforge.pmd.lang.vm.ast; * @author Nathan Bubna * @version $Id: ASTMathNode.java 517553 2007-03-13 06:09:58Z wglass $ */ -abstract class ASTMathNode extends AbstractVmNode { +abstract class ASTMathNode extends AbstractVtlNode { ASTMathNode(int id) { super(id); diff --git a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/ASTMethod.java b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/ASTMethod.java similarity index 88% rename from pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/ASTMethod.java rename to pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/ASTMethod.java index 217081e8ac..13d7935c55 100644 --- a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/ASTMethod.java +++ b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/ASTMethod.java @@ -1,5 +1,5 @@ -package net.sourceforge.pmd.lang.vm.ast; +package net.sourceforge.pmd.lang.velocity.ast; /* * Licensed to the Apache Software Foundation (ASF) under one @@ -35,14 +35,14 @@ package net.sourceforge.pmd.lang.vm.ast; * @author Geir Magnusson Jr. * @version $Id: ASTMethod.java 720228 2008-11-24 16:58:33Z nbubna $ */ -public final class ASTMethod extends AbstractVmNode { +public final class ASTMethod extends AbstractVtlNode { ASTMethod(int id) { super(id); } @Override - protected R acceptVmVisitor(VmVisitor visitor, P data) { + protected R acceptVtlVisitor(VtlVisitor visitor, P data) { return visitor.visit(this, data); } diff --git a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/ASTModNode.java b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/ASTModNode.java similarity index 90% rename from pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/ASTModNode.java rename to pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/ASTModNode.java index 24cb9b0555..af8ac7c625 100644 --- a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/ASTModNode.java +++ b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/ASTModNode.java @@ -1,5 +1,5 @@ -package net.sourceforge.pmd.lang.vm.ast; +package net.sourceforge.pmd.lang.velocity.ast; /* * Licensed to the Apache Software Foundation (ASF) under one @@ -39,7 +39,7 @@ public final class ASTModNode extends ASTMathNode { @Override - protected R acceptVmVisitor(VmVisitor visitor, P data) { + protected R acceptVtlVisitor(VtlVisitor visitor, P data) { return visitor.visit(this, data); } } diff --git a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/ASTMulNode.java b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/ASTMulNode.java similarity index 91% rename from pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/ASTMulNode.java rename to pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/ASTMulNode.java index 780950c3f5..f36f6fc534 100644 --- a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/ASTMulNode.java +++ b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/ASTMulNode.java @@ -1,5 +1,5 @@ -package net.sourceforge.pmd.lang.vm.ast; +package net.sourceforge.pmd.lang.velocity.ast; /* * Licensed to the Apache Software Foundation (ASF) under one @@ -40,7 +40,7 @@ public final class ASTMulNode extends ASTMathNode { @Override - protected R acceptVmVisitor(VmVisitor visitor, P data) { + protected R acceptVtlVisitor(VtlVisitor visitor, P data) { return visitor.visit(this, data); } } diff --git a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/ASTReference.java b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/ASTReference.java similarity index 93% rename from pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/ASTReference.java rename to pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/ASTReference.java index 5d208ad78d..5d0dbad3fd 100644 --- a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/ASTReference.java +++ b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/ASTReference.java @@ -1,5 +1,5 @@ -package net.sourceforge.pmd.lang.vm.ast; +package net.sourceforge.pmd.lang.velocity.ast; /* * Licensed to the Apache Software Foundation (ASF) under one @@ -32,7 +32,7 @@ package net.sourceforge.pmd.lang.vm.ast; * @author Kent Johnson * @version $Id: ASTReference.java 806597 2009-08-21 15:21:44Z nbubna $ */ -public final class ASTReference extends AbstractVmNode { +public final class ASTReference extends AbstractVtlNode { private String rootString; private String literal = null; @@ -42,7 +42,7 @@ public final class ASTReference extends AbstractVmNode { } @Override - protected R acceptVmVisitor(VmVisitor visitor, P data) { + protected R acceptVtlVisitor(VtlVisitor visitor, P data) { return visitor.visit(this, data); } diff --git a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/ASTStringLiteral.java b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/ASTStringLiteral.java similarity index 87% rename from pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/ASTStringLiteral.java rename to pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/ASTStringLiteral.java index 51daa8bab7..8f6ac41fb0 100644 --- a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/ASTStringLiteral.java +++ b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/ASTStringLiteral.java @@ -1,5 +1,5 @@ -package net.sourceforge.pmd.lang.vm.ast; +package net.sourceforge.pmd.lang.velocity.ast; /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -25,14 +25,14 @@ package net.sourceforge.pmd.lang.vm.ast; * @author Jason van Zyl * @version $Id: ASTStringLiteral.java 705297 2008-10-16 17:59:24Z nbubna $ */ -public final class ASTStringLiteral extends AbstractVmNode { +public final class ASTStringLiteral extends AbstractVtlNode { ASTStringLiteral(int id) { super(id); } @Override - protected R acceptVmVisitor(VmVisitor visitor, P data) { + protected R acceptVtlVisitor(VtlVisitor visitor, P data) { return visitor.visit(this, data); } diff --git a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/ASTSubtractNode.java b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/ASTSubtractNode.java similarity index 91% rename from pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/ASTSubtractNode.java rename to pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/ASTSubtractNode.java index bfa9791e1b..d9490bd2c2 100644 --- a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/ASTSubtractNode.java +++ b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/ASTSubtractNode.java @@ -1,5 +1,5 @@ -package net.sourceforge.pmd.lang.vm.ast; +package net.sourceforge.pmd.lang.velocity.ast; /* * Licensed to the Apache Software Foundation (ASF) under one @@ -41,7 +41,7 @@ public final class ASTSubtractNode extends ASTMathNode { @Override - protected R acceptVmVisitor(VmVisitor visitor, P data) { + protected R acceptVtlVisitor(VtlVisitor visitor, P data) { return visitor.visit(this, data); } } diff --git a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/ASTTemplate.java b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/ASTTemplate.java similarity index 74% rename from pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/ASTTemplate.java rename to pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/ASTTemplate.java index d2a544b3dd..283bc7c01c 100644 --- a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/ASTTemplate.java +++ b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/ASTTemplate.java @@ -2,13 +2,13 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vm.ast; +package net.sourceforge.pmd.lang.velocity.ast; import net.sourceforge.pmd.lang.ast.AstInfo; import net.sourceforge.pmd.lang.ast.Parser.ParserTask; import net.sourceforge.pmd.lang.ast.RootNode; -public final class ASTTemplate extends AbstractVmNode implements RootNode { +public final class ASTTemplate extends AbstractVtlNode implements RootNode { private AstInfo astInfo; @@ -28,7 +28,7 @@ public final class ASTTemplate extends AbstractVmNode implements RootNode { @Override - protected R acceptVmVisitor(VmVisitor visitor, P data) { + protected R acceptVtlVisitor(VtlVisitor visitor, P data) { return visitor.visit(this, data); } } diff --git a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/AbstractVmNode.java b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/AbstractVtlNode.java similarity index 79% rename from pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/AbstractVmNode.java rename to pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/AbstractVtlNode.java index 82e4c70be6..b2221fa6fc 100644 --- a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/AbstractVmNode.java +++ b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/AbstractVtlNode.java @@ -1,5 +1,5 @@ -package net.sourceforge.pmd.lang.vm.ast; +package net.sourceforge.pmd.lang.velocity.ast; /* * Licensed to the Apache Software Foundation (ASF) under one @@ -24,26 +24,26 @@ import net.sourceforge.pmd.lang.ast.AstVisitor; import net.sourceforge.pmd.lang.ast.impl.javacc.AbstractJjtreeNode; import net.sourceforge.pmd.lang.ast.impl.javacc.JavaccToken; -abstract class AbstractVmNode extends AbstractJjtreeNode implements VmNode { +abstract class AbstractVtlNode extends AbstractJjtreeNode implements VtlNode { - protected AbstractVmNode(final int i) { + protected AbstractVtlNode(final int i) { super(i); } @Override public String getXPathNodeName() { - return VmParserImplTreeConstants.jjtNodeName[id]; + return VtlParserImplTreeConstants.jjtNodeName[id]; } - protected abstract R acceptVmVisitor(VmVisitor visitor, P data); + protected abstract R acceptVtlVisitor(VtlVisitor visitor, P data); @Override @SuppressWarnings("unchecked") public final R acceptVisitor(AstVisitor visitor, P data) { - if (visitor instanceof VmVisitor) { - return acceptVmVisitor((VmVisitor) visitor, data); + if (visitor instanceof VtlVisitor) { + return acceptVtlVisitor((VtlVisitor) visitor, data); } return visitor.cannotVisit(this, data); } diff --git a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/NodeUtils.java b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/NodeUtils.java similarity index 97% rename from pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/NodeUtils.java rename to pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/NodeUtils.java index 913f7d23d5..3ea6ea0205 100644 --- a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/NodeUtils.java +++ b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/NodeUtils.java @@ -1,5 +1,5 @@ -package net.sourceforge.pmd.lang.vm.ast; +package net.sourceforge.pmd.lang.velocity.ast; import net.sourceforge.pmd.lang.ast.impl.javacc.JavaccToken; @@ -117,7 +117,7 @@ final class NodeUtils { */ static String tokenLiteral(final JavaccToken t) { // Look at kind of token and return "" when it's a multiline comment - if (t.kind == VmTokenKinds.MULTI_LINE_COMMENT) { + if (t.kind == VtlTokenKinds.MULTI_LINE_COMMENT) { return ""; } else if (t.getPreviousComment() == null || t.getPreviousComment().getImage().startsWith("##")) { return t.getImage(); diff --git a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/VmNode.java b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/VtlNode.java similarity index 59% rename from pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/VmNode.java rename to pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/VtlNode.java index 8d93fc91df..2e0ea70907 100644 --- a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/VmNode.java +++ b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/VtlNode.java @@ -2,9 +2,9 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vm.ast; +package net.sourceforge.pmd.lang.velocity.ast; import net.sourceforge.pmd.lang.ast.impl.javacc.JjtreeNode; -public interface VmNode extends JjtreeNode { +public interface VtlNode extends JjtreeNode { } diff --git a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/VmParser.java b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/VtlParser.java similarity index 81% rename from pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/VmParser.java rename to pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/VtlParser.java index 2c7491b21e..8a4227da00 100644 --- a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/VmParser.java +++ b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/VtlParser.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vm.ast; +package net.sourceforge.pmd.lang.velocity.ast; import org.checkerframework.checker.nullness.qual.Nullable; @@ -14,16 +14,16 @@ import net.sourceforge.pmd.lang.ast.impl.javacc.JavaccTokenDocument.TokenDocumen import net.sourceforge.pmd.lang.ast.impl.javacc.JjtreeParserAdapter; /** - * Adapter for the VmParser. + * Adapter for the VtlParser. */ -public class VmParser extends JjtreeParserAdapter { +public class VtlParser extends JjtreeParserAdapter { - private static final TokenDocumentBehavior TOKEN_BEHAVIOR = new TokenDocumentBehavior(VmTokenKinds.TOKEN_NAMES) { + private static final TokenDocumentBehavior TOKEN_BEHAVIOR = new TokenDocumentBehavior(VtlTokenKinds.TOKEN_NAMES) { @Override public JavaccToken createToken(JavaccTokenDocument self, int kind, CharStream cs, @Nullable String image) { String realImage = image == null ? cs.getTokenImage() : image; - if (kind == VmTokenKinds.ESCAPE_DIRECTIVE) { + if (kind == VtlTokenKinds.ESCAPE_DIRECTIVE) { realImage = escapedDirective(realImage); } @@ -44,7 +44,7 @@ public class VmParser extends JjtreeParserAdapter { @Override protected ASTTemplate parseImpl(CharStream cs, ParserTask task) throws ParseException { - return new VmParserImpl(cs).Template().makeTaskInfo(task); + return new VtlParserImpl(cs).Template().makeTaskInfo(task); } diff --git a/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/VtlVisitorBase.java b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/VtlVisitorBase.java new file mode 100644 index 0000000000..ac9987b1aa --- /dev/null +++ b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/ast/VtlVisitorBase.java @@ -0,0 +1,12 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +package net.sourceforge.pmd.lang.velocity.ast; + + +import net.sourceforge.pmd.lang.ast.AstVisitorBase; + +public abstract class VtlVisitorBase extends AstVisitorBase implements VtlVisitor { + +} diff --git a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/cpd/VmCpdLexer.java b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/cpd/VtlCpdLexer.java similarity index 71% rename from pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/cpd/VmCpdLexer.java rename to pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/cpd/VtlCpdLexer.java index 9a2b0a78ba..4d7ad4fa95 100644 --- a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/cpd/VmCpdLexer.java +++ b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/cpd/VtlCpdLexer.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vm.cpd; +package net.sourceforge.pmd.lang.velocity.cpd; import java.io.IOException; @@ -11,14 +11,14 @@ import net.sourceforge.pmd.lang.TokenManager; import net.sourceforge.pmd.lang.ast.impl.javacc.CharStream; import net.sourceforge.pmd.lang.ast.impl.javacc.JavaccToken; import net.sourceforge.pmd.lang.document.TextDocument; -import net.sourceforge.pmd.lang.vm.ast.VmTokenKinds; +import net.sourceforge.pmd.lang.velocity.ast.VtlTokenKinds; /** *

Note: This class has been called VmTokenizer in PMD 6

. */ -public class VmCpdLexer extends JavaccCpdLexer { +public class VtlCpdLexer extends JavaccCpdLexer { @Override protected TokenManager makeLexerImpl(TextDocument doc) throws IOException { - return VmTokenKinds.newTokenManager(CharStream.create(doc)); + return VtlTokenKinds.newTokenManager(CharStream.create(doc)); } } diff --git a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/rule/AbstractVmRule.java b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/rule/AbstractVtlRule.java similarity index 71% rename from pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/rule/AbstractVmRule.java rename to pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/rule/AbstractVtlRule.java index 704cb31534..c89007c5f5 100644 --- a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/rule/AbstractVmRule.java +++ b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/rule/AbstractVtlRule.java @@ -2,14 +2,14 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vm.rule; +package net.sourceforge.pmd.lang.velocity.rule; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.rule.AbstractRule; -import net.sourceforge.pmd.lang.vm.ast.VmVisitor; +import net.sourceforge.pmd.lang.velocity.ast.VtlVisitor; import net.sourceforge.pmd.reporting.RuleContext; -public abstract class AbstractVmRule extends AbstractRule implements VmVisitor { +public abstract class AbstractVtlRule extends AbstractRule implements VtlVisitor { @Override public void apply(Node target, RuleContext ctx) { diff --git a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/rule/bestpractices/AvoidReassigningParametersRule.java b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/rule/bestpractices/AvoidReassigningParametersRule.java similarity index 71% rename from pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/rule/bestpractices/AvoidReassigningParametersRule.java rename to pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/rule/bestpractices/AvoidReassigningParametersRule.java index 1b6a716db7..633871807b 100644 --- a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/rule/bestpractices/AvoidReassigningParametersRule.java +++ b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/rule/bestpractices/AvoidReassigningParametersRule.java @@ -2,17 +2,17 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vm.rule.bestpractices; +package net.sourceforge.pmd.lang.velocity.rule.bestpractices; import java.util.HashSet; import java.util.Set; -import net.sourceforge.pmd.lang.vm.ast.ASTDirective; -import net.sourceforge.pmd.lang.vm.ast.ASTReference; -import net.sourceforge.pmd.lang.vm.ast.ASTSetDirective; -import net.sourceforge.pmd.lang.vm.rule.AbstractVmRule; +import net.sourceforge.pmd.lang.velocity.ast.ASTDirective; +import net.sourceforge.pmd.lang.velocity.ast.ASTReference; +import net.sourceforge.pmd.lang.velocity.ast.ASTSetDirective; +import net.sourceforge.pmd.lang.velocity.rule.AbstractVtlRule; -public class AvoidReassigningParametersRule extends AbstractVmRule { +public class AvoidReassigningParametersRule extends AbstractVtlRule { @Override public Object visit(final ASTDirective node, final Object data) { diff --git a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/rule/bestpractices/UnusedMacroParameterRule.java b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/rule/bestpractices/UnusedMacroParameterRule.java similarity index 83% rename from pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/rule/bestpractices/UnusedMacroParameterRule.java rename to pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/rule/bestpractices/UnusedMacroParameterRule.java index 6e6cf6d5df..520c7e72d5 100644 --- a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/rule/bestpractices/UnusedMacroParameterRule.java +++ b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/rule/bestpractices/UnusedMacroParameterRule.java @@ -2,18 +2,18 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vm.rule.bestpractices; +package net.sourceforge.pmd.lang.velocity.rule.bestpractices; import java.util.HashSet; import java.util.Set; -import net.sourceforge.pmd.lang.vm.ast.ASTBlock; -import net.sourceforge.pmd.lang.vm.ast.ASTDirective; -import net.sourceforge.pmd.lang.vm.ast.ASTReference; -import net.sourceforge.pmd.lang.vm.ast.ASTStringLiteral; -import net.sourceforge.pmd.lang.vm.rule.AbstractVmRule; +import net.sourceforge.pmd.lang.velocity.ast.ASTBlock; +import net.sourceforge.pmd.lang.velocity.ast.ASTDirective; +import net.sourceforge.pmd.lang.velocity.ast.ASTReference; +import net.sourceforge.pmd.lang.velocity.ast.ASTStringLiteral; +import net.sourceforge.pmd.lang.velocity.rule.AbstractVtlRule; -public class UnusedMacroParameterRule extends AbstractVmRule { +public class UnusedMacroParameterRule extends AbstractVtlRule { @Override public Object visit(final ASTDirective node, final Object data) { diff --git a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/rule/design/AvoidDeeplyNestedIfStmtsRule.java b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/rule/design/AvoidDeeplyNestedIfStmtsRule.java similarity index 71% rename from pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/rule/design/AvoidDeeplyNestedIfStmtsRule.java rename to pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/rule/design/AvoidDeeplyNestedIfStmtsRule.java index a5053b0918..ec1b0323e9 100644 --- a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/rule/design/AvoidDeeplyNestedIfStmtsRule.java +++ b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/rule/design/AvoidDeeplyNestedIfStmtsRule.java @@ -2,20 +2,20 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vm.rule.design; +package net.sourceforge.pmd.lang.velocity.rule.design; import static net.sourceforge.pmd.properties.NumericConstraints.positive; -import net.sourceforge.pmd.lang.vm.ast.ASTElseIfStatement; -import net.sourceforge.pmd.lang.vm.ast.ASTIfStatement; -import net.sourceforge.pmd.lang.vm.ast.ASTTemplate; -import net.sourceforge.pmd.lang.vm.ast.VmNode; -import net.sourceforge.pmd.lang.vm.rule.AbstractVmRule; +import net.sourceforge.pmd.lang.velocity.ast.ASTElseIfStatement; +import net.sourceforge.pmd.lang.velocity.ast.ASTIfStatement; +import net.sourceforge.pmd.lang.velocity.ast.ASTTemplate; +import net.sourceforge.pmd.lang.velocity.ast.VtlNode; +import net.sourceforge.pmd.lang.velocity.rule.AbstractVtlRule; import net.sourceforge.pmd.properties.PropertyDescriptor; import net.sourceforge.pmd.properties.PropertyFactory; -public class AvoidDeeplyNestedIfStmtsRule extends AbstractVmRule { +public class AvoidDeeplyNestedIfStmtsRule extends AbstractVtlRule { private int depth; private int depthLimit; @@ -46,9 +46,9 @@ public class AvoidDeeplyNestedIfStmtsRule extends AbstractVmRule { return handleIf(node, data); } - private Object handleIf(VmNode node, Object data) { + private Object handleIf(VtlNode node, Object data) { depth++; - super.visitVmNode(node, data); + super.visitVtlNode(node, data); if (depth == depthLimit) { asCtx(data).addViolation(node); } diff --git a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/rule/design/CollapsibleIfStatementsRule.java b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/rule/design/CollapsibleIfStatementsRule.java similarity index 80% rename from pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/rule/design/CollapsibleIfStatementsRule.java rename to pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/rule/design/CollapsibleIfStatementsRule.java index e94804e2a7..3963b9b40c 100644 --- a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/rule/design/CollapsibleIfStatementsRule.java +++ b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/rule/design/CollapsibleIfStatementsRule.java @@ -2,20 +2,20 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vm.rule.design; +package net.sourceforge.pmd.lang.velocity.rule.design; import org.apache.commons.lang3.StringUtils; import net.sourceforge.pmd.lang.ast.Node; -import net.sourceforge.pmd.lang.vm.ast.ASTBlock; -import net.sourceforge.pmd.lang.vm.ast.ASTElseIfStatement; -import net.sourceforge.pmd.lang.vm.ast.ASTElseStatement; -import net.sourceforge.pmd.lang.vm.ast.ASTIfStatement; -import net.sourceforge.pmd.lang.vm.ast.ASTText; -import net.sourceforge.pmd.lang.vm.ast.VmNode; -import net.sourceforge.pmd.lang.vm.rule.AbstractVmRule; +import net.sourceforge.pmd.lang.velocity.ast.ASTBlock; +import net.sourceforge.pmd.lang.velocity.ast.ASTElseIfStatement; +import net.sourceforge.pmd.lang.velocity.ast.ASTElseStatement; +import net.sourceforge.pmd.lang.velocity.ast.ASTIfStatement; +import net.sourceforge.pmd.lang.velocity.ast.ASTText; +import net.sourceforge.pmd.lang.velocity.ast.VtlNode; +import net.sourceforge.pmd.lang.velocity.rule.AbstractVtlRule; -public class CollapsibleIfStatementsRule extends AbstractVmRule { +public class CollapsibleIfStatementsRule extends AbstractVtlRule { @Override public Object visit(final ASTIfStatement node, final Object data) { @@ -32,7 +32,7 @@ public class CollapsibleIfStatementsRule extends AbstractVmRule { return super.visit(node, data); } - private void handleIfElseIf(final VmNode node, final Object data) { + private void handleIfElseIf(final VtlNode node, final Object data) { if (node.firstChild(ASTElseStatement.class) == null && node.firstChild(ASTElseIfStatement.class) == null) { final ASTBlock ifBlock = node.firstChild(ASTBlock.class); diff --git a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/rule/design/ExcessiveTemplateLengthRule.java b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/rule/design/ExcessiveTemplateLengthRule.java similarity index 83% rename from pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/rule/design/ExcessiveTemplateLengthRule.java rename to pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/rule/design/ExcessiveTemplateLengthRule.java index 99e933d807..f25220f700 100644 --- a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/rule/design/ExcessiveTemplateLengthRule.java +++ b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/rule/design/ExcessiveTemplateLengthRule.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vm.rule.design; +package net.sourceforge.pmd.lang.velocity.rule.design; import static net.sourceforge.pmd.properties.NumericConstraints.positive; @@ -10,11 +10,11 @@ import org.checkerframework.checker.nullness.qual.NonNull; import net.sourceforge.pmd.lang.rule.RuleTargetSelector; import net.sourceforge.pmd.lang.rule.internal.CommonPropertyDescriptors; -import net.sourceforge.pmd.lang.vm.ast.ASTTemplate; -import net.sourceforge.pmd.lang.vm.rule.AbstractVmRule; +import net.sourceforge.pmd.lang.velocity.ast.ASTTemplate; +import net.sourceforge.pmd.lang.velocity.rule.AbstractVtlRule; import net.sourceforge.pmd.properties.PropertyDescriptor; -public class ExcessiveTemplateLengthRule extends AbstractVmRule { +public class ExcessiveTemplateLengthRule extends AbstractVtlRule { private static final PropertyDescriptor REPORT_LEVEL = CommonPropertyDescriptors.reportLevelProperty() diff --git a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/rule/design/NoInlineJavaScriptRule.java b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/rule/design/NoInlineJavaScriptRule.java similarity index 77% rename from pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/rule/design/NoInlineJavaScriptRule.java rename to pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/rule/design/NoInlineJavaScriptRule.java index c4ecbc78bd..af4956e079 100644 --- a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/rule/design/NoInlineJavaScriptRule.java +++ b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/rule/design/NoInlineJavaScriptRule.java @@ -2,15 +2,15 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vm.rule.design; +package net.sourceforge.pmd.lang.velocity.rule.design; import java.util.regex.Matcher; import java.util.regex.Pattern; -import net.sourceforge.pmd.lang.vm.ast.ASTText; -import net.sourceforge.pmd.lang.vm.rule.AbstractVmRule; +import net.sourceforge.pmd.lang.velocity.ast.ASTText; +import net.sourceforge.pmd.lang.velocity.rule.AbstractVtlRule; -public class NoInlineJavaScriptRule extends AbstractVmRule { +public class NoInlineJavaScriptRule extends AbstractVtlRule { private static final Pattern SCRIPT_PATTERN = Pattern.compile("]*>", Pattern.CASE_INSENSITIVE); private static final Pattern SRC_PATTERN = Pattern.compile("\\ssrc\\s*=", Pattern.CASE_INSENSITIVE); diff --git a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/rule/errorprone/EmptyForeachStmtRule.java b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/rule/errorprone/EmptyForeachStmtRule.java similarity index 53% rename from pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/rule/errorprone/EmptyForeachStmtRule.java rename to pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/rule/errorprone/EmptyForeachStmtRule.java index b08d9d3b18..52c24b3ef6 100644 --- a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/rule/errorprone/EmptyForeachStmtRule.java +++ b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/rule/errorprone/EmptyForeachStmtRule.java @@ -2,13 +2,13 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vm.rule.errorprone; +package net.sourceforge.pmd.lang.velocity.rule.errorprone; -import net.sourceforge.pmd.lang.vm.ast.ASTBlock; -import net.sourceforge.pmd.lang.vm.ast.ASTForeachStatement; -import net.sourceforge.pmd.lang.vm.rule.AbstractVmRule; +import net.sourceforge.pmd.lang.velocity.ast.ASTBlock; +import net.sourceforge.pmd.lang.velocity.ast.ASTForeachStatement; +import net.sourceforge.pmd.lang.velocity.rule.AbstractVtlRule; -public class EmptyForeachStmtRule extends AbstractVmRule { +public class EmptyForeachStmtRule extends AbstractVtlRule { @Override public Object visit(final ASTForeachStatement node, final Object data) { diff --git a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/rule/errorprone/EmptyIfStmtRule.java b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/rule/errorprone/EmptyIfStmtRule.java similarity index 56% rename from pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/rule/errorprone/EmptyIfStmtRule.java rename to pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/rule/errorprone/EmptyIfStmtRule.java index 8b314b3590..54860d4ff7 100644 --- a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/rule/errorprone/EmptyIfStmtRule.java +++ b/pmd-velocity/src/main/java/net/sourceforge/pmd/lang/velocity/rule/errorprone/EmptyIfStmtRule.java @@ -2,16 +2,16 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vm.rule.errorprone; +package net.sourceforge.pmd.lang.velocity.rule.errorprone; -import net.sourceforge.pmd.lang.vm.ast.ASTBlock; -import net.sourceforge.pmd.lang.vm.ast.ASTElseIfStatement; -import net.sourceforge.pmd.lang.vm.ast.ASTElseStatement; -import net.sourceforge.pmd.lang.vm.ast.ASTIfStatement; -import net.sourceforge.pmd.lang.vm.ast.VmNode; -import net.sourceforge.pmd.lang.vm.rule.AbstractVmRule; +import net.sourceforge.pmd.lang.velocity.ast.ASTBlock; +import net.sourceforge.pmd.lang.velocity.ast.ASTElseIfStatement; +import net.sourceforge.pmd.lang.velocity.ast.ASTElseStatement; +import net.sourceforge.pmd.lang.velocity.ast.ASTIfStatement; +import net.sourceforge.pmd.lang.velocity.ast.VtlNode; +import net.sourceforge.pmd.lang.velocity.rule.AbstractVtlRule; -public class EmptyIfStmtRule extends AbstractVmRule { +public class EmptyIfStmtRule extends AbstractVtlRule { @Override public Object visit(final ASTIfStatement node, final Object data) { handleIf(node, data); @@ -30,7 +30,7 @@ public class EmptyIfStmtRule extends AbstractVmRule { return super.visit(node, data); } - private void handleIf(final VmNode node, final Object data) { + private void handleIf(final VtlNode node, final Object data) { if (node.firstChild(ASTBlock.class).isEmpty()) { asCtx(data).addViolation(node); } diff --git a/pmd-velocity/src/main/resources/META-INF/services/net.sourceforge.pmd.lang.Language b/pmd-velocity/src/main/resources/META-INF/services/net.sourceforge.pmd.lang.Language new file mode 100644 index 0000000000..f791fb9a97 --- /dev/null +++ b/pmd-velocity/src/main/resources/META-INF/services/net.sourceforge.pmd.lang.Language @@ -0,0 +1 @@ +net.sourceforge.pmd.lang.velocity.VtlLanguageModule diff --git a/pmd-vm/src/main/resources/category/vm/bestpractices.xml b/pmd-velocity/src/main/resources/category/velocity/bestpractices.xml similarity index 67% rename from pmd-vm/src/main/resources/category/vm/bestpractices.xml rename to pmd-velocity/src/main/resources/category/velocity/bestpractices.xml index 327320f7f8..6d6f8de81e 100644 --- a/pmd-vm/src/main/resources/category/vm/bestpractices.xml +++ b/pmd-velocity/src/main/resources/category/velocity/bestpractices.xml @@ -10,11 +10,11 @@ Rules which enforce generally accepted best practices. + class="net.sourceforge.pmd.lang.velocity.rule.bestpractices.AvoidReassigningParametersRule" + externalInfoUrl="${pmd.website.baseurl}/pmd_rules_velocity_bestpractices.html#avoidreassigningparameters"> Reassigning values to incoming parameters is not recommended. Use temporary local variables instead. @@ -22,11 +22,11 @@ Reassigning values to incoming parameters is not recommended. Use temporary loc + class="net.sourceforge.pmd.lang.velocity.rule.bestpractices.UnusedMacroParameterRule" + externalInfoUrl="${pmd.website.baseurl}/pmd_rules_velocity_bestpractices.html#unusedmacroparameter"> Avoid unused macro parameters. They should be deleted. diff --git a/pmd-velocity/src/main/resources/category/velocity/categories.properties b/pmd-velocity/src/main/resources/category/velocity/categories.properties new file mode 100644 index 0000000000..a8a97bf71f --- /dev/null +++ b/pmd-velocity/src/main/resources/category/velocity/categories.properties @@ -0,0 +1,17 @@ +# +# BSD-style license; for more info see http://pmd.sourceforge.net/license.html +# + +rulesets.filenames=\ + category/velocity/bestpractices.xml,\ + category/velocity/design.xml,\ + category/velocity/errorprone.xml + +# +# categories without rules +# +# category/velocity/codestyle.xml +# category/velocity/documentation.xml +# category/velocity/multithreading.xml +# category/velocity/performance.xml +# category/velocity/security.xml diff --git a/pmd-vm/src/main/resources/category/vm/codestyle.xml b/pmd-velocity/src/main/resources/category/velocity/codestyle.xml similarity index 100% rename from pmd-vm/src/main/resources/category/vm/codestyle.xml rename to pmd-velocity/src/main/resources/category/velocity/codestyle.xml diff --git a/pmd-vm/src/main/resources/category/vm/design.xml b/pmd-velocity/src/main/resources/category/velocity/design.xml similarity index 66% rename from pmd-vm/src/main/resources/category/vm/design.xml rename to pmd-velocity/src/main/resources/category/velocity/design.xml index eaad2f1fe4..acc723aa4f 100644 --- a/pmd-vm/src/main/resources/category/vm/design.xml +++ b/pmd-velocity/src/main/resources/category/velocity/design.xml @@ -10,11 +10,11 @@ Rules that help you discover design issues. + class="net.sourceforge.pmd.lang.velocity.rule.design.AvoidDeeplyNestedIfStmtsRule" + externalInfoUrl="${pmd.website.baseurl}/pmd_rules_velocity_design.html#avoiddeeplynestedifstmts"> Avoid creating deeply nested if-then statements since they are harder to read and error-prone to maintain. @@ -22,11 +22,11 @@ Avoid creating deeply nested if-then statements since they are harder to read an + class="net.sourceforge.pmd.lang.velocity.rule.design.CollapsibleIfStatementsRule" + externalInfoUrl="${pmd.website.baseurl}/pmd_rules_velocity_design.html#collapsibleifstatements"> Sometimes two consecutive 'if' statements can be consolidated by separating their conditions with a boolean short-circuit operator. @@ -34,11 +34,11 @@ Sometimes two consecutive 'if' statements can be consolidated by separating thei + class="net.sourceforge.pmd.lang.velocity.rule.design.ExcessiveTemplateLengthRule" + externalInfoUrl="${pmd.website.baseurl}/pmd_rules_velocity_design.html#excessivetemplatelength"> The template is too long. It should be broken up into smaller pieces. @@ -46,11 +46,11 @@ The template is too long. It should be broken up into smaller pieces. + class="net.sourceforge.pmd.lang.velocity.rule.design.NoInlineJavaScriptRule" + externalInfoUrl="${pmd.website.baseurl}/pmd_rules_velocity_design.html#noinlinejavascript"> Avoid inline JavaScript. Import .js files instead. @@ -58,11 +58,11 @@ Avoid inline JavaScript. Import .js files instead. + externalInfoUrl="${pmd.website.baseurl}/pmd_rules_velocity_design.html#noinlinestyles"> Avoid inline styles. Use css classes instead. diff --git a/pmd-vm/src/main/resources/category/vm/documentation.xml b/pmd-velocity/src/main/resources/category/velocity/documentation.xml similarity index 100% rename from pmd-vm/src/main/resources/category/vm/documentation.xml rename to pmd-velocity/src/main/resources/category/velocity/documentation.xml diff --git a/pmd-vm/src/main/resources/category/vm/errorprone.xml b/pmd-velocity/src/main/resources/category/velocity/errorprone.xml similarity index 67% rename from pmd-vm/src/main/resources/category/vm/errorprone.xml rename to pmd-velocity/src/main/resources/category/velocity/errorprone.xml index bcc3ed19cd..c2b041f8b1 100644 --- a/pmd-vm/src/main/resources/category/vm/errorprone.xml +++ b/pmd-velocity/src/main/resources/category/velocity/errorprone.xml @@ -10,11 +10,11 @@ Rules to detect constructs that are either broken, extremely confusing or prone + class="net.sourceforge.pmd.lang.velocity.rule.errorprone.EmptyForeachStmtRule" + externalInfoUrl="${pmd.website.baseurl}/pmd_rules_velocity_errorprone.html#emptyforeachstmt"> Empty foreach statements should be deleted. @@ -22,11 +22,11 @@ Empty foreach statements should be deleted. + class="net.sourceforge.pmd.lang.velocity.rule.errorprone.EmptyIfStmtRule" + externalInfoUrl="${pmd.website.baseurl}/pmd_rules_velocity_errorprone.html#emptyifstmt"> Empty if statements should be deleted. diff --git a/pmd-vm/src/main/resources/category/vm/multithreading.xml b/pmd-velocity/src/main/resources/category/velocity/multithreading.xml similarity index 100% rename from pmd-vm/src/main/resources/category/vm/multithreading.xml rename to pmd-velocity/src/main/resources/category/velocity/multithreading.xml diff --git a/pmd-vm/src/main/resources/category/vm/performance.xml b/pmd-velocity/src/main/resources/category/velocity/performance.xml similarity index 100% rename from pmd-vm/src/main/resources/category/vm/performance.xml rename to pmd-velocity/src/main/resources/category/velocity/performance.xml diff --git a/pmd-vm/src/main/resources/category/vm/security.xml b/pmd-velocity/src/main/resources/category/velocity/security.xml similarity index 100% rename from pmd-vm/src/main/resources/category/vm/security.xml rename to pmd-velocity/src/main/resources/category/velocity/security.xml diff --git a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/LanguageVersionTest.java b/pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity/LanguageVersionTest.java similarity index 60% rename from pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/LanguageVersionTest.java rename to pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity/LanguageVersionTest.java index bd51aaae2f..bcea97f9ba 100644 --- a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/LanguageVersionTest.java +++ b/pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity/LanguageVersionTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vm; +package net.sourceforge.pmd.lang.velocity; import java.util.Arrays; import java.util.Collection; @@ -12,7 +12,7 @@ import net.sourceforge.pmd.test.AbstractLanguageVersionTest; class LanguageVersionTest extends AbstractLanguageVersionTest { static Collection data() { - return Arrays.asList(new TestDescriptor(VmLanguageModule.NAME, VmLanguageModule.ID, "2.3", - getLanguage(VmLanguageModule.NAME).getDefaultVersion())); + return Arrays.asList(new TestDescriptor(VtlLanguageModule.NAME, VtlLanguageModule.ID, "2.3", + getLanguage(VtlLanguageModule.NAME).getDefaultVersion())); } } diff --git a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/RuleSetFactoryTest.java b/pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity/RuleSetFactoryTest.java similarity index 87% rename from pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/RuleSetFactoryTest.java rename to pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity/RuleSetFactoryTest.java index b549df0edd..024c5efaa9 100644 --- a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/RuleSetFactoryTest.java +++ b/pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity/RuleSetFactoryTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vm; +package net.sourceforge.pmd.lang.velocity; import net.sourceforge.pmd.test.lang.rule.AbstractRuleSetFactoryTest; diff --git a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/VmParserTest.java b/pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity/VtlParserTest.java similarity index 85% rename from pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/VmParserTest.java rename to pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity/VtlParserTest.java index 17b388fe0a..c975be39d9 100644 --- a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/VmParserTest.java +++ b/pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity/VtlParserTest.java @@ -2,14 +2,14 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vm; +package net.sourceforge.pmd.lang.velocity; import org.junit.jupiter.api.Test; /** * Unit test for VM parsing. */ -class VmParserTest { +class VtlParserTest { private static final String VM_SRC = "Hello $customer.Name " + "#foreach($mud in $mudsOnSpecial)" + " #if ( $customer.hasPurchased($mud) )" + " " + " + - + - + - + - + - + - + - + - + - + - + - + - + - + - + From a96b6016af9ce4c66dfb5882d7a50fcb92028b70 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 1 Mar 2024 12:47:15 +0100 Subject: [PATCH 47/52] [apex] Verify ApexDoc with annotated classes Fixes #4774 --- docs/pages/release_notes.md | 4 ++ .../pmd/lang/apex/ast/ApexCommentTest.java | 41 +++++++++++++++++-- .../apex/rule/documentation/xml/ApexDoc.xml | 17 ++++++++ 3 files changed, 58 insertions(+), 4 deletions(-) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 9dd9ca8b80..66634a03e2 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -274,6 +274,8 @@ The rules have been moved into categories with PMD 6. * [#4796](https://github.com/pmd/pmd/pull/4796): Remove deprecated and release rulesets * apex * [#3766](https://github.com/pmd/pmd/issues/3766): \[apex] Replace Jorje with fully open source front-end +* apex-documentation + * [#4774](https://github.com/pmd/pmd/issues/4774): \[apex] ApexDoc false-positive for the first method of an annotated Apex class * apex-performance * [#4675](https://github.com/pmd/pmd/issues/4675): \[apex] New Rule: OperationWithHighCostInLoop * groovy @@ -1349,6 +1351,8 @@ Language specific fixes: * [#2667](https://github.com/pmd/pmd/issues/2667): \[apex] Integrate nawforce/ApexLink to build robust Unused rule * [#4509](https://github.com/pmd/pmd/issues/4509): \[apex] ExcessivePublicCount doesn't consider inner classes correctly * [#4596](https://github.com/pmd/pmd/issues/4596): \[apex] ExcessivePublicCount ignores properties +* apex-documentation + * [#4774](https://github.com/pmd/pmd/issues/4774): \[apex] ApexDoc false-positive for the first method of an annotated Apex class * apex-performance * [#4675](https://github.com/pmd/pmd/issues/4675): \[apex] New Rule: OperationWithHighCostInLoop * apex-security diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/ast/ApexCommentTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/ast/ApexCommentTest.java index f2df308ce9..728cce6253 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/ast/ApexCommentTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/ast/ApexCommentTest.java @@ -10,6 +10,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import org.junit.jupiter.api.Test; class ApexCommentTest extends ApexParserTestBase { + private static final String FORMAL_COMMENT_CONTENT = "/** formal comment */"; @Test void testContainsComment1() { @@ -24,13 +25,45 @@ class ApexCommentTest extends ApexParserTestBase { @Test void fieldDeclarationHasFormalComment() { - final String commentContent = "/** formal comment */"; ASTApexFile file = apex.parse("class MyClass {\n" - + " " + commentContent + "\n" + + " " + FORMAL_COMMENT_CONTENT + "\n" + " Integer field;\n" + "}\n"); - ASTFormalComment comment = file.descendants(ASTFieldDeclaration.class).crossFindBoundaries() + ASTFormalComment comment = file.descendants(ASTUserClass.class) + .children(ASTFieldDeclarationStatements.class) + .children(ASTFieldDeclaration.class) .children(ASTFormalComment.class).first(); - assertEquals(commentContent, comment.getImage()); + assertEquals(FORMAL_COMMENT_CONTENT, comment.getImage()); + } + + @Test + void methodHasFormalComment() { + ASTApexFile file = apex.parse(FORMAL_COMMENT_CONTENT + "\n" + + "class MyClass {\n" + + " " + FORMAL_COMMENT_CONTENT + "\n" + + " public void bar() {}\n" + + "}"); + ASTFormalComment comment = file.descendants(ASTUserClass.class).children(ASTMethod.class).children(ASTFormalComment.class).first(); + assertEquals(FORMAL_COMMENT_CONTENT, comment.getImage()); + } + + @Test + void methodHasFormalCommentAnnotatedClass() { + ASTApexFile file = apex.parse(FORMAL_COMMENT_CONTENT + "\n" + + "@RestResource(urlMapping='/api/v1/get/*')\n" + + "class MyClass {\n" + + " " + FORMAL_COMMENT_CONTENT + "\n" + + " public void bar() {}\n" + + "}"); + ASTFormalComment comment = file.descendants(ASTUserClass.class).children(ASTMethod.class).children(ASTFormalComment.class).first(); + assertEquals(FORMAL_COMMENT_CONTENT, comment.getImage()); + } + + @Test + void classHasFormalComment() { + ASTApexFile file = apex.parse(FORMAL_COMMENT_CONTENT + "\n" + + "class MyClass {}"); + ASTFormalComment comment = file.descendants(ASTUserClass.class).children(ASTFormalComment.class).first(); + assertEquals(FORMAL_COMMENT_CONTENT, comment.getImage()); } } diff --git a/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/rule/documentation/xml/ApexDoc.xml b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/rule/documentation/xml/ApexDoc.xml index 69e879b3ed..800b8632e6 100644 --- a/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/rule/documentation/xml/ApexDoc.xml +++ b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/rule/documentation/xml/ApexDoc.xml @@ -728,6 +728,23 @@ public class MyClass { Test = 1; } } +]]> + + + + [apex] ApexDoc false-positive for the first method of an annotated Apex class #4774 + 0 + From 150c0c88a466011a4fdc8ffb1228ca279c028814 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 1 Mar 2024 14:37:17 +0100 Subject: [PATCH 48/52] [apex] Update doc about apex parser [skip ci] --- docs/pages/pmd/languages/apex.md | 10 ++++++---- docs/pages/release_notes.md | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/docs/pages/pmd/languages/apex.md b/docs/pages/pmd/languages/apex.md index f6904aa7a8..1c5b19e64f 100644 --- a/docs/pages/pmd/languages/apex.md +++ b/docs/pages/pmd/languages/apex.md @@ -33,8 +33,10 @@ See [Apex language properties](pmd_languages_configuration.html#apex-language-pr ## Parser -We use Jorje, the Apex parsers that is shipped within the Apex Language Server. This is part of -the [Salesforce Extensions for VS Code](https://github.com/forcedotcom/salesforcedx-vscode). +Since PMD 7.0.0 we use the open source [apex-parser](https://github.com/apex-dev-tools/apex-parser), +together with [Summit AST](https://github.com/google/summit-ast) which translates the ANTLR parse tree +into an AST. -We take the binary from -and provide it as a maven dependency (see [pmd-apex-jorje](https://github.com/pmd/pmd/tree/master/pmd-apex-jorje)). +When PMD added Apex support with version 5.5.0, it utilized the Apex Jorje library to parse Apex source +and generate an AST. This library is however a binary-blob provided as part of the +[Salesforce Extensions for VS Code](https://github.com/forcedotcom/salesforcedx-vscode), and it is closed-source. diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 66634a03e2..83b0a63859 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -102,7 +102,8 @@ Also having access to the source code, enhancements and modifications are easier Under the hood, we use two open source libraries instead: -* [apex-parser](https://github.com/nawforce/apex-parser) by [Kevin Jones](https://github.com/nawforce) (@nawforce) +* [apex-parser](https://github.com/apex-dev-tools/apex-parser) originally by + [Kevin Jones](https://github.com/nawforce) (@nawforce). This project provides the grammar for a ANTLR based parser. * [Summit-AST](https://github.com/google/summit-ast) by [Google](https://github.com/google) (@google) This project translates the ANTLR parse tree into an AST, that is similar to the AST Jorje provided. From 5e277c8211b932c6fbe1755516eca0a548d430cc Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 1 Mar 2024 14:50:35 +0100 Subject: [PATCH 49/52] [core] Fix NPE in AbstractAnalysisCache in case of processing errors --- .../cache/internal/AbstractAnalysisCache.java | 7 ++++- .../cache/internal/FileAnalysisCacheTest.java | 30 +++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/cache/internal/AbstractAnalysisCache.java b/pmd-core/src/main/java/net/sourceforge/pmd/cache/internal/AbstractAnalysisCache.java index 7108a368b7..0d12db7d7c 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/cache/internal/AbstractAnalysisCache.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/cache/internal/AbstractAnalysisCache.java @@ -215,13 +215,18 @@ abstract class AbstractAnalysisCache implements AnalysisCache { final FileId fileName = file.getFileId(); return new FileAnalysisListener() { + private boolean failed = false; + @Override public void onRuleViolation(RuleViolation violation) { - updatedResultsCache.get(fileName).addViolation(violation); + if (!failed) { + updatedResultsCache.get(fileName).addViolation(violation); + } } @Override public void onError(ProcessingError error) { + failed = true; analysisFailed(file); } }; diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/cache/internal/FileAnalysisCacheTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/cache/internal/FileAnalysisCacheTest.java index 2f11170415..253abd19dd 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/cache/internal/FileAnalysisCacheTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/cache/internal/FileAnalysisCacheTest.java @@ -48,6 +48,7 @@ import net.sourceforge.pmd.lang.rule.Rule; import net.sourceforge.pmd.lang.rule.internal.RuleSets; import net.sourceforge.pmd.reporting.FileAnalysisListener; import net.sourceforge.pmd.reporting.InternalApiBridge; +import net.sourceforge.pmd.reporting.Report; import net.sourceforge.pmd.reporting.RuleViolation; class FileAnalysisCacheTest { @@ -146,6 +147,35 @@ class FileAnalysisCacheTest { assertEquals(textLocation.getEndColumn(), cachedViolation.getEndColumn()); } + @Test + void testStorePersistsFilesWithViolationsAndProcessingErrors() throws IOException { + final FileAnalysisCache cache = new FileAnalysisCache(newCacheFile); + cache.checkValidity(mock(RuleSets.class), mock(ClassLoader.class), setOf(sourceFileBackend)); + final FileAnalysisListener cacheListener = cache.startFileAnalysis(sourceFile); + + cache.isUpToDate(sourceFile); + + cacheListener.onError(new Report.ProcessingError(new RuntimeException("some rule failed"), sourceFile.getFileId())); + + final RuleViolation rv = mock(RuleViolation.class); + final TextRange2d textLocation = TextRange2d.range2d(1, 2, 3, 4); + when(rv.getLocation()).thenReturn(FileLocation.range(sourceFile.getFileId(), textLocation)); + final Rule rule = mock(Rule.class, Mockito.RETURNS_SMART_NULLS); + when(rule.getLanguage()).thenReturn(mock(Language.class)); + when(rv.getRule()).thenReturn(rule); + + // the next rule wants to report a violation + cacheListener.onRuleViolation(rv); + cache.persist(); + + final FileAnalysisCache reloadedCache = new FileAnalysisCache(newCacheFile); + reloadedCache.checkValidity(mock(RuleSets.class), mock(ClassLoader.class), setOf(sourceFileBackend)); + assertFalse(reloadedCache.isUpToDate(sourceFile), + "Cache believes file is up to date although processing errors happened earlier"); + + final List cachedViolations = reloadedCache.getCachedViolations(sourceFile); + assertTrue(cachedViolations.isEmpty(), "There should be no cached rule violations"); + } @Test void testDisplayNameIsRespected() throws Exception { From cc3da7b21e3b407c191ff81c67a9d66394ab4da8 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 1 Mar 2024 16:16:49 +0100 Subject: [PATCH 50/52] Fix kotlin compiler warnings --- .../pmd/lang/apex/ast/ApexTreeBuilder.kt | 21 +++++++--------- .../lang/java/ast/ASTCastExpressionTest.kt | 1 - .../pmd/lang/java/ast/ASTFieldAccessTest.kt | 3 +-- .../pmd/lang/java/ast/ASTMethodCallTest.kt | 2 +- .../lang/java/ast/ASTMethodDeclarationTest.kt | 2 +- .../pmd/lang/java/ast/ASTPatternTest.kt | 1 - .../lang/java/ast/ASTSuperExpressionTest.kt | 2 +- .../lang/java/ast/ASTThisExpressionTest.kt | 2 +- .../pmd/lang/java/ast/ASTTypeTest.kt | 4 ++-- .../lang/java/ast/ASTUnaryExpressionTest.kt | 2 +- .../pmd/lang/java/ast/Java11Test.kt | 2 -- .../pmd/lang/java/ast/KotlinTestingDsl.kt | 15 +++++------- .../pmd/lang/java/ast/NodeParsingCtx.kt | 3 ++- .../pmd/lang/java/ast/ParenthesesTest.kt | 4 ++-- .../pmd/lang/java/ast/TestExtensions.kt | 24 +++++++++---------- .../lang/java/ast/TypeDisambiguationTest.kt | 16 ++++++------- .../pmd/lang/java/ast/UsageResolutionTest.kt | 8 +++---- .../lang/java/ast/VarDisambiguationTest.kt | 1 - .../java/symbols/internal/AstSymbolTests.kt | 4 ++-- .../symbols/internal/PrimitiveSymbolTests.kt | 2 +- .../internal/ReflectedClassSymbolTests.kt | 2 +- .../internal/ReflectedFieldSymbolTest.kt | 16 +++++++++---- .../pmd/lang/java/symbols/internal/Utils.kt | 3 +-- .../internal/asm/BrokenClasspathTest.kt | 2 +- .../symbols/internal/asm/SigParserTest.kt | 2 -- .../table/internal/HeaderScopesTest.kt | 14 +++++------ .../table/internal/LocalTypeScopesTest.kt | 2 +- .../table/internal/MemberInheritanceTest.kt | 10 ++++---- .../symbols/table/internal/VarScopingTest.kt | 10 ++++---- .../pmd/lang/java/types/ArraySymbolTests.kt | 2 +- .../pmd/lang/java/types/BoxingTest.kt | 1 - .../pmd/lang/java/types/CaptureTest.kt | 3 +-- .../pmd/lang/java/types/SubtypingTest.kt | 17 +++++++------ .../lang/java/types/TestUtilitiesForTypes.kt | 6 ++--- .../pmd/lang/java/types/TypeCreationDsl.kt | 6 ++--- .../pmd/lang/java/types/TypeEqualityTest.kt | 4 +--- .../pmd/lang/java/types/TypeGenerationUtil.kt | 13 +++++----- .../java/types/TypesFromReflectionTest.kt | 1 + .../java/types/ast/ConversionContextTests.kt | 4 ++-- .../internal/infer/BranchingExprsTestCases.kt | 1 - .../internal/infer/CaptureInferenceTest.kt | 1 - .../types/internal/infer/CtorInferenceTest.kt | 6 ++--- .../internal/infer/Java7InferenceTest.kt | 4 ++-- .../types/internal/infer/OverridingTest.kt | 1 - .../internal/infer/SpecialMethodsTest.kt | 5 ++-- .../internal/infer/StandaloneTypesTest.kt | 3 --- .../java/types/internal/infer/StressTest.kt | 2 +- .../infer/TypeAnnotationsInferenceTest.kt | 2 -- .../types/internal/infer/TypeInferenceTest.kt | 2 +- .../infer/UnresolvedTypesRecoveryTest.kt | 2 +- .../pmd/cpd/test/CpdTextComparisonTest.kt | 14 +++++------ .../pmd/lang/ast/test/NodeExtensions.kt | 2 -- .../pmd/lang/ast/test/NodePrinters.kt | 6 ++--- .../pmd/lang/ast/test/TestUtils.kt | 7 +++--- .../pmd/test/BaseTextComparisonTest.kt | 8 +++---- 55 files changed, 141 insertions(+), 162 deletions(-) diff --git a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ApexTreeBuilder.kt b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ApexTreeBuilder.kt index c48f2ad0cd..5c9728c01c 100644 --- a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ApexTreeBuilder.kt +++ b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ApexTreeBuilder.kt @@ -76,10 +76,9 @@ import com.google.summit.ast.statement.WhileLoopStatement import kotlin.reflect.KClass -@Suppress("DEPRECATION") -class ApexTreeBuilder(val task: ParserTask, val proc: ApexLanguageProcessor) { - private val sourceCode = task.getTextDocument() - private val commentBuilder = ApexCommentBuilder(sourceCode, proc.getProperties().getSuppressMarker()) +class ApexTreeBuilder(private val task: ParserTask, private val proc: ApexLanguageProcessor) { + private val sourceCode = task.textDocument + private val commentBuilder = ApexCommentBuilder(sourceCode, proc.properties.suppressMarker) /** Builds and returns an [ASTApexFile] corresponding to the given [CompilationUnit]. */ fun buildTree(compilationUnit: CompilationUnit): ASTApexFile { @@ -87,7 +86,7 @@ class ApexTreeBuilder(val task: ParserTask, val proc: ApexLanguageProcessor) { val baseClass = build(compilationUnit, parent = null) as? BaseApexClass<*> ?: throw ParseException("Unable to build tree") - val result = ASTApexFile(task, compilationUnit, commentBuilder.getSuppressMap(), proc) + val result = ASTApexFile(task, compilationUnit, commentBuilder.suppressMap, proc) baseClass.setParent(result) // Post-processing passes @@ -759,8 +758,8 @@ class ApexTreeBuilder(val task: ParserTask, val proc: ApexLanguageProcessor) { } } - for(i in 0..node.getNumChildren()-1) { - node.setChild(children.get(i) as AbstractApexNode, i) + for(i in 0 until node.getNumChildren()) { + node.setChild(children[i] as AbstractApexNode, i) } } @@ -794,12 +793,10 @@ class ApexTreeBuilder(val task: ParserTask, val proc: ApexLanguageProcessor) { } /** - * If [parent] is not null, adds this [ApexNode] as a [child][ApexNode.jjtAddChild] and sets - * [parent] as the [parent][ApexNode.jjtSetParent]. + * If [parent] is not null, adds this [ApexNode] as a [child][AbstractApexNode.addChild] and sets + * [parent] as the [parent][AbstractApexNode.setParent]. */ private fun AbstractApexNode.setParent(parent: AbstractApexNode?) { - if (parent != null) { - parent.addChild(this, parent.numChildren) - } + parent?.addChild(this, parent.numChildren) } } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTCastExpressionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTCastExpressionTest.kt index ed3cb48cea..acb334402a 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 @@ -7,7 +7,6 @@ package net.sourceforge.pmd.lang.java.ast import net.sourceforge.pmd.lang.ast.test.shouldBe import net.sourceforge.pmd.lang.java.ast.JavaVersion.Companion.Earliest import net.sourceforge.pmd.lang.java.ast.JavaVersion.Companion.Latest -import net.sourceforge.pmd.lang.java.ast.ExpressionParsingCtx import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.* class ASTCastExpressionTest : ParserTestSpec({ diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTFieldAccessTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTFieldAccessTest.kt index b259b9c1bc..8be8683fdd 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTFieldAccessTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTFieldAccessTest.kt @@ -4,7 +4,6 @@ package net.sourceforge.pmd.lang.java.ast -import io.kotest.matchers.shouldBe import net.sourceforge.pmd.lang.ast.test.shouldBe /** @@ -12,7 +11,7 @@ import net.sourceforge.pmd.lang.ast.test.shouldBe */ class ASTFieldAccessTest : ParserTestSpec({ - parserTest("Field access exprs") { + parserTest("Field access expressions") { inContext(ExpressionParsingCtx) { diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodCallTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodCallTest.kt index e22d343589..5fe7339255 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 @@ -13,7 +13,7 @@ import net.sourceforge.pmd.lang.ast.test.shouldBe class ASTMethodCallTest : ParserTestSpec({ - parserTest("Method call exprs") { + parserTest("Method call expressions") { inContext(ExpressionParsingCtx) { diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodDeclarationTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodDeclarationTest.kt index ff47a82431..0f621ebb93 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 @@ -138,7 +138,7 @@ class ASTMethodDeclarationTest : ParserTestSpec({ } } - // default abstract is an invalid combination of modifiers so we won't encounter it in real analysis + // default abstract is an invalid combination of modifiers, so we won't encounter it in real analysis } parserTest("Throws list") { diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTPatternTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTPatternTest.kt index 80549663cd..b9ba5114a4 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTPatternTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTPatternTest.kt @@ -5,7 +5,6 @@ package net.sourceforge.pmd.lang.java.ast import io.kotest.matchers.shouldBe -import io.kotest.matchers.shouldNot import net.sourceforge.pmd.lang.java.ast.JavaVersion.J16 import java.io.IOException diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTSuperExpressionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTSuperExpressionTest.kt index bd2bd9096f..067756e2fe 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 @@ -31,7 +31,7 @@ class ASTSuperExpressionTest : ParserTestSpec({ // a method call, field access, or method reference "super" shouldNot parse() - // type arguments and annots are disallowed on the qualifier + // type arguments and annotations are disallowed on the qualifier "T.B.super::foo" shouldNot parse() "T.B.super.foo()" shouldNot parse() "T.@F B.super.foo()" shouldNot parse() diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTThisExpressionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTThisExpressionTest.kt index dc49ff18d4..f3e0b7209a 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 @@ -47,7 +47,7 @@ class ASTThisExpressionTest : ParserTestSpec({ parserTest("Neg cases") { inContext(ExpressionParsingCtx) { - // type arguments and annots are disallowed on the qualifier + // type arguments and annotations are disallowed on the qualifier "T.B.this" shouldNot parse() "T.@F B.this" shouldNot parse() } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTTypeTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTTypeTest.kt index bee2963f29..2f85f2ceaf 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 @@ -59,9 +59,9 @@ class ASTTypeTest : ParserTestSpec({ // So @B binds to "java" // If the annotation is not applicable to TYPE_USE then it doesn't compile - // this happens in type context, eg in a cast, or in an extends list + // this happens in type context, e.g. in a cast, or in an extends list - // TYPE_USE annotations are prohibited eg before a declaration + // TYPE_USE annotations are prohibited e.g. before a declaration inContext(TypeParsingCtx) { diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTUnaryExpressionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTUnaryExpressionTest.kt index fd2bb913fc..d13cb2483c 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTUnaryExpressionTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTUnaryExpressionTest.kt @@ -84,7 +84,7 @@ class ASTUnaryExpressionTest : ParserTestSpec({ parserTest("Unary expression ambiguity corner cases") { - // the following cases test ambiguity between cast of unary, and eg parenthesized additive expr + // the following cases test ambiguity between cast of unary, and e.g. parenthesized additive expr // see https://docs.oracle.com/javase/specs/jls/se9/html/jls-15.html#jls-UnaryExpressionNotPlusMinus // comments about ambiguity are below grammar diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/Java11Test.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/Java11Test.kt index 8a0e225520..5626dba682 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/Java11Test.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/Java11Test.kt @@ -4,9 +4,7 @@ package net.sourceforge.pmd.lang.java.ast -import io.kotest.matchers.shouldBe import net.sourceforge.pmd.lang.ast.test.shouldBe -import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.ast.JavaVersion.* import net.sourceforge.pmd.lang.java.ast.JavaVersion.Companion.Latest diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/KotlinTestingDsl.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/KotlinTestingDsl.kt index 791df7c2a3..aa4260bdc3 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 @@ -14,7 +14,6 @@ import io.kotest.matchers.MatcherResult import io.kotest.matchers.collections.shouldContainAll import net.sourceforge.pmd.lang.ast.* import net.sourceforge.pmd.lang.ast.test.* -import net.sourceforge.pmd.lang.java.JavaLanguageModule import net.sourceforge.pmd.lang.java.JavaParsingHelper import net.sourceforge.pmd.lang.java.JavaParsingHelper.* import java.beans.PropertyDescriptor @@ -40,8 +39,6 @@ enum class JavaVersion : Comparable { /** Name suitable for use with e.g. [JavaParsingHelper.parse] */ val pmdName: String = name.removePrefix("J").replaceFirst("__", "-").replace('_', '.').lowercase() - val pmdVersion get() = JavaLanguageModule.getInstance().getVersion(pmdName) - val parser: JavaParsingHelper = DEFAULT.withDefaultVersion(pmdName) operator fun not(): List = values().toList() - this @@ -64,9 +61,9 @@ enum class JavaVersion : Comparable { fun since(v: JavaVersion) = v.rangeTo(Latest) fun except(v1: JavaVersion, vararg versions: JavaVersion) = - values().toList() - v1 - versions + values().toList() - v1 - versions.toSet() - fun except(versions: List) = values().toList() - versions + fun except(versions: List) = values().toList() - versions.toSet() } } @@ -151,8 +148,8 @@ inline fun JavaNode?.shouldMatchNode(ignoreChildren: Boolean * Can be used inside of a [ParserTestSpec] with [ParserTestSpec.parserTest]. * * Parsing contexts allow to parse a string containing only the node you're interested - * in instead of writing up a full class that the parser can handle. See [parseExpression], - * [parseStatement]. + * in instead of writing up a full class that the parser can handle. See [ExpressionParsingCtx], + * [StatementParsingCtx]. * * These are implicitly used by [matchExpr] and [matchStmt], which specify a matcher directly * on the strings, using their type parameter and the info in this test context to parse, find @@ -169,7 +166,7 @@ inline fun JavaNode?.shouldMatchNode(ignoreChildren: Boolean * Import statements in the parsing contexts can be configured by adding types to [importedTypes], * or strings to [otherImports]. * - * Technically the utilities provided by this class may be used outside of [io.kotest.specs.FunSpec]s, + * Technically the utilities provided by this class may be used outside of [io.kotest.core.spec.Spec]s, * e.g. in regular JUnit tests, but I think we should strive to uniformize our testing style, * especially since KotlinTest defines so many. * @@ -224,7 +221,7 @@ open class ParserTestCtx(testScope: TestScope, /** * Places all node parsing contexts inside the declaration of the given class * of the given class. - * It's like you were writing eg expressions inside the class, with the method + * It's like you were writing e.g. expressions inside the class, with the method * declarations around it and all. * * LIMITATIONS: diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/NodeParsingCtx.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/NodeParsingCtx.kt index 2bf63f7669..cecc164d17 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/NodeParsingCtx.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/NodeParsingCtx.kt @@ -5,6 +5,7 @@ package net.sourceforge.pmd.lang.java.ast import net.sourceforge.pmd.lang.ast.Node +import net.sourceforge.pmd.lang.ast.ParseException import net.sourceforge.pmd.lang.java.JavaParsingHelper /** @@ -139,7 +140,7 @@ $construct } override fun retrieveNode(acu: ASTCompilationUnit): ASTBodyDeclaration = - acu.typeDeclarations.firstOrThrow().getDeclarations().firstOrThrow() + acu.typeDeclarations.firstOrThrow().declarations.firstOrThrow() } object TopLevelTypeDeclarationParsingCtx : NodeParsingCtx("top-level declaration") { diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ParenthesesTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ParenthesesTest.kt index d5a59df21a..12efd016a2 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 @@ -73,7 +73,7 @@ class ParenthesesTest : ParserTestSpec({ it::getParenthesisDepth shouldBe 2 it::isParenthesized shouldBe true - it.tokenList().map { it.image } shouldBe listOf("(", "(", "a", ")", ")") + it.tokenList().map { token -> token.image } shouldBe listOf("(", "(", "a", ")", ")") } } } @@ -95,7 +95,7 @@ class ParenthesesTest : ParserTestSpec({ it::getParenthesisDepth shouldBe 1 it::isParenthesized shouldBe true - it.tokenList().map { it.image } shouldBe listOf("(", "a", ")") + it.tokenList().map { token -> token.image } shouldBe listOf("(", "a", ")") } } } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TestExtensions.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TestExtensions.kt index 1759e7c91b..de4ae950d9 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TestExtensions.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TestExtensions.kt @@ -256,8 +256,8 @@ fun TreeNodeWrapper.returnStatement(contents: ValuedNodeSpec.forLoop(body: ValuedNodeSpec = { null }) = child { - val body = body() - if (body != null) it::getBody shouldBe body + val expectedBody = body() + if (expectedBody != null) it::getBody shouldBe expectedBody else unspecifiedChildren(it.numChildren) } @@ -280,22 +280,22 @@ fun TreeNodeWrapper.statementExprList(body: NodeSpec.foreachLoop(body: ValuedNodeSpec = { null }) = child { - val body = body() - if (body != null) it::getBody shouldBe body + val expectedBody = body() + if (expectedBody != null) it::getBody shouldBe expectedBody else unspecifiedChildren(it.numChildren) } fun TreeNodeWrapper.doLoop(body: ValuedNodeSpec = { null }) = child { - val body = body() - if (body != null) it::getBody shouldBe body + val expectedBody = body() + if (expectedBody != null) it::getBody shouldBe expectedBody else unspecifiedChildren(it.numChildren) } fun TreeNodeWrapper.whileLoop(body: ValuedNodeSpec = { null }) = child { - val body = body() - if (body != null) it::getBody shouldBe body + val expectedBody = body() + if (expectedBody != null) it::getBody shouldBe expectedBody else unspecifiedChildren(it.numChildren) } @@ -398,7 +398,7 @@ fun TreeNodeWrapper.unionType(contents: NodeSpec = EmptyA contents() } -fun TreeNodeWrapper.voidType() = child() {} +fun TreeNodeWrapper.voidType() = child {} fun TreeNodeWrapper.typeExpr(contents: ValuedNodeSpec) = @@ -425,7 +425,7 @@ fun TreeNodeWrapper.arrayType(contents: NodeSpec = EmptyA fun TreeNodeWrapper.primitiveType(type: PrimitiveTypeKind, assertions: NodeSpec = EmptyAssertions) = child { it::getKind shouldBe type - PrettyPrintingUtil.prettyPrintType(it) shouldBe type.toString(); + PrettyPrintingUtil.prettyPrintType(it) shouldBe type.toString() assertions() } @@ -586,8 +586,8 @@ fun TreeNodeWrapper.switchStmt(assertions: NodeSpec fun TreeNodeWrapper.switchArrow(rhs: ValuedNodeSpec = { null }) = child { - val rhs = rhs() - if (rhs != null) it::getRightHandSide shouldBe rhs + val expectedRhs = rhs() + if (expectedRhs != null) it::getRightHandSide shouldBe expectedRhs else unspecifiedChildren(2) // label + rhs } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TypeDisambiguationTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TypeDisambiguationTest.kt index 7cf336cf72..3fcc73d62f 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 @@ -246,18 +246,18 @@ class TypeDisambiguationTest : ParserTestSpec({ val outerUnresolved = m0.qualifier!! val outerT = outerUnresolved.typeMirror.shouldBeA { - it.symbol.shouldBeA { - it::isUnresolved shouldBe true - it::getSimpleName shouldBe "OuterUnresolved" + it.symbol.shouldBeA { classSymbol -> + classSymbol::isUnresolved shouldBe true + classSymbol::getSimpleName shouldBe "OuterUnresolved" } } val innerT = m0.typeMirror.shouldBeA { it::getEnclosingType shouldBe outerT - it.symbol.shouldBeA { - it::isUnresolved shouldBe true - it::getSimpleName shouldBe "InnerUnresolved" - it.enclosingClass.shouldBeSameInstanceAs(outerT.symbol) + it.symbol.shouldBeA { classSymbol -> + classSymbol::isUnresolved shouldBe true + classSymbol::getSimpleName shouldBe "InnerUnresolved" + classSymbol.enclosingClass.shouldBeSameInstanceAs(outerT.symbol) } } @@ -314,7 +314,7 @@ class TypeDisambiguationTest : ParserTestSpec({ // before all classes of the CU have been visited enableProcessing() - val acu = parser.parse(""" + @Suppress("UNUSED_VARIABLE") val acu = parser.parse(""" package p; import static p.Assert2.*; diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/UsageResolutionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/UsageResolutionTest.kt index bf332c059f..b6f3e05e0e 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 @@ -65,13 +65,13 @@ class UsageResolutionTest : ProcessorTestSpec({ p::isRecordComponent shouldBe true p.localUsages.shouldHaveSize(2) p.localUsages[0].shouldBeA { - it.referencedSym!!.shouldBeA { - it.tryGetNode() shouldBe p + it.referencedSym!!.shouldBeA { symbol -> + symbol.tryGetNode() shouldBe p } } p.localUsages[1].shouldBeA { - it.referencedSym!!.shouldBeA { - it.tryGetNode() shouldBe p + it.referencedSym!!.shouldBeA { symbol -> + symbol.tryGetNode() shouldBe p } } } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/VarDisambiguationTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/VarDisambiguationTest.kt index d890ddd97d..a96b9b9077 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 @@ -11,7 +11,6 @@ import net.sourceforge.pmd.lang.ast.test.shouldMatchN import net.sourceforge.pmd.lang.java.JavaParsingHelper import net.sourceforge.pmd.lang.java.symbols.JClassSymbol import net.sourceforge.pmd.lang.java.symbols.JTypeParameterSymbol -import net.sourceforge.pmd.lang.java.symbols.table.internal.JavaSemanticErrors import net.sourceforge.pmd.lang.java.symbols.table.internal.JavaSemanticErrors.* class VarDisambiguationTest : ParserTestSpec({ diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/AstSymbolTests.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/AstSymbolTests.kt index cb8c48b9c8..7933491035 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 @@ -386,7 +386,7 @@ class AstSymbolTests : ParserTestSpec({ val (canonCtor1, canonCtor2) = acu.descendants(ASTRecordComponentList::class.java).toList { it.symbol } val (auxCtor) = acu.descendants(ASTConstructorDeclaration::class.java).toList { it.symbol } val (xAccessor) = acu.descendants(ASTMethodDeclaration::class.java).toList { it.symbol } - val (xComp, yComp, x2Comp, y2Comp, x2Formal) = acu.descendants(ASTVariableId::class.java).toList { it.symbol } + val (xComp, yComp, _, y2Comp, _) = acu.descendants(ASTVariableId::class.java).toList { it.symbol } doTest("should reflect their modifiers") { @@ -550,7 +550,7 @@ class AstSymbolTests : ParserTestSpec({ } // all others are Runnable - (allAnons - anonsWithSuperClass).forEach { + (allAnons - anonsWithSuperClass.toSet()).forEach { it::getSuperclass shouldBe it.typeSystem.OBJECT.symbol it::getSuperInterfaces shouldBe listOf(it.typeSystem.getClassSymbol(Runnable::class.java)) } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/PrimitiveSymbolTests.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/PrimitiveSymbolTests.kt index fae15094cd..676f0ffb01 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/PrimitiveSymbolTests.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/PrimitiveSymbolTests.kt @@ -17,7 +17,7 @@ import net.sourceforge.pmd.lang.java.types.testTypeSystem */ class PrimitiveSymbolTests : WordSpec({ - fun primitives(): List = testTypeSystem.allPrimitives.map { it.symbol!! } + fun primitives(): List = testTypeSystem.allPrimitives.map { it.symbol } "A primitive symbol" should { diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/ReflectedClassSymbolTests.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/ReflectedClassSymbolTests.kt index 5051b1396e..51ab28b726 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/ReflectedClassSymbolTests.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/ReflectedClassSymbolTests.kt @@ -40,7 +40,7 @@ class ReflectedClassSymbolTests : IntelliMarker, WordSpec({ "reflect its superinterfaces correctly" { TestClassesGen.forAllEqual { - classSym(it)!!.superInterfaces to it.interfaces.toList().map { classSym(it) } + classSym(it)!!.superInterfaces to it.interfaces.toList().map { clazz -> classSym(clazz) } } } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/ReflectedFieldSymbolTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/ReflectedFieldSymbolTest.kt index bf09835375..4e5e07f00f 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/ReflectedFieldSymbolTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/ReflectedFieldSymbolTest.kt @@ -6,6 +6,7 @@ package net.sourceforge.pmd.lang.java.symbols.internal import io.kotest.assertions.throwables.shouldThrow import io.kotest.core.spec.style.WordSpec +import io.kotest.matchers.ints.shouldBeExactly import io.kotest.matchers.shouldBe import io.kotest.matchers.shouldNotBe import io.kotest.property.arbitrary.filterNot @@ -39,8 +40,8 @@ class ReflectedFieldSymbolTest : IntelliMarker, WordSpec({ "reflect its modifiers properly" { TestClassesGen.filterNot { it.isArray }.forAllEqual { Pair( - classSym(it)!!.declaredFields.map { it.simpleName to it.modifiers }, - it.declaredFields.map { it.name to it.modifiers } + classSym(it)!!.declaredFields.map { fieldSymbol -> fieldSymbol.simpleName to fieldSymbol.modifiers }, + it.declaredFields.map { field -> field.name to field.modifiers } ) } } @@ -56,9 +57,14 @@ class ReflectedFieldSymbolTest : IntelliMarker, WordSpec({ } "be unmodifiable" { - shouldThrow { - classSym(SomeFields::class.java)!!.getDeclaredField("foo")!!.declaredAnnotations.add(null) - } + val declaredAnnotations = classSym(SomeFields::class.java)!!.getDeclaredField("foo")!!.declaredAnnotations + declaredAnnotations.size shouldBeExactly 1 + val annot = declaredAnnotations.first() + declaredAnnotations.plus(annot) + declaredAnnotations.size shouldBeExactly 1 + + // still unmodified + classSym(SomeFields::class.java)!!.getDeclaredField("foo")!!.declaredAnnotations.size shouldBeExactly 1 } } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/Utils.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/Utils.kt index d83b1cafbc..549db7c9e8 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/Utils.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/Utils.kt @@ -8,7 +8,6 @@ import io.kotest.assertions.withClue import io.kotest.matchers.collections.haveSize import io.kotest.matchers.should import io.kotest.property.* -import io.kotest.property.arbitrary.arbitrary import net.sourceforge.pmd.lang.java.symbols.JClassSymbol import net.sourceforge.pmd.lang.java.symbols.SymbolResolver import net.sourceforge.pmd.lang.java.types.testTypeSystem @@ -80,7 +79,7 @@ object TestClassesGen : Arb>() { return } val files = directory.listFiles() - for (file in files) { + for (file in files!!) { if (file.isDirectory) { assert(!file.name.contains(".")) findClasses(file, packageName + "." + file.name) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/BrokenClasspathTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/BrokenClasspathTest.kt index 85f988420c..adce5714d8 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/BrokenClasspathTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/BrokenClasspathTest.kt @@ -59,7 +59,7 @@ class BrokenClasspathTest : FunSpec({ // since we're loading things lazily this type hasn't tried to populate its superinterfaces val superItfType = ts.declaration(unresolvedItfSym) as JClassType val subclassType = ts.declaration(subclassSym) as JClassType - val (tvarC, tvarD) = subclassType.formalTypeParams + val (_, tvarD) = subclassType.formalTypeParams // and now since the super interface *type* is parameterized, we'll try to create SuperItf // Except SuperItf is unresolved. diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/SigParserTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/SigParserTest.kt index 4d16fdc868..70732ce819 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/SigParserTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/SigParserTest.kt @@ -7,9 +7,7 @@ package net.sourceforge.pmd.lang.java.symbols.internal.asm import io.kotest.assertions.throwables.shouldThrow import io.kotest.assertions.withClue import io.kotest.core.spec.style.FunSpec -import io.kotest.matchers.Matcher import io.kotest.matchers.collections.shouldHaveSize -import io.kotest.matchers.should import io.kotest.matchers.shouldBe import io.kotest.matchers.string.shouldContain import javasymbols.testdata.impls.SomeInnerClasses diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/HeaderScopesTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/HeaderScopesTest.kt index e580ec1ceb..2275d89510 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/HeaderScopesTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/HeaderScopesTest.kt @@ -7,8 +7,6 @@ package net.sourceforge.pmd.lang.java.symbols.table.internal import io.kotest.matchers.collections.* -import io.kotest.matchers.maps.shouldBeEmpty -import io.kotest.matchers.maps.shouldContain import io.kotest.matchers.nulls.shouldNotBeNull import io.kotest.matchers.should import io.kotest.matchers.shouldBe @@ -252,8 +250,8 @@ class HeaderScopesTest : ProcessorTestSpec({ it.apply { scopeTag shouldBe SINGLE_IMPORT results should haveSize(2) - results.forEach { - it.symbol.enclosingClass.canonicalName shouldBe "javasymbols.testdata.StaticNameCollision" + results.forEach { methodSig -> + methodSig.symbol.enclosingClass.canonicalName shouldBe "javasymbols.testdata.StaticNameCollision" } } @@ -261,8 +259,8 @@ class HeaderScopesTest : ProcessorTestSpec({ it.apply { scopeTag shouldBe IMPORT_ON_DEMAND results should haveSize(2) - results.forEach { - it.symbol.enclosingClass.canonicalName shouldBe "javasymbols.testdata.Statics" + results.forEach { methodSig -> + methodSig.symbol.enclosingClass.canonicalName shouldBe "javasymbols.testdata.Statics" } } } @@ -276,8 +274,8 @@ class HeaderScopesTest : ProcessorTestSpec({ it.apply { scopeTag shouldBe IMPORT_ON_DEMAND results should haveSize(1) - results.forEach { - it.symbol.enclosingClass.canonicalName shouldBe "javasymbols.testdata.Statics" + results.forEach { methodSig -> + methodSig.symbol.enclosingClass.canonicalName shouldBe "javasymbols.testdata.Statics" } } } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/LocalTypeScopesTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/LocalTypeScopesTest.kt index eb874dca5e..e069eacc04 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 @@ -112,7 +112,7 @@ class LocalTypeScopesTest : ParserTestSpec({ } """) - val (foo, inner, other) = + val (foo, inner, _) = acu.descendants(ASTClassDeclaration::class.java).toList() val (insideFoo, insideInner, insideOther) = diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/MemberInheritanceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/MemberInheritanceTest.kt index 47f9947c13..425d703d0b 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 @@ -261,26 +261,26 @@ class MemberInheritanceTest : ParserTestSpec({ } """) - val (t_Scratch, t_Inner) = + val (typeScratch, typeInner) = acu.descendants(ASTClassDeclaration::class.java).toList { it.typeMirror } val insideFoo = acu.descendants(ASTClassBody::class.java) .crossFindBoundaries().get(2)!! - val `t_Scratch{String}Inner` = with (acu.typeDsl) { - t_Scratch[gen.t_String].selectInner(t_Inner.symbol, emptyList()) + val `typeScratch{String}Inner` = with (acu.typeDsl) { + typeScratch[gen.t_String].selectInner(typeInner.symbol, emptyList()) } insideFoo.symbolTable.types().resolve("Inner").shouldBeSingleton { - it.shouldBe(`t_Scratch{String}Inner`) + it.shouldBe(`typeScratch{String}Inner`) } val typeNode = acu.descendants(ASTClassType::class.java).first { it.simpleName == "Inner" }!! typeNode.shouldMatchN { classType("Inner") { - it shouldHaveType `t_Scratch{String}Inner` + it shouldHaveType `typeScratch{String}Inner` } } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/VarScopingTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/VarScopingTest.kt index 2435e576d5..6018dc47d8 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 @@ -426,7 +426,7 @@ class VarScopingTest : ProcessorTestSpec({ """.trimIndent()) - val (_, t_SomeEnum) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } + val (_, typeSomeEnum) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } val (enumA, enumB) = acu.descendants(ASTEnumDeclaration::class.java) @@ -443,17 +443,17 @@ class VarScopingTest : ProcessorTestSpec({ qualifiedA.referencedSym shouldBe enumA.symbol qualifiedA.referencedSym!!.tryGetNode() shouldBe enumA - qualifiedA shouldHaveType t_SomeEnum + qualifiedA shouldHaveType typeSomeEnum caseA.referencedSym shouldBe enumA.symbol caseA.referencedSym!!.tryGetNode() shouldBe enumA - caseA shouldHaveType t_SomeEnum + caseA shouldHaveType typeSomeEnum caseB.referencedSym shouldBe enumB.symbol caseB.referencedSym!!.tryGetNode() shouldBe enumB - caseB shouldHaveType t_SomeEnum + caseB shouldHaveType typeSomeEnum - e shouldHaveType t_SomeEnum + e shouldHaveType typeSomeEnum // symbol tables don't carry that info, this is documented on JSymbolTable#variables() caseB.symbolTable.variables().resolve("A").shouldBeEmpty() diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ArraySymbolTests.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ArraySymbolTests.kt index 34d72f2690..c3fbed8538 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ArraySymbolTests.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ArraySymbolTests.kt @@ -21,7 +21,7 @@ import net.sourceforge.pmd.lang.java.symbols.internal.getDeclaredMethods */ class ArraySymbolTests : WordSpec({ - val INT_SYM = testTypeSystem.getClassSymbol(java.lang.Integer.TYPE) + val INT_SYM = testTypeSystem.getClassSymbol(Integer.TYPE) val STRING_SYM = testTypeSystem.getClassSymbol(java.lang.String::class.java) fun makeArraySym(comp: JTypeDeclSymbol?) = ArraySymbolImpl(testTypeSystem, comp) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/BoxingTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/BoxingTest.kt index f061b0050a..2d0739dda1 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/BoxingTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/BoxingTest.kt @@ -10,7 +10,6 @@ import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.shouldNotBe import io.kotest.matchers.types.shouldBeInstanceOf import io.kotest.matchers.types.shouldBeSameInstanceAs -import io.kotest.property.forAll import net.sourceforge.pmd.lang.java.symbols.internal.forAllEqual /** diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/CaptureTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/CaptureTest.kt index 951f12c671..03125a0a58 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/CaptureTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/CaptureTest.kt @@ -7,7 +7,6 @@ package net.sourceforge.pmd.lang.java.types import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.java.symbols.JClassSymbol import net.sourceforge.pmd.lang.java.symbols.internal.asm.createUnresolvedAsmSymbol import net.sourceforge.pmd.lang.java.types.TypeConversion.* @@ -58,7 +57,7 @@ class CaptureTest : FunSpec({ } test("Capture of malformed types") { - val sym = ts.createUnresolvedAsmSymbol("does.not.Exist") as JClassSymbol + val sym = ts.createUnresolvedAsmSymbol("does.not.Exist") val matcher = captureMatcher(`?` extends t_String).also { capture(sym[t_String, `?` extends t_String]) shouldBe sym[t_String, it] diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/SubtypingTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/SubtypingTest.kt index 1fdb1affa0..e370ca9112 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/SubtypingTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/SubtypingTest.kt @@ -15,7 +15,6 @@ import io.kotest.property.exhaustive.ints import io.kotest.property.forAll import net.sourceforge.pmd.lang.ast.test.shouldBeA import net.sourceforge.pmd.lang.java.ast.ParserTestCtx -import net.sourceforge.pmd.lang.java.symbols.JClassSymbol import net.sourceforge.pmd.lang.java.symbols.internal.UnresolvedClassStore import net.sourceforge.pmd.lang.java.symbols.internal.asm.createUnresolvedAsmSymbol import net.sourceforge.pmd.lang.java.types.TypeConversion.* @@ -157,10 +156,10 @@ class SubtypingTest : FunSpec({ test("Test raw type is convertible to wildcard parameterized type without unchecked conversion") { val `Class{String}` = Class::class[ts.STRING] - val `Class{?}` = Class::class[`?`] + val `Class{Wildcard}` = Class::class[`?`] val Class = Class::class.raw - val `Comparable{?}` = java.lang.Comparable::class[`?`] + val `Comparable{Wildcard}` = java.lang.Comparable::class[`?`] /* Class raw = String.class; @@ -179,15 +178,15 @@ class SubtypingTest : FunSpec({ `Class{String}` shouldBeSubtypeOf Class - `Class{?}` shouldBeSubtypeOf Class + `Class{Wildcard}` shouldBeSubtypeOf Class - `Class{String}` shouldBeSubtypeOf `Class{?}` - `Class{?}` shouldNotBeSubtypeOf `Class{String}` + `Class{String}` shouldBeSubtypeOf `Class{Wildcard}` + `Class{Wildcard}` shouldNotBeSubtypeOf `Class{String}` - assertSubtype(Class, `Class{?}`) { this == UNCHECKED_NO_WARNING } + assertSubtype(Class, `Class{Wildcard}`) { this == UNCHECKED_NO_WARNING } Class shouldBeUncheckedSubtypeOf `Class{String}` - ts.STRING shouldBeSubtypeOf `Comparable{?}` + ts.STRING shouldBeSubtypeOf `Comparable{Wildcard}` } test("Test wildcard subtyping") { @@ -319,7 +318,7 @@ class SubtypingTest : FunSpec({ } test("Test non well-formed types") { - val sym = ts.createUnresolvedAsmSymbol("does.not.Exist") as JClassSymbol + val sym = ts.createUnresolvedAsmSymbol("does.not.Exist") sym[t_String, t_String] shouldBeUnrelatedTo sym[t_String] sym[t_String] shouldBeSubtypeOf sym[t_String] sym[t_String] shouldBeSubtypeOf sym[`?` extends t_String] // containment diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TestUtilitiesForTypes.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TestUtilitiesForTypes.kt index 90482a9828..ae87d1890e 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TestUtilitiesForTypes.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TestUtilitiesForTypes.kt @@ -8,7 +8,6 @@ package net.sourceforge.pmd.lang.java.types import io.kotest.assertions.* -import io.kotest.assertions.print.Printed import io.kotest.assertions.print.print import io.kotest.matchers.shouldBe import net.sourceforge.pmd.lang.ast.test.shouldBe @@ -18,8 +17,8 @@ import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.symbols.internal.asm.AsmSymbolResolver import net.sourceforge.pmd.lang.java.types.TypeOps.* import org.hamcrest.Description +import java.util.stream.Collectors import kotlin.String -import kotlin.streams.toList import kotlin.test.assertTrue /* @@ -45,7 +44,7 @@ val TypeSystem.STRING get() = declaration(getClassSymbol(String::class.java)) as typealias TypePair = Pair -fun JTypeMirror.getMethodsByName(name: String) = streamMethods { it.simpleName == name }.toList() +fun JTypeMirror.getMethodsByName(name: String): List = streamMethods { it.simpleName == name }.collect(Collectors.toList()) fun JTypeMirror.shouldBeUnresolvedClass(canonicalName: String) = this.shouldBeA { @@ -225,6 +224,7 @@ val JTypeMirror.isExlusiveIntersectionBound /** * Was added in java 12. */ +@Suppress("UNCHECKED_CAST") val Class.arrayType: Class> get() { val arr = java.lang.reflect.Array.newInstance(this, 0) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeCreationDsl.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeCreationDsl.kt index f274fd9122..e0afd0284a 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeCreationDsl.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeCreationDsl.kt @@ -7,7 +7,6 @@ package net.sourceforge.pmd.lang.java.types import net.sourceforge.pmd.lang.java.ast.JavaNode -import net.sourceforge.pmd.lang.java.ast.ParserTestSpec import net.sourceforge.pmd.lang.java.symbols.JClassSymbol import net.sourceforge.pmd.lang.java.symbols.SymbolicValue.SymAnnot import net.sourceforge.pmd.lang.java.symbols.internal.FakeSymAnnot @@ -26,7 +25,7 @@ val JavaNode.typeDsl get() = TypeDslOf(this.typeSystem) * int[][]: int.toArray(2) * List: List::class[`?` extends Number::class] * - * Use [typeDsl] (eg `with(node.typeDsl) { ... }`, + * Use [typeDsl] (eg `with(node.typeDsl) { ... }`), * or [TypeDslOf] (eg `with(TypeDslOf(ts)) { ... }`) * * to bring it into scope. @@ -125,13 +124,14 @@ interface TypeDslMixin { * List::class[`?` super String::class] * */ + @Suppress("DANGEROUS_CHARACTERS") val `?`: WildcardDsl get() = WildcardDsl(ts) } /** See [TypeDslMixin.@A]. */ -val ParserTestSpec.GroupTestCtx.VersionedTestCtx.ImplicitNodeParsingCtx<*>.AnnotA +val AnnotA get() = "@" + ClassWithTypeAnnotationsInside.A::class.java.canonicalName class TypeDslOf(override val ts: TypeSystem) : TypeDslMixin diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeEqualityTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeEqualityTest.kt index 99e363d56e..439fb9a03e 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeEqualityTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeEqualityTest.kt @@ -10,9 +10,7 @@ import io.kotest.matchers.shouldBe import io.kotest.matchers.shouldNotBe import io.kotest.property.checkAll import io.kotest.property.forAll -import net.sourceforge.pmd.lang.java.symbols.JClassSymbol import net.sourceforge.pmd.lang.java.symbols.internal.asm.createUnresolvedAsmSymbol -import net.sourceforge.pmd.lang.java.symbols.internal.forAllEqual /** * @author Clément Fournier @@ -83,7 +81,7 @@ class TypeEqualityTest : FunSpec({ test("Test non well-formed types") { - val sym = ts.createUnresolvedAsmSymbol("does.not.Exist") as JClassSymbol + val sym = ts.createUnresolvedAsmSymbol("does.not.Exist") // not equal sym[t_String, t_String] shouldNotBe sym[t_String] sym[t_String] shouldNotBe sym[t_String, t_String] diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeGenerationUtil.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeGenerationUtil.kt index 455c7ba3fd..69260414da 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeGenerationUtil.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeGenerationUtil.kt @@ -10,7 +10,9 @@ import io.kotest.property.Arb import io.kotest.property.Exhaustive import io.kotest.property.RandomSource import io.kotest.property.Sample -import io.kotest.property.arbitrary.* +import io.kotest.property.arbitrary.arbitrary +import io.kotest.property.arbitrary.filter +import io.kotest.property.arbitrary.pair import io.kotest.property.exhaustive.exhaustive import net.sourceforge.pmd.lang.java.JavaParsingHelper import net.sourceforge.pmd.lang.java.ast.ASTTypeParameter @@ -18,8 +20,7 @@ import net.sourceforge.pmd.lang.java.ast.ASTTypeParameters import net.sourceforge.pmd.lang.java.ast.ParserTestCtx import net.sourceforge.pmd.lang.java.symbols.internal.TestClassesGen import net.sourceforge.pmd.lang.java.symbols.internal.asm.createUnresolvedAsmSymbol -import javax.lang.model.type.TypeMirror -import kotlin.streams.toList +import java.util.stream.Collectors val TypeSystem.primitiveGen: Exhaustive get() = exhaustive(this.allPrimitives.toList()) @@ -48,7 +49,7 @@ class RefTypeGenArb(val ts: TypeSystem) : Arb() { // we exclude the null type because it's not ok as an array component ts.SERIALIZABLE, ts.CLONEABLE - ); + ) override fun edgecase(rs: RandomSource): JTypeMirror { return allEdgecases.random(rs.random) @@ -105,7 +106,7 @@ class RefTypeGenArb(val ts: TypeSystem) : Arb() { -@Suppress("ObjectPropertyName", "MemberVisibilityCanBePrivate") +@Suppress("MemberVisibilityCanBePrivate", "DANGEROUS_CHARACTERS") class RefTypeConstants(override val ts: TypeSystem) : TypeDslMixin { val t_String: JClassType get() = java.lang.String::class.decl @@ -192,7 +193,7 @@ fun JavaParsingHelper.makeDummyTVars(vararg names: String): List { .toStream() .map { it.typeMirror - }.toList() + }.collect(Collectors.toList()) } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypesFromReflectionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypesFromReflectionTest.kt index 0e8c5a6cc3..9785fc2669 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypesFromReflectionTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypesFromReflectionTest.kt @@ -90,6 +90,7 @@ class TypesFromReflectionTest : FunSpec({ } + @Suppress("unused") private class GenericKlass /** diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ast/ConversionContextTests.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ast/ConversionContextTests.kt index b17eeae84e..c7ddf6d271 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 @@ -49,7 +49,7 @@ class ConversionContextTests : ProcessorTestSpec({ } """) - val (ternary, _, num1, shortCast, num5) = acu.descendants(ASTExpression::class.java).toList() + val (ternary, _, num1, shortCast, _) = acu.descendants(ASTExpression::class.java).toList() spy.shouldBeOk { // ternary is in double assignment context @@ -80,7 +80,7 @@ class ConversionContextTests : ProcessorTestSpec({ } """) - val (ternary, _, integerCast, nullLit, num4) = acu.descendants(ASTExpression::class.java).toList() + val (ternary, _, integerCast, _, num4) = acu.descendants(ASTExpression::class.java).toList() spy.shouldBeOk { // ternary is in double assignment context diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/BranchingExprsTestCases.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/BranchingExprsTestCases.kt index 3810efe856..54d7834c04 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/BranchingExprsTestCases.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/BranchingExprsTestCases.kt @@ -4,7 +4,6 @@ package net.sourceforge.pmd.lang.java.types.internal.infer -import io.kotest.matchers.shouldBe import net.sourceforge.pmd.lang.ast.test.shouldBe import net.sourceforge.pmd.lang.ast.test.shouldMatchN import net.sourceforge.pmd.lang.java.ast.* diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/CaptureInferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/CaptureInferenceTest.kt index b4f84781af..f9b36667de 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 @@ -476,7 +476,6 @@ public class SubClass { """.trimIndent() ) - val cvar = acu.typeVar("C") val tvar = acu.typeVar("T") spy.shouldBeOk { diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/CtorInferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/CtorInferenceTest.kt index ce73c75bfb..8719732856 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/CtorInferenceTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/CtorInferenceTest.kt @@ -215,7 +215,7 @@ class CtorInferenceTest : ProcessorTestSpec({ """) - val (t_Outer, t_Inner, t_Scratch) = acu.declaredTypeSignatures() + val (t_Outer, t_Inner, _) = acu.declaredTypeSignatures() val (innerCtor) = acu.ctorDeclarations().toList() val (ctor) = acu.descendants(ASTExplicitConstructorInvocation::class.java).toList() @@ -260,7 +260,7 @@ class CtorInferenceTest : ProcessorTestSpec({ """) - val (t_Outer, t_Inner, t_Scratch) = acu.declaredTypeSignatures() + val (t_Outer, t_Inner, _) = acu.declaredTypeSignatures() val (innerCtor) = acu.ctorDeclarations().toList() val (ctor) = acu.descendants(ASTExplicitConstructorInvocation::class.java).toList() @@ -335,7 +335,7 @@ class CtorInferenceTest : ProcessorTestSpec({ parserTest("Mapping of type params doesn't fail") { - val (acu, spy) = parser.parseWithTypeInferenceSpy( + val (acu, _) = parser.parseWithTypeInferenceSpy( """ class Gen { diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/Java7InferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/Java7InferenceTest.kt index bb2778d52c..c67186fe28 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 @@ -193,7 +193,7 @@ class Java7InferenceTest : ProcessorTestSpec({ }) -private fun TypeDslMixin.ctorInfersTo( +private fun ctorInfersTo( call: ASTConstructorCall, inferredType: JClassType ) { @@ -204,7 +204,7 @@ private fun TypeDslMixin.ctorInfersTo( ) } -private fun TypeDslMixin.methodInfersTo(call: ASTMethodCall, returnType: JClassType) { +private fun methodInfersTo(call: ASTMethodCall, returnType: JClassType) { call.methodType.shouldMatchMethod( named = call.methodName, declaredIn = null, // not asserted diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverridingTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverridingTest.kt index 4265682cfc..c7f41da2b8 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverridingTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverridingTest.kt @@ -10,7 +10,6 @@ import io.kotest.matchers.shouldBe import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.types.* import net.sourceforge.pmd.util.OptionalBool -import org.intellij.lang.annotations.Language import kotlin.test.assertFalse import kotlin.test.assertTrue diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/SpecialMethodsTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/SpecialMethodsTest.kt index 05ae0ee19a..1c3d7feb0e 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/SpecialMethodsTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/SpecialMethodsTest.kt @@ -5,6 +5,7 @@ package net.sourceforge.pmd.lang.java.types.internal.infer import io.kotest.matchers.shouldBe +import io.kotest.matchers.shouldNotBe import net.sourceforge.pmd.lang.ast.test.shouldBeA import net.sourceforge.pmd.lang.ast.test.shouldMatchN import net.sourceforge.pmd.lang.java.ast.* @@ -44,7 +45,7 @@ class SpecialMethodsTest : ProcessorTestSpec({ val t_Scratch = acu.declaredTypeSignatures()[0] val kvar = acu.typeVar("K") - val (k, k2, raw, call) = acu.methodCalls().toList() + val (k, k2, _, call) = acu.methodCalls().toList() doTest("Test this::getClass") { spy.shouldBeOk { @@ -137,7 +138,7 @@ class SpecialMethodsTest : ProcessorTestSpec({ """.trimIndent()) - val t_Scratch = acu.descendants(ASTTypeDeclaration::class.java).firstOrThrow().typeMirror + acu.descendants(ASTTypeDeclaration::class.java).firstOrThrow().typeMirror shouldNotBe null val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/StandaloneTypesTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/StandaloneTypesTest.kt index 51729be664..ada89eb28b 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/StandaloneTypesTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/StandaloneTypesTest.kt @@ -8,10 +8,7 @@ package net.sourceforge.pmd.lang.java.types.internal.infer import io.kotest.assertions.withClue import io.kotest.matchers.shouldBe import io.kotest.matchers.shouldNotBe -import io.kotest.property.arbitrary.filterNot -import io.kotest.property.checkAll import net.sourceforge.pmd.lang.ast.test.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBeA import net.sourceforge.pmd.lang.ast.test.shouldMatchN import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.ast.BinaryOp.* diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/StressTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/StressTest.kt index 587e564fd7..2af70e82aa 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 @@ -39,7 +39,7 @@ class StressTest : ProcessorTestSpec({ fun TreeNodeWrapper.typeIs(value: Boolean) { it.typeMirror.shouldBeA { it.symbol.binaryName shouldBe "net.sourceforge.pmd.lang.java.types.testdata.BoolLogic\$${value.toString() - .replaceFirstChar { if (it.isLowerCase()) it.titlecase(Locale.getDefault()) else it.toString() }}" + .replaceFirstChar { char -> if (char.isLowerCase()) char.titlecase(Locale.getDefault()) else char.toString() }}" } } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/TypeAnnotationsInferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/TypeAnnotationsInferenceTest.kt index b43cc4be6f..05ecc933b9 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/TypeAnnotationsInferenceTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/TypeAnnotationsInferenceTest.kt @@ -8,8 +8,6 @@ package net.sourceforge.pmd.lang.java.types.internal.infer import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.types.* -import net.sourceforge.pmd.lang.java.types.internal.infer.TypeInferenceLogger.VerboseLogger -import java.util.* /** */ diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/TypeInferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/TypeInferenceTest.kt index 8a1e246d74..27d8af4949 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 @@ -248,7 +248,7 @@ class Scratch { } """.trimIndent()) - val (t_I, t_C) = acu.declaredTypeSignatures() + val (_, t_C) = acu.declaredTypeSignatures() val tParam = acu.typeVariables().first { it.name == "T" } spy.shouldBeOk { diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/UnresolvedTypesRecoveryTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/UnresolvedTypesRecoveryTest.kt index 9c2b3e147d..99ca3b5dd2 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 @@ -261,7 +261,7 @@ class C { val (fooM, idM) = acu.descendants(ASTMethodDeclaration::class.java).toList { it.symbol } val t_Foo = fooM.getReturnType(Substitution.EMPTY).shouldBeUnresolvedClass("ooo.Foo") - val t_Bound = idM.typeParameters[0].upperBound.shouldBeUnresolvedClass("ooo.Bound") + idM.typeParameters[0].upperBound.shouldBeUnresolvedClass("ooo.Bound") val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() diff --git a/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/cpd/test/CpdTextComparisonTest.kt b/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/cpd/test/CpdTextComparisonTest.kt index 7e462d2c99..abf42e6d75 100644 --- a/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/cpd/test/CpdTextComparisonTest.kt +++ b/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/cpd/test/CpdTextComparisonTest.kt @@ -130,9 +130,9 @@ abstract class CpdTextComparisonTest( private fun StringBuilder.formatLine(escapedImage: String, bcol: Any, ecol: Any): StringBuilder { var colStart = length - colStart = append(Indent).append(escapedImage).padCol(colStart, Col0Width) + colStart = append(INDENT).append(escapedImage).padCol(colStart, COL_0_WIDTH) @Suppress("UNUSED_VALUE") - colStart = append(Indent).append(bcol).padCol(colStart, Col1Width) + colStart = append(INDENT).append(bcol).padCol(colStart, COL_1_WIDTH) return append(ecol) } @@ -152,7 +152,7 @@ abstract class CpdTextComparisonTest( .replace(Regex("\\u000D\\u000A|[\\u000A\\u000B\\u000C\\u000D\\u0085\\u2028\\u2029]"), "\\\\n") // escape other newlines (normalizing), use \\R with java8+ .replace(Regex("[]\\[]"), "\\\\$0") // escape [] - var truncated = StringUtils.truncate(escaped, ImageSize) + var truncated = StringUtils.truncate(escaped, IMAGE_SIZE) if (truncated.endsWith('\\') && !truncated.endsWith("\\\\")) truncated = truncated.substring(0, truncated.length - 1) // cut inside an escape @@ -176,10 +176,10 @@ abstract class CpdTextComparisonTest( CpdLexer.tokenize(cpdLexer, sourceCodeOf(fileData)) private companion object { - const val Indent = " " - const val Col0Width = 40 - const val Col1Width = 10 + Indent.length - val ImageSize = Col0Width - Indent.length - 2 // -2 is for the "[]" + const val INDENT = " " + const val COL_0_WIDTH = 40 + const val COL_1_WIDTH = 10 + INDENT.length + const val IMAGE_SIZE = COL_0_WIDTH - INDENT.length - 2 // -2 is for the "[]" } } diff --git a/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/ast/test/NodeExtensions.kt b/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/ast/test/NodeExtensions.kt index 2a132ce149..a6d0ea0892 100644 --- a/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/ast/test/NodeExtensions.kt +++ b/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/ast/test/NodeExtensions.kt @@ -20,8 +20,6 @@ val TextAvailableNode.textStr: String infix fun TextAvailableNode.shouldHaveText(str: String) { this::textStr shouldBe str } -inline fun Node.getDescendantsOfType(): List = descendants(T::class.java).toList() -inline fun Node.getFirstDescendantOfType(): T = descendants(T::class.java).firstOrThrow() fun Node.textOfReportLocation(): String? = reportLocation.regionInFile?.let(textDocument::sliceOriginalText)?.toString() diff --git a/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/ast/test/NodePrinters.kt b/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/ast/test/NodePrinters.kt index 709b18c115..9d3dad1d49 100644 --- a/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/ast/test/NodePrinters.kt +++ b/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/ast/test/NodePrinters.kt @@ -27,10 +27,10 @@ val SimpleNodePrinter = TextTreeRenderer(true, -1) open class RelevantAttributePrinter : BaseNodeAttributePrinter() { - private val Ignored = setOf("BeginLine", "EndLine", "BeginColumn", "EndColumn", "FindBoundary", "SingleLine") + private val defaultIgnoredAttributes = setOf("BeginLine", "EndLine", "BeginColumn", "EndColumn", "FindBoundary", "SingleLine") override fun ignoreAttribute(node: Node, attribute: Attribute): Boolean = - Ignored.contains(attribute.name) || attribute.name == "Image" && attribute.value == null + defaultIgnoredAttributes.contains(attribute.name) || attribute.name == "Image" && attribute.value == null } @@ -102,7 +102,7 @@ open class BaseNodeAttributePrinter : TextTreeRenderer(true, -1) { get() = this.javaClass.let { when { it.isEnum -> it - else -> it.enclosingClass.takeIf { it.isEnum } + else -> it.enclosingClass.takeIf { clazz -> clazz.isEnum } ?: throw IllegalStateException() } } diff --git a/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/ast/test/TestUtils.kt b/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/ast/test/TestUtils.kt index e037138889..b7d9a5127e 100644 --- a/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/ast/test/TestUtils.kt +++ b/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/ast/test/TestUtils.kt @@ -12,6 +12,7 @@ import net.sourceforge.pmd.reporting.Report import net.sourceforge.pmd.reporting.RuleViolation import net.sourceforge.pmd.lang.ast.Node import net.sourceforge.pmd.lang.document.Chars +import java.util.* import kotlin.reflect.KCallable import kotlin.reflect.jvm.isAccessible import kotlin.test.assertEquals @@ -29,9 +30,9 @@ infix fun KCallable.shouldEqual(expected: V?) = n.should(equalityMatcher(v) as Matcher) } -private fun assertWrapper(callable: KCallable, right: V, asserter: (N, V) -> Unit) { +private fun assertWrapper(callable: KCallable, expected: V, asserter: (N, V) -> Unit) { - fun formatName() = "::" + callable.name.removePrefix("get").decapitalize() + fun formatName() = "::" + callable.name.removePrefix("get").replaceFirstChar { it.lowercase(Locale.getDefault()) } val value: N = try { callable.isAccessible = true @@ -41,7 +42,7 @@ private fun assertWrapper(callable: KCallable, right: V, asserter: (N, } try { - asserter(value, right) + asserter(value, expected) } catch (e: AssertionError) { if (e.message?.contains("expected:") == true) { diff --git a/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/test/BaseTextComparisonTest.kt b/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/test/BaseTextComparisonTest.kt index 635a85655c..9c67e29a9a 100644 --- a/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/test/BaseTextComparisonTest.kt +++ b/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/test/BaseTextComparisonTest.kt @@ -31,8 +31,8 @@ abstract class BaseTextComparisonTest { data class FileData(val fileName: FileId, val fileText:String) /** - * Executes the test. The test files are looked up using the [parser]. - * The reference test file must be named [fileBaseName] + [ExpectedExt]. + * Executes the test. The test files are looked up using the [resourceLoader]. + * The reference test file must be named [fileBaseName] + [EXPECTED_EXTENSION]. * The source file to parse must be named [fileBaseName] + [extensionIncludingDot]. * * @param transformTextContent Function that maps the contents of the source file to the @@ -41,7 +41,7 @@ abstract class BaseTextComparisonTest { internal fun doTest(fileBaseName: String, expectedSuffix: String = "", transformTextContent: (FileData) -> String) { - val expectedFile = findTestFile(resourceLoader, "${resourcePrefix}/$fileBaseName$expectedSuffix$ExpectedExt").toFile() + val expectedFile = findTestFile(resourceLoader, "${resourcePrefix}/$fileBaseName$expectedSuffix$EXPECTED_EXTENSION").toFile() val actual = transformTextContent(sourceText(fileBaseName)) @@ -97,7 +97,7 @@ abstract class BaseTextComparisonTest { } companion object { - const val ExpectedExt = ".txt" + const val EXPECTED_EXTENSION = ".txt" } From dc92c64135a80c49ca4ba5bd7f5ff692a258346b Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 1 Mar 2024 17:06:58 +0100 Subject: [PATCH 51/52] [core] NodeStreamBlanketTest - prefilter the test data in order to avoid many ignored unit tests. E.g. before this change, we had: Tests passed: 5,417, ignored: 2,539 of 7,956 tests meaning about 30% of the tests were ignored. --- .../ast/internal/NodeStreamBlanketTest.java | 44 ++++++++++++------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/lang/ast/internal/NodeStreamBlanketTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/lang/ast/internal/NodeStreamBlanketTest.java index d8a0f3a496..755f948c7c 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/lang/ast/internal/NodeStreamBlanketTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/lang/ast/internal/NodeStreamBlanketTest.java @@ -68,7 +68,7 @@ class NodeStreamBlanketTest { ); @ParameterizedTest - @MethodSource("primeNumbers") + @MethodSource("allNodeStreamVariants") void testToListConsistency(NodeStream stream) { List toList = stream.toList(); List collected = stream.collect(Collectors.toList()); @@ -81,7 +81,7 @@ class NodeStreamBlanketTest { } @ParameterizedTest - @MethodSource("primeNumbers") + @MethodSource("allNodeStreamVariants") void testToListSize(NodeStream stream) { List toList = stream.toList(); @@ -90,7 +90,7 @@ class NodeStreamBlanketTest { @ParameterizedTest - @MethodSource("primeNumbers") + @MethodSource("nodeStreamVariantsNonEmpty") void testLast(NodeStream stream) { assertImplication( stream, @@ -100,7 +100,7 @@ class NodeStreamBlanketTest { } @ParameterizedTest - @MethodSource("primeNumbers") + @MethodSource("nodeStreamVariantsNonEmpty") void testFirst(NodeStream stream) { assertImplication( stream, @@ -111,7 +111,7 @@ class NodeStreamBlanketTest { @ParameterizedTest - @MethodSource("primeNumbers") + @MethodSource("nodeStreamVariantsNonEmpty") void testDrop(NodeStream stream) { assertImplication( stream, @@ -123,7 +123,7 @@ class NodeStreamBlanketTest { } @ParameterizedTest - @MethodSource("primeNumbers") + @MethodSource("nodeStreamVariantsNonEmpty") void testDropLast(NodeStream stream) { assertImplication( stream, @@ -135,7 +135,7 @@ class NodeStreamBlanketTest { } @ParameterizedTest - @MethodSource("primeNumbers") + @MethodSource("nodeStreamVariantsMoreThanOne") void testDropMoreThan1(NodeStream stream) { assertImplication( stream, @@ -146,7 +146,7 @@ class NodeStreamBlanketTest { } @ParameterizedTest - @MethodSource("primeNumbers") + @MethodSource("nodeStreamVariantsNonEmpty") void testTake(NodeStream stream) { assertImplication( stream, @@ -158,7 +158,7 @@ class NodeStreamBlanketTest { } @ParameterizedTest - @MethodSource("primeNumbers") + @MethodSource("allNodeStreamVariants") void testGet(NodeStream stream) { for (int i = 0; i < 100; i++) { assertSame(stream.get(i), stream.drop(i).first(), "stream.get(i) == stream.drop(i).first()"); @@ -166,25 +166,25 @@ class NodeStreamBlanketTest { } @ParameterizedTest - @MethodSource("primeNumbers") + @MethodSource("allNodeStreamVariants") void testGetNegative(NodeStream stream) { assertThrows(IllegalArgumentException.class, () -> stream.get(-1)); } @ParameterizedTest - @MethodSource("primeNumbers") + @MethodSource("allNodeStreamVariants") void testDropNegative(NodeStream stream) { assertThrows(IllegalArgumentException.class, () -> stream.drop(-1)); } @ParameterizedTest - @MethodSource("primeNumbers") + @MethodSource("allNodeStreamVariants") void testTakeNegative(NodeStream stream) { assertThrows(IllegalArgumentException.class, () -> stream.take(-1)); } @ParameterizedTest - @MethodSource("primeNumbers") + @MethodSource("allNodeStreamVariants") void testEmpty(NodeStream stream) { assertEquivalence( stream, @@ -201,11 +201,21 @@ class NodeStreamBlanketTest { ); } - static Collection primeNumbers() { + static Collection> nodeStreamVariantsNonEmpty() { + return allNodeStreamVariants().stream().filter(NodeStream::nonEmpty).collect(Collectors.toList()); + } + + static Collection> nodeStreamVariantsMoreThanOne() { + return allNodeStreamVariants().stream().filter(n -> n.count() > 1).collect(Collectors.toList()); + } + + + static Collection> allNodeStreamVariants() { return ASTS.stream().flatMap( root -> Stream.of( root.asStream(), root.children().first().asStream(), + // keep this, so that transformation are tested on empty node streams as well NodeStream.empty() ) ).flatMap( @@ -261,10 +271,10 @@ class NodeStreamBlanketTest { private static void assertImplication(T input, Prop precond, Prop... properties) { assumeTrue(precond.test(input)); - for (Prop prop2 : properties) { + for (Prop prop : properties) { assertTrue( - prop2.test(input), - "Expected (" + precond.description + ") to entail (" + prop2.description + prop.test(input), + "Expected (" + precond.description + ") to entail (" + prop.description + "), but the latter was false" ); } From 6593a902d07f8e59fd9896cbf85bcf022c83cade Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Mon, 4 Mar 2024 18:50:11 +0100 Subject: [PATCH 52/52] [java] Fix AstTreeDumpTests after merge MethodDeclaration doesn't have @Image attribute anymore. --- .../Jep456_UnnamedPatternsAndVariables.txt | 20 +++++++++---------- .../java22p/Jep459_StringTemplates.txt | 16 +++++++-------- .../java22p/Jep463_UnnamedClasses1.txt | 2 +- .../java22p/Jep463_UnnamedClasses2.txt | 4 ++-- .../java22p/Jep463_UnnamedClasses3.txt | 2 +- .../Jep463_UnnamedClasses4WithImports.txt | 2 +- 6 files changed, 23 insertions(+), 23 deletions(-) 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 8ade7f7fcc..ae94a215f0 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 @@ -42,7 +42,7 @@ | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] - +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "unnamedPatterns1", @Name = "unnamedPatterns1", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "unnamedPatterns1", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | +- VoidType[] | +- FormalParameters[@Empty = true, @Size = 0] @@ -158,7 +158,7 @@ | | +- ClassType[@FullyQualified = false, @SimpleName = "T"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "content", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] - +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "unnamedPatterns2", @Name = "unnamedPatterns2", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "unnamedPatterns2", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | +- VoidType[] | +- FormalParameters[@Empty = true, @Size = 0] @@ -294,7 +294,7 @@ | | +- UnnamedPattern[] | +- MethodCall[@CompileTimeConstant = false, @Image = "pickAnotherBox", @MethodName = "pickAnotherBox", @ParenthesisDepth = 0, @Parenthesized = false] | +- ArgumentList[@Empty = true, @Size = 0] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Image = "processBox", @Name = "processBox", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = true] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Name = "processBox", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = true] | +- ModifierList[@EffectiveModifiers = "{private}", @ExplicitModifiers = "{private}"] | +- VoidType[] | +- FormalParameters[@Empty = false, @Size = 1] @@ -306,12 +306,12 @@ | | | +- ClassType[@FullyQualified = false, @SimpleName = "Ball"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = true, @Size = 0, @containsComment = false] - +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Image = "stopProcessing", @Name = "stopProcessing", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = true] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Name = "stopProcessing", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = true] | +- ModifierList[@EffectiveModifiers = "{private}", @ExplicitModifiers = "{private}"] | +- VoidType[] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = true, @Size = 0, @containsComment = false] - +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Image = "pickAnotherBox", @Name = "pickAnotherBox", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = true] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Name = "pickAnotherBox", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = true] | +- ModifierList[@EffectiveModifiers = "{private}", @ExplicitModifiers = "{private}"] | +- VoidType[] | +- FormalParameters[@Empty = true, @Size = 0] @@ -325,14 +325,14 @@ | +- VariableDeclarator[@Initializer = true, @Name = "LIMIT"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "LIMIT", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "10", @IntLiteral = true, @Integral = true, @LiteralText = "10", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 10.0, @ValueAsFloat = 10.0, @ValueAsInt = 10, @ValueAsLong = 10] - +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Image = "sideEffect", @Name = "sideEffect", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = false] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Name = "sideEffect", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = false] | +- ModifierList[@EffectiveModifiers = "{private}", @ExplicitModifiers = "{private}"] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ReturnStatement[] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "unnamedVariables", @Name = "unnamedVariables", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "unnamedVariables", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | +- VoidType[] | +- FormalParameters[@Empty = false, @Size = 1] @@ -496,14 +496,14 @@ | +- 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, @Image = "close", @Name = "close", @Overridden = true, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] + | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "close", @Overridden = true, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] | | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] | | | +- Annotation[@SimpleName = "Override"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Override"] | | +- VoidType[] | | +- FormalParameters[@Empty = true, @Size = 0] | | +- Block[@Empty = true, @Size = 0, @containsComment = false] - | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "acquire", @Name = "acquire", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] + | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "acquire", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] | +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] | +- ClassType[@FullyQualified = false, @SimpleName = "ScopedContext"] | +- FormalParameters[@Empty = true, @Size = 0] @@ -512,7 +512,7 @@ | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] | +- ClassType[@FullyQualified = false, @SimpleName = "ScopedContext"] | +- ArgumentList[@Empty = true, @Size = 0] - +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "unusedVariables2", @Name = "unusedVariables2", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "unusedVariables2", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] +- VoidType[] +- FormalParameters[@Empty = true, @Size = 0] 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 7ac8614246..73aced4fc5 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 @@ -23,7 +23,7 @@ | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "ipAddress", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] - +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "STRTemplateProcessor", @Name = "STRTemplateProcessor", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "STRTemplateProcessor", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] | +- VoidType[] | +- FormalParameters[@Empty = true, @Size = 0] @@ -297,14 +297,14 @@ | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] | | +- TemplateFragment[@Content = "}\""] | +- TemplateFragment[@Content = "}\""] - +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "getOfferType", @Name = "getOfferType", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "getOfferType", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ReturnStatement[] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "_getOfferType_", @Empty = false, @Image = "\"_getOfferType_\"", @Length = 14, @LiteralText = "\"_getOfferType_\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "multilineTemplateExpressions", @Name = "multilineTemplateExpressions", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "multilineTemplateExpressions", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] | +- VoidType[] | +- FormalParameters[@Empty = true, @Size = 0] @@ -448,7 +448,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] | | +- ArgumentList[@Empty = true, @Size = 0] | +- TemplateFragment[@Content = "}\n \"\"\""] - +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "FMTTemplateProcessor", @Name = "FMTTemplateProcessor", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "FMTTemplateProcessor", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] | +- VoidType[] | +- FormalParameters[@Empty = true, @Size = 0] @@ -470,7 +470,7 @@ | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.DOUBLE] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "height", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordBody[@Empty = false, @Size = 1] - | | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Image = "area", @Name = "area", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] + | | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Name = "area", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.DOUBLE] | | +- FormalParameters[@Empty = true, @Size = 0] @@ -607,7 +607,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] | | +- ArgumentList[@Empty = true, @Size = 0] | +- TemplateFragment[@Content = "}\n \"\"\""] - +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "ensuringSafety", @Name = "ensuringSafety", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "ensuringSafety", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] | +- VoidType[] | +- FormalParameters[@Empty = true, @Size = 0] @@ -650,7 +650,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 = "accountNumber", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] - +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "literalsInsideTemplateExpressions", @Name = "literalsInsideTemplateExpressions", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "literalsInsideTemplateExpressions", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] | +- VoidType[] | +- FormalParameters[@Empty = true, @Size = 0] @@ -690,7 +690,7 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "user", @Name = "user", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArgumentList[@Empty = true, @Size = 0] | +- TemplateFragment[@Content = "}\""] - +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "emptyEmbeddedExpression", @Name = "emptyEmbeddedExpression", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "emptyEmbeddedExpression", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] +- VoidType[] +- FormalParameters[@Empty = true, @Size = 0] 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 7b2ceabde1..8bafb59ab5 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,5 +1,5 @@ +- CompilationUnit[@PackageName = ""] - +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "main", @MainMethod = true, @Name = "main", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] +- VoidType[] +- FormalParameters[@Empty = true, @Size = 0] 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 4b147ea7bf..200582f309 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,12 +1,12 @@ +- CompilationUnit[@PackageName = ""] - +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "greeting", @Name = "greeting", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "greeting", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ReturnStatement[] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Hello, World!", @Empty = false, @Image = "\"Hello, World!\"", @Length = 13, @LiteralText = "\"Hello, World!\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "main", @MainMethod = true, @Name = "main", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] +- VoidType[] +- FormalParameters[@Empty = true, @Size = 0] 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 5e04a358e1..2c78364825 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 @@ -5,7 +5,7 @@ | +- VariableDeclarator[@Initializer = true, @Name = "greeting"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "greeting", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Hello, World!", @Empty = false, @Image = "\"Hello, World!\"", @Length = 13, @LiteralText = "\"Hello, World!\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "main", @MainMethod = true, @Name = "main", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] +- VoidType[] +- FormalParameters[@Empty = true, @Size = 0] 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 6324eadc34..ab0ba4f8de 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 @@ -21,7 +21,7 @@ | | +- ClassType[@FullyQualified = false, @SimpleName = "Collectors"] | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = ", ", @Empty = false, @Image = "\", \"", @Length = 2, @LiteralText = "\", \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "main", @MainMethod = true, @Name = "main", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] +- VoidType[] +- FormalParameters[@Empty = true, @Size = 0]
" @@ -28,17 +28,17 @@ class VmParserTest { @Test void testParser() { - VmParsingHelper.DEFAULT.parse(VM_SRC); + VtlParsingHelper.DEFAULT.parse(VM_SRC); } @Test void testParser2() { - VmParsingHelper.DEFAULT.parse(SRC2); + VtlParsingHelper.DEFAULT.parse(SRC2); } @Test void testParser3() { - VmParsingHelper.DEFAULT.parse(SRC3); + VtlParsingHelper.DEFAULT.parse(SRC3); } } diff --git a/pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity/VtlParsingHelper.java b/pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity/VtlParsingHelper.java new file mode 100644 index 0000000000..af7d04dde5 --- /dev/null +++ b/pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity/VtlParsingHelper.java @@ -0,0 +1,22 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +package net.sourceforge.pmd.lang.velocity; + +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; +import net.sourceforge.pmd.lang.velocity.ast.ASTTemplate; + +public final class VtlParsingHelper extends BaseParsingHelper { + + public static final VtlParsingHelper DEFAULT = new VtlParsingHelper(Params.getDefault()); + + private VtlParsingHelper(Params params) { + super(VtlLanguageModule.getInstance(), ASTTemplate.class, params); + } + + @Override + protected VtlParsingHelper clone(Params params) { + return new VtlParsingHelper(params); + } +} diff --git a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/cpd/VmCpdLexerTest.java b/pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity/cpd/VtlCpdLexerTest.java similarity index 52% rename from pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/cpd/VmCpdLexerTest.java rename to pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity/cpd/VtlCpdLexerTest.java index be9fc01a2c..d2f67a6cb5 100644 --- a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/cpd/VmCpdLexerTest.java +++ b/pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity/cpd/VtlCpdLexerTest.java @@ -2,16 +2,16 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vm.cpd; +package net.sourceforge.pmd.lang.velocity.cpd; import org.junit.jupiter.api.Test; import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest; -import net.sourceforge.pmd.lang.vm.VmLanguageModule; +import net.sourceforge.pmd.lang.velocity.VtlLanguageModule; -class VmCpdLexerTest extends CpdTextComparisonTest { - VmCpdLexerTest() { - super(VmLanguageModule.getInstance(), ".vm"); +class VtlCpdLexerTest extends CpdTextComparisonTest { + VtlCpdLexerTest() { + super(VtlLanguageModule.getInstance(), ".vm"); } @Test diff --git a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/bestpractices/AvoidReassigningParametersTest.java b/pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity/rule/bestpractices/AvoidReassigningParametersTest.java similarity index 78% rename from pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/bestpractices/AvoidReassigningParametersTest.java rename to pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity/rule/bestpractices/AvoidReassigningParametersTest.java index 3b14ac5628..14bb9756e1 100644 --- a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/bestpractices/AvoidReassigningParametersTest.java +++ b/pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity/rule/bestpractices/AvoidReassigningParametersTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vm.rule.bestpractices; +package net.sourceforge.pmd.lang.velocity.rule.bestpractices; import net.sourceforge.pmd.test.PmdRuleTst; diff --git a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/bestpractices/UnusedMacroParameterTest.java b/pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity/rule/bestpractices/UnusedMacroParameterTest.java similarity index 78% rename from pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/bestpractices/UnusedMacroParameterTest.java rename to pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity/rule/bestpractices/UnusedMacroParameterTest.java index b9f961adb2..11c87c29fb 100644 --- a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/bestpractices/UnusedMacroParameterTest.java +++ b/pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity/rule/bestpractices/UnusedMacroParameterTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vm.rule.bestpractices; +package net.sourceforge.pmd.lang.velocity.rule.bestpractices; import net.sourceforge.pmd.test.PmdRuleTst; diff --git a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/AvoidDeeplyNestedIfStmtsTest.java b/pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity/rule/design/AvoidDeeplyNestedIfStmtsTest.java similarity index 80% rename from pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/AvoidDeeplyNestedIfStmtsTest.java rename to pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity/rule/design/AvoidDeeplyNestedIfStmtsTest.java index 720ffeaa50..7c3c85c224 100644 --- a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/AvoidDeeplyNestedIfStmtsTest.java +++ b/pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity/rule/design/AvoidDeeplyNestedIfStmtsTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vm.rule.design; +package net.sourceforge.pmd.lang.velocity.rule.design; import net.sourceforge.pmd.test.PmdRuleTst; diff --git a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/CollapsibleIfStatementsTest.java b/pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity/rule/design/CollapsibleIfStatementsTest.java similarity index 80% rename from pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/CollapsibleIfStatementsTest.java rename to pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity/rule/design/CollapsibleIfStatementsTest.java index a5053b4c86..c8b4828c95 100644 --- a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/CollapsibleIfStatementsTest.java +++ b/pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity/rule/design/CollapsibleIfStatementsTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vm.rule.design; +package net.sourceforge.pmd.lang.velocity.rule.design; import net.sourceforge.pmd.test.PmdRuleTst; diff --git a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/ExcessiveTemplateLengthTest.java b/pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity/rule/design/ExcessiveTemplateLengthTest.java similarity index 80% rename from pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/ExcessiveTemplateLengthTest.java rename to pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity/rule/design/ExcessiveTemplateLengthTest.java index bb77ea067e..b03afee4f2 100644 --- a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/ExcessiveTemplateLengthTest.java +++ b/pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity/rule/design/ExcessiveTemplateLengthTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vm.rule.design; +package net.sourceforge.pmd.lang.velocity.rule.design; import net.sourceforge.pmd.test.PmdRuleTst; diff --git a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/NoInlineJavaScriptTest.java b/pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity/rule/design/NoInlineJavaScriptTest.java similarity index 79% rename from pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/NoInlineJavaScriptTest.java rename to pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity/rule/design/NoInlineJavaScriptTest.java index a2ca069449..6787c7b04a 100644 --- a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/NoInlineJavaScriptTest.java +++ b/pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity/rule/design/NoInlineJavaScriptTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vm.rule.design; +package net.sourceforge.pmd.lang.velocity.rule.design; import net.sourceforge.pmd.test.PmdRuleTst; diff --git a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/NoInlineStylesTest.java b/pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity/rule/design/NoInlineStylesTest.java similarity index 79% rename from pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/NoInlineStylesTest.java rename to pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity/rule/design/NoInlineStylesTest.java index 1f9592a738..f94e7ef9bc 100644 --- a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/NoInlineStylesTest.java +++ b/pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity/rule/design/NoInlineStylesTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vm.rule.design; +package net.sourceforge.pmd.lang.velocity.rule.design; import net.sourceforge.pmd.test.PmdRuleTst; diff --git a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/errorprone/EmptyForeachStmtTest.java b/pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity/rule/errorprone/EmptyForeachStmtTest.java similarity index 78% rename from pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/errorprone/EmptyForeachStmtTest.java rename to pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity/rule/errorprone/EmptyForeachStmtTest.java index ccd9182e67..0c49151dac 100644 --- a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/errorprone/EmptyForeachStmtTest.java +++ b/pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity/rule/errorprone/EmptyForeachStmtTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vm.rule.errorprone; +package net.sourceforge.pmd.lang.velocity.rule.errorprone; import net.sourceforge.pmd.test.PmdRuleTst; diff --git a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/errorprone/EmptyIfStmtTest.java b/pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity/rule/errorprone/EmptyIfStmtTest.java similarity index 78% rename from pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/errorprone/EmptyIfStmtTest.java rename to pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity/rule/errorprone/EmptyIfStmtTest.java index 034e362b8f..76bb0d65b9 100644 --- a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/errorprone/EmptyIfStmtTest.java +++ b/pmd-velocity/src/test/java/net/sourceforge/pmd/lang/velocity/rule/errorprone/EmptyIfStmtTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.vm.rule.errorprone; +package net.sourceforge.pmd.lang.velocity.rule.errorprone; import net.sourceforge.pmd.test.PmdRuleTst; diff --git a/pmd-vm/src/test/resources/net/sourceforge/pmd/lang/vm/cpd/testdata/sample_vm.txt b/pmd-velocity/src/test/resources/net/sourceforge/pmd/lang/velocity/cpd/testdata/sample_vm.txt similarity index 100% rename from pmd-vm/src/test/resources/net/sourceforge/pmd/lang/vm/cpd/testdata/sample_vm.txt rename to pmd-velocity/src/test/resources/net/sourceforge/pmd/lang/velocity/cpd/testdata/sample_vm.txt diff --git a/pmd-vm/src/test/resources/net/sourceforge/pmd/lang/vm/cpd/testdata/sample_vm.vm b/pmd-velocity/src/test/resources/net/sourceforge/pmd/lang/velocity/cpd/testdata/sample_vm.vm similarity index 100% rename from pmd-vm/src/test/resources/net/sourceforge/pmd/lang/vm/cpd/testdata/sample_vm.vm rename to pmd-velocity/src/test/resources/net/sourceforge/pmd/lang/velocity/cpd/testdata/sample_vm.vm diff --git a/pmd-vm/src/test/resources/net/sourceforge/pmd/lang/vm/rule/bestpractices/xml/AvoidReassigningParameters.xml b/pmd-velocity/src/test/resources/net/sourceforge/pmd/lang/velocity/rule/bestpractices/xml/AvoidReassigningParameters.xml similarity index 100% rename from pmd-vm/src/test/resources/net/sourceforge/pmd/lang/vm/rule/bestpractices/xml/AvoidReassigningParameters.xml rename to pmd-velocity/src/test/resources/net/sourceforge/pmd/lang/velocity/rule/bestpractices/xml/AvoidReassigningParameters.xml diff --git a/pmd-vm/src/test/resources/net/sourceforge/pmd/lang/vm/rule/bestpractices/xml/UnusedMacroParameter.xml b/pmd-velocity/src/test/resources/net/sourceforge/pmd/lang/velocity/rule/bestpractices/xml/UnusedMacroParameter.xml similarity index 100% rename from pmd-vm/src/test/resources/net/sourceforge/pmd/lang/vm/rule/bestpractices/xml/UnusedMacroParameter.xml rename to pmd-velocity/src/test/resources/net/sourceforge/pmd/lang/velocity/rule/bestpractices/xml/UnusedMacroParameter.xml diff --git a/pmd-vm/src/test/resources/net/sourceforge/pmd/lang/vm/rule/design/xml/AvoidDeeplyNestedIfStmts.xml b/pmd-velocity/src/test/resources/net/sourceforge/pmd/lang/velocity/rule/design/xml/AvoidDeeplyNestedIfStmts.xml similarity index 100% rename from pmd-vm/src/test/resources/net/sourceforge/pmd/lang/vm/rule/design/xml/AvoidDeeplyNestedIfStmts.xml rename to pmd-velocity/src/test/resources/net/sourceforge/pmd/lang/velocity/rule/design/xml/AvoidDeeplyNestedIfStmts.xml diff --git a/pmd-vm/src/test/resources/net/sourceforge/pmd/lang/vm/rule/design/xml/CollapsibleIfStatements.xml b/pmd-velocity/src/test/resources/net/sourceforge/pmd/lang/velocity/rule/design/xml/CollapsibleIfStatements.xml similarity index 100% rename from pmd-vm/src/test/resources/net/sourceforge/pmd/lang/vm/rule/design/xml/CollapsibleIfStatements.xml rename to pmd-velocity/src/test/resources/net/sourceforge/pmd/lang/velocity/rule/design/xml/CollapsibleIfStatements.xml diff --git a/pmd-vm/src/test/resources/net/sourceforge/pmd/lang/vm/rule/design/xml/ExcessiveTemplateLength.xml b/pmd-velocity/src/test/resources/net/sourceforge/pmd/lang/velocity/rule/design/xml/ExcessiveTemplateLength.xml similarity index 100% rename from pmd-vm/src/test/resources/net/sourceforge/pmd/lang/vm/rule/design/xml/ExcessiveTemplateLength.xml rename to pmd-velocity/src/test/resources/net/sourceforge/pmd/lang/velocity/rule/design/xml/ExcessiveTemplateLength.xml diff --git a/pmd-vm/src/test/resources/net/sourceforge/pmd/lang/vm/rule/design/xml/NoInlineJavaScript.xml b/pmd-velocity/src/test/resources/net/sourceforge/pmd/lang/velocity/rule/design/xml/NoInlineJavaScript.xml similarity index 100% rename from pmd-vm/src/test/resources/net/sourceforge/pmd/lang/vm/rule/design/xml/NoInlineJavaScript.xml rename to pmd-velocity/src/test/resources/net/sourceforge/pmd/lang/velocity/rule/design/xml/NoInlineJavaScript.xml diff --git a/pmd-vm/src/test/resources/net/sourceforge/pmd/lang/vm/rule/design/xml/NoInlineStyles.xml b/pmd-velocity/src/test/resources/net/sourceforge/pmd/lang/velocity/rule/design/xml/NoInlineStyles.xml similarity index 100% rename from pmd-vm/src/test/resources/net/sourceforge/pmd/lang/vm/rule/design/xml/NoInlineStyles.xml rename to pmd-velocity/src/test/resources/net/sourceforge/pmd/lang/velocity/rule/design/xml/NoInlineStyles.xml diff --git a/pmd-vm/src/test/resources/net/sourceforge/pmd/lang/vm/rule/errorprone/xml/EmptyForeachStmt.xml b/pmd-velocity/src/test/resources/net/sourceforge/pmd/lang/velocity/rule/errorprone/xml/EmptyForeachStmt.xml similarity index 100% rename from pmd-vm/src/test/resources/net/sourceforge/pmd/lang/vm/rule/errorprone/xml/EmptyForeachStmt.xml rename to pmd-velocity/src/test/resources/net/sourceforge/pmd/lang/velocity/rule/errorprone/xml/EmptyForeachStmt.xml diff --git a/pmd-vm/src/test/resources/net/sourceforge/pmd/lang/vm/rule/errorprone/xml/EmptyIfStmt.xml b/pmd-velocity/src/test/resources/net/sourceforge/pmd/lang/velocity/rule/errorprone/xml/EmptyIfStmt.xml similarity index 100% rename from pmd-vm/src/test/resources/net/sourceforge/pmd/lang/vm/rule/errorprone/xml/EmptyIfStmt.xml rename to pmd-velocity/src/test/resources/net/sourceforge/pmd/lang/velocity/rule/errorprone/xml/EmptyIfStmt.xml diff --git a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/VmHandler.java b/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/VmHandler.java deleted file mode 100644 index cac346da69..0000000000 --- a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/VmHandler.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -package net.sourceforge.pmd.lang.vm; - -import net.sourceforge.pmd.lang.AbstractPmdLanguageVersionHandler; -import net.sourceforge.pmd.lang.ast.Parser; -import net.sourceforge.pmd.lang.vm.ast.VmParser; - -/** - * Implementation of LanguageVersionHandler for the VM parser. - * - */ -public class VmHandler extends AbstractPmdLanguageVersionHandler { - - - @Override - public Parser getParser() { - return new VmParser(); - } - -} diff --git a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/VmVisitorBase.java b/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/VmVisitorBase.java deleted file mode 100644 index db58f9bb9c..0000000000 --- a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/VmVisitorBase.java +++ /dev/null @@ -1,12 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -package net.sourceforge.pmd.lang.vm.ast; - - -import net.sourceforge.pmd.lang.ast.AstVisitorBase; - -public abstract class VmVisitorBase extends AstVisitorBase implements VmVisitor { - -} diff --git a/pmd-vm/src/main/resources/META-INF/services/net.sourceforge.pmd.lang.Language b/pmd-vm/src/main/resources/META-INF/services/net.sourceforge.pmd.lang.Language deleted file mode 100644 index aa6c6924ac..0000000000 --- a/pmd-vm/src/main/resources/META-INF/services/net.sourceforge.pmd.lang.Language +++ /dev/null @@ -1 +0,0 @@ -net.sourceforge.pmd.lang.vm.VmLanguageModule diff --git a/pmd-vm/src/main/resources/category/vm/categories.properties b/pmd-vm/src/main/resources/category/vm/categories.properties deleted file mode 100644 index ea336212f6..0000000000 --- a/pmd-vm/src/main/resources/category/vm/categories.properties +++ /dev/null @@ -1,17 +0,0 @@ -# -# BSD-style license; for more info see http://pmd.sourceforge.net/license.html -# - -rulesets.filenames=\ - category/vm/bestpractices.xml,\ - category/vm/design.xml,\ - category/vm/errorprone.xml - -# -# categories without rules -# -# category/vm/codestyle.xml -# category/vm/documentation.xml -# category/vm/multithreading.xml -# category/vm/performance.xml -# category/vm/security.xml diff --git a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/VmParsingHelper.java b/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/VmParsingHelper.java deleted file mode 100644 index 6ce7377671..0000000000 --- a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/VmParsingHelper.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -package net.sourceforge.pmd.lang.vm; - -import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; -import net.sourceforge.pmd.lang.vm.ast.ASTTemplate; - -public final class VmParsingHelper extends BaseParsingHelper { - - public static final VmParsingHelper DEFAULT = new VmParsingHelper(Params.getDefault()); - - private VmParsingHelper(Params params) { - super(VmLanguageModule.getInstance(), ASTTemplate.class, params); - } - - @Override - protected VmParsingHelper clone(Params params) { - return new VmParsingHelper(params); - } -} diff --git a/pom.xml b/pom.xml index e37389959f..d5b2f51565 100644 --- a/pom.xml +++ b/pom.xml @@ -1282,8 +1282,8 @@ pmd-test pmd-test-schema pmd-tsql + pmd-velocity pmd-visualforce - pmd-vm pmd-xml pmd-ant pmd-languages-deps From 7813f544e330694d276679da7b705320cd585d5b Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 23 Feb 2024 17:28:16 +0100 Subject: [PATCH 37/52] [doc] Fix rule doc generation and dead links - previous existing rule docs will be deleted now --- docs/_data/sidebars/pmd_sidebar.yml | 12 +++---- .../adding_new_cpd_language.md | 2 +- docs/pages/pmd/languages/visualforce.md | 2 +- docs/pages/pmd/userdocs/cli_reference.md | 4 +-- docs/pages/release_notes.md | 2 +- docs/pages/release_notes_pmd7.md | 2 +- .../pmd/doc/internal/RuleDocGenerator.java | 33 +++++++++++++++++++ .../test/resources/expected/pmd_sidebar.yml | 4 +-- 8 files changed, 47 insertions(+), 14 deletions(-) diff --git a/docs/_data/sidebars/pmd_sidebar.yml b/docs/_data/sidebars/pmd_sidebar.yml index 247c6fae94..1902b8761d 100644 --- a/docs/_data/sidebars/pmd_sidebar.yml +++ b/docs/_data/sidebars/pmd_sidebar.yml @@ -324,10 +324,10 @@ entries: subfolderitems: - title: Index output: web, pdf - url: /pmd_rules_vf.html + url: /pmd_rules_visualforce.html - title: Security output: web, pdf - url: /pmd_rules_vf_security.html + url: /pmd_rules_visualforce_security.html - title: null output: web, pdf subfolders: @@ -360,16 +360,16 @@ entries: subfolderitems: - title: Index output: web, pdf - url: /pmd_rules_vm.html + url: /pmd_rules_velocity.html - title: Best Practices output: web, pdf - url: /pmd_rules_vm_bestpractices.html + url: /pmd_rules_velocity_bestpractices.html - title: Design output: web, pdf - url: /pmd_rules_vm_design.html + url: /pmd_rules_velocity_design.html - title: Error Prone output: web, pdf - url: /pmd_rules_vm_errorprone.html + url: /pmd_rules_velocity_errorprone.html - title: null output: web, pdf subfolders: diff --git a/docs/pages/pmd/devdocs/major_contributions/adding_new_cpd_language.md b/docs/pages/pmd/devdocs/major_contributions/adding_new_cpd_language.md index 9261c50e18..5238f752a0 100644 --- a/docs/pages/pmd/devdocs/major_contributions/adding_new_cpd_language.md +++ b/docs/pages/pmd/devdocs/major_contributions/adding_new_cpd_language.md @@ -75,7 +75,7 @@ If your language only supports CPD, then you can subclass {% jdoc core::lang.imp At this point the new language module should be available in {% jdoc core::lang.LanguageRegistry#CPD %} and usable by CPD like any other language. -4. Update the test that asserts the list of supported languages by updating the `SUPPORTED_LANGUAGES` constant in [BinaryDistributionIT](https://github.com/pmd/pmd/blob/master/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java). +4. Update the test that asserts the list of supported languages by updating the `SUPPORTED_LANGUAGES` constant in [BinaryDistributionIT](https://github.com/pmd/pmd/blob/master/pmd-dist/src/test/java/net/sourceforge/pmd/dist/BinaryDistributionIT.java). 5. Add some tests for your CpdLexer by following the [section below](#testing-your-implementation). diff --git a/docs/pages/pmd/languages/visualforce.md b/docs/pages/pmd/languages/visualforce.md index 0bffab4e5b..0f9809a1da 100644 --- a/docs/pages/pmd/languages/visualforce.md +++ b/docs/pages/pmd/languages/visualforce.md @@ -28,7 +28,7 @@ Since PMD 6.30.0 support for type resolution has been added. The Visualforce AST now can resolve the data type of Visualforce expressions that reference Apex Controller properties and Custom Object fields. This feature improves the precision of existing rules, -like {% rule vf/security/VfUnescapeEl %}. +like {% rule visualforce/security/VfUnescapeEl %}. This can be configured using two language properties, which can be set as environment variables: diff --git a/docs/pages/pmd/userdocs/cli_reference.md b/docs/pages/pmd/userdocs/cli_reference.md index 28a6978ac7..a190504225 100644 --- a/docs/pages/pmd/userdocs/cli_reference.md +++ b/docs/pages/pmd/userdocs/cli_reference.md @@ -263,8 +263,8 @@ Example: * [pom](pmd_rules_pom.html) (Maven POM) * [scala](pmd_rules_scala.html) * [swift](pmd_rules_swift.html) -* [vf](pmd_rules_vf.html) (Salesforce VisualForce) -* [vm](pmd_rules_vm.html) (Apache Velocity) +* [velocity](pmd_rules_velocity.html) (Apache Velocity Template Language) +* [visualforce](pmd_rules_visualforce.html) (Salesforce VisualForce) * [xml](pmd_rules_xml.html) * [xsl](pmd_rules_xsl.html) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 425493360e..1c9cec1674 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -1138,7 +1138,7 @@ Contributors: [Aaron Hurst](https://github.com/aaronhurst-google) (@aaronhurst-g {% rule plsql/design/ExcessiveParameterList %}, {% rule plsql/design/ExcessiveTypeLength %}, {% rule plsql/design/NcssMethodCount %}, {% rule plsql/design/NcssObjectCount %}, {% rule plsql/design/NPathComplexity %} - * VM: {% rule vm/design/ExcessiveTemplateLength %} + * Velocity: {% rule velocity/design/ExcessiveTemplateLength %} * The general property `violationSuppressXPath` which is available for all rules to [suppress warnings]({{ baseurl }}pmd_userdocs_suppressing_warnings.html) now uses XPath version 3.1 by default. diff --git a/docs/pages/release_notes_pmd7.md b/docs/pages/release_notes_pmd7.md index a0ddd27183..8c7c35526f 100644 --- a/docs/pages/release_notes_pmd7.md +++ b/docs/pages/release_notes_pmd7.md @@ -330,7 +330,7 @@ can be parsed now. PMD should now be able to parse Apex code up to version 59.0 {% rule plsql/design/ExcessiveParameterList %}, {% rule plsql/design/ExcessiveTypeLength %}, {% rule plsql/design/NcssMethodCount %}, {% rule plsql/design/NcssObjectCount %}, {% rule plsql/design/NPathComplexity %} - * VM: {% rule vm/design/ExcessiveTemplateLength %} + * Velocity: {% rule velocity/design/ExcessiveTemplateLength %} * The general property `violationSuppressXPath` which is available for all rules to [suppress warnings](pmd_userdocs_suppressing_warnings.html) now uses XPath version 3.1 by default. diff --git a/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/RuleDocGenerator.java b/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/RuleDocGenerator.java index cdaec8328e..5ad83287e4 100644 --- a/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/RuleDocGenerator.java +++ b/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/RuleDocGenerator.java @@ -90,6 +90,7 @@ public class RuleDocGenerator { } public void generate(List registeredRulesets, List additionalRulesets) throws IOException { + removeExistingRuleDocs(); Map> sortedRulesets; Map> sortedAdditionalRulesets; sortedRulesets = sortRulesets(registeredRulesets); @@ -102,6 +103,38 @@ public class RuleDocGenerator { generateSidebar(sortedRulesets); } + private void removeExistingRuleDocs() throws IOException { + Path directory = root.resolve("docs/pages/pmd/rules"); + if (!Files.isDirectory(directory)) { + // no old files exist yet + return; + } + + System.out.println("Deleting old rule docs in " + directory); + Files.walkFileTree(directory, new SimpleFileVisitor() { + @Override + public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { + if (file.toString().endsWith("scala.md")) { + // don't delete scala.md, since we don't have any rules yet... + return FileVisitResult.CONTINUE; + } + Files.delete(file); + return FileVisitResult.CONTINUE; + } + + @Override + public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException { + if (dir.equals(directory)) { + // don't delete the whole directory, keep it empty + // or almost empty (scala.md is still present) + return FileVisitResult.CONTINUE; + } + Files.delete(dir); + return FileVisitResult.CONTINUE; + } + }); + } + private void ensureAllLanguages(Map> sortedRulesets) { for (Language language : LanguageRegistry.PMD.getLanguages()) { sortedRulesets.putIfAbsent(language, Collections.emptyList()); diff --git a/pmd-doc/src/test/resources/expected/pmd_sidebar.yml b/pmd-doc/src/test/resources/expected/pmd_sidebar.yml index 756c9ece74..dc489db83f 100644 --- a/pmd-doc/src/test/resources/expected/pmd_sidebar.yml +++ b/pmd-doc/src/test/resources/expected/pmd_sidebar.yml @@ -98,7 +98,7 @@ entries: subfolderitems: - title: Index output: web, pdf - url: /pmd_rules_vf.html + url: /pmd_rules_visualforce.html - title: null output: web, pdf subfolders: @@ -125,7 +125,7 @@ entries: subfolderitems: - title: Index output: web, pdf - url: /pmd_rules_vm.html + url: /pmd_rules_velocity.html - title: null output: web, pdf subfolders: From f49f25f0e19f0505b05bc2753e95a74ede440404 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 23 Feb 2024 17:45:23 +0100 Subject: [PATCH 38/52] Rename lang-terse-name to lang-id --- antlr4-wrapper.xml | 6 +++--- javacc-wrapper.xml | 6 +++--- pmd-cpp/pom.xml | 2 +- pmd-cs/pom.xml | 2 +- pmd-dart/pom.xml | 2 +- pmd-go/pom.xml | 2 +- pmd-java/pom.xml | 2 +- pmd-javascript/pom.xml | 2 +- pmd-jsp/pom.xml | 2 +- pmd-kotlin/pom.xml | 2 +- pmd-lua/pom.xml | 2 +- pmd-matlab/pom.xml | 2 +- pmd-modelica/pom.xml | 2 +- pmd-objectivec/pom.xml | 2 +- pmd-plsql/pom.xml | 2 +- pmd-python/pom.xml | 2 +- pmd-swift/pom.xml | 2 +- pmd-velocity/pom.xml | 2 +- pmd-visualforce/pom.xml | 2 +- 19 files changed, 23 insertions(+), 23 deletions(-) diff --git a/antlr4-wrapper.xml b/antlr4-wrapper.xml index c2d3e224ff..d795c8bafe 100644 --- a/antlr4-wrapper.xml +++ b/antlr4-wrapper.xml @@ -6,7 +6,7 @@ - + - + diff --git a/javacc-wrapper.xml b/javacc-wrapper.xml index b248dd3227..b6e9d14aab 100644 --- a/javacc-wrapper.xml +++ b/javacc-wrapper.xml @@ -17,7 +17,7 @@ whose name is an acronym, eg PLSQL (in camelcase, "Plsql"). Defaults to lang-name. - - lang-terse-name: Terse name, used in the conventional package names + - lang-id: The language id, used in the conventional package names It also uses the following maven properties: @@ -34,12 +34,12 @@ - + - + diff --git a/pmd-cpp/pom.xml b/pmd-cpp/pom.xml index 4f64a2da65..779890b2e8 100644 --- a/pmd-cpp/pom.xml +++ b/pmd-cpp/pom.xml @@ -36,7 +36,7 @@ - + diff --git a/pmd-cs/pom.xml b/pmd-cs/pom.xml index 4af69e4c3c..4f4361093f 100644 --- a/pmd-cs/pom.xml +++ b/pmd-cs/pom.xml @@ -31,7 +31,7 @@ - + diff --git a/pmd-dart/pom.xml b/pmd-dart/pom.xml index dede831b74..68c56122ed 100644 --- a/pmd-dart/pom.xml +++ b/pmd-dart/pom.xml @@ -31,7 +31,7 @@ - + diff --git a/pmd-go/pom.xml b/pmd-go/pom.xml index 060920664c..1f6720920a 100644 --- a/pmd-go/pom.xml +++ b/pmd-go/pom.xml @@ -31,7 +31,7 @@ - + diff --git a/pmd-java/pom.xml b/pmd-java/pom.xml index 06570caf2b..0999263c4e 100644 --- a/pmd-java/pom.xml +++ b/pmd-java/pom.xml @@ -107,7 +107,7 @@ - + diff --git a/pmd-javascript/pom.xml b/pmd-javascript/pom.xml index 1fb4bb9ea9..39cd2edf07 100644 --- a/pmd-javascript/pom.xml +++ b/pmd-javascript/pom.xml @@ -49,7 +49,7 @@ - + diff --git a/pmd-jsp/pom.xml b/pmd-jsp/pom.xml index 42bb314996..357e96396c 100644 --- a/pmd-jsp/pom.xml +++ b/pmd-jsp/pom.xml @@ -42,7 +42,7 @@ - + diff --git a/pmd-kotlin/pom.xml b/pmd-kotlin/pom.xml index 3eab88732b..5cabb6a854 100644 --- a/pmd-kotlin/pom.xml +++ b/pmd-kotlin/pom.xml @@ -44,7 +44,7 @@ - + diff --git a/pmd-lua/pom.xml b/pmd-lua/pom.xml index 3cf75e198d..281b01e36b 100644 --- a/pmd-lua/pom.xml +++ b/pmd-lua/pom.xml @@ -31,7 +31,7 @@ - + diff --git a/pmd-matlab/pom.xml b/pmd-matlab/pom.xml index cadb6012cd..12c60c13c2 100644 --- a/pmd-matlab/pom.xml +++ b/pmd-matlab/pom.xml @@ -36,7 +36,7 @@ - + diff --git a/pmd-modelica/pom.xml b/pmd-modelica/pom.xml index 3c9344d6a2..66598f6a4d 100644 --- a/pmd-modelica/pom.xml +++ b/pmd-modelica/pom.xml @@ -66,7 +66,7 @@ - + diff --git a/pmd-objectivec/pom.xml b/pmd-objectivec/pom.xml index c2a592ae8d..d52fea8ceb 100644 --- a/pmd-objectivec/pom.xml +++ b/pmd-objectivec/pom.xml @@ -36,7 +36,7 @@ - + diff --git a/pmd-plsql/pom.xml b/pmd-plsql/pom.xml index d23562dfd7..6b8fa398e8 100644 --- a/pmd-plsql/pom.xml +++ b/pmd-plsql/pom.xml @@ -43,7 +43,7 @@ - + diff --git a/pmd-python/pom.xml b/pmd-python/pom.xml index 86be90a79d..be877e8ea8 100644 --- a/pmd-python/pom.xml +++ b/pmd-python/pom.xml @@ -36,7 +36,7 @@ - + diff --git a/pmd-swift/pom.xml b/pmd-swift/pom.xml index 9f008e7e3f..fd3a83f3df 100644 --- a/pmd-swift/pom.xml +++ b/pmd-swift/pom.xml @@ -43,7 +43,7 @@ - + diff --git a/pmd-velocity/pom.xml b/pmd-velocity/pom.xml index fbc05bd757..441389b4d9 100644 --- a/pmd-velocity/pom.xml +++ b/pmd-velocity/pom.xml @@ -45,7 +45,7 @@ - + diff --git a/pmd-visualforce/pom.xml b/pmd-visualforce/pom.xml index fea99b1726..626b0bf1f3 100644 --- a/pmd-visualforce/pom.xml +++ b/pmd-visualforce/pom.xml @@ -49,7 +49,7 @@ - + From 689a7d5a2887fced01b936bb5143a8bc6fd13389 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 23 Feb 2024 17:47:59 +0100 Subject: [PATCH 39/52] [doc] Update release notes, fixes #4830 --- 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 1c9cec1674..d0391d6547 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -291,6 +291,7 @@ The rules have been moved into categories with PMD 6. * [#4749](https://github.com/pmd/pmd/pull/4749): Fixes NoSuchMethodError on processing errors in pmd-compat6 * [#4776](https://github.com/pmd/pmd/issues/4776): \[ci] Upgrade to ruby 3 * [#4796](https://github.com/pmd/pmd/pull/4796): Remove deprecated and release rulesets + * [#4830](https://github.com/pmd/pmd/issues/4830): Consolidate packages in each maven module * apex * [#3766](https://github.com/pmd/pmd/issues/3766): \[apex] Replace Jorje with fully open source front-end * apex-performance @@ -1288,6 +1289,7 @@ See also [Detailed Release Notes for PMD 7]({{ baseurl }}pmd_release_notes_pmd7. * [#4749](https://github.com/pmd/pmd/pull/4749): Fixes NoSuchMethodError on processing errors in pmd-compat6 * [#4776](https://github.com/pmd/pmd/issues/4776): \[ci] Upgrade to ruby 3 * [#4796](https://github.com/pmd/pmd/pull/4796): Remove deprecated and release rulesets + * [#4830](https://github.com/pmd/pmd/issues/4830): Consolidate packages in each maven module * ant * [#4080](https://github.com/pmd/pmd/issues/4080): \[ant] Split off Ant integration into a new submodule * core From 9adf12f7bee2a8281839c4b7e6729c226f9cf9ec Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 23 Feb 2024 21:15:04 +0100 Subject: [PATCH 40/52] [doc] Fix configuring rule docu for multivalues properties Fixes #4704 --- docs/pages/pmd/userdocs/configuring_rules.md | 22 ++++++++++++++------ docs/pages/release_notes.md | 2 ++ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/docs/pages/pmd/userdocs/configuring_rules.md b/docs/pages/pmd/userdocs/configuring_rules.md index 4cf888a280..d0425f1921 100644 --- a/docs/pages/pmd/userdocs/configuring_rules.md +++ b/docs/pages/pmd/userdocs/configuring_rules.md @@ -4,7 +4,7 @@ short_title: Configuring rules keywords: [property, properties, message, priority] tags: [userdocs, getting_started] summary: "Learn how to configure your rules directly from the ruleset XML." -last_updated: May 2023 (7.0.0) +last_updated: February 2024 (7.0.0) permalink: pmd_userdocs_configuring_rules.html author: Hooper Bloob , Romain Pelisse , Clément Fournier --- @@ -43,7 +43,10 @@ will cause the rule to be ignored. ## Rule properties -Properties make it easy to customise the behaviour of a rule directly from the xml. They come in several types, which correspond to the type of their values. For example, NPathComplexity declares a property "reportLevel", with an integer value type, and which corresponds to the threshold above which a method will be reported. If you believe that its default value of 200 is too high, you could lower it to e.g. 150 in the following way: +Properties make it easy to customise the behaviour of a rule directly from the xml. They come in several types, +which correspond to the type of their values. For example, NPathComplexity declares a property "reportLevel", +with an integer value type, and which corresponds to the threshold above which a method will be reported. +If you believe that its default value of 200 is too high, you could lower it to e.g. 150 in the following way: ```xml @@ -55,7 +58,9 @@ Properties make it easy to customise the behaviour of a rule directly from the x ``` -Properties are assigned a value with a `property` element, which should mention the name of a property as an attribute. The value of the property can be specified either in the content of the element, like above, or in the `value` attribute, e.g. +Properties are assigned a value with a `property` element, which should mention the name of a property as an +attribute. The value of the property can be specified either in the content of the element, like above, or +in the `value` attribute, e.g. ```xml @@ -63,12 +68,17 @@ Properties are assigned a value with a `property` element, which should mention All property assignments must be enclosed in a `properties` element, which is itself inside a `rule` element. -{%include tip.html content="The properties of a rule are documented with the rule, e.g. [here](pmd_rules_java_design.html#npathcomplexity) for NPathComplexity. Note that **assigning a value to a property that does not exist throws an error!**" %} +{% capture tip_content %} +The properties of a rule are documented with the rule, e.g. [here](pmd_rules_java_design.html#npathcomplexity) +for NPathComplexity. Note that **assigning a value to a property that does not exist throws an error!** +{% endcapture %} +{%include tip.html content=tip_content %} -Some properties take multiple values (a list), in which case you can provide them all by delimiting them with a delimiter character. It is usually a pipe ('\|'), or a comma (',') for numeric properties, e.g. +Some properties take multiple values (a list), in which case you can provide them all by delimiting them with +a comma (','), e.g. ```xml + value="java.util.ArrayList,java.util.Vector,java.util.HashMap"/> ``` These properties are referred to as **multivalued properties** in this documentation. diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 6dd6099c26..3bfa1a48aa 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -255,6 +255,7 @@ The rules have been moved into categories with PMD 6. * [#4659](https://github.com/pmd/pmd/pull/4659): \[doc] Improve ant documentation * [#4669](https://github.com/pmd/pmd/pull/4669): \[doc] Add bld PMD Extension to Tools / Integrations * [#4676](https://github.com/pmd/pmd/issues/4676): \[doc] Clarify how CPD `--ignore-literals` and `--ignore-identifiers` work + * [#4704](https://github.com/pmd/pmd/issues/4704): \[doc] Multivalued properties do not accept | as a separator * miscellaneous * [#4699](https://github.com/pmd/pmd/pull/4699): Make PMD buildable with java 21 * [#4586](https://github.com/pmd/pmd/pull/4586): Use explicit encoding in ruleset xml files @@ -1305,6 +1306,7 @@ See also [Detailed Release Notes for PMD 7]({{ baseurl }}pmd_release_notes_pmd7. * [#4676](https://github.com/pmd/pmd/issues/4676): \[doc] Clarify how CPD `--ignore-literals` and `--ignore-identifiers` work * [#4659](https://github.com/pmd/pmd/pull/4659): \[doc] Improve ant documentation * [#4669](https://github.com/pmd/pmd/pull/4669): \[doc] Add bld PMD Extension to Tools / Integrations + * [#4704](https://github.com/pmd/pmd/issues/4704): \[doc] Multivalued properties do not accept | as a separator * testing * [#2435](https://github.com/pmd/pmd/issues/2435): \[test] Remove duplicated Dummy language module * [#4234](https://github.com/pmd/pmd/issues/4234): \[test] Tests that change the logging level do not work From 53323de95143c1616ee0a67e6dc18562903079d4 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Mon, 26 Feb 2024 19:25:56 +0100 Subject: [PATCH 41/52] [apex] MethodNamingConventions: Remove prop skipTestMethodUnderscores This property was deprecated since PMD 6.15.0. --- docs/pages/release_notes.md | 9 +++++ docs/pages/release_notes_pmd7.md | 6 ++++ .../MethodNamingConventionsRule.java | 15 +------- .../codestyle/xml/MethodNamingConventions.xml | 35 ------------------- 4 files changed, 16 insertions(+), 49 deletions(-) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 6dd6099c26..7f30add175 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -138,6 +138,9 @@ Experimental Kotlin support has been promoted as stable API now. * {% rule java/codestyle/EmptyControlStatement %}: The rule has a new property to allow empty blocks when they contain a comment (`allowCommentedBlocks`). +* {% rule apex/codestyle/MethodNamingConventions %}: The deprecated rule property `skipTestMethodUnderscores` has + been removed. It was actually deprecated since PMD 6.15.0, but was not mentioned in the release notes + back then. Use the property `testPattern` instead to configure valid names for test methods. **Removed Rules** @@ -1083,6 +1086,12 @@ Contributors: [Aaron Hurst](https://github.com/aaronhurst-google) (@aaronhurst-g from all rules. These properties have been deprecated since PMD 6.13.0. See [issue #1648](https://github.com/pmd/pmd/issues/1648) for more details. +**Apex Codestyle** + +* {% rule apex/codestyle/MethodNamingConventions %}: The deprecated rule property `skipTestMethodUnderscores` has + been removed. It was actually deprecated since PMD 6.15.0, but was not mentioned in the release notes + back then. Use the property `testPattern` instead to configure valid names for test methods. + **Java General changes** * Violations reported on methods or classes previously reported the line range of the entire method diff --git a/docs/pages/release_notes_pmd7.md b/docs/pages/release_notes_pmd7.md index 444cdd1232..ce28426448 100644 --- a/docs/pages/release_notes_pmd7.md +++ b/docs/pages/release_notes_pmd7.md @@ -343,6 +343,12 @@ can be parsed now. PMD should now be able to parse Apex code up to version 59.0 from all rules. These properties have been deprecated since PMD 6.13.0. See [issue #1648](https://github.com/pmd/pmd/issues/1648) for more details. +**Apex Codestyle** + +* {% rule apex/codestyle/MethodNamingConventions %}: The deprecated rule property `skipTestMethodUnderscores` has + been removed. It was actually deprecated since PMD 6.15.0, but was not mentioned in the release notes + back then. Use the property `testPattern` instead to configure valid names for test methods. + **Java General changes** * Violations reported on methods or classes previously reported the line range of the entire method diff --git a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/codestyle/MethodNamingConventionsRule.java b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/codestyle/MethodNamingConventionsRule.java index e338090048..de3ae0a330 100644 --- a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/codestyle/MethodNamingConventionsRule.java +++ b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/codestyle/MethodNamingConventionsRule.java @@ -4,8 +4,6 @@ package net.sourceforge.pmd.lang.apex.rule.codestyle; -import static net.sourceforge.pmd.properties.PropertyFactory.booleanProperty; - import java.util.HashMap; import java.util.Map; import java.util.regex.Pattern; @@ -30,14 +28,7 @@ public class MethodNamingConventionsRule extends AbstractNamingConventionsRule { private static final PropertyDescriptor INSTANCE_REGEX = prop("instancePattern", "instance method", DESCRIPTOR_TO_DISPLAY_NAME).defaultValue(CAMEL_CASE).build(); - private static final PropertyDescriptor SKIP_TEST_METHOD_UNDERSCORES_DESCRIPTOR - = booleanProperty("skipTestMethodUnderscores") - .desc("deprecated! Skip underscores in test methods") - .defaultValue(false) - .build(); - public MethodNamingConventionsRule() { - definePropertyDescriptor(SKIP_TEST_METHOD_UNDERSCORES_DESCRIPTOR); definePropertyDescriptor(TEST_REGEX); definePropertyDescriptor(STATIC_REGEX); definePropertyDescriptor(INSTANCE_REGEX); @@ -65,11 +56,7 @@ public class MethodNamingConventionsRule extends AbstractNamingConventionsRule { } if (node.getModifiers().isTest()) { - if (getProperty(SKIP_TEST_METHOD_UNDERSCORES_DESCRIPTOR)) { - checkMatches(TEST_REGEX, CAMEL_CASE_WITH_UNDERSCORES, node, data); - } else { - checkMatches(TEST_REGEX, node, data); - } + checkMatches(TEST_REGEX, node, data); } else if (node.getModifiers().isStatic()) { checkMatches(STATIC_REGEX, node, data); } else { diff --git a/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/rule/codestyle/xml/MethodNamingConventions.xml b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/rule/codestyle/xml/MethodNamingConventions.xml index 71e3f5f12f..4e22a60804 100644 --- a/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/rule/codestyle/xml/MethodNamingConventions.xml +++ b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/rule/codestyle/xml/MethodNamingConventions.xml @@ -64,41 +64,6 @@ public class Foo { ]]> - - #1573 method names should not contain underscores, but skip test methods 1 - true - 0 - - - - - #1573 method names should not contain underscores, but skip test methods 2 - true - 0 - - - - - #1573 method names should not contain underscores, but skip test methods 3 - false - 1 - - - all is well 0 From fb4f4888c99d4cec2ad1e2dfe574b6e4b3426280 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Mon, 26 Feb 2024 19:26:45 +0100 Subject: [PATCH 42/52] [doc] Fix release notes, add missing change in EmptyControlStatement Refs #4754 --- docs/pages/release_notes_pmd7.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/pages/release_notes_pmd7.md b/docs/pages/release_notes_pmd7.md index ce28426448..e051c28c08 100644 --- a/docs/pages/release_notes_pmd7.md +++ b/docs/pages/release_notes_pmd7.md @@ -390,6 +390,8 @@ can be parsed now. PMD should now be able to parse Apex code up to version 59.0 not necessary are allowed, if they separate expressions of different precedence. The other property `ignoreBalancing` (default: true) is similar, in that it allows parentheses that help reading and understanding the expressions. +* {% rule java/codestyle/EmptyControlStatement %}: The rule has a new property to allow empty blocks when + they contain a comment (`allowCommentedBlocks`). **Java Design** From 504fc3e967b3c4acc63644c74863a7fe5192581d Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Mon, 26 Feb 2024 19:33:00 +0100 Subject: [PATCH 43/52] [java] CommentRequired: Remove property headerCommentRequirement This property has been deprecated since PMD 6.21.0 --- docs/pages/release_notes.md | 4 +++ docs/pages/release_notes_pmd7.md | 2 ++ .../documentation/CommentRequiredRule.java | 26 ++----------------- .../documentation/CommentRequiredTest.java | 3 --- .../documentation/xml/CommentRequired.xml | 12 +-------- 5 files changed, 9 insertions(+), 38 deletions(-) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 7f30add175..7f543baeaa 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -141,6 +141,8 @@ Experimental Kotlin support has been promoted as stable API now. * {% rule apex/codestyle/MethodNamingConventions %}: The deprecated rule property `skipTestMethodUnderscores` has been removed. It was actually deprecated since PMD 6.15.0, but was not mentioned in the release notes back then. Use the property `testPattern` instead to configure valid names for test methods. +* {% rule java/documentation/CommentRequired %}: The deprecated property `headerCommentRequirement` has been removed. + Use the property `classCommentRequirement` instead. **Removed Rules** @@ -1162,6 +1164,8 @@ Contributors: [Aaron Hurst](https://github.com/aaronhurst-google) (@aaronhurst-g See also [pull request #3757](https://github.com/pmd/pmd/pull/3757). * Elements in annotation types are now detected as well. This might lead to an increased number of violations for missing public method comments. + * The deprecated property `headerCommentRequirement` has been removed. Use the property `classCommentRequirement` + instead. * {% rule java/documentation/CommentSize %}: When determining the line-length of a comment, the leading comment prefix markers (e.g. `*` or `//`) are ignored and don't add up to the line-length. See also [pull request #4369](https://github.com/pmd/pmd/pull/4369). diff --git a/docs/pages/release_notes_pmd7.md b/docs/pages/release_notes_pmd7.md index e051c28c08..349b5acbf7 100644 --- a/docs/pages/release_notes_pmd7.md +++ b/docs/pages/release_notes_pmd7.md @@ -419,6 +419,8 @@ can be parsed now. PMD should now be able to parse Apex code up to version 59.0 See also [pull request #3757](https://github.com/pmd/pmd/pull/3757). * Elements in annotation types are now detected as well. This might lead to an increased number of violations for missing public method comments. + * The deprecated property `headerCommentRequirement` has been removed. Use the property `classCommentRequirement` + instead. * {% rule java/documentation/CommentSize %}: When determining the line-length of a comment, the leading comment prefix markers (e.g. `*` or `//`) are ignored and don't add up to the line-length. See also [pull request #4369](https://github.com/pmd/pmd/pull/4369). diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentRequiredRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentRequiredRule.java index 00a92e335e..8992970ec6 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentRequiredRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentRequiredRule.java @@ -9,9 +9,6 @@ import java.util.HashMap; import java.util.Locale; import java.util.Map; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import net.sourceforge.pmd.lang.java.ast.ASTBodyDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTClassDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTConstructorDeclaration; @@ -35,8 +32,6 @@ import net.sourceforge.pmd.util.CollectionUtil; * @author Brian Remedios */ public class CommentRequiredRule extends AbstractJavaRulechainRule { - private static final Logger LOG = LoggerFactory.getLogger(CommentRequiredRule.class); - // Used to pretty print a message private static final Map DESCRIPTOR_NAME_TO_COMMENT_TYPE = new HashMap<>(); @@ -46,8 +41,6 @@ public class CommentRequiredRule extends AbstractJavaRulechainRule { private static final PropertyDescriptor OVERRIDE_CMT_DESCRIPTOR = requirementPropertyBuilder("methodWithOverrideCommentRequirement", "Comments on @Override methods") .defaultValue(CommentRequirement.Ignored).build(); - private static final PropertyDescriptor HEADER_CMT_REQUIREMENT_DESCRIPTOR - = requirementPropertyBuilder("headerCommentRequirement", "Deprecated! Header comments. Please use the property \"classCommentRequired\" instead.").build(); private static final PropertyDescriptor CLASS_CMT_REQUIREMENT_DESCRIPTOR = requirementPropertyBuilder("classCommentRequirement", "Class comments").build(); private static final PropertyDescriptor FIELD_CMT_REQUIREMENT_DESCRIPTOR @@ -73,7 +66,6 @@ public class CommentRequiredRule extends AbstractJavaRulechainRule { definePropertyDescriptor(OVERRIDE_CMT_DESCRIPTOR); definePropertyDescriptor(ACCESSOR_CMT_DESCRIPTOR); definePropertyDescriptor(CLASS_CMT_REQUIREMENT_DESCRIPTOR); - definePropertyDescriptor(HEADER_CMT_REQUIREMENT_DESCRIPTOR); definePropertyDescriptor(FIELD_CMT_REQUIREMENT_DESCRIPTOR); definePropertyDescriptor(PUB_METHOD_CMT_REQUIREMENT_DESCRIPTOR); definePropertyDescriptor(PROT_METHOD_CMT_REQUIREMENT_DESCRIPTOR); @@ -94,20 +86,7 @@ public class CommentRequiredRule extends AbstractJavaRulechainRule { getProperty(SERIAL_VERSION_UID_CMT_REQUIREMENT_DESCRIPTOR)); propertyValues.put(SERIAL_PERSISTENT_FIELDS_CMT_REQUIREMENT_DESCRIPTOR, getProperty(SERIAL_PERSISTENT_FIELDS_CMT_REQUIREMENT_DESCRIPTOR)); - - CommentRequirement headerCommentRequirementValue = getProperty(HEADER_CMT_REQUIREMENT_DESCRIPTOR); - boolean headerCommentRequirementValueOverridden = headerCommentRequirementValue != CommentRequirement.Required; - CommentRequirement classCommentRequirementValue = getProperty(CLASS_CMT_REQUIREMENT_DESCRIPTOR); - boolean classCommentRequirementValueOverridden = classCommentRequirementValue != CommentRequirement.Required; - - if (headerCommentRequirementValueOverridden && !classCommentRequirementValueOverridden) { - LOG.warn("Rule CommentRequired uses deprecated property 'headerCommentRequirement'. " - + "Future versions of PMD will remove support for this property. " - + "Please use 'classCommentRequirement' instead!"); - propertyValues.put(CLASS_CMT_REQUIREMENT_DESCRIPTOR, headerCommentRequirementValue); - } else { - propertyValues.put(CLASS_CMT_REQUIREMENT_DESCRIPTOR, classCommentRequirementValue); - } + propertyValues.put(CLASS_CMT_REQUIREMENT_DESCRIPTOR, getProperty(CLASS_CMT_REQUIREMENT_DESCRIPTOR)); } private void checkCommentMeetsRequirement(Object data, JavadocCommentOwner node, @@ -203,8 +182,7 @@ public class CommentRequiredRule extends AbstractJavaRulechainRule { return getProperty(OVERRIDE_CMT_DESCRIPTOR) == CommentRequirement.Ignored && getProperty(ACCESSOR_CMT_DESCRIPTOR) == CommentRequirement.Ignored - && (getProperty(CLASS_CMT_REQUIREMENT_DESCRIPTOR) == CommentRequirement.Ignored - || getProperty(HEADER_CMT_REQUIREMENT_DESCRIPTOR) == CommentRequirement.Ignored) + && getProperty(CLASS_CMT_REQUIREMENT_DESCRIPTOR) == CommentRequirement.Ignored && getProperty(FIELD_CMT_REQUIREMENT_DESCRIPTOR) == CommentRequirement.Ignored && getProperty(PUB_METHOD_CMT_REQUIREMENT_DESCRIPTOR) == CommentRequirement.Ignored && getProperty(PROT_METHOD_CMT_REQUIREMENT_DESCRIPTOR) == CommentRequirement.Ignored diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentRequiredTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentRequiredTest.java index 4c026b25c3..c0eefbb589 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentRequiredTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentRequiredTest.java @@ -23,9 +23,6 @@ class CommentRequiredTest extends PmdRuleTst { assertNull(rule.dysfunctionReason(), "By default, the rule should be functional"); List> propertyDescriptors = getProperties(rule); - // remove deprecated properties - propertyDescriptors.removeIf(property -> property.description().startsWith("Deprecated!")); - for (PropertyDescriptor property : propertyDescriptors) { setPropertyValue(rule, property, "Ignored"); } diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/documentation/xml/CommentRequired.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/documentation/xml/CommentRequired.xml index b8328ba236..6f4158572f 100755 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/documentation/xml/CommentRequired.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/documentation/xml/CommentRequired.xml @@ -514,17 +514,7 @@ public class CommentRequired { - #1683 [java] CommentRequired property names are inconsistent - use deprecated property - Unwanted - 1 - - - - - #1683 [java] CommentRequired property names are inconsistent - use new property + #1683 [java] CommentRequired property names are inconsistent Unwanted 1 Date: Mon, 26 Feb 2024 19:36:51 +0100 Subject: [PATCH 44/52] [java] NonSerializableClass: Remove property prefix This property has been deprecated since PMD 6.52.0 --- docs/pages/release_notes.md | 4 ++++ docs/pages/release_notes_pmd7.md | 2 ++ .../lang/java/rule/errorprone/NonSerializableClassRule.java | 4 ---- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 7f543baeaa..a6ad31ca1e 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -143,6 +143,8 @@ Experimental Kotlin support has been promoted as stable API now. back then. Use the property `testPattern` instead to configure valid names for test methods. * {% rule java/documentation/CommentRequired %}: The deprecated property `headerCommentRequirement` has been removed. Use the property `classCommentRequirement` instead. +* {% rule java/errorprone/NonSerializableClass %}: The deprecated property `prefix` has been removed + without replacement. In a serializable class all fields have to be serializable regardless of the name. **Removed Rules** @@ -1179,6 +1181,8 @@ Contributors: [Aaron Hurst](https://github.com/aaronhurst-google) (@aaronhurst-g special-cased anymore. Rename the exception parameter to `ignored` to ignore them. * {% rule java/errorprone/ImplicitSwitchFallThrough %}: Violations are now reported on the case statements rather than on the switch statements. This is more accurate but might result in more violations now. +* {% rule java/errorprone/NonSerializableClass %}: The deprecated property `prefix` has been removed + without replacement. In a serializable class all fields have to be serializable regardless of the name. #### Removed Rules diff --git a/docs/pages/release_notes_pmd7.md b/docs/pages/release_notes_pmd7.md index 349b5acbf7..f269965bf0 100644 --- a/docs/pages/release_notes_pmd7.md +++ b/docs/pages/release_notes_pmd7.md @@ -434,6 +434,8 @@ can be parsed now. PMD should now be able to parse Apex code up to version 59.0 special-cased anymore. Rename the exception parameter to `ignored` to ignore them. * {% rule java/errorprone/ImplicitSwitchFallThrough %}: Violations are now reported on the case statements rather than on the switch statements. This is more accurate but might result in more violations now. +* {% rule java/errorprone/NonSerializableClass %}: The deprecated property `prefix` has been removed + without replacement. In a serializable class all fields have to be serializable regardless of the name. ### Deprecated Rules diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonSerializableClassRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonSerializableClassRule.java index 136a68799c..31e5c53f2f 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonSerializableClassRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonSerializableClassRule.java @@ -5,7 +5,6 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; import static net.sourceforge.pmd.properties.PropertyFactory.booleanProperty; -import static net.sourceforge.pmd.properties.PropertyFactory.stringProperty; import java.io.Externalizable; import java.io.ObjectInputStream; @@ -45,8 +44,6 @@ import net.sourceforge.pmd.reporting.RuleContext; // Note: This rule has been formerly known as "BeanMembersShouldSerialize". public class NonSerializableClassRule extends AbstractJavaRulechainRule { - private static final PropertyDescriptor PREFIX_DESCRIPTOR = stringProperty("prefix") - .desc("deprecated! A variable prefix to skip, i.e., m_").defaultValue("").build(); private static final PropertyDescriptor CHECK_ABSTRACT_TYPES = booleanProperty("checkAbstractTypes") .desc("Enable to verify fields with abstract types like abstract classes, interfaces, generic types " + "or java.lang.Object. Enabling this might lead to more false positives, since the concrete " @@ -62,7 +59,6 @@ public class NonSerializableClassRule extends AbstractJavaRulechainRule { public NonSerializableClassRule() { super(ASTVariableId.class, ASTClassDeclaration.class, ASTEnumDeclaration.class, ASTRecordDeclaration.class); - definePropertyDescriptor(PREFIX_DESCRIPTOR); definePropertyDescriptor(CHECK_ABSTRACT_TYPES); } From b036931995f6841f54384c9f6b0e450a6e185abb Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Tue, 27 Feb 2024 19:49:23 +0100 Subject: [PATCH 45/52] Fix javadoc/dokka configuration --- pmd-ant/pom.xml | 18 ++++++++++++++++++ pmd-core/pom.xml | 9 +++++++++ pmd-lang-test/pom.xml | 13 +++++++++++++ pmd-test-schema/pom.xml | 17 +++++++++++++++++ pmd-test/pom.xml | 18 ++++++++++++++++++ pom.xml | 23 ++++++++++++++++++----- 6 files changed, 93 insertions(+), 5 deletions(-) diff --git a/pmd-ant/pom.xml b/pmd-ant/pom.xml index f8c867276c..f41b68a635 100644 --- a/pmd-ant/pom.xml +++ b/pmd-ant/pom.xml @@ -15,6 +15,24 @@ PMD Ant Integration Apache Ant integration for PMD. + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + + ${project.basedir}/../pmd-core/target/apidocs + ../../pmd-core/${project.version} + + + + + + + net.sourceforge.pmd diff --git a/pmd-core/pom.xml b/pmd-core/pom.xml index 12d73daa38..7bce749567 100644 --- a/pmd-core/pom.xml +++ b/pmd-core/pom.xml @@ -33,6 +33,15 @@ + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + + diff --git a/pmd-lang-test/pom.xml b/pmd-lang-test/pom.xml index 61ae292f4d..fd7521f1fe 100644 --- a/pmd-lang-test/pom.xml +++ b/pmd-lang-test/pom.xml @@ -45,6 +45,19 @@ org.jetbrains.dokka dokka-maven-plugin + + + + + https://docs.pmd-code.org/apidocs/pmd-core/${project.version}/ + file://${project.basedir}/../pmd-core/target/apidocs/element-list + + + https://docs.pmd-code.org/apidocs/pmd-test/${project.version}/ + file://${project.basedir}/../pmd-test/target/apidocs/element-list + + + diff --git a/pmd-test-schema/pom.xml b/pmd-test-schema/pom.xml index 044b0c5e2b..c81c7b26dc 100644 --- a/pmd-test-schema/pom.xml +++ b/pmd-test-schema/pom.xml @@ -19,6 +19,23 @@ 8 + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + + ${project.basedir}/../pmd-core/target/apidocs + ../../pmd-core/${project.version} + + + + + + diff --git a/pmd-test/pom.xml b/pmd-test/pom.xml index 296651078d..3313f25111 100644 --- a/pmd-test/pom.xml +++ b/pmd-test/pom.xml @@ -16,6 +16,24 @@ 8 + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + + ${project.basedir}/../pmd-core/target/apidocs + ../../pmd-core/${project.version} + + + + + + + - ${project.basedir}/../pmd-core/target/apidocs - ../../pmd-core/${project.version} + ${project.basedir}/../pmd-lang-test/target/dokkaJavadocJar + ../../pmd-lang-test/${project.version} @@ -397,6 +396,20 @@ ${dokka.version} ${dokka.skip} + + + https://docs.pmd-code.org/apidocs/pmd-core/${project.version}/ + file://${project.basedir}/../pmd-core/target/apidocs/element-list + + + https://docs.pmd-code.org/apidocs/pmd-test/${project.version}/ + file://${project.basedir}/../pmd-test/target/apidocs/element-list + + + https://docs.pmd-code.org/apidocs/pmd-lang-test/${project.version}/ + file:///${project.basedir}/../pmd-lang-test/target/dokkaJavadocJar/element-list + + From a24bc9be1a73c5244cc0b704a6abb68a94a73a99 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 1 Mar 2024 12:45:02 +0100 Subject: [PATCH 46/52] Add @liqingjun123 as a contributor --- .all-contributorsrc | 9 +++++++++ docs/pages/pmd/projectdocs/credits.md | 29 ++++++++++++++------------- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index b7f0ddc431..99907c2d17 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -7370,6 +7370,15 @@ "contributions": [ "bug" ] + }, + { + "login": "liqingjun123", + "name": "liqingjun123", + "avatar_url": "https://avatars.githubusercontent.com/u/12873992?v=4", + "profile": "https://github.com/liqingjun123", + "contributions": [ + "bug" + ] } ], "contributorsPerLine": 7, diff --git a/docs/pages/pmd/projectdocs/credits.md b/docs/pages/pmd/projectdocs/credits.md index b57caee7d6..5a9a8aea08 100644 --- a/docs/pages/pmd/projectdocs/credits.md +++ b/docs/pages/pmd/projectdocs/credits.md @@ -919,127 +919,128 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
lasselindqvist

đź›

lgemeinhardt

đź›

lihuaib

đź›

liqingjun123

đź›

lonelyma1021

đź›

lpeddy

đź›

lpeddy

đź›

lujiefsi

đź’»

lukelukes

đź’»

lyriccoder

đź›

marcelmore

đź›

matchbox

đź›

matthiaskraaz

đź›

meandonlyme

đź›

meandonlyme

đź›

mikesive

đź›

milossesic

đź›

mluckam

đź’»

mohan-chinnappan-n

đź’»

mriddell95

đź›

mrlzh

đź›

msloan

đź›

msloan

đź›

mucharlaravalika

đź›

mvenneman

đź›

nareshl119

đź›

nicolas-harraudeau-sonarsource

đź›

noerremark

đź›

novsirion

đź›

nwcm

đź“– đź›

nwcm

đź“– đź›

oggboy

đź›

oinume

đź›

orimarko

đź’» đź›

pacvz

đź’»

pallavi agarwal

đź›

parksungrin

đź›

patpatpat123

đź›

patpatpat123

đź›

patriksevallius

đź›

pbrajesh1

đź›

phoenix384

đź›

piotrszymanski-sc

đź’»

plan3d

đź›

poojasix

đź›

prabhushrikant

đź›

prabhushrikant

đź›

pujitha8783

đź›

r-r-a-j

đź›

raghujayjunk

đź›

rajeshveera

đź›

rajeswarreddy88

đź›

recdevs

đź›

reudismam

đź’» đź›

reudismam

đź’» đź›

rijkt

đź›

rillig-tk

đź›

rmohan20

đź’» đź›

rnveach

đź›

rxmicro

đź›

ryan-gustafson

đź’» đź›

sabi0

đź›

sabi0

đź›

scais

đź›

sebbASF

đź›

sergeygorbaty

đź’»

shilko2013

đź›

shiomiyan

đź“–

simeonKondr

đź›

snajberk

đź›

snajberk

đź›

sniperrifle2004

đź›

snuyanzin

đź› đź’»

soyodream

đź›

sratz

đź›

stonio

đź›

sturton

đź’» đź›

sudharmohan

đź›

sudharmohan

đź›

suruchidawar

đź›

svenfinitiv

đź›

tashiscool

đź›

test-git-hook

đź›

testation21

đź’» đź›

thanosa

đź›

tiandiyixian

đź›

tiandiyixian

đź›

tobwoerk

đź›

tprouvot

đź› đź’»

trentchilders

đź›

triandicAnt

đź›

trishul14

đź›

tsui

đź›

winhkey

đź›

winhkey

đź›

witherspore

đź›

wjljack

đź›

wuchiuwong

đź›

xingsong

đź›

xioayuge

đź›

xnYi9wRezm

đź’» đź›

xuanuy

đź›

xuanuy

đź›

xyf0921

đź›

yalechen-cyw3

đź›

yasuharu-sato

đź›

zenglian

đź›

zgrzyt93

đź’» đź›

zh3ng

đź›

zt_soft

đź›

zt_soft

đź›

ztt79

đź›

zzzzfeng

đź›

Ărpád Magosányi

đź›