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/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/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/_data/sidebars/pmd_sidebar.yml b/docs/_data/sidebars/pmd_sidebar.yml index 22741aaf1b..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: @@ -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/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..b36e3dd853 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)`. @@ -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/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/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/pmd/languages/java.md b/docs/pages/pmd/languages/java.md index 6354280cae..83717461d5 100644 --- a/docs/pages/pmd/languages/java.md +++ b/docs/pages/pmd/languages/java.md @@ -15,9 +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 | -| 20-preview | | 6.55.0 | +| 21 | | 7.0.0 | | 20 | | 6.55.0 | | 19 | | 6.48.0 | | 18 | | 6.44.0 | @@ -40,10 +41,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/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/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/visualforce.md b/docs/pages/pmd/languages/visualforce.md index ecb56a9f9e..0f9809a1da 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 @@ -22,37 +28,37 @@ 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: -* `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/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/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

🐛 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/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/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/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..bbad4b0f5b 100644 --- a/docs/pages/pmd/userdocs/migrating_to_pmd7.md +++ b/docs/pages/pmd/userdocs/migrating_to_pmd7.md @@ -74,6 +74,8 @@ 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` +* 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. @@ -115,9 +117,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/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/docs/pages/release_notes.md b/docs/pages/release_notes.md index cbacf68c2f..c54dec614d 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) @@ -102,7 +124,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. @@ -116,6 +139,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 @@ -125,6 +159,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** @@ -138,6 +181,20 @@ 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. +* {% 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. + +**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** @@ -255,6 +312,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 @@ -264,8 +322,13 @@ 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 + * [#4827](https://github.com/pmd/pmd/pull/4827): \[compat6] Support config errors and cpd for csharp + * [#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-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 @@ -275,6 +338,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-bestpractices * [#4603](https://github.com/pmd/pmd/issues/4603): \[java] UnusedAssignment false positive in record compact constructor * [#4625](https://github.com/pmd/pmd/issues/4625): \[java] UnusedPrivateMethod false positive: Autoboxing into Number @@ -290,6 +354,7 @@ The rules have been moved into categories with PMD 6. * [#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 @@ -303,6 +368,17 @@ 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. +* {%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`. +* {%jdoc java::lang.java.ast.ASTUnnamedPattern %} is not experimental anymore. The language feature + has been standardized with Java 22. + **New API** The API around {%jdoc core::util.treeexport.TreeRenderer %} has been declared as stable. It was previously @@ -336,6 +412,42 @@ 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 %}. +* 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`. +* 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`) + * {%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` +* 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** @@ -397,6 +509,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. @@ -662,6 +778,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. @@ -676,10 +793,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)** @@ -1076,7 +1193,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. @@ -1089,6 +1206,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 @@ -1159,6 +1282,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). @@ -1172,6 +1297,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 @@ -1226,6 +1353,9 @@ 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 + * [#4827](https://github.com/pmd/pmd/pull/4827): \[compat6] Support config errors and cpd for csharp + * [#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 @@ -1311,6 +1441,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 @@ -1330,6 +1461,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 @@ -1369,6 +1502,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 @@ -1474,6 +1608,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/docs/pages/release_notes_pmd7.md b/docs/pages/release_notes_pmd7.md index 444cdd1232..3708759182 100644 --- a/docs/pages/release_notes_pmd7.md +++ b/docs/pages/release_notes_pmd7.md @@ -214,6 +214,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, @@ -330,7 +352,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. @@ -343,6 +365,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 @@ -384,6 +412,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** @@ -411,6 +441,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). @@ -424,6 +456,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 @@ -1705,7 +1739,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 +1754,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 +1889,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 +2111,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/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-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-ant/src/main/java/net/sourceforge/pmd/ant/Formatter.java b/pmd-ant/src/main/java/net/sourceforge/pmd/ant/Formatter.java index cd36777ca9..cc3cde3876 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; @@ -196,8 +197,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 ignored) { + // fall-through - we use a Java Runtime < 22. + } + try { Object res = FieldUtils.readDeclaredField(console, "cs", true); if (res instanceof Charset) { 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-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/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/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/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/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/AllMetricsTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/metrics/internal/AllMetricsTest.java similarity index 88% 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 2936a9d81a..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,11 +2,11 @@ * 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; -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/metrics/impl/CognitiveComplexityTestRule.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/metrics/internal/CognitiveComplexityTestRule.java similarity index 86% 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 569f16e6f8..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,12 +2,12 @@ * 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; 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/internal/CycloTestRule.java similarity index 87% 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 195d6f3192..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,13 +2,13 @@ * 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; 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/internal/WmcTestRule.java similarity index 82% 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 12063ede03..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,11 +2,11 @@ * 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; -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-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-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/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 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 + 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"> 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-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-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} + 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/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 8c9762f110..13f0485c6f 100644 --- a/pmd-compat6/src/it/pmd-for-java/pom.xml +++ b/pmd-compat6/src/it/pmd-for-java/pom.xml @@ -36,6 +36,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/cpd/CPDConfiguration.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/CPDConfiguration.java index c33dd2e3bf..c49b21586c 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 @@ -296,6 +296,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; + } } } 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 { diff --git a/pmd-core/pom.xml b/pmd-core/pom.xml index ed0b16591d..27b39da16f 100644 --- a/pmd-core/pom.xml +++ b/pmd-core/pom.xml @@ -67,6 +67,15 @@ + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + + 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/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-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/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 { 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/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" ); } 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 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-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/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-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/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-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-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} 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 93% 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..fbce76013c 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; @@ -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/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 94% 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 f9dd400565..6277a3f714 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; @@ -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", "velocity", "visualforce", "wsdl", "xml", "xsl" ); private static final List SUPPORTED_LANGUAGES_PMD = listOf( @@ -49,8 +49,9 @@ 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", "java-8", "java-9", "jsp-2", "jsp-3", "kotlin-1.6", "kotlin-1.7", "kotlin-1.8", "modelica-3.4", "modelica-3.5", @@ -60,11 +61,13 @@ 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", - "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" + "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", + "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/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; 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/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-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-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 95% rename from pmd-doc/src/main/java/net/sourceforge/pmd/docs/RuleDocGenerator.java rename to pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/RuleDocGenerator.java index a5d32cc979..5ad83287e4 100644 --- a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/RuleDocGenerator.java +++ b/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/RuleDocGenerator.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.docs; +package net.sourceforge.pmd.doc.internal; import java.io.File; import java.io.IOException; @@ -90,6 +90,7 @@ public class RuleDocGenerator { } public void generate(List registeredRulesets, List additionalRulesets) throws IOException { + removeExistingRuleDocs(); Map> sortedRulesets; Map> sortedAdditionalRulesets; sortedRulesets = sortRulesets(registeredRulesets); @@ -102,6 +103,38 @@ public class RuleDocGenerator { generateSidebar(sortedRulesets); } + private void removeExistingRuleDocs() throws IOException { + Path directory = root.resolve("docs/pages/pmd/rules"); + if (!Files.isDirectory(directory)) { + // no old files exist yet + return; + } + + System.out.println("Deleting old rule docs in " + directory); + Files.walkFileTree(directory, new SimpleFileVisitor() { + @Override + public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { + if (file.toString().endsWith("scala.md")) { + // don't delete scala.md, since we don't have any rules yet... + return FileVisitResult.CONTINUE; + } + Files.delete(file); + return FileVisitResult.CONTINUE; + } + + @Override + public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException { + if (dir.equals(directory)) { + // don't delete the whole directory, keep it empty + // or almost empty (scala.md is still present) + return FileVisitResult.CONTINUE; + } + Files.delete(dir); + return FileVisitResult.CONTINUE; + } + }); + } + private void ensureAllLanguages(Map> sortedRulesets) { for (Language language : LanguageRegistry.PMD.getLanguages()) { sortedRulesets.putIfAbsent(language, Collections.emptyList()); diff --git a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/RuleSetUtils.java b/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/RuleSetUtils.java similarity index 98% rename from pmd-doc/src/main/java/net/sourceforge/pmd/docs/RuleSetUtils.java rename to pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/RuleSetUtils.java index 156946cfbc..2399f96ebd 100644 --- a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/RuleSetUtils.java +++ b/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/RuleSetUtils.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.docs; +package net.sourceforge.pmd.doc.internal; import java.io.File; import java.util.regex.Pattern; diff --git a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/RuleTagChecker.java b/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/RuleTagChecker.java similarity index 99% rename from pmd-doc/src/main/java/net/sourceforge/pmd/docs/RuleTagChecker.java rename to pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/RuleTagChecker.java index a1ae35b753..9e41a1fa32 100644 --- a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/RuleTagChecker.java +++ b/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/RuleTagChecker.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.docs; +package net.sourceforge.pmd.doc.internal; import java.io.IOException; import java.nio.charset.StandardCharsets; diff --git a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/SidebarGenerator.java b/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/SidebarGenerator.java similarity index 99% rename from pmd-doc/src/main/java/net/sourceforge/pmd/docs/SidebarGenerator.java rename to pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/SidebarGenerator.java index 0982f7fb5b..d9f248eb0c 100644 --- a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/SidebarGenerator.java +++ b/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/SidebarGenerator.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.docs; +package net.sourceforge.pmd.doc.internal; import java.io.IOException; import java.io.Reader; diff --git a/pmd-doc/src/test/java/net/sourceforge/pmd/docs/EscapeUtilsTest.java b/pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/EscapeUtilsTest.java similarity index 98% rename from pmd-doc/src/test/java/net/sourceforge/pmd/docs/EscapeUtilsTest.java rename to pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/EscapeUtilsTest.java index 439a9f41bc..fe83327d77 100644 --- a/pmd-doc/src/test/java/net/sourceforge/pmd/docs/EscapeUtilsTest.java +++ b/pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/EscapeUtilsTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.docs; +package net.sourceforge.pmd.doc.internal; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/pmd-doc/src/test/java/net/sourceforge/pmd/docs/MockedFileWriter.java b/pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/MockedFileWriter.java similarity index 96% rename from pmd-doc/src/test/java/net/sourceforge/pmd/docs/MockedFileWriter.java rename to pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/MockedFileWriter.java index b954a3a9d3..7173fcc927 100644 --- a/pmd-doc/src/test/java/net/sourceforge/pmd/docs/MockedFileWriter.java +++ b/pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/MockedFileWriter.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.docs; +package net.sourceforge.pmd.doc.internal; import java.io.IOException; import java.nio.file.Path; diff --git a/pmd-doc/src/test/java/net/sourceforge/pmd/docs/RuleDocGeneratorTest.java b/pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/RuleDocGeneratorTest.java similarity index 96% rename from pmd-doc/src/test/java/net/sourceforge/pmd/docs/RuleDocGeneratorTest.java rename to pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/RuleDocGeneratorTest.java index b593280141..cffe8af125 100644 --- a/pmd-doc/src/test/java/net/sourceforge/pmd/docs/RuleDocGeneratorTest.java +++ b/pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/RuleDocGeneratorTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.docs; +package net.sourceforge.pmd.doc.internal; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -19,7 +19,7 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; -import net.sourceforge.pmd.docs.MockedFileWriter.FileEntry; +import net.sourceforge.pmd.doc.internal.MockedFileWriter.FileEntry; import net.sourceforge.pmd.internal.util.IOUtil; import net.sourceforge.pmd.lang.rule.RuleSet; import net.sourceforge.pmd.lang.rule.RuleSetLoader; diff --git a/pmd-doc/src/test/java/net/sourceforge/pmd/docs/RuleSetResolverTest.java b/pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/RuleSetResolverTest.java similarity index 98% rename from pmd-doc/src/test/java/net/sourceforge/pmd/docs/RuleSetResolverTest.java rename to pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/RuleSetResolverTest.java index bd3ee01d54..9abb6b4618 100644 --- a/pmd-doc/src/test/java/net/sourceforge/pmd/docs/RuleSetResolverTest.java +++ b/pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/RuleSetResolverTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.docs; +package net.sourceforge.pmd.doc.internal; import static net.sourceforge.pmd.util.CollectionUtil.listOf; import static org.junit.jupiter.api.Assertions.assertFalse; diff --git a/pmd-doc/src/test/java/net/sourceforge/pmd/docs/RuleTagCheckerTest.java b/pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/RuleTagCheckerTest.java similarity index 97% rename from pmd-doc/src/test/java/net/sourceforge/pmd/docs/RuleTagCheckerTest.java rename to pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/RuleTagCheckerTest.java index 3808b616a5..d9aa3cf7a1 100644 --- a/pmd-doc/src/test/java/net/sourceforge/pmd/docs/RuleTagCheckerTest.java +++ b/pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/RuleTagCheckerTest.java @@ -3,7 +3,7 @@ */ -package net.sourceforge.pmd.docs; +package net.sourceforge.pmd.doc.internal; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/pmd-doc/src/test/java/net/sourceforge/pmd/docs/SidebarGeneratorTest.java b/pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/SidebarGeneratorTest.java similarity index 98% rename from pmd-doc/src/test/java/net/sourceforge/pmd/docs/SidebarGeneratorTest.java rename to pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/SidebarGeneratorTest.java index 68ce308d5b..81f3392583 100644 --- a/pmd-doc/src/test/java/net/sourceforge/pmd/docs/SidebarGeneratorTest.java +++ b/pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/SidebarGeneratorTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.docs; +package net.sourceforge.pmd.doc.internal; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/pmd-doc/src/test/resources/expected/pmd_sidebar.yml b/pmd-doc/src/test/resources/expected/pmd_sidebar.yml index 756c9ece74..dc489db83f 100644 --- a/pmd-doc/src/test/resources/expected/pmd_sidebar.yml +++ b/pmd-doc/src/test/resources/expected/pmd_sidebar.yml @@ -98,7 +98,7 @@ entries: subfolderitems: - title: Index output: web, pdf - url: /pmd_rules_vf.html + url: /pmd_rules_visualforce.html - title: null output: web, pdf subfolders: @@ -125,7 +125,7 @@ entries: subfolderitems: - title: Index output: web, pdf - url: /pmd_rules_vm.html + url: /pmd_rules_velocity.html - title: null output: web, pdf subfolders: diff --git a/pmd-doc/src/test/resources/net/sourceforge/pmd/docs/sidebar.yml b/pmd-doc/src/test/resources/net/sourceforge/pmd/doc/internal/sidebar.yml similarity index 100% rename from pmd-doc/src/test/resources/net/sourceforge/pmd/docs/sidebar.yml rename to pmd-doc/src/test/resources/net/sourceforge/pmd/doc/internal/sidebar.yml diff --git a/pmd-fortran/src/test/java/net/sourceforge/pmd/lang/fortran/cpd/FortranCpdLexerTest.java b/pmd-fortran/src/test/java/net/sourceforge/pmd/lang/fortran/cpd/FortranCpdLexerTest.java index 4174204f44..992072abae 100644 --- a/pmd-fortran/src/test/java/net/sourceforge/pmd/lang/fortran/cpd/FortranCpdLexerTest.java +++ b/pmd-fortran/src/test/java/net/sourceforge/pmd/lang/fortran/cpd/FortranCpdLexerTest.java @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.fortran.cpd; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest; +import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest; /** * @author rpelisse diff --git a/pmd-gherkin/src/test/java/net/sourceforge/pmd/lang/gherkin/cpd/GherkinCpdLexerTest.java b/pmd-gherkin/src/test/java/net/sourceforge/pmd/lang/gherkin/cpd/GherkinCpdLexerTest.java index 6fde983b27..92d7fcab15 100644 --- a/pmd-gherkin/src/test/java/net/sourceforge/pmd/lang/gherkin/cpd/GherkinCpdLexerTest.java +++ b/pmd-gherkin/src/test/java/net/sourceforge/pmd/lang/gherkin/cpd/GherkinCpdLexerTest.java @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.gherkin.cpd; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest; +import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest; class GherkinCpdLexerTest extends CpdTextComparisonTest { GherkinCpdLexerTest() { diff --git a/pmd-go/pom.xml b/pmd-go/pom.xml index 060920664c..1f6720920a 100644 --- a/pmd-go/pom.xml +++ b/pmd-go/pom.xml @@ -31,7 +31,7 @@ - + diff --git a/pmd-go/src/test/java/net/sourceforge/pmd/lang/go/cpd/GoCpdLexerTest.java b/pmd-go/src/test/java/net/sourceforge/pmd/lang/go/cpd/GoCpdLexerTest.java index e40d2c2b23..571102abf5 100644 --- a/pmd-go/src/test/java/net/sourceforge/pmd/lang/go/cpd/GoCpdLexerTest.java +++ b/pmd-go/src/test/java/net/sourceforge/pmd/lang/go/cpd/GoCpdLexerTest.java @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.go.cpd; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest; +import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest; class GoCpdLexerTest extends CpdTextComparisonTest { diff --git a/pmd-groovy/src/test/java/net/sourceforge/pmd/lang/groovy/cpd/GroovyCpdLexerTest.java b/pmd-groovy/src/test/java/net/sourceforge/pmd/lang/groovy/cpd/GroovyCpdLexerTest.java index 647020c363..38ddb03717 100644 --- a/pmd-groovy/src/test/java/net/sourceforge/pmd/lang/groovy/cpd/GroovyCpdLexerTest.java +++ b/pmd-groovy/src/test/java/net/sourceforge/pmd/lang/groovy/cpd/GroovyCpdLexerTest.java @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.groovy.cpd; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest; +import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest; class GroovyCpdLexerTest extends CpdTextComparisonTest { diff --git a/pmd-html/src/main/java/net/sourceforge/pmd/lang/html/HtmlLanguageModule.java b/pmd-html/src/main/java/net/sourceforge/pmd/lang/html/HtmlLanguageModule.java index 26d02710a9..c4809cc487 100644 --- a/pmd-html/src/main/java/net/sourceforge/pmd/lang/html/HtmlLanguageModule.java +++ b/pmd-html/src/main/java/net/sourceforge/pmd/lang/html/HtmlLanguageModule.java @@ -7,7 +7,7 @@ package net.sourceforge.pmd.lang.html; import net.sourceforge.pmd.cpd.CpdLexer; import net.sourceforge.pmd.lang.LanguagePropertyBundle; import net.sourceforge.pmd.lang.LanguageRegistry; -import net.sourceforge.pmd.lang.html.ast.HtmlCpdLexer; +import net.sourceforge.pmd.lang.html.cpd.HtmlCpdLexer; import net.sourceforge.pmd.lang.impl.SimpleLanguageModuleBase; public final class HtmlLanguageModule extends SimpleLanguageModuleBase { diff --git a/pmd-html/src/main/java/net/sourceforge/pmd/lang/html/ast/HtmlCpdLexer.java b/pmd-html/src/main/java/net/sourceforge/pmd/lang/html/cpd/HtmlCpdLexer.java similarity index 87% rename from pmd-html/src/main/java/net/sourceforge/pmd/lang/html/ast/HtmlCpdLexer.java rename to pmd-html/src/main/java/net/sourceforge/pmd/lang/html/cpd/HtmlCpdLexer.java index f7f0668de6..18a2392e08 100644 --- a/pmd-html/src/main/java/net/sourceforge/pmd/lang/html/ast/HtmlCpdLexer.java +++ b/pmd-html/src/main/java/net/sourceforge/pmd/lang/html/cpd/HtmlCpdLexer.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.html.ast; +package net.sourceforge.pmd.lang.html.cpd; import java.io.IOException; import java.io.UncheckedIOException; @@ -15,6 +15,10 @@ import net.sourceforge.pmd.lang.ast.Parser.ParserTask; import net.sourceforge.pmd.lang.ast.SemanticErrorReporter; import net.sourceforge.pmd.lang.document.TextDocument; import net.sourceforge.pmd.lang.html.HtmlLanguageModule; +import net.sourceforge.pmd.lang.html.ast.ASTHtmlDocument; +import net.sourceforge.pmd.lang.html.ast.ASTHtmlTextNode; +import net.sourceforge.pmd.lang.html.ast.HtmlNode; +import net.sourceforge.pmd.lang.html.ast.HtmlParser; /** *

Note: This class has been called HtmlTokenizer in PMD 6

. diff --git a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/LanguageVersionTest.java b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/LanguageVersionTest.java index 0a8b032163..9315ee0525 100644 --- a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/LanguageVersionTest.java +++ b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/LanguageVersionTest.java @@ -7,7 +7,7 @@ package net.sourceforge.pmd.lang.html; import java.util.Arrays; import java.util.Collection; -import net.sourceforge.pmd.AbstractLanguageVersionTest; +import net.sourceforge.pmd.test.AbstractLanguageVersionTest; class LanguageVersionTest extends AbstractLanguageVersionTest { diff --git a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/RuleSetFactoryTest.java b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/RuleSetFactoryTest.java index f3255130e1..a79d09a0af 100644 --- a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/RuleSetFactoryTest.java +++ b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/RuleSetFactoryTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.html; -import net.sourceforge.pmd.lang.rule.AbstractRuleSetFactoryTest; +import net.sourceforge.pmd.test.lang.rule.AbstractRuleSetFactoryTest; class RuleSetFactoryTest extends AbstractRuleSetFactoryTest { // no additional tests yet diff --git a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/ast/HtmlParsingHelper.java b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/ast/HtmlParsingHelper.java index 5cf5e3461a..a916551648 100644 --- a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/ast/HtmlParsingHelper.java +++ b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/ast/HtmlParsingHelper.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.html.ast; -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; import net.sourceforge.pmd.lang.html.HtmlLanguageModule; public final class HtmlParsingHelper extends BaseParsingHelper { diff --git a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/ast/HtmlTreeDumpTest.java b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/ast/HtmlTreeDumpTest.java index 864e9a04ed..0809b27f36 100644 --- a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/ast/HtmlTreeDumpTest.java +++ b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/ast/HtmlTreeDumpTest.java @@ -7,9 +7,9 @@ package net.sourceforge.pmd.lang.html.ast; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; -import net.sourceforge.pmd.lang.ast.test.BaseTreeDumpTest; -import net.sourceforge.pmd.lang.ast.test.RelevantAttributePrinter; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; +import net.sourceforge.pmd.lang.test.ast.BaseTreeDumpTest; +import net.sourceforge.pmd.lang.test.ast.RelevantAttributePrinter; class HtmlTreeDumpTest extends BaseTreeDumpTest { HtmlTreeDumpTest() { diff --git a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/ast/PositionTest.java b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/ast/PositionTest.java index 2979e52a47..c704e7bf35 100644 --- a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/ast/PositionTest.java +++ b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/ast/PositionTest.java @@ -6,9 +6,9 @@ package net.sourceforge.pmd.lang.html.ast; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; -import net.sourceforge.pmd.lang.ast.test.BaseTreeDumpTest; -import net.sourceforge.pmd.lang.ast.test.CoordinatesPrinter; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; +import net.sourceforge.pmd.lang.test.ast.BaseTreeDumpTest; +import net.sourceforge.pmd.lang.test.ast.CoordinatesPrinter; class PositionTest extends BaseTreeDumpTest { PositionTest() { diff --git a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/cpd/HtmlCpdLexerTest.java b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/cpd/HtmlCpdLexerTest.java index 2039a2f72b..63bc1a03dd 100644 --- a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/cpd/HtmlCpdLexerTest.java +++ b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/cpd/HtmlCpdLexerTest.java @@ -7,7 +7,7 @@ package net.sourceforge.pmd.lang.html.cpd; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest; +import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest; import net.sourceforge.pmd.lang.html.HtmlLanguageModule; class HtmlCpdLexerTest extends CpdTextComparisonTest { diff --git a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/rule/bestpractices/AvoidInlineStylesTest.java b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/rule/bestpractices/AvoidInlineStylesTest.java index ca4314861d..e3dab36338 100644 --- a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/rule/bestpractices/AvoidInlineStylesTest.java +++ b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/rule/bestpractices/AvoidInlineStylesTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.html.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidInlineStylesTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/rule/bestpractices/UnnecessaryTypeAttributeTest.java b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/rule/bestpractices/UnnecessaryTypeAttributeTest.java index ade5f87078..aaf2915ebf 100644 --- a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/rule/bestpractices/UnnecessaryTypeAttributeTest.java +++ b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/rule/bestpractices/UnnecessaryTypeAttributeTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.html.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnnecessaryTypeAttributeTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/rule/bestpractices/UseAltAttributeForImagesTest.java b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/rule/bestpractices/UseAltAttributeForImagesTest.java index c4904a4aee..a336b2d2de 100644 --- a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/rule/bestpractices/UseAltAttributeForImagesTest.java +++ b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/rule/bestpractices/UseAltAttributeForImagesTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.html.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UseAltAttributeForImagesTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/etc/grammar/Java.jjt b/pmd-java/etc/grammar/Java.jjt index 3318fa4083..c29ac79910 100644 --- a/pmd-java/etc/grammar/Java.jjt +++ b/pmd-java/etc/grammar/Java.jjt @@ -1,4 +1,16 @@ /** + * Support "JEP 447: Statements before super(...) (Preview)" (Java 22) + * Changes in ConstructorBlock + * Support "JEP 456: Unnamed Variables & Patterns" (Java 22) + * This is now a regular language feature. Otherwise no changes. + * Support "JEP 463: Implicitly Declared Classes and Instance Main Methods (Second Preview)" (Java 22) + * No changes. + * Support "JEP 459: String Templates (Second Preview)" (Java 22) + * Use ASTTemplate.setContent instead of setImage. + * Remove support for Record pattern in enhanced for statements. This was only a Java 20 Preview feature. + * Remove support for ParenthesizedPatterns. This was only a Java 20 Preview feature. + * Andreas Dangel 02/2024 + *==================================================================== * Renamed various nodes: * ClassOrInterfaceType -> ClassType * ClassOrInterfaceDeclaration -> ClassDeclaration @@ -1049,7 +1061,7 @@ TOKEN : // In order to produce the correct token sequence, the ambiguity needs to be resolved using the context. // That means, that STRING_TEMPLATE_MID/END and TEXT_BLOCK_TEMPLATE_MID/END could actually be a closing bracket ("}"). // Additionally, a STRING_TEMPLATE_MID could be a TEXT_BLOCK_TEMPLATE_MID and the other way round. -// See JLS 3.13 Fragments (Java 21 Preview) +// See JLS 3.13 Fragments (Java 21 Preview and Java 22 Preview) TOKEN : { @@ -1147,7 +1159,7 @@ ASTCompilationUnit CompilationUnit() : // OrdinaryCompilationUnit: -> TopLevelClassOrInterfaceDeclaration ( TypeDeclaration() ( EmptyDeclaration() )* )* - // UnnamedClassCompilationUnit: + // SimpleCompilationUnit: [ ( LOOKAHEAD(3) ClassMemberDeclarationNoMethod() )* ModifierList() MethodDeclaration() @@ -1512,7 +1524,12 @@ private void ConstructorBlock() #Block: {} { "{" { tokenContexts.push(TokenContext.BLOCK); } - [ LOOKAHEAD(ExplicitConstructorInvocation()) ExplicitConstructorInvocation() ] + ( + LOOKAHEAD(ExplicitConstructorInvocation()) ExplicitConstructorInvocation() + | + ( LOOKAHEAD(2) BlockStatement() )* + [ LOOKAHEAD(ExplicitConstructorInvocation()) ExplicitConstructorInvocation() ] + ) ( BlockStatement() )* "}" { tokenContexts.pop(); } } @@ -1895,18 +1912,9 @@ void Pattern() #void: {} { LOOKAHEAD((Annotation())* ReferenceType() "(") RecordPattern() - | LOOKAHEAD("(") ParenthesizedPattern() | TypePattern() } -// ParenthesizedPatterns are removed with Java 21 (JEP 441), but needed for now to support Java 20 Preview -// TODO: Remove ParenthesizedPattern once java 20-preview is removed -void ParenthesizedPattern() #void: -{} -{ - "(" Pattern() ")" { AstImplUtil.bumpParenDepth((ASTPattern) jjtree.peekNode()); } -} - void TypePattern(): {} { @@ -2341,10 +2349,10 @@ void StringTemplate() #void : { { tokenContexts.push(TokenContext.STRING_TEMPLATE); } - { setLastTokenImage(jjtThis); } #TemplateFragment + { jjtThis.setContent(getToken(0).getImage()); } #TemplateFragment EmbeddedExpression() - ( { setLastTokenImage(jjtThis); } #TemplateFragment EmbeddedExpression() )* - { setLastTokenImage(jjtThis); } #TemplateFragment + ( { jjtThis.setContent(getToken(0).getImage()); } #TemplateFragment EmbeddedExpression() )* + { jjtThis.setContent(getToken(0).getImage()); } #TemplateFragment { tokenContexts.pop(); } } @@ -2354,10 +2362,10 @@ void TextBlockTemplate() #void : { { tokenContexts.push(TokenContext.TEXT_BLOCK_TEMPLATE); } - { setLastTokenImage(jjtThis); } #TemplateFragment + { jjtThis.setContent(getToken(0).getImage()); } #TemplateFragment EmbeddedExpression() - ( { setLastTokenImage(jjtThis); } #TemplateFragment EmbeddedExpression() )* - { setLastTokenImage(jjtThis); } #TemplateFragment + ( { jjtThis.setContent(getToken(0).getImage()); } #TemplateFragment EmbeddedExpression() )* + { jjtThis.setContent(getToken(0).getImage()); } #TemplateFragment { tokenContexts.pop(); } } @@ -2771,9 +2779,7 @@ void ForStatement() #void: void EnhancedForDeclaration() #void: {} { - LOOKAHEAD(LocalVariableDeclaration()) LocalVariableDeclaration() - // TODO: a recored pattern here is only valid with Java 20 Preview and not anymore with Java 21 (see JEP 440) - | RecordPattern() + LocalVariableDeclaration() } void ForInit() : diff --git a/pmd-java/pom.xml b/pmd-java/pom.xml index 06570caf2b..0999263c4e 100644 --- a/pmd-java/pom.xml +++ b/pmd-java/pom.xml @@ -107,7 +107,7 @@ - +
diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/JavaLanguageModule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/JavaLanguageModule.java index 562b6365e6..393a5983ef 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/JavaLanguageModule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/JavaLanguageModule.java @@ -42,9 +42,10 @@ public class JavaLanguageModule extends LanguageModuleBase implements PmdCapable .addVersion("18") .addVersion("19") .addVersion("20") - .addVersion("20-preview") - .addDefaultVersion("21") // 21 is the default - .addVersion("21-preview")); + .addVersion("21") + .addVersion("21-preview") + .addDefaultVersion("22") // 22 is the default + .addVersion("22-preview")); } public static JavaLanguageModule getInstance() { diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTPattern.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTPattern.java index 214bfcac9c..eeedf1aaa8 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTPattern.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTPattern.java @@ -4,8 +4,6 @@ package net.sourceforge.pmd.lang.java.ast; -import net.sourceforge.pmd.annotation.Experimental; - /** * A pattern for pattern matching constructs like {@link ASTInfixExpression InstanceOfExpression} * or within a {@link ASTSwitchLabel}). This is a JDK 16 feature. @@ -21,18 +19,7 @@ import net.sourceforge.pmd.annotation.Experimental; * * * @see JEP 394: Pattern Matching for instanceof (Java 16) - * @see JEP 405: Record Patterns (Preview) (Java 19) - * @see JEP 432: Record Patterns (Second Preview) (Java 20) * @see JEP 440: Record Patterns (Java 21) */ public interface ASTPattern extends JavaNode { - - /** - * Returns the number of parenthesis levels around this pattern. - * If this method returns 0, then no parentheses are present. - * @deprecated Parenthesized patterns are only possible with Java 20 Preview and are removed with Java 21. - */ - @Experimental("Parenthesized patterns is a Java 20 Preview feature") - @Deprecated - int getParenthesisDepth(); } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTRecordPattern.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTRecordPattern.java index 20d4e80fce..f16730342f 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTRecordPattern.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTRecordPattern.java @@ -5,8 +5,6 @@ package net.sourceforge.pmd.lang.java.ast; -import net.sourceforge.pmd.annotation.Experimental; - /** * A record pattern, a Java 21 language feature. * @@ -17,14 +15,10 @@ import net.sourceforge.pmd.annotation.Experimental; * * * @see ASTRecordDeclaration - * @see JEP 405: Record Patterns (Preview) (Java 19) - * @see JEP 432: Record Patterns (Second Preview) (Java 20) * @see JEP 440: Record Patterns (Java 21) */ public final class ASTRecordPattern extends AbstractJavaNode implements ASTPattern { - private int parenDepth; - ASTRecordPattern(int id) { super(id); } @@ -45,14 +39,4 @@ public final class ASTRecordPattern extends AbstractJavaNode implements ASTPatte public ASTVariableId getVarId() { return firstChild(ASTVariableId.class); } - - void bumpParenDepth() { - parenDepth++; - } - - @Override - @Experimental("Parenthesized patterns is a Java 20 Preview feature") - public int getParenthesisDepth() { - return parenDepth; - } } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTemplate.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTemplate.java index d1379fbf07..13decf984d 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTemplate.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTemplate.java @@ -7,7 +7,7 @@ package net.sourceforge.pmd.lang.java.ast; import net.sourceforge.pmd.annotation.Experimental; /** - * This is a Java 21 Preview feature. + * This is a Java 21/22 Preview feature. * *
  *
@@ -15,9 +15,10 @@ import net.sourceforge.pmd.annotation.Experimental;
  *
  * 
* - * @see JEP 430: String Templates (Preview) + * @see JEP 430: String Templates (Preview) (Java 21) + * @see JEP 459: String Templates (Second Preview) (Java 22) */ -@Experimental("String templates is a Java 21 Preview feature") +@Experimental("String templates is a Java 21/22 Preview feature") public final class ASTTemplate extends AbstractJavaNode { ASTTemplate(int i) { super(i); diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTemplateExpression.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTemplateExpression.java index c612ce5ef7..ef2b512b09 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTemplateExpression.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTemplateExpression.java @@ -8,7 +8,7 @@ import net.sourceforge.pmd.annotation.Experimental; import net.sourceforge.pmd.lang.java.ast.ASTAssignableExpr.ASTNamedReferenceExpr; /** - * This is a Java 21 Preview feature. + * This is a Java 21/22 Preview feature. * *
  *
@@ -17,9 +17,10 @@ import net.sourceforge.pmd.lang.java.ast.ASTAssignableExpr.ASTNamedReferenceExpr
  *
  * 
* - * @see JEP 430: String Templates (Preview) + * @see JEP 430: String Templates (Preview) (Java 21) + * @see JEP 459: String Templates (Second Preview) (Java 22) */ -@Experimental("String templates is a Java 21 Preview feature") +@Experimental("String templates is a Java 21/22 Preview feature") public final class ASTTemplateExpression extends AbstractJavaExpr { ASTTemplateExpression(int i) { super(i); diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTemplateFragment.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTemplateFragment.java index 2ff13744b0..2ecf0cc3fc 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTemplateFragment.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTemplateFragment.java @@ -7,7 +7,7 @@ package net.sourceforge.pmd.lang.java.ast; import net.sourceforge.pmd.annotation.Experimental; /** - * This is a Java 21 Preview feature. + * This is a Java 21/22 Preview feature. * *
  *
@@ -16,10 +16,13 @@ import net.sourceforge.pmd.annotation.Experimental;
  *
  * 
* - * @see JEP 430: String Templates (Preview) + * @see JEP 430: String Templates (Preview) (Java 21) + * @see JEP 459: String Templates (Second Preview) (Java 22) */ -@Experimental("String templates is a Java 21 Preview feature") +@Experimental("String templates is a Java 21/22 Preview feature") public final class ASTTemplateFragment extends AbstractJavaNode { + private String content; + ASTTemplateFragment(int i) { super(i); } @@ -28,4 +31,13 @@ public final class ASTTemplateFragment extends AbstractJavaNode { protected R acceptVisitor(JavaVisitor visitor, P data) { return visitor.visit(this, data); } + + public String getContent() { + return content; + } + + void setContent(String content) { + this.content = content; + } + } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTypePattern.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTypePattern.java index 66fc999e03..3a99a89ea2 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTypePattern.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTypePattern.java @@ -8,8 +8,6 @@ import java.util.Objects; import org.checkerframework.checker.nullness.qual.NonNull; -import net.sourceforge.pmd.annotation.Experimental; - /** * A type pattern (JDK16). This can be found on * the right-hand side of an {@link ASTInfixExpression InstanceOfExpression}, @@ -21,12 +19,10 @@ import net.sourceforge.pmd.annotation.Experimental; * * * - * @see JEP 394: Pattern Matching for instanceof + * @see JEP 394: Pattern Matching for instanceof (Java 16) */ public final class ASTTypePattern extends AbstractJavaNode implements ASTPattern, ModifierOwner { - private int parenDepth; - ASTTypePattern(int id) { super(id); } @@ -47,14 +43,4 @@ public final class ASTTypePattern extends AbstractJavaNode implements ASTPattern public @NonNull ASTVariableId getVarId() { return Objects.requireNonNull(firstChild(ASTVariableId.class)); } - - void bumpParenDepth() { - parenDepth++; - } - - @Override - @Experimental("Parenthesized patterns is a Java 20 Preview feature") - public int getParenthesisDepth() { - return parenDepth; - } } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTUnnamedPattern.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTUnnamedPattern.java index 9b76fbb19f..52a5534764 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTUnnamedPattern.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTUnnamedPattern.java @@ -5,10 +5,8 @@ package net.sourceforge.pmd.lang.java.ast; -import net.sourceforge.pmd.annotation.Experimental; - /** - * An unnamed pattern, a Java 21 Preview language feature. + * An unnamed pattern, a Java 22 language feature. * *
  *
@@ -16,9 +14,8 @@ import net.sourceforge.pmd.annotation.Experimental;
  *
  * 
* - * @see JEP 443: Unnamed patterns and variables (Preview) (Java 21) + * @see JEP 456: Unnamed Variables & Patterns (Java 22) */ -@Experimental("Unnamed patterns is a Java 21 Preview feature") public final class ASTUnnamedPattern extends AbstractJavaNode implements ASTPattern { ASTUnnamedPattern(int id) { @@ -29,9 +26,4 @@ public final class ASTUnnamedPattern extends AbstractJavaNode implements ASTPatt protected R acceptVisitor(JavaVisitor visitor, P data) { return visitor.visit(this, data); } - - @Override - public int getParenthesisDepth() { - return 0; - } } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/AstImplUtil.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/AstImplUtil.java index 5ed897d23a..e82aa68a37 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/AstImplUtil.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/AstImplUtil.java @@ -47,20 +47,4 @@ final class AstImplUtil { ((AbstractJavaExpr) expression).bumpParenDepth(); } - - /** - * @deprecated Parenthesized patterns are only possible with Java 20 Preview and are removed with Java 21. - */ - @Deprecated - static void bumpParenDepth(ASTPattern pattern) { - assert pattern instanceof ASTTypePattern - || pattern instanceof ASTRecordPattern - : pattern.getClass() + " doesn't have parenDepth attribute!"; - - if (pattern instanceof ASTTypePattern) { - ((ASTTypePattern) pattern).bumpParenDepth(); - } else if (pattern instanceof ASTRecordPattern) { - ((ASTRecordPattern) pattern).bumpParenDepth(); - } - } } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/internal/LanguageLevelChecker.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/internal/LanguageLevelChecker.java index 2b1267f9ee..aa9ae5a538 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/internal/LanguageLevelChecker.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/internal/LanguageLevelChecker.java @@ -18,7 +18,9 @@ import net.sourceforge.pmd.lang.java.ast.ASTCastExpression; import net.sourceforge.pmd.lang.java.ast.ASTCatchClause; import net.sourceforge.pmd.lang.java.ast.ASTCompilationUnit; import net.sourceforge.pmd.lang.java.ast.ASTConstructorCall; +import net.sourceforge.pmd.lang.java.ast.ASTConstructorDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTEnumDeclaration; +import net.sourceforge.pmd.lang.java.ast.ASTExplicitConstructorInvocation; import net.sourceforge.pmd.lang.java.ast.ASTForeachStatement; import net.sourceforge.pmd.lang.java.ast.ASTFormalParameter; import net.sourceforge.pmd.lang.java.ast.ASTGuard; @@ -122,69 +124,32 @@ public class LanguageLevelChecker { * They might be also be standardized. */ private enum PreviewFeature implements LanguageFeature { - /** - * Pattern matching for switch - * @see JEP 406: Pattern Matching for switch (Preview) (Java 17) - * @see JEP 420: Pattern Matching for switch (Second Preview) (Java 18) - * @see JEP 427: Pattern Matching for switch (Third Preview) (Java 19) - * @see JEP 433: Pattern Matching for switch (Fourth Preview) (Java 20) - * @see JEP 441: Pattern Matching for switch (Java 21) - */ - PATTERNS_IN_SWITCH_STATEMENTS(17, 20, true), - - /** - * Part of pattern matching for switch - * @see #PATTERNS_IN_SWITCH_STATEMENTS - * @see JEP 406: Pattern Matching for switch (Preview) (Java 17) - * @see JEP 420: Pattern Matching for switch (Second Preview) (Java 18) - * @see JEP 427: Pattern Matching for switch (Third Preview) (Java 19) - * @see JEP 433: Pattern Matching for switch (Fourth Preview) (Java 20) - * @see JEP 441: Pattern Matching for switch (Java 21) - */ - NULL_IN_SWITCH_CASES(17, 20, true), - - /** - * Part of pattern matching for switch: Case refinement using "when" - * @see #PATTERNS_IN_SWITCH_STATEMENTS - * @see JEP 427: Pattern Matching for switch (Third Preview) (Java 19) - * @see JEP 433: Pattern Matching for switch (Fourth Preview) (Java 20) - * @see JEP 441: Pattern Matching for switch (Java 21) - */ - CASE_REFINEMENT(19, 20, true), - - /** - * Record patterns - * @see JEP 405: Record Patterns (Preview) (Java 19) - * @see JEP 432: Record Patterns (Second Preview) (Java 20) - * @see JEP 440: Record Patterns (Java 21) - */ - RECORD_PATTERNS(19, 20, true), - - /** - * Record deconstruction patterns in for-each loops. - * Note: support for this has been removed with Java 21 (JEP 440). - * @see JEP 432: Record Patterns (Second Preview) (Java 20) - * @see JEP 440: Record Patterns (Java 21) - */ - DECONSTRUCTION_PATTERNS_IN_ENHANCED_FOR_STATEMENT(20, 20, false), - /** * String Templates. * @see JEP 430: String Templates (Preview) (Java 21) + * @see JEP 459: String Templates (Second Preview) (Java 22) */ - STRING_TEMPLATES(21, 21, false), + STRING_TEMPLATES(21, 22, false), /** - * Unnamed patterns and variables. + * Unnamed variables and patterns. * @see JEP 443: Unnamed patterns and variables (Preview) (Java 21) + * @see JEP 456: Unnamed Variables & Patterns (Java 22) */ - UNNAMED_PATTERNS_AND_VARIABLES(21, 21, false), + UNNAMED_VARIABLES_AND_PATTERNS(21, 21, true), /** * Unnamed Classes and Instance Main Methods * @see JEP 445: Unnamed Classes and Instance Main Methods (Preview) (Java 21) + * @see JEP 463: Implicitly Declared Classes and Instance Main Methods (Second Preview) (Java 22) */ - UNNAMED_CLASSES(21, 21, false), + UNNAMED_CLASSES(21, 22, false), + + /** + * Statements before super + * @see JEP 447: Statements before super(...) (Preview) (Java 22) + */ + STATEMENTS_BEFORE_SUPER(22, 22, false), ; // SUPPRESS CHECKSTYLE enum trailing semi is awesome @@ -211,10 +176,10 @@ public class LanguageLevelChecker { } String message = StringUtils.capitalize(displayNameLower(name())); - if (canBePreview) { + if (wasStandardized) { + message += " was only standardized in Java " + (maxPreviewVersion + 1); + } else if (canBePreview) { message += " is a preview feature of JDK " + jdk; - } else if (wasStandardized) { - message = message + " was only standardized in Java " + (maxPreviewVersion + 1); } else if (minPreviewVersion == maxPreviewVersion) { message += " is a preview feature of JDK " + minPreviewVersion; } else { @@ -378,6 +343,44 @@ public class LanguageLevelChecker { */ SEALED_CLASSES(17), + /** + * Pattern matching for switch + * @see JEP 406: Pattern Matching for switch (Preview) (Java 17) + * @see JEP 420: Pattern Matching for switch (Second Preview) (Java 18) + * @see JEP 427: Pattern Matching for switch (Third Preview) (Java 19) + * @see JEP 433: Pattern Matching for switch (Fourth Preview) (Java 20) + * @see JEP 441: Pattern Matching for switch (Java 21) + */ + PATTERNS_IN_SWITCH_STATEMENTS(21), + + /** + * Part of pattern matching for switch + * @see #PATTERNS_IN_SWITCH_STATEMENTS + * @see JEP 406: Pattern Matching for switch (Preview) (Java 17) + * @see JEP 420: Pattern Matching for switch (Second Preview) (Java 18) + * @see JEP 427: Pattern Matching for switch (Third Preview) (Java 19) + * @see JEP 433: Pattern Matching for switch (Fourth Preview) (Java 20) + * @see JEP 441: Pattern Matching for switch (Java 21) + */ + NULL_IN_SWITCH_CASES(21), + + /** + * Part of pattern matching for switch: Case refinement using "when" + * @see #PATTERNS_IN_SWITCH_STATEMENTS + * @see JEP 427: Pattern Matching for switch (Third Preview) (Java 19) + * @see JEP 433: Pattern Matching for switch (Fourth Preview) (Java 20) + * @see JEP 441: Pattern Matching for switch (Java 21) + */ + CASE_REFINEMENT(21), + + /** + * Record patterns + * @see JEP 405: Record Patterns (Preview) (Java 19) + * @see JEP 432: Record Patterns (Second Preview) (Java 20) + * @see JEP 440: Record Patterns (Java 21) + */ + RECORD_PATTERNS(21), + ; // SUPPRESS CHECKSTYLE enum trailing semi is awesome private final int minJdkLevel; @@ -512,9 +515,6 @@ public class LanguageLevelChecker { @Override public Void visit(ASTForeachStatement node, T data) { check(node, RegularLanguageFeature.FOREACH_LOOPS, data); - if (node.getFirstChild() instanceof ASTRecordPattern) { - check(node, PreviewFeature.DECONSTRUCTION_PATTERNS_IN_ENHANCED_FOR_STATEMENT, data); - } return null; } @@ -578,13 +578,13 @@ public class LanguageLevelChecker { @Override public Void visit(ASTRecordPattern node, T data) { - check(node, PreviewFeature.RECORD_PATTERNS, data); + check(node, RegularLanguageFeature.RECORD_PATTERNS, data); return null; } @Override public Void visit(ASTGuard node, T data) { - check(node, PreviewFeature.CASE_REFINEMENT, data); + check(node, RegularLanguageFeature.CASE_REFINEMENT, data); return null; } @@ -627,13 +627,13 @@ public class LanguageLevelChecker { check(node, RegularLanguageFeature.COMPOSITE_CASE_LABEL, data); } if (node.isDefault() && JavaTokenKinds.CASE == node.getFirstToken().getKind()) { - check(node, PreviewFeature.PATTERNS_IN_SWITCH_STATEMENTS, data); + check(node, RegularLanguageFeature.PATTERNS_IN_SWITCH_STATEMENTS, data); } if (node.getFirstChild() instanceof ASTNullLiteral) { - check(node, PreviewFeature.NULL_IN_SWITCH_CASES, data); + check(node, RegularLanguageFeature.NULL_IN_SWITCH_CASES, data); } if (node.getFirstChild() instanceof ASTPattern) { - check(node, PreviewFeature.PATTERNS_IN_SWITCH_STATEMENTS, data); + check(node, RegularLanguageFeature.PATTERNS_IN_SWITCH_STATEMENTS, data); } return null; } @@ -664,7 +664,7 @@ public class LanguageLevelChecker { @Override public Void visit(ASTUnnamedPattern node, T data) { - check(node, PreviewFeature.UNNAMED_PATTERNS_AND_VARIABLES, data); + check(node, PreviewFeature.UNNAMED_VARIABLES_AND_PATTERNS, data); return null; } @@ -691,14 +691,25 @@ public class LanguageLevelChecker { return null; } + @Override + public Void visit(ASTConstructorDeclaration node, T data) { + super.visit(node, data); + if (node.getBody().descendants(ASTExplicitConstructorInvocation.class).nonEmpty()) { + if (!(node.getBody().getFirstChild() instanceof ASTExplicitConstructorInvocation)) { + check(node, PreviewFeature.STATEMENTS_BEFORE_SUPER, data); + } + } + return null; + } + private void checkIdent(JavaNode node, String simpleName, T acc) { if ("enum".equals(simpleName)) { check(node, Keywords.ENUM_AS_AN_IDENTIFIER, acc); } else if ("assert".equals(simpleName)) { check(node, Keywords.ASSERT_AS_AN_IDENTIFIER, acc); } else if ("_".equals(simpleName)) { - if (LanguageLevelChecker.this.preview) { - check(node, PreviewFeature.UNNAMED_PATTERNS_AND_VARIABLES, acc); + if (LanguageLevelChecker.this.jdkVersion >= 21) { + check(node, PreviewFeature.UNNAMED_VARIABLES_AND_PATTERNS, acc); } else { check(node, Keywords.UNDERSCORE_AS_AN_IDENTIFIER, acc); } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentRequiredRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentRequiredRule.java index 00a92e335e..8992970ec6 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentRequiredRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentRequiredRule.java @@ -9,9 +9,6 @@ import java.util.HashMap; import java.util.Locale; import java.util.Map; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import net.sourceforge.pmd.lang.java.ast.ASTBodyDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTClassDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTConstructorDeclaration; @@ -35,8 +32,6 @@ import net.sourceforge.pmd.util.CollectionUtil; * @author Brian Remedios */ public class CommentRequiredRule extends AbstractJavaRulechainRule { - private static final Logger LOG = LoggerFactory.getLogger(CommentRequiredRule.class); - // Used to pretty print a message private static final Map DESCRIPTOR_NAME_TO_COMMENT_TYPE = new HashMap<>(); @@ -46,8 +41,6 @@ public class CommentRequiredRule extends AbstractJavaRulechainRule { private static final PropertyDescriptor OVERRIDE_CMT_DESCRIPTOR = requirementPropertyBuilder("methodWithOverrideCommentRequirement", "Comments on @Override methods") .defaultValue(CommentRequirement.Ignored).build(); - private static final PropertyDescriptor HEADER_CMT_REQUIREMENT_DESCRIPTOR - = requirementPropertyBuilder("headerCommentRequirement", "Deprecated! Header comments. Please use the property \"classCommentRequired\" instead.").build(); private static final PropertyDescriptor CLASS_CMT_REQUIREMENT_DESCRIPTOR = requirementPropertyBuilder("classCommentRequirement", "Class comments").build(); private static final PropertyDescriptor FIELD_CMT_REQUIREMENT_DESCRIPTOR @@ -73,7 +66,6 @@ public class CommentRequiredRule extends AbstractJavaRulechainRule { definePropertyDescriptor(OVERRIDE_CMT_DESCRIPTOR); definePropertyDescriptor(ACCESSOR_CMT_DESCRIPTOR); definePropertyDescriptor(CLASS_CMT_REQUIREMENT_DESCRIPTOR); - definePropertyDescriptor(HEADER_CMT_REQUIREMENT_DESCRIPTOR); definePropertyDescriptor(FIELD_CMT_REQUIREMENT_DESCRIPTOR); definePropertyDescriptor(PUB_METHOD_CMT_REQUIREMENT_DESCRIPTOR); definePropertyDescriptor(PROT_METHOD_CMT_REQUIREMENT_DESCRIPTOR); @@ -94,20 +86,7 @@ public class CommentRequiredRule extends AbstractJavaRulechainRule { getProperty(SERIAL_VERSION_UID_CMT_REQUIREMENT_DESCRIPTOR)); propertyValues.put(SERIAL_PERSISTENT_FIELDS_CMT_REQUIREMENT_DESCRIPTOR, getProperty(SERIAL_PERSISTENT_FIELDS_CMT_REQUIREMENT_DESCRIPTOR)); - - CommentRequirement headerCommentRequirementValue = getProperty(HEADER_CMT_REQUIREMENT_DESCRIPTOR); - boolean headerCommentRequirementValueOverridden = headerCommentRequirementValue != CommentRequirement.Required; - CommentRequirement classCommentRequirementValue = getProperty(CLASS_CMT_REQUIREMENT_DESCRIPTOR); - boolean classCommentRequirementValueOverridden = classCommentRequirementValue != CommentRequirement.Required; - - if (headerCommentRequirementValueOverridden && !classCommentRequirementValueOverridden) { - LOG.warn("Rule CommentRequired uses deprecated property 'headerCommentRequirement'. " - + "Future versions of PMD will remove support for this property. " - + "Please use 'classCommentRequirement' instead!"); - propertyValues.put(CLASS_CMT_REQUIREMENT_DESCRIPTOR, headerCommentRequirementValue); - } else { - propertyValues.put(CLASS_CMT_REQUIREMENT_DESCRIPTOR, classCommentRequirementValue); - } + propertyValues.put(CLASS_CMT_REQUIREMENT_DESCRIPTOR, getProperty(CLASS_CMT_REQUIREMENT_DESCRIPTOR)); } private void checkCommentMeetsRequirement(Object data, JavadocCommentOwner node, @@ -203,8 +182,7 @@ public class CommentRequiredRule extends AbstractJavaRulechainRule { return getProperty(OVERRIDE_CMT_DESCRIPTOR) == CommentRequirement.Ignored && getProperty(ACCESSOR_CMT_DESCRIPTOR) == CommentRequirement.Ignored - && (getProperty(CLASS_CMT_REQUIREMENT_DESCRIPTOR) == CommentRequirement.Ignored - || getProperty(HEADER_CMT_REQUIREMENT_DESCRIPTOR) == CommentRequirement.Ignored) + && getProperty(CLASS_CMT_REQUIREMENT_DESCRIPTOR) == CommentRequirement.Ignored && getProperty(FIELD_CMT_REQUIREMENT_DESCRIPTOR) == CommentRequirement.Ignored && getProperty(PUB_METHOD_CMT_REQUIREMENT_DESCRIPTOR) == CommentRequirement.Ignored && getProperty(PROT_METHOD_CMT_REQUIREMENT_DESCRIPTOR) == CommentRequirement.Ignored diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonSerializableClassRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonSerializableClassRule.java index 136a68799c..31e5c53f2f 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonSerializableClassRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonSerializableClassRule.java @@ -5,7 +5,6 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; import static net.sourceforge.pmd.properties.PropertyFactory.booleanProperty; -import static net.sourceforge.pmd.properties.PropertyFactory.stringProperty; import java.io.Externalizable; import java.io.ObjectInputStream; @@ -45,8 +44,6 @@ import net.sourceforge.pmd.reporting.RuleContext; // Note: This rule has been formerly known as "BeanMembersShouldSerialize". public class NonSerializableClassRule extends AbstractJavaRulechainRule { - private static final PropertyDescriptor PREFIX_DESCRIPTOR = stringProperty("prefix") - .desc("deprecated! A variable prefix to skip, i.e., m_").defaultValue("").build(); private static final PropertyDescriptor CHECK_ABSTRACT_TYPES = booleanProperty("checkAbstractTypes") .desc("Enable to verify fields with abstract types like abstract classes, interfaces, generic types " + "or java.lang.Object. Enabling this might lead to more false positives, since the concrete " @@ -62,7 +59,6 @@ public class NonSerializableClassRule extends AbstractJavaRulechainRule { public NonSerializableClassRule() { super(ASTVariableId.class, ASTClassDeclaration.class, ASTEnumDeclaration.class, ASTRecordDeclaration.class); - definePropertyDescriptor(PREFIX_DESCRIPTOR); definePropertyDescriptor(CHECK_ABSTRACT_TYPES); } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/SingletonClassReturningNewInstanceRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/SingletonClassReturningNewInstanceRule.java index ddfa812087..9589b49d11 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/SingletonClassReturningNewInstanceRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/SingletonClassReturningNewInstanceRule.java @@ -6,12 +6,15 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; import net.sourceforge.pmd.lang.ast.NodeStream; import net.sourceforge.pmd.lang.ast.NodeStream.DescendantNodeStream; +import net.sourceforge.pmd.lang.java.ast.ASTAssignableExpr; +import net.sourceforge.pmd.lang.java.ast.ASTAssignmentExpression; import net.sourceforge.pmd.lang.java.ast.ASTConstructorCall; import net.sourceforge.pmd.lang.java.ast.ASTMethodDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTReturnStatement; import net.sourceforge.pmd.lang.java.ast.ASTVariableAccess; import net.sourceforge.pmd.lang.java.ast.internal.JavaAstUtils; import net.sourceforge.pmd.lang.java.rule.AbstractJavaRulechainRule; +import net.sourceforge.pmd.lang.java.symbols.JVariableSymbol; public class SingletonClassReturningNewInstanceRule extends AbstractJavaRulechainRule { @@ -37,6 +40,62 @@ public class SingletonClassReturningNewInstanceRule extends AbstractJavaRulechai } private boolean returnsLocalVariables(NodeStream returns) { - return returns.children(ASTVariableAccess.class).filter(JavaAstUtils::isReferenceToLocal).nonEmpty(); + return returns.children(ASTVariableAccess.class) + .filter(JavaAstUtils::isReferenceToLocal) + .filterNot(this::isDoubleAssignment) + .nonEmpty(); } + + private boolean isDoubleAssignment(ASTVariableAccess variableAccess) { + // search in the whole method + return variableAccess.ancestors(ASTMethodDeclaration.class) + .descendants(ASTVariableAccess.class) + // for any writes + .filter(v -> v.getAccessType() == ASTAssignableExpr.AccessType.WRITE) + // to the same variable + .filter(v -> JavaAstUtils.isReferenceToSameVar(variableAccess, v)) + // assignment from a constructor call (next sibling = right hand side) or another Assignment + .filter(v -> v.getNextSibling() instanceof ASTConstructorCall || v.getNextSibling() instanceof ASTAssignmentExpression) + // check for both variants + .filter(v -> { + boolean variant1 = false; + boolean variant2 = false; + + // check variant 1: field = localVar = new Singleton() + if (v.getNextSibling() instanceof ASTConstructorCall) { + if (v.getParent() instanceof ASTAssignmentExpression && v.getParent().getParent() instanceof ASTAssignmentExpression) { + ASTAssignmentExpression leftAssignment = (ASTAssignmentExpression) v.getParent().getParent(); + ASTAssignmentExpression rightAssignment = (ASTAssignmentExpression) v.getParent(); + + boolean fromConstructor = rightAssignment.getRightOperand() instanceof ASTConstructorCall; + boolean fromRightToLeft = leftAssignment.getRightOperand() == rightAssignment; + boolean leftIsField = false; + if (leftAssignment.getLeftOperand() instanceof ASTAssignableExpr.ASTNamedReferenceExpr) { + JVariableSymbol symbol = ((ASTAssignableExpr.ASTNamedReferenceExpr) leftAssignment.getLeftOperand()).getReferencedSym(); + leftIsField = symbol != null && symbol.isField(); + } + variant1 = fromConstructor && fromRightToLeft && leftIsField; + } + + // check variant 2: localVar = field = new Singleton() + } else if (v.getNextSibling() instanceof ASTAssignmentExpression) { + if (v.getParent() instanceof ASTAssignmentExpression) { + ASTAssignmentExpression leftAssignment = (ASTAssignmentExpression) v.getParent(); + ASTAssignmentExpression rightAssignment = (ASTAssignmentExpression) v.getNextSibling(); + + boolean fromConstructor = rightAssignment.getRightOperand() instanceof ASTConstructorCall; + boolean fromRightToLeft = leftAssignment.getRightOperand() == rightAssignment; + boolean rightIsField = false; + if (rightAssignment.getLeftOperand() instanceof ASTAssignableExpr.ASTNamedReferenceExpr) { + JVariableSymbol symbol = ((ASTAssignableExpr.ASTNamedReferenceExpr) rightAssignment.getLeftOperand()).getReferencedSym(); + rightIsField = symbol != null && symbol.isField(); + } + variant2 = fromConstructor && fromRightToLeft && rightIsField; + } + } + return variant1 || variant2; + }) + .nonEmpty(); + } + } diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/BaseJavaTreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/BaseJavaTreeDumpTest.java index 0484a8f315..eeb5bba886 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/BaseJavaTreeDumpTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/BaseJavaTreeDumpTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java; -import net.sourceforge.pmd.lang.ast.test.BaseTreeDumpTest; +import net.sourceforge.pmd.lang.test.ast.BaseTreeDumpTest; /** * Special tweak of BaseTreeDumpTest to remove deprecated attributes diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/ExcludeLinesTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ExcludeLinesTest.java similarity index 90% rename from pmd-java/src/test/java/net/sourceforge/pmd/ExcludeLinesTest.java rename to pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ExcludeLinesTest.java index e334d16371..f8be02dc22 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/ExcludeLinesTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ExcludeLinesTest.java @@ -2,14 +2,13 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd; +package net.sourceforge.pmd.lang.java; -import static net.sourceforge.pmd.lang.ast.test.TestUtilsKt.assertSize; -import static net.sourceforge.pmd.lang.ast.test.TestUtilsKt.assertSuppressed; +import static net.sourceforge.pmd.lang.test.ast.TestUtilsKt.assertSize; +import static net.sourceforge.pmd.lang.test.ast.TestUtilsKt.assertSuppressed; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.lang.java.BaseParserTest; import net.sourceforge.pmd.lang.java.ast.ASTVariableId; import net.sourceforge.pmd.lang.java.rule.AbstractJavaRule; import net.sourceforge.pmd.lang.rule.Rule; diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/FooRule.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/FooRule.java similarity index 96% rename from pmd-java/src/test/java/net/sourceforge/pmd/FooRule.java rename to pmd-java/src/test/java/net/sourceforge/pmd/lang/java/FooRule.java index 8c16cc9e74..7875410bdd 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/FooRule.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/FooRule.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd; +package net.sourceforge.pmd.lang.java; import net.sourceforge.pmd.lang.java.ast.ASTClassDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTVariableId; diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/JavaAttributesPrinter.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/JavaAttributesPrinter.java index 4e598a9cef..fee672333d 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/JavaAttributesPrinter.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/JavaAttributesPrinter.java @@ -11,7 +11,7 @@ import java.util.stream.Collectors; import org.checkerframework.checker.nullness.qual.NonNull; import net.sourceforge.pmd.lang.ast.Node; -import net.sourceforge.pmd.lang.ast.test.RelevantAttributePrinter; +import net.sourceforge.pmd.lang.test.ast.RelevantAttributePrinter; import net.sourceforge.pmd.lang.java.ast.ASTExpression; import net.sourceforge.pmd.lang.java.ast.ASTMethodDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTModifierList; diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/JavaLanguageModuleTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/JavaLanguageModuleTest.java index 4655032327..cdf292b34f 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/JavaLanguageModuleTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/JavaLanguageModuleTest.java @@ -24,10 +24,10 @@ class JavaLanguageModuleTest { @Test void previewVersionShouldBeGreaterThanNonPreview() { - LanguageVersion java20 = JavaLanguageModule.getInstance().getVersion("20"); - LanguageVersion java20p = JavaLanguageModule.getInstance().getVersion("20-preview"); + LanguageVersion java = JavaLanguageModule.getInstance().getVersion("22"); + LanguageVersion javaPreview = JavaLanguageModule.getInstance().getVersion("22-preview"); - assertTrue(java20p.compareTo(java20) > 0, "java20-preview should be greater than java20"); + assertTrue(javaPreview.compareTo(java) > 0, "java-preview should be greater than java"); } @Test diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/JavaParsingHelper.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/JavaParsingHelper.java index 0fd2359166..c5bcd3332e 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/JavaParsingHelper.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/JavaParsingHelper.java @@ -24,7 +24,7 @@ import net.sourceforge.pmd.lang.LanguageProcessor; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.ast.SemanticErrorReporter; import net.sourceforge.pmd.lang.ast.SemanticException; -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; import net.sourceforge.pmd.lang.java.ast.ASTCompilationUnit; import net.sourceforge.pmd.lang.java.ast.JavaParser; import net.sourceforge.pmd.lang.java.internal.JavaAstProcessor; diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/LanguageVersionDiscovererTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/LanguageVersionDiscovererTest.java similarity index 96% rename from pmd-java/src/test/java/net/sourceforge/pmd/LanguageVersionDiscovererTest.java rename to pmd-java/src/test/java/net/sourceforge/pmd/lang/java/LanguageVersionDiscovererTest.java index 4b190e8689..77ff85c6c7 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/LanguageVersionDiscovererTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/LanguageVersionDiscovererTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd; +package net.sourceforge.pmd.lang.java; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -11,11 +11,11 @@ import java.io.File; import org.junit.jupiter.api.Test; +import net.sourceforge.pmd.PMDConfiguration; import net.sourceforge.pmd.lang.Language; import net.sourceforge.pmd.lang.LanguageRegistry; import net.sourceforge.pmd.lang.LanguageVersion; import net.sourceforge.pmd.lang.LanguageVersionDiscoverer; -import net.sourceforge.pmd.lang.java.JavaLanguageModule; class LanguageVersionDiscovererTest { diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/LanguageVersionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/LanguageVersionTest.java index 47f1619085..59d784aeec 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/LanguageVersionTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/LanguageVersionTest.java @@ -4,13 +4,13 @@ package net.sourceforge.pmd.lang.java; -import static net.sourceforge.pmd.AbstractLanguageVersionTest.TestDescriptor.defaultVersionIs; -import static net.sourceforge.pmd.AbstractLanguageVersionTest.TestDescriptor.versionDoesNotExist; +import static net.sourceforge.pmd.test.AbstractLanguageVersionTest.TestDescriptor.defaultVersionIs; +import static net.sourceforge.pmd.test.AbstractLanguageVersionTest.TestDescriptor.versionDoesNotExist; import java.util.Arrays; import java.util.Collection; -import net.sourceforge.pmd.AbstractLanguageVersionTest; +import net.sourceforge.pmd.test.AbstractLanguageVersionTest; import net.sourceforge.pmd.lang.Language; class LanguageVersionTest extends AbstractLanguageVersionTest { @@ -37,16 +37,17 @@ class LanguageVersionTest extends AbstractLanguageVersionTest { new TestDescriptor(java, "18"), new TestDescriptor(java, "19"), new TestDescriptor(java, "20"), - new TestDescriptor(java, "20-preview"), new TestDescriptor(java, "21"), new TestDescriptor(java, "21-preview"), + new TestDescriptor(java, "22"), + new TestDescriptor(java, "22-preview"), - defaultVersionIs(java, "21"), + defaultVersionIs(java, "22"), // this one won't be found: case-sensitive! versionDoesNotExist("JAVA", "JAVA", "1.7"), // not supported anymore - versionDoesNotExist(java, "19-preview") + versionDoesNotExist(java, "20-preview") ); } } diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/coverage/PMDCoverageTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/PMDCoverageTest.java similarity index 97% rename from pmd-java/src/test/java/net/sourceforge/pmd/coverage/PMDCoverageTest.java rename to pmd-java/src/test/java/net/sourceforge/pmd/lang/java/PMDCoverageTest.java index ff9265a678..5202134e26 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/coverage/PMDCoverageTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/PMDCoverageTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.coverage; +package net.sourceforge.pmd.lang.java; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; @@ -25,7 +25,6 @@ import net.sourceforge.pmd.PMDConfiguration; import net.sourceforge.pmd.PmdAnalysis; import net.sourceforge.pmd.internal.util.IOUtil; import net.sourceforge.pmd.lang.LanguageVersion; -import net.sourceforge.pmd.lang.java.JavaLanguageModule; import com.github.stefanbirkner.systemlambda.SystemLambda; diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/ant/PMDTaskTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/PMDTaskTest.java similarity index 95% rename from pmd-java/src/test/java/net/sourceforge/pmd/ant/PMDTaskTest.java rename to pmd-java/src/test/java/net/sourceforge/pmd/lang/java/PMDTaskTest.java index b4d8e5a12c..268b850b11 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/ant/PMDTaskTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/PMDTaskTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.ant; +package net.sourceforge.pmd.lang.java; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -14,10 +14,12 @@ import java.util.Locale; import org.junit.jupiter.api.Test; import net.sourceforge.pmd.internal.util.IOUtil; +import net.sourceforge.pmd.test.AbstractAntTestHelper; class PMDTaskTest extends AbstractAntTestHelper { PMDTaskTest() { + pathToTestScript = "target/test-classes/net/sourceforge/pmd/lang/java/ant/xml"; antTestScriptFilename = "pmdtasktest.xml"; } diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/QuickstartRulesetTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/QuickstartRulesetTest.java index 6f3d7e4f37..5fa5b76c2a 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/QuickstartRulesetTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/QuickstartRulesetTest.java @@ -9,7 +9,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.lang.rule.AbstractRuleSetFactoryTest; +import net.sourceforge.pmd.test.lang.rule.AbstractRuleSetFactoryTest; import net.sourceforge.pmd.lang.rule.RuleSet; import net.sourceforge.pmd.lang.rule.RuleSetLoader; diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/ReportTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ReportTest.java similarity index 91% rename from pmd-java/src/test/java/net/sourceforge/pmd/ReportTest.java rename to pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ReportTest.java index f9bb61fdca..2e6befc748 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/ReportTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ReportTest.java @@ -2,10 +2,10 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd; +package net.sourceforge.pmd.lang.java; -import static net.sourceforge.pmd.lang.ast.test.TestUtilsKt.assertSize; -import static net.sourceforge.pmd.lang.ast.test.TestUtilsKt.assertSuppressed; +import static net.sourceforge.pmd.lang.test.ast.TestUtilsKt.assertSize; +import static net.sourceforge.pmd.lang.test.ast.TestUtilsKt.assertSuppressed; import static org.junit.jupiter.api.Assertions.assertFalse; import java.util.Optional; @@ -13,7 +13,6 @@ import java.util.regex.Pattern; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.lang.java.JavaParsingHelper; import net.sourceforge.pmd.lang.rule.Rule; import net.sourceforge.pmd.reporting.Report; diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/RuleSetFactoryTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/RuleSetFactoryTest.java index eac601291e..7276d213b0 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/RuleSetFactoryTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/RuleSetFactoryTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java; -import net.sourceforge.pmd.lang.rule.AbstractRuleSetFactoryTest; +import net.sourceforge.pmd.test.lang.rule.AbstractRuleSetFactoryTest; /** * Test java's rulesets diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/SuppressWarningsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/SuppressWarningsTest.java index 3c71089661..40a023f965 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/SuppressWarningsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/SuppressWarningsTest.java @@ -4,12 +4,11 @@ package net.sourceforge.pmd.lang.java; -import static net.sourceforge.pmd.lang.ast.test.TestUtilsKt.assertSize; +import static net.sourceforge.pmd.lang.test.ast.TestUtilsKt.assertSize; import org.checkerframework.checker.nullness.qual.NonNull; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.FooRule; import net.sourceforge.pmd.lang.java.ast.ASTClassDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTCompilationUnit; import net.sourceforge.pmd.lang.java.rule.AbstractJavaRule; diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/AllJavaAstTreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/AllJavaAstTreeDumpTest.java index 850d2d5f90..cd1e20ef28 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/AllJavaAstTreeDumpTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/AllJavaAstTreeDumpTest.java @@ -15,9 +15,10 @@ import org.junit.platform.suite.api.Suite; Java15TreeDumpTest.class, Java16TreeDumpTest.class, Java17TreeDumpTest.class, - Java20PreviewTreeDumpTest.class, Java21TreeDumpTest.class, - Java21PreviewTreeDumpTest.class + Java21PreviewTreeDumpTest.class, + Java22TreeDumpTest.class, + Java22PreviewTreeDumpTest.class }) class AllJavaAstTreeDumpTest { diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/JDKVersionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/JDKVersionTest.java index 45cb62715a..44516d5d53 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/JDKVersionTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/JDKVersionTest.java @@ -16,7 +16,7 @@ import org.checkerframework.checker.nullness.qual.NonNull; import org.junit.jupiter.api.Test; import net.sourceforge.pmd.lang.ast.ParseException; -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; import net.sourceforge.pmd.lang.java.BaseJavaTreeDumpTest; import net.sourceforge.pmd.lang.java.JavaParsingHelper; diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java14TreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java14TreeDumpTest.java index 5100aaba9f..0e75ba10c1 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java14TreeDumpTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java14TreeDumpTest.java @@ -11,7 +11,7 @@ import org.checkerframework.checker.nullness.qual.NonNull; import org.junit.jupiter.api.Test; import net.sourceforge.pmd.lang.ast.ParseException; -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; import net.sourceforge.pmd.lang.java.BaseJavaTreeDumpTest; import net.sourceforge.pmd.lang.java.JavaParsingHelper; diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java15TreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java15TreeDumpTest.java index 9b65df591e..c8ed83bde6 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java15TreeDumpTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java15TreeDumpTest.java @@ -9,7 +9,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import org.junit.jupiter.api.Test; import net.sourceforge.pmd.lang.ast.ParseException; -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; import net.sourceforge.pmd.lang.java.BaseJavaTreeDumpTest; import net.sourceforge.pmd.lang.java.JavaParsingHelper; diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java16TreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java16TreeDumpTest.java index bd830313eb..16324eef76 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java16TreeDumpTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java16TreeDumpTest.java @@ -18,7 +18,7 @@ import org.junit.jupiter.api.Test; import net.sourceforge.pmd.lang.ast.NodeStream; import net.sourceforge.pmd.lang.ast.ParseException; -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; import net.sourceforge.pmd.lang.java.BaseJavaTreeDumpTest; import net.sourceforge.pmd.lang.java.JavaParsingHelper; import net.sourceforge.pmd.lang.java.symbols.JElementSymbol; diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java17TreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java17TreeDumpTest.java index 64b7a127d7..e27c306f8e 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java17TreeDumpTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java17TreeDumpTest.java @@ -10,7 +10,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import org.junit.jupiter.api.Test; import net.sourceforge.pmd.lang.ast.ParseException; -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; import net.sourceforge.pmd.lang.java.BaseJavaTreeDumpTest; import net.sourceforge.pmd.lang.java.JavaParsingHelper; diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java20PreviewTreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java20PreviewTreeDumpTest.java deleted file mode 100644 index fec894662d..0000000000 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java20PreviewTreeDumpTest.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -package net.sourceforge.pmd.lang.java.ast; - -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.junit.jupiter.api.Assertions.assertTrue; - -import org.junit.jupiter.api.Test; - -import net.sourceforge.pmd.lang.ast.ParseException; -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; -import net.sourceforge.pmd.lang.java.BaseJavaTreeDumpTest; -import net.sourceforge.pmd.lang.java.JavaParsingHelper; - -class Java20PreviewTreeDumpTest extends BaseJavaTreeDumpTest { - private final JavaParsingHelper java20p = - JavaParsingHelper.DEFAULT.withDefaultVersion("20-preview") - .withResourceContext(Java20PreviewTreeDumpTest.class, "jdkversiontests/java20p/"); - private final JavaParsingHelper java20 = java20p.withDefaultVersion("20"); - - @Override - public BaseParsingHelper getParser() { - return java20p; - } - - @Test - void dealingWithNullBeforeJava20Preview() { - ParseException thrown = assertThrows(ParseException.class, () -> java20.parseResource("DealingWithNull.java")); - assertTrue(thrown.getMessage().contains("Null in switch cases is a preview feature of JDK 20, you should select your language version accordingly"), - "Unexpected message: " + thrown.getMessage()); - } - - @Test - void dealingWithNull() { - doTest("DealingWithNull"); - } - - @Test - void enhancedTypeCheckingSwitch() { - doTest("EnhancedTypeCheckingSwitch"); - } - - @Test - void exhaustiveSwitch() { - doTest("ExhaustiveSwitch"); - } - - @Test - void guardedAndParenthesizedPatternsBeforeJava20Preview() { - ParseException thrown = assertThrows(ParseException.class, () -> java20.parseResource("GuardedAndParenthesizedPatterns.java")); - assertTrue(thrown.getMessage().contains("Patterns in switch statements is a preview feature of JDK 20, you should select your language version accordingly"), - "Unexpected message: " + thrown.getMessage()); - } - - @Test - void guardedAndParenthesizedPatterns() { - doTest("GuardedAndParenthesizedPatterns"); - } - - @Test - void patternsInSwitchLabelsBeforeJava20Preview() { - ParseException thrown = assertThrows(ParseException.class, () -> java20.parseResource("PatternsInSwitchLabels.java")); - assertTrue(thrown.getMessage().contains("Patterns in switch statements is a preview feature of JDK 20, you should select your language version accordingly"), - "Unexpected message: " + thrown.getMessage()); - } - - @Test - void patternsInSwitchLabels() { - doTest("PatternsInSwitchLabels"); - } - - @Test - void refiningPatternsInSwitch() { - doTest("RefiningPatternsInSwitch"); - } - - @Test - void scopeOfPatternVariableDeclarations() { - doTest("ScopeOfPatternVariableDeclarations"); - } - - @Test - void recordPatterns() { - doTest("RecordPatterns"); - } - - @Test - void recordPatternsBeforeJava20Preview() { - ParseException thrown = assertThrows(ParseException.class, () -> java20.parseResource("RecordPatterns.java")); - assertTrue(thrown.getMessage().contains("Record patterns is a preview feature of JDK 20, you should select your language version accordingly"), - "Unexpected message: " + thrown.getMessage()); - } - - @Test - void recordPatternsInEnhancedFor() { - doTest("RecordPatternsInEnhancedFor"); - } - - @Test - void recordPatternsInEnhancedForBeforeJava20Preview() { - ParseException thrown = assertThrows(ParseException.class, () -> java20.parseResource("RecordPatternsInEnhancedFor.java")); - assertTrue(thrown.getMessage().contains("Deconstruction patterns in enhanced for statement is a preview feature of JDK 20, you should select your language version accordingly"), - "Unexpected message: " + thrown.getMessage()); - } - - @Test - void recordPatternsExhaustiveSwitch() { - doTest("RecordPatternsExhaustiveSwitch"); - } -} diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java21PreviewTreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java21PreviewTreeDumpTest.java index 26c055469d..33919d1984 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java21PreviewTreeDumpTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java21PreviewTreeDumpTest.java @@ -15,11 +15,11 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import org.junit.jupiter.api.Test; import net.sourceforge.pmd.lang.ast.ParseException; -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; import net.sourceforge.pmd.lang.java.BaseJavaTreeDumpTest; import net.sourceforge.pmd.lang.java.JavaParsingHelper; import net.sourceforge.pmd.lang.java.symbols.JClassSymbol; import net.sourceforge.pmd.lang.java.types.JTypeMirror; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; class Java21PreviewTreeDumpTest extends BaseJavaTreeDumpTest { private final JavaParsingHelper java21p = @@ -59,10 +59,7 @@ class Java21PreviewTreeDumpTest extends BaseJavaTreeDumpTest { @Test void unnamedPatternsAndVariablesBeforeJava21Preview() { ParseException thrown = assertThrows(ParseException.class, () -> java21.parseResource("Jep443_UnnamedPatternsAndVariables.java")); - assertThat(thrown.getMessage(), containsString("Since Java 9, '_' is reserved and cannot be used as an identifier")); - - thrown = assertThrows(ParseException.class, () -> java21.parseResource("Jep443_UnnamedPatternsAndVariables2.java")); - assertThat(thrown.getMessage(), containsString("Unnamed patterns and variables is a preview feature of JDK 21, you should select your language version accordingly")); + assertThat(thrown.getMessage(), containsString("Unnamed variables and patterns was only standardized in Java 22, you should select your language version accordingly")); } @Test diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java21TreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java21TreeDumpTest.java index 6ffde7d974..2dc7a4e1db 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java21TreeDumpTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java21TreeDumpTest.java @@ -11,9 +11,9 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import org.junit.jupiter.api.Test; import net.sourceforge.pmd.lang.ast.ParseException; -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; import net.sourceforge.pmd.lang.java.BaseJavaTreeDumpTest; import net.sourceforge.pmd.lang.java.JavaParsingHelper; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; class Java21TreeDumpTest extends BaseJavaTreeDumpTest { private final JavaParsingHelper java21 = @@ -34,7 +34,7 @@ class Java21TreeDumpTest extends BaseJavaTreeDumpTest { @Test void patternMatchingForSwitchBeforeJava21() { ParseException thrown = assertThrows(ParseException.class, () -> java20.parseResource("Jep441_PatternMatchingForSwitch.java")); - assertThat(thrown.getMessage(), containsString("Patterns in switch statements is a preview feature of JDK 20, you should select your language version accordingly")); + assertThat(thrown.getMessage(), containsString("Patterns in switch statements are a feature of Java 21, you should select your language version accordingly")); } @Test @@ -45,7 +45,7 @@ class Java21TreeDumpTest extends BaseJavaTreeDumpTest { @Test void dealingWithNullBeforeJava21() { ParseException thrown = assertThrows(ParseException.class, () -> java20.parseResource("DealingWithNull.java")); - assertThat(thrown.getMessage(), containsString("Null in switch cases is a preview feature of JDK 20, you should select your language version accordingly")); + assertThat(thrown.getMessage(), containsString("Null in switch cases are a feature of Java 21, you should select your language version accordingly")); } @@ -67,7 +67,7 @@ class Java21TreeDumpTest extends BaseJavaTreeDumpTest { @Test void guardedPatternsBeforeJava21() { ParseException thrown = assertThrows(ParseException.class, () -> java20.parseResource("GuardedPatterns.java")); - assertThat(thrown.getMessage(), containsString("Patterns in switch statements is a preview feature of JDK 20, you should select your language version accordingly")); + assertThat(thrown.getMessage(), containsString("Patterns in switch statements are a feature of Java 21, you should select your language version accordingly")); } @Test @@ -78,7 +78,7 @@ class Java21TreeDumpTest extends BaseJavaTreeDumpTest { @Test void patternsInSwitchLabelsBeforeJava21() { ParseException thrown = assertThrows(ParseException.class, () -> java20.parseResource("PatternsInSwitchLabels.java")); - assertThat(thrown.getMessage(), containsString("Patterns in switch statements is a preview feature of JDK 20, you should select your language version accordingly")); + assertThat(thrown.getMessage(), containsString("Patterns in switch statements are a feature of Java 21, you should select your language version accordingly")); } @Test @@ -99,7 +99,7 @@ class Java21TreeDumpTest extends BaseJavaTreeDumpTest { @Test void recordPatternsJepBeforeJava21() { ParseException thrown = assertThrows(ParseException.class, () -> java20.parseResource("Jep440_RecordPatterns.java")); - assertThat(thrown.getMessage(), containsString("Record patterns is a preview feature of JDK 20, you should select your language version accordingly")); + assertThat(thrown.getMessage(), containsString("Record patterns are a feature of Java 21, you should select your language version accordingly")); } @Test @@ -110,7 +110,7 @@ class Java21TreeDumpTest extends BaseJavaTreeDumpTest { @Test void recordPatternsBeforeJava21() { ParseException thrown = assertThrows(ParseException.class, () -> java20.parseResource("RecordPatterns.java")); - assertThat(thrown.getMessage(), containsString("Record patterns is a preview feature of JDK 20, you should select your language version accordingly")); + assertThat(thrown.getMessage(), containsString("Record patterns are a feature of Java 21, you should select your language version accordingly")); } @Test diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java22PreviewTreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java22PreviewTreeDumpTest.java new file mode 100644 index 0000000000..5f46fd79fa --- /dev/null +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java22PreviewTreeDumpTest.java @@ -0,0 +1,106 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +package net.sourceforge.pmd.lang.java.ast; + +import static org.hamcrest.CoreMatchers.containsString; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.junit.jupiter.api.Test; + +import net.sourceforge.pmd.lang.ast.ParseException; +import net.sourceforge.pmd.lang.java.BaseJavaTreeDumpTest; +import net.sourceforge.pmd.lang.java.JavaParsingHelper; +import net.sourceforge.pmd.lang.java.symbols.JClassSymbol; +import net.sourceforge.pmd.lang.java.types.JTypeMirror; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; + +class Java22PreviewTreeDumpTest extends BaseJavaTreeDumpTest { + private final JavaParsingHelper java22p = + JavaParsingHelper.DEFAULT.withDefaultVersion("22-preview") + .withResourceContext(Java22PreviewTreeDumpTest.class, "jdkversiontests/java22p/"); + private final JavaParsingHelper java22 = java22p.withDefaultVersion("22"); + + @Override + public BaseParsingHelper getParser() { + return java22p; + } + + @Test + void jep459TemplateProcessors() { + doTest("Jep459_StringTemplates"); + } + + @Test + void jep459TemplateProcessorsBeforeJava22Preview() { + ParseException thrown = assertThrows(ParseException.class, () -> java22.parseResource("Jep459_StringTemplates.java")); + assertThat(thrown.getMessage(), containsString("String templates is a preview feature of JDK 22, you should select your language version accordingly")); + } + + @Test + void jep459TemplateExpressionType() { + ASTCompilationUnit unit = java22p.parse("class Foo {{ int i = 1; String s = STR.\"i = \\{i}\"; }}"); + ASTTemplateExpression templateExpression = unit.descendants(ASTTemplateExpression.class).first(); + JTypeMirror typeMirror = templateExpression.getTypeMirror(); + assertEquals("java.lang.String", ((JClassSymbol) typeMirror.getSymbol()).getCanonicalName()); + } + + @Test + void jep463UnnamedClasses1() { + doTest("Jep463_UnnamedClasses1"); + ASTCompilationUnit compilationUnit = java22p.parseResource("Jep463_UnnamedClasses1.java"); + assertTrue(compilationUnit.isUnnamedClass()); + ASTMethodCall methodCall = compilationUnit.descendants(ASTMethodCall.class).first(); + assertNotNull(methodCall.getTypeMirror()); + } + + @Test + void jep463UnnamedClasses2() { + doTest("Jep463_UnnamedClasses2"); + } + + @Test + void jep463UnnamedClasses3() { + doTest("Jep463_UnnamedClasses3"); + } + + @Test + void jep463UnnamedClasses4WithImports() { + doTest("Jep463_UnnamedClasses4WithImports"); + } + + @Test + void jep463UnnamedClassesBeforeJava22Preview() { + ParseException thrown = assertThrows(ParseException.class, () -> java22.parseResource("Jep463_UnnamedClasses1.java")); + assertThat(thrown.getMessage(), containsString("Unnamed classes is a preview feature of JDK 22, you should select your language version accordingly")); + } + + @Test + void jep463TestOrdinaryCompilationUnit() { + ASTCompilationUnit compilationUnit = java22.parse("public class Foo { public static void main(String[] args) {}}"); + assertFalse(compilationUnit.isUnnamedClass()); + } + + @Test + void jep463TestModularCompilationUnit() { + ASTCompilationUnit compilationUnit = java22.parse("module foo {}"); + assertFalse(compilationUnit.isUnnamedClass()); + } + + @Test + void jep447StatementsBeforeSuper() { + doTest("Jep447_StatementsBeforeSuper"); + } + + @Test + void jep447StatementsBeforeSuperBeforeJava22Preview() { + ParseException thrown = assertThrows(ParseException.class, () -> java22.parseResource("Jep447_StatementsBeforeSuper.java")); + assertThat(thrown.getMessage(), containsString("Statements before super is a preview feature of JDK 22, you should select your language version accordingly")); + } +} diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java22TreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java22TreeDumpTest.java new file mode 100644 index 0000000000..acd9a99137 --- /dev/null +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java22TreeDumpTest.java @@ -0,0 +1,46 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +package net.sourceforge.pmd.lang.java.ast; + +import static org.hamcrest.CoreMatchers.containsString; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import org.junit.jupiter.api.Test; + +import net.sourceforge.pmd.lang.ast.ParseException; +import net.sourceforge.pmd.lang.java.BaseJavaTreeDumpTest; +import net.sourceforge.pmd.lang.java.JavaParsingHelper; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; + +class Java22TreeDumpTest extends BaseJavaTreeDumpTest { + private final JavaParsingHelper java22 = + JavaParsingHelper.DEFAULT.withDefaultVersion("22") + .withResourceContext(Java21TreeDumpTest.class, "jdkversiontests/java22/"); + private final JavaParsingHelper java21 = java22.withDefaultVersion("21"); + private final JavaParsingHelper java17 = java22.withDefaultVersion("17"); + + @Override + public BaseParsingHelper getParser() { + return java22; + } + + @Test + void jep456UnnamedPatternsAndVariables() { + doTest("Jep456_UnnamedPatternsAndVariables"); + } + + @Test + void jep456UnnamedPatternsAndVariablesBeforeJava22() { + ParseException thrown = assertThrows(ParseException.class, () -> java21.parseResource("Jep456_UnnamedPatternsAndVariables.java")); + assertThat(thrown.getMessage(), containsString("Unnamed variables and patterns was only standardized in Java 22, you should select your language version accordingly")); + } + + @Test + void jep456UnnamedVariablesAndPatternsUnderscoreBeforeJava21() { + ParseException thrown = assertThrows(ParseException.class, () -> java17.parse("class Test { { for(Integer _ : java.util.Arrays.asList(1, 2, 3)) {} } }")); + assertThat(thrown.getMessage(), containsString("Since Java 9, '_' is reserved and cannot be used as an identifier")); + } +} diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java9TreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java9TreeDumpTest.java index b8c8522d76..b29dab3f0a 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java9TreeDumpTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java9TreeDumpTest.java @@ -7,7 +7,7 @@ package net.sourceforge.pmd.lang.java.ast; import org.checkerframework.checker.nullness.qual.NonNull; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; import net.sourceforge.pmd.lang.java.BaseJavaTreeDumpTest; import net.sourceforge.pmd.lang.java.JavaParsingHelper; diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/ParserCornersTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/ParserCornersTest.java index 8ebb9fde3c..69f4fd13b7 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/ParserCornersTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/ParserCornersTest.java @@ -20,7 +20,7 @@ import org.junit.jupiter.api.Timeout; import net.sourceforge.pmd.lang.ast.ParseException; import net.sourceforge.pmd.lang.ast.impl.javacc.MalformedSourceException; -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; import net.sourceforge.pmd.lang.document.FileId; import net.sourceforge.pmd.lang.java.BaseJavaTreeDumpTest; import net.sourceforge.pmd.lang.java.JavaParsingHelper; diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/cpd/JavaCpdLexerTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/cpd/JavaCpdLexerTest.java index 2e287f4efe..935b7c6b3c 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/cpd/JavaCpdLexerTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/cpd/JavaCpdLexerTest.java @@ -12,8 +12,8 @@ import org.junit.jupiter.api.Test; import net.sourceforge.pmd.cpd.CpdLanguageProperties; import net.sourceforge.pmd.cpd.CpdLexer; -import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest; -import net.sourceforge.pmd.cpd.test.LanguagePropertyConfig; +import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest; +import net.sourceforge.pmd.lang.test.cpd.LanguagePropertyConfig; import net.sourceforge.pmd.lang.ast.LexException; import net.sourceforge.pmd.lang.document.FileId; import net.sourceforge.pmd.lang.document.TextDocument; diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/metrics/impl/AllMetricsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/metrics/impl/AllMetricsTest.java index bedece59e4..b227d27b90 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/metrics/impl/AllMetricsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/metrics/impl/AllMetricsTest.java @@ -8,7 +8,7 @@ import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.java.ast.ASTExecutableDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTTypeDeclaration; import net.sourceforge.pmd.lang.java.ast.internal.PrettyPrintingUtil; -import net.sourceforge.pmd.testframework.SimpleAggregatorTst; +import net.sourceforge.pmd.test.SimpleAggregatorTst; /** * Executes the metrics testing rules. diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/metrics/impl/JavaDoubleMetricTestRule.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/metrics/impl/JavaDoubleMetricTestRule.java index f03e625677..bc5ac8e1e7 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/metrics/impl/JavaDoubleMetricTestRule.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/metrics/impl/JavaDoubleMetricTestRule.java @@ -10,7 +10,7 @@ import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.java.ast.ASTExecutableDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTTypeDeclaration; import net.sourceforge.pmd.lang.metrics.Metric; -import net.sourceforge.pmd.test.AbstractMetricTestRule; +import net.sourceforge.pmd.lang.test.AbstractMetricTestRule; /** * diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/metrics/impl/JavaIntMetricTestRule.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/metrics/impl/JavaIntMetricTestRule.java index e4d2348417..f566c58340 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/metrics/impl/JavaIntMetricTestRule.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/metrics/impl/JavaIntMetricTestRule.java @@ -8,7 +8,7 @@ import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.java.ast.ASTExecutableDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTTypeDeclaration; import net.sourceforge.pmd.lang.metrics.Metric; -import net.sourceforge.pmd.test.AbstractMetricTestRule; +import net.sourceforge.pmd.lang.test.AbstractMetricTestRule; /** * diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/metrics/impl/NPathTestRule.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/metrics/impl/NPathTestRule.java index 80850a2795..73dc04513f 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/metrics/impl/NPathTestRule.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/metrics/impl/NPathTestRule.java @@ -8,7 +8,7 @@ import java.math.BigInteger; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.java.metrics.JavaMetrics; -import net.sourceforge.pmd.test.AbstractMetricTestRule; +import net.sourceforge.pmd.lang.test.AbstractMetricTestRule; /** * @author Clément Fournier diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AbstractClassWithoutAbstractMethodTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AbstractClassWithoutAbstractMethodTest.java index b319c5e9f1..f1d3e1eb28 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AbstractClassWithoutAbstractMethodTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AbstractClassWithoutAbstractMethodTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AbstractClassWithoutAbstractMethodTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AccessorClassGenerationTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AccessorClassGenerationTest.java index 1c922fd22e..b4818807f8 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AccessorClassGenerationTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AccessorClassGenerationTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AccessorClassGenerationTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AccessorMethodGenerationTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AccessorMethodGenerationTest.java index 7ef92f4c8e..a4bff3af89 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AccessorMethodGenerationTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AccessorMethodGenerationTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AccessorMethodGenerationTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ArrayIsStoredDirectlyTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ArrayIsStoredDirectlyTest.java index 0fba328ac6..9df0a31644 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ArrayIsStoredDirectlyTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ArrayIsStoredDirectlyTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ArrayIsStoredDirectlyTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidMessageDigestFieldTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidMessageDigestFieldTest.java index df4543674d..1403fe41f3 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidMessageDigestFieldTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidMessageDigestFieldTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidMessageDigestFieldTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidPrintStackTraceTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidPrintStackTraceTest.java index 436d56f150..c3c2d9a56e 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidPrintStackTraceTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidPrintStackTraceTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidPrintStackTraceTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidReassigningCatchVariablesTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidReassigningCatchVariablesTest.java index 25ab862bfe..67fd392bde 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidReassigningCatchVariablesTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidReassigningCatchVariablesTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidReassigningCatchVariablesTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidReassigningLoopVariablesTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidReassigningLoopVariablesTest.java index a15f9742fb..b7deb6616c 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidReassigningLoopVariablesTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidReassigningLoopVariablesTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidReassigningLoopVariablesTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidReassigningParametersTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidReassigningParametersTest.java index 68ab080b7d..aa1eecf167 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidReassigningParametersTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidReassigningParametersTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidReassigningParametersTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidStringBufferFieldTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidStringBufferFieldTest.java index 1b1e7898cf..7f1b4a2e16 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidStringBufferFieldTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidStringBufferFieldTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidStringBufferFieldTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidUsingHardCodedIPTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidUsingHardCodedIPTest.java index 82d84a3c05..fe7b0ce420 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidUsingHardCodedIPTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidUsingHardCodedIPTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidUsingHardCodedIPTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/CheckResultSetTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/CheckResultSetTest.java index cba377fd59..8699d4134d 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/CheckResultSetTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/CheckResultSetTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class CheckResultSetTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ConstantsInInterfaceTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ConstantsInInterfaceTest.java index bf685f3ad7..c81183b7b6 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ConstantsInInterfaceTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ConstantsInInterfaceTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ConstantsInInterfaceTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/DefaultLabelNotLastInSwitchStmtTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/DefaultLabelNotLastInSwitchStmtTest.java index 1a407779e8..b316a1881f 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/DefaultLabelNotLastInSwitchStmtTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/DefaultLabelNotLastInSwitchStmtTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class DefaultLabelNotLastInSwitchStmtTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/DoubleBraceInitializationTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/DoubleBraceInitializationTest.java index 26eee695b6..8a6947126a 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/DoubleBraceInitializationTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/DoubleBraceInitializationTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class DoubleBraceInitializationTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ForLoopCanBeForeachTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ForLoopCanBeForeachTest.java index e0b774b80d..771debeb16 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ForLoopCanBeForeachTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ForLoopCanBeForeachTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ForLoopCanBeForeachTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ForLoopVariableCountTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ForLoopVariableCountTest.java index 5843550a3a..059c71f39d 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ForLoopVariableCountTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ForLoopVariableCountTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ForLoopVariableCountTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/GuardLogStatementTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/GuardLogStatementTest.java index 84dce65d9c..5a1979c853 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/GuardLogStatementTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/GuardLogStatementTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class GuardLogStatementTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4SuitesShouldUseSuiteAnnotationTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4SuitesShouldUseSuiteAnnotationTest.java index dc2c92f4ae..2765a69ce2 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4SuitesShouldUseSuiteAnnotationTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4SuitesShouldUseSuiteAnnotationTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class JUnit4SuitesShouldUseSuiteAnnotationTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4TestShouldUseAfterAnnotationTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4TestShouldUseAfterAnnotationTest.java index 341829e928..ea6070f9e3 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4TestShouldUseAfterAnnotationTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4TestShouldUseAfterAnnotationTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class JUnit4TestShouldUseAfterAnnotationTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4TestShouldUseBeforeAnnotationTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4TestShouldUseBeforeAnnotationTest.java index b92ab68100..d32f7a5087 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4TestShouldUseBeforeAnnotationTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4TestShouldUseBeforeAnnotationTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class JUnit4TestShouldUseBeforeAnnotationTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4TestShouldUseTestAnnotationTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4TestShouldUseTestAnnotationTest.java index 6710c145be..15b507dafb 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4TestShouldUseTestAnnotationTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4TestShouldUseTestAnnotationTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class JUnit4TestShouldUseTestAnnotationTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit5TestShouldBePackagePrivateTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit5TestShouldBePackagePrivateTest.java index bf8190b559..d39a19249b 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit5TestShouldBePackagePrivateTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit5TestShouldBePackagePrivateTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class JUnit5TestShouldBePackagePrivateTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitAssertionsShouldIncludeMessageTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitAssertionsShouldIncludeMessageTest.java index 239cce7659..e77dd78150 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitAssertionsShouldIncludeMessageTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitAssertionsShouldIncludeMessageTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class JUnitAssertionsShouldIncludeMessageTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestContainsTooManyAssertsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestContainsTooManyAssertsTest.java index c91e0ec567..30404275d4 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestContainsTooManyAssertsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestContainsTooManyAssertsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class JUnitTestContainsTooManyAssertsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestsShouldIncludeAssertTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestsShouldIncludeAssertTest.java index b638b6931a..933f3f612c 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestsShouldIncludeAssertTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestsShouldIncludeAssertTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class JUnitTestsShouldIncludeAssertTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitUseExpectedTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitUseExpectedTest.java index fccdcb4321..3ad1c36784 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitUseExpectedTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitUseExpectedTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class JUnitUseExpectedTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/LiteralsFirstInComparisonsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/LiteralsFirstInComparisonsTest.java index ad573713aa..a5720ad7f7 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/LiteralsFirstInComparisonsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/LiteralsFirstInComparisonsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class LiteralsFirstInComparisonsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/LooseCouplingTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/LooseCouplingTest.java index 2d702101d4..5578b24fd5 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/LooseCouplingTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/LooseCouplingTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class LooseCouplingTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/MethodReturnsInternalArrayTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/MethodReturnsInternalArrayTest.java index 4ac38bd990..f3646e5d54 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/MethodReturnsInternalArrayTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/MethodReturnsInternalArrayTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class MethodReturnsInternalArrayTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/MissingOverrideTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/MissingOverrideTest.java index 0d374f3810..fd9b847b62 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/MissingOverrideTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/MissingOverrideTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class MissingOverrideTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/OneDeclarationPerLineTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/OneDeclarationPerLineTest.java index 84c2a6d5b5..8c21b1715c 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/OneDeclarationPerLineTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/OneDeclarationPerLineTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class OneDeclarationPerLineTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/PreserveStackTraceTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/PreserveStackTraceTest.java index 3ee1e1f9ec..56e4f6de8b 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/PreserveStackTraceTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/PreserveStackTraceTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class PreserveStackTraceTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/PrimitiveWrapperInstantiationTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/PrimitiveWrapperInstantiationTest.java index c4c4242233..6e656beb8e 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/PrimitiveWrapperInstantiationTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/PrimitiveWrapperInstantiationTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class PrimitiveWrapperInstantiationTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ReplaceEnumerationWithIteratorTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ReplaceEnumerationWithIteratorTest.java index ae43342146..125b827b3a 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ReplaceEnumerationWithIteratorTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ReplaceEnumerationWithIteratorTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ReplaceEnumerationWithIteratorTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ReplaceHashtableWithMapTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ReplaceHashtableWithMapTest.java index 96c695b7d9..32a5a7d682 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ReplaceHashtableWithMapTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ReplaceHashtableWithMapTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ReplaceHashtableWithMapTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ReplaceVectorWithListTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ReplaceVectorWithListTest.java index 6e6c42ebfa..ef8f827443 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ReplaceVectorWithListTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ReplaceVectorWithListTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ReplaceVectorWithListTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/SimplifiableTestAssertionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/SimplifiableTestAssertionTest.java index 4e8f183411..3d40f44bd2 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/SimplifiableTestAssertionTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/SimplifiableTestAssertionTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class SimplifiableTestAssertionTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/SwitchStmtsShouldHaveDefaultTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/SwitchStmtsShouldHaveDefaultTest.java index c1e3024e73..1e413f1bde 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/SwitchStmtsShouldHaveDefaultTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/SwitchStmtsShouldHaveDefaultTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class SwitchStmtsShouldHaveDefaultTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/SystemPrintlnTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/SystemPrintlnTest.java index f56c1d553a..eb401c15bc 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/SystemPrintlnTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/SystemPrintlnTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class SystemPrintlnTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedAssignmentTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedAssignmentTest.java index e0268e6b19..0401dd83ec 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedAssignmentTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedAssignmentTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnusedAssignmentTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedFormalParameterTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedFormalParameterTest.java index 1498848b13..d50db5eed9 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedFormalParameterTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedFormalParameterTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnusedFormalParameterTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedLocalVariableTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedLocalVariableTest.java index cef06f1d28..e036436f04 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedLocalVariableTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedLocalVariableTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnusedLocalVariableTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedPrivateFieldTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedPrivateFieldTest.java index 2dbebb0d75..393832d452 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedPrivateFieldTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedPrivateFieldTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnusedPrivateFieldTest extends PmdRuleTst { diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedPrivateMethodTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedPrivateMethodTest.java index 95c69992cb..a865a70706 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedPrivateMethodTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedPrivateMethodTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnusedPrivateMethodTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseCollectionIsEmptyTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseCollectionIsEmptyTest.java index c5ff68ec34..59f03df249 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseCollectionIsEmptyTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseCollectionIsEmptyTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UseCollectionIsEmptyTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseStandardCharsetsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseStandardCharsetsTest.java index 9ca82a74bf..aca984101e 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseStandardCharsetsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseStandardCharsetsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UseStandardCharsetsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseTryWithResourcesTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseTryWithResourcesTest.java index 6ae963e5b7..07334453bd 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseTryWithResourcesTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseTryWithResourcesTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UseTryWithResourcesTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseVarargsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseVarargsTest.java index d427a9b63a..d3c6b35411 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseVarargsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseVarargsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UseVarargsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/WhileLoopWithLiteralBooleanTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/WhileLoopWithLiteralBooleanTest.java index c123e41fb9..4fe2c32ef5 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/WhileLoopWithLiteralBooleanTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/WhileLoopWithLiteralBooleanTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class WhileLoopWithLiteralBooleanTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AtLeastOneConstructorTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AtLeastOneConstructorTest.java index a01faa8ee8..0016e9ddbc 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AtLeastOneConstructorTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AtLeastOneConstructorTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AtLeastOneConstructorTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AvoidDollarSignsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AvoidDollarSignsTest.java index 3912331a26..34a6e215bb 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AvoidDollarSignsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AvoidDollarSignsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidDollarSignsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AvoidProtectedFieldInFinalClassTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AvoidProtectedFieldInFinalClassTest.java index 6f12fef002..f7776cd225 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AvoidProtectedFieldInFinalClassTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AvoidProtectedFieldInFinalClassTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidProtectedFieldInFinalClassTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AvoidProtectedMethodInFinalClassNotExtendingTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AvoidProtectedMethodInFinalClassNotExtendingTest.java index 26f19cbefb..7d7e2cfa3b 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AvoidProtectedMethodInFinalClassNotExtendingTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AvoidProtectedMethodInFinalClassNotExtendingTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidProtectedMethodInFinalClassNotExtendingTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AvoidUsingNativeCodeTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AvoidUsingNativeCodeTest.java index d6be3157ba..fae466967b 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AvoidUsingNativeCodeTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AvoidUsingNativeCodeTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidUsingNativeCodeTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/BooleanGetMethodNameTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/BooleanGetMethodNameTest.java index 4ecd11cdae..1b239e2ab1 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/BooleanGetMethodNameTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/BooleanGetMethodNameTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class BooleanGetMethodNameTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/CallSuperInConstructorTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/CallSuperInConstructorTest.java index c1df93ea1c..34310381de 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/CallSuperInConstructorTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/CallSuperInConstructorTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class CallSuperInConstructorTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ClassNamingConventionsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ClassNamingConventionsTest.java index 32796e3fd4..ca721c867a 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ClassNamingConventionsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ClassNamingConventionsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ClassNamingConventionsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/CommentDefaultAccessModifierTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/CommentDefaultAccessModifierTest.java index 57e297e29a..c6e02b62f5 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/CommentDefaultAccessModifierTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/CommentDefaultAccessModifierTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class CommentDefaultAccessModifierTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ConfusingTernaryTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ConfusingTernaryTest.java index 383ded2194..ed559d2e32 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ConfusingTernaryTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ConfusingTernaryTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ConfusingTernaryTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ControlStatementBracesTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ControlStatementBracesTest.java index 02ba0a4103..c94aed935c 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ControlStatementBracesTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ControlStatementBracesTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ControlStatementBracesTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/EmptyControlStatementTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/EmptyControlStatementTest.java index 70bbcd8897..4cb1a84298 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/EmptyControlStatementTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/EmptyControlStatementTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class EmptyControlStatementTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/EmptyMethodInAbstractClassShouldBeAbstractTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/EmptyMethodInAbstractClassShouldBeAbstractTest.java index 44de194856..27bb5620d1 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/EmptyMethodInAbstractClassShouldBeAbstractTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/EmptyMethodInAbstractClassShouldBeAbstractTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class EmptyMethodInAbstractClassShouldBeAbstractTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ExtendsObjectTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ExtendsObjectTest.java index a5b01cc926..6e66ca54e4 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ExtendsObjectTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ExtendsObjectTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ExtendsObjectTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/FieldDeclarationsShouldBeAtStartOfClassTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/FieldDeclarationsShouldBeAtStartOfClassTest.java index 2a46f0ccc8..f1c9cfcb91 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/FieldDeclarationsShouldBeAtStartOfClassTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/FieldDeclarationsShouldBeAtStartOfClassTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class FieldDeclarationsShouldBeAtStartOfClassTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/FieldNamingConventionsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/FieldNamingConventionsTest.java index ad43201f57..e4a1157bf2 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/FieldNamingConventionsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/FieldNamingConventionsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class FieldNamingConventionsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/FinalParameterInAbstractMethodTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/FinalParameterInAbstractMethodTest.java index 68a325445b..8efa889742 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/FinalParameterInAbstractMethodTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/FinalParameterInAbstractMethodTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class FinalParameterInAbstractMethodTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ForLoopShouldBeWhileLoopTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ForLoopShouldBeWhileLoopTest.java index 0e77ed8483..427e066be8 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ForLoopShouldBeWhileLoopTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ForLoopShouldBeWhileLoopTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ForLoopShouldBeWhileLoopTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/FormalParameterNamingConventionsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/FormalParameterNamingConventionsTest.java index 16f76366c5..2327c1cd2f 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/FormalParameterNamingConventionsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/FormalParameterNamingConventionsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class FormalParameterNamingConventionsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/GenericsNamingTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/GenericsNamingTest.java index 1408b7f3f2..4ed583d9fe 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/GenericsNamingTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/GenericsNamingTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class GenericsNamingTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/IdenticalCatchBranchesTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/IdenticalCatchBranchesTest.java index 9b306eb379..87875e0f14 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/IdenticalCatchBranchesTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/IdenticalCatchBranchesTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class IdenticalCatchBranchesTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LinguisticNamingTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LinguisticNamingTest.java index 2535e6a9a0..fd1466df70 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LinguisticNamingTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LinguisticNamingTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class LinguisticNamingTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalHomeNamingConventionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalHomeNamingConventionTest.java index 8f9adcc264..04fdee75ab 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalHomeNamingConventionTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalHomeNamingConventionTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class LocalHomeNamingConventionTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalInterfaceSessionNamingConventionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalInterfaceSessionNamingConventionTest.java index ff39a550b0..ff119c1a28 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalInterfaceSessionNamingConventionTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalInterfaceSessionNamingConventionTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class LocalInterfaceSessionNamingConventionTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalVariableCouldBeFinalTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalVariableCouldBeFinalTest.java index 610f44eecd..5c49860210 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalVariableCouldBeFinalTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalVariableCouldBeFinalTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class LocalVariableCouldBeFinalTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalVariableNamingConventionsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalVariableNamingConventionsTest.java index 103742c709..18753981b9 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalVariableNamingConventionsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalVariableNamingConventionsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class LocalVariableNamingConventionsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LongVariableTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LongVariableTest.java index f93806cc6a..86ad669aac 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LongVariableTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LongVariableTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class LongVariableTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/MDBAndSessionBeanNamingConventionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/MDBAndSessionBeanNamingConventionTest.java index 5a9477e98e..5104b29ffc 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/MDBAndSessionBeanNamingConventionTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/MDBAndSessionBeanNamingConventionTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class MDBAndSessionBeanNamingConventionTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/MethodArgumentCouldBeFinalTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/MethodArgumentCouldBeFinalTest.java index 589830413c..55d4325665 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/MethodArgumentCouldBeFinalTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/MethodArgumentCouldBeFinalTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class MethodArgumentCouldBeFinalTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/MethodNamingConventionsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/MethodNamingConventionsTest.java index eaa4fde1e9..67a7557ec0 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/MethodNamingConventionsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/MethodNamingConventionsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class MethodNamingConventionsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/NoPackageTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/NoPackageTest.java index df3821dc03..80badeb38c 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/NoPackageTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/NoPackageTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class NoPackageTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/OnlyOneReturnTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/OnlyOneReturnTest.java index 9cd086b1e5..bf2e0d75eb 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/OnlyOneReturnTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/OnlyOneReturnTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class OnlyOneReturnTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/PackageCaseTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/PackageCaseTest.java index cdd036a17d..f82f7071ce 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/PackageCaseTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/PackageCaseTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class PackageCaseTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/PrematureDeclarationTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/PrematureDeclarationTest.java index 16f56fc61a..7449842bd8 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/PrematureDeclarationTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/PrematureDeclarationTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class PrematureDeclarationTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/RemoteInterfaceNamingConventionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/RemoteInterfaceNamingConventionTest.java index 6985386725..99b7caad86 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/RemoteInterfaceNamingConventionTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/RemoteInterfaceNamingConventionTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class RemoteInterfaceNamingConventionTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/RemoteSessionInterfaceNamingConventionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/RemoteSessionInterfaceNamingConventionTest.java index 5e95b5525f..8c9a2dba9c 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/RemoteSessionInterfaceNamingConventionTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/RemoteSessionInterfaceNamingConventionTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class RemoteSessionInterfaceNamingConventionTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ShortClassNameTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ShortClassNameTest.java index c4ae1aff0d..cc08d111d9 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ShortClassNameTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ShortClassNameTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ShortClassNameTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ShortMethodNameTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ShortMethodNameTest.java index 9fab5587dc..77f1793eca 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ShortMethodNameTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ShortMethodNameTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ShortMethodNameTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ShortVariableTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ShortVariableTest.java index b178ba1bf7..e505d0ef49 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ShortVariableTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ShortVariableTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ShortVariableTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/TooManyStaticImportsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/TooManyStaticImportsTest.java index ae659dcfdc..6346aa9a48 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/TooManyStaticImportsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/TooManyStaticImportsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class TooManyStaticImportsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryAnnotationValueElementTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryAnnotationValueElementTest.java index 75d06a7980..051a52d508 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryAnnotationValueElementTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryAnnotationValueElementTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnnecessaryAnnotationValueElementTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryBoxingTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryBoxingTest.java index 09e83074a5..bb37cb806f 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryBoxingTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryBoxingTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnnecessaryBoxingTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryCastTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryCastTest.java index b479fdfa98..ddbca59128 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryCastTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryCastTest.java @@ -5,7 +5,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnnecessaryCastTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryConstructorTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryConstructorTest.java index 4e0c2bf4b7..b5111c5bb4 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryConstructorTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryConstructorTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnnecessaryConstructorTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryFullyQualifiedNameTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryFullyQualifiedNameTest.java index b8edf924a3..9f0c2eec0f 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryFullyQualifiedNameTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryFullyQualifiedNameTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnnecessaryFullyQualifiedNameTest extends PmdRuleTst { // Do not delete these two enums - it is needed for a test case diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryImportTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryImportTest.java index 4cdbf50000..ea4bea97d4 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryImportTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryImportTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnnecessaryImportTest extends PmdRuleTst { // these 2 methods are used for a test case, do not delete diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryLocalBeforeReturnTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryLocalBeforeReturnTest.java index d6fe2b3a65..10bf3efae5 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryLocalBeforeReturnTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryLocalBeforeReturnTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnnecessaryLocalBeforeReturnTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryModifierTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryModifierTest.java index 442d89734b..5c77459d42 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryModifierTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryModifierTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnnecessaryModifierTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryReturnTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryReturnTest.java index de89b09b55..9213d7d9f2 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryReturnTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryReturnTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnnecessaryReturnTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessarySemicolonTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessarySemicolonTest.java index 6258d531d9..9e488c285c 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessarySemicolonTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessarySemicolonTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnnecessarySemicolonTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UseDiamondOperatorTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UseDiamondOperatorTest.java index fe6f6c19b4..3148d3a690 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UseDiamondOperatorTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UseDiamondOperatorTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UseDiamondOperatorTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UseExplicitTypesTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UseExplicitTypesTest.java index e535efd39c..506bbd7095 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UseExplicitTypesTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UseExplicitTypesTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UseExplicitTypesTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UseShortArrayInitializerTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UseShortArrayInitializerTest.java index 28959ae4c0..a4cec59f39 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UseShortArrayInitializerTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UseShortArrayInitializerTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UseShortArrayInitializerTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UseUnderscoresInNumericLiteralsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UseUnderscoresInNumericLiteralsTest.java index df002dba91..71098101c0 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UseUnderscoresInNumericLiteralsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UseUnderscoresInNumericLiteralsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UseUnderscoresInNumericLiteralsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UselessParenthesesTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UselessParenthesesTest.java index 2ff2cb875e..8e4050c9aa 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UselessParenthesesTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UselessParenthesesTest.java @@ -15,7 +15,7 @@ import net.sourceforge.pmd.lang.java.JavaParsingHelper; import net.sourceforge.pmd.lang.java.ast.ASTCompilationUnit; import net.sourceforge.pmd.lang.java.ast.ASTExpression; import net.sourceforge.pmd.lang.java.rule.codestyle.UselessParenthesesRule.Necessity; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UselessParenthesesTest extends PmdRuleTst { diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UselessQualifiedThisTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UselessQualifiedThisTest.java index d4c28d5193..c7eed79cee 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UselessQualifiedThisTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UselessQualifiedThisTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UselessQualifiedThisTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AbstractClassWithoutAnyMethodTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AbstractClassWithoutAnyMethodTest.java index 2707edc916..a5d9253ee2 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AbstractClassWithoutAnyMethodTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AbstractClassWithoutAnyMethodTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AbstractClassWithoutAnyMethodTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidCatchingGenericExceptionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidCatchingGenericExceptionTest.java index 9014238a7b..32fecf59f8 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidCatchingGenericExceptionTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidCatchingGenericExceptionTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidCatchingGenericExceptionTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidDeeplyNestedIfStmtsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidDeeplyNestedIfStmtsTest.java index ffeb2eff0b..28eab0fdf1 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidDeeplyNestedIfStmtsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidDeeplyNestedIfStmtsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidDeeplyNestedIfStmtsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidRethrowingExceptionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidRethrowingExceptionTest.java index 8b4946aba8..aa3bbd57ba 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidRethrowingExceptionTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidRethrowingExceptionTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidRethrowingExceptionTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidThrowingNewInstanceOfSameExceptionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidThrowingNewInstanceOfSameExceptionTest.java index 80992fa8b8..14e7a6b7df 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidThrowingNewInstanceOfSameExceptionTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidThrowingNewInstanceOfSameExceptionTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidThrowingNewInstanceOfSameExceptionTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidThrowingNullPointerExceptionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidThrowingNullPointerExceptionTest.java index 47eace4526..c1b437ab41 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidThrowingNullPointerExceptionTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidThrowingNullPointerExceptionTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidThrowingNullPointerExceptionTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidThrowingRawExceptionTypesTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidThrowingRawExceptionTypesTest.java index be27cc8e00..8cffad6aeb 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidThrowingRawExceptionTypesTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidThrowingRawExceptionTypesTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidThrowingRawExceptionTypesTest extends PmdRuleTst { public static class Throwable extends java.lang.Throwable { diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidUncheckedExceptionsInSignaturesTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidUncheckedExceptionsInSignaturesTest.java index 0a18773aa2..146b4990f3 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidUncheckedExceptionsInSignaturesTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidUncheckedExceptionsInSignaturesTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidUncheckedExceptionsInSignaturesTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ClassWithOnlyPrivateConstructorsShouldBeFinalTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ClassWithOnlyPrivateConstructorsShouldBeFinalTest.java index 5310503f78..7328a0999f 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ClassWithOnlyPrivateConstructorsShouldBeFinalTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ClassWithOnlyPrivateConstructorsShouldBeFinalTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ClassWithOnlyPrivateConstructorsShouldBeFinalTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/CognitiveComplexityTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/CognitiveComplexityTest.java index c6c2edcebc..b20c1035a8 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/CognitiveComplexityTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/CognitiveComplexityTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class CognitiveComplexityTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/CollapsibleIfStatementsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/CollapsibleIfStatementsTest.java index 3f13ce5287..44d831ea9e 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/CollapsibleIfStatementsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/CollapsibleIfStatementsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class CollapsibleIfStatementsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/CouplingBetweenObjectsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/CouplingBetweenObjectsTest.java index 7c2948ec32..79ab664ae7 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/CouplingBetweenObjectsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/CouplingBetweenObjectsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class CouplingBetweenObjectsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/CyclomaticComplexityTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/CyclomaticComplexityTest.java index df859e7e08..7833abbb86 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/CyclomaticComplexityTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/CyclomaticComplexityTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class CyclomaticComplexityTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/DataClassTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/DataClassTest.java index af2152f439..6a7cccfdd9 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/DataClassTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/DataClassTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class DataClassTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/DoNotExtendJavaLangErrorTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/DoNotExtendJavaLangErrorTest.java index e5d9b7b301..57280be3f8 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/DoNotExtendJavaLangErrorTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/DoNotExtendJavaLangErrorTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class DoNotExtendJavaLangErrorTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ExceptionAsFlowControlTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ExceptionAsFlowControlTest.java index 292fde945d..2dbd142d27 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ExceptionAsFlowControlTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ExceptionAsFlowControlTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ExceptionAsFlowControlTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ExcessiveImportsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ExcessiveImportsTest.java index 74fd72a16c..7547ce785a 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ExcessiveImportsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ExcessiveImportsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ExcessiveImportsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ExcessiveParameterListTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ExcessiveParameterListTest.java index 6308b1fe4f..30fa157b94 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ExcessiveParameterListTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ExcessiveParameterListTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ExcessiveParameterListTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ExcessivePublicCountTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ExcessivePublicCountTest.java index 760e4807fe..7417e82f49 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ExcessivePublicCountTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ExcessivePublicCountTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ExcessivePublicCountTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/FinalFieldCouldBeStaticTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/FinalFieldCouldBeStaticTest.java index cf9d950639..71b86c4014 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/FinalFieldCouldBeStaticTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/FinalFieldCouldBeStaticTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class FinalFieldCouldBeStaticTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/GodClassTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/GodClassTest.java index dd69734923..eac3f10322 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/GodClassTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/GodClassTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class GodClassTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ImmutableFieldTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ImmutableFieldTest.java index b974fad282..eb0972d72b 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ImmutableFieldTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ImmutableFieldTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ImmutableFieldTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/InvalidJavaBeanTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/InvalidJavaBeanTest.java index dc8c949263..f50fbe1971 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/InvalidJavaBeanTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/InvalidJavaBeanTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; public class InvalidJavaBeanTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/LawOfDemeterTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/LawOfDemeterTest.java index 99e77ad459..b4e94a6e26 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/LawOfDemeterTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/LawOfDemeterTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class LawOfDemeterTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/LogicInversionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/LogicInversionTest.java index 3a4cb92739..b59044573a 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/LogicInversionTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/LogicInversionTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class LogicInversionTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/LoosePackageCouplingTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/LoosePackageCouplingTest.java index 00e0b010c9..b838934226 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/LoosePackageCouplingTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/LoosePackageCouplingTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class LoosePackageCouplingTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/MutableStaticStateTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/MutableStaticStateTest.java index cb5e29d512..df946baa86 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/MutableStaticStateTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/MutableStaticStateTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class MutableStaticStateTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/NPathComplexityTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/NPathComplexityTest.java index 98ddc7cae6..f23536ba55 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/NPathComplexityTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/NPathComplexityTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class NPathComplexityTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/NcssCountTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/NcssCountTest.java index 48e984d9ad..537485d26c 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/NcssCountTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/NcssCountTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class NcssCountTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SignatureDeclareThrowsExceptionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SignatureDeclareThrowsExceptionTest.java index d44e58ec86..d5e0bc20af 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SignatureDeclareThrowsExceptionTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SignatureDeclareThrowsExceptionTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class SignatureDeclareThrowsExceptionTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SimplifiedTernaryTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SimplifiedTernaryTest.java index 3f2a8a5daf..dc68ac28bd 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SimplifiedTernaryTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SimplifiedTernaryTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class SimplifiedTernaryTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SimplifyBooleanExpressionsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SimplifyBooleanExpressionsTest.java index 0b1a4bc204..f17434579f 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SimplifyBooleanExpressionsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SimplifyBooleanExpressionsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class SimplifyBooleanExpressionsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SimplifyBooleanReturnsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SimplifyBooleanReturnsTest.java index ab631f2194..e385db5af1 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SimplifyBooleanReturnsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SimplifyBooleanReturnsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class SimplifyBooleanReturnsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SimplifyConditionalTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SimplifyConditionalTest.java index 47400d35cf..9ad90e779d 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SimplifyConditionalTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SimplifyConditionalTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class SimplifyConditionalTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SingularFieldTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SingularFieldTest.java index 95fd5ff04c..81835c7c5b 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SingularFieldTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SingularFieldTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class SingularFieldTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SwitchDensityTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SwitchDensityTest.java index 588ab69e8d..20788f1419 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SwitchDensityTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SwitchDensityTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class SwitchDensityTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/TooManyFieldsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/TooManyFieldsTest.java index 05933e2507..9c3c33d7ee 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/TooManyFieldsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/TooManyFieldsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class TooManyFieldsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/TooManyMethodsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/TooManyMethodsTest.java index 122519449a..fa9d3db763 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/TooManyMethodsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/TooManyMethodsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class TooManyMethodsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/UseObjectForClearerAPITest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/UseObjectForClearerAPITest.java index 9a397a435a..fc4a699a0d 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/UseObjectForClearerAPITest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/UseObjectForClearerAPITest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UseObjectForClearerAPITest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/UseUtilityClassTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/UseUtilityClassTest.java index 41ff6bd799..7d023149da 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/UseUtilityClassTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/UseUtilityClassTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UseUtilityClassTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/UselessOverridingMethodTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/UselessOverridingMethodTest.java index 85ff3df3d9..ead57712d1 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/UselessOverridingMethodTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/UselessOverridingMethodTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.design; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UselessOverridingMethodTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentContentTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentContentTest.java index 322a64200a..9ecdfb0ba9 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentContentTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentContentTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.documentation; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class CommentContentTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentRequiredTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentRequiredTest.java index 4c026b25c3..b3f976c2a9 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentRequiredTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentRequiredTest.java @@ -14,7 +14,7 @@ import org.junit.jupiter.api.Test; import net.sourceforge.pmd.lang.rule.Rule; import net.sourceforge.pmd.properties.PropertyDescriptor; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class CommentRequiredTest extends PmdRuleTst { @Test @@ -23,9 +23,6 @@ class CommentRequiredTest extends PmdRuleTst { assertNull(rule.dysfunctionReason(), "By default, the rule should be functional"); List> propertyDescriptors = getProperties(rule); - // remove deprecated properties - propertyDescriptors.removeIf(property -> property.description().startsWith("Deprecated!")); - for (PropertyDescriptor property : propertyDescriptors) { setPropertyValue(rule, property, "Ignored"); } diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentSizeTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentSizeTest.java index 5d4e204836..5c7b46c604 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentSizeTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentSizeTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.documentation; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class CommentSizeTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/UncommentedEmptyConstructorTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/UncommentedEmptyConstructorTest.java index 0bb603709c..07db696d06 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/UncommentedEmptyConstructorTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/UncommentedEmptyConstructorTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.documentation; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UncommentedEmptyConstructorTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/UncommentedEmptyMethodBodyTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/UncommentedEmptyMethodBodyTest.java index 8c2095d737..cf02536ff6 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/UncommentedEmptyMethodBodyTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/UncommentedEmptyMethodBodyTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.documentation; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UncommentedEmptyMethodBodyTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AssignmentInOperandTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AssignmentInOperandTest.java index 4edf718a2d..bcc9a1a047 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AssignmentInOperandTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AssignmentInOperandTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AssignmentInOperandTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AssignmentToNonFinalStaticTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AssignmentToNonFinalStaticTest.java index 4813dfffbc..a0ec733db1 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AssignmentToNonFinalStaticTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AssignmentToNonFinalStaticTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AssignmentToNonFinalStaticTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidAccessibilityAlterationTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidAccessibilityAlterationTest.java index 03bde11b12..299773b485 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidAccessibilityAlterationTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidAccessibilityAlterationTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidAccessibilityAlterationTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidAssertAsIdentifierTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidAssertAsIdentifierTest.java index 886c08b67d..2181e84e4b 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidAssertAsIdentifierTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidAssertAsIdentifierTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidAssertAsIdentifierTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidBranchingStatementAsLastInLoopTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidBranchingStatementAsLastInLoopTest.java index 191b68987d..e220e19d13 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidBranchingStatementAsLastInLoopTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidBranchingStatementAsLastInLoopTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidBranchingStatementAsLastInLoopTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidCallingFinalizeTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidCallingFinalizeTest.java index 246bce0db7..d677bbb03e 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidCallingFinalizeTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidCallingFinalizeTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidCallingFinalizeTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidCatchingNPETest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidCatchingNPETest.java index 006cc3d84e..b232a83d67 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidCatchingNPETest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidCatchingNPETest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidCatchingNPETest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidCatchingThrowableTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidCatchingThrowableTest.java index c11ea40e2a..c8a5c0c84d 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidCatchingThrowableTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidCatchingThrowableTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidCatchingThrowableTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidDecimalLiteralsInBigDecimalConstructorTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidDecimalLiteralsInBigDecimalConstructorTest.java index 267bb84ab9..89ea4cb63c 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidDecimalLiteralsInBigDecimalConstructorTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidDecimalLiteralsInBigDecimalConstructorTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidDecimalLiteralsInBigDecimalConstructorTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidDuplicateLiteralsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidDuplicateLiteralsTest.java index d2f660a2e9..c08bad740b 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidDuplicateLiteralsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidDuplicateLiteralsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidDuplicateLiteralsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidEnumAsIdentifierTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidEnumAsIdentifierTest.java index be57423730..8b6da14263 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidEnumAsIdentifierTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidEnumAsIdentifierTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidEnumAsIdentifierTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidFieldNameMatchingMethodNameTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidFieldNameMatchingMethodNameTest.java index f8486d435e..9cea99c577 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidFieldNameMatchingMethodNameTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidFieldNameMatchingMethodNameTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidFieldNameMatchingMethodNameTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidFieldNameMatchingTypeNameTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidFieldNameMatchingTypeNameTest.java index 3edcfcf304..3583b1a557 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidFieldNameMatchingTypeNameTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidFieldNameMatchingTypeNameTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidFieldNameMatchingTypeNameTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidInstanceofChecksInCatchClauseTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidInstanceofChecksInCatchClauseTest.java index 68b781f08a..a839a4c68a 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidInstanceofChecksInCatchClauseTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidInstanceofChecksInCatchClauseTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidInstanceofChecksInCatchClauseTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidLiteralsInIfConditionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidLiteralsInIfConditionTest.java index 802b8dca59..d2a8f2c42b 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidLiteralsInIfConditionTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidLiteralsInIfConditionTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidLiteralsInIfConditionTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidLosingExceptionInformationTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidLosingExceptionInformationTest.java index d31247dec4..e1cdd89895 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidLosingExceptionInformationTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidLosingExceptionInformationTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidLosingExceptionInformationTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidMultipleUnaryOperatorsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidMultipleUnaryOperatorsTest.java index 68121b5dc5..3d2893f02c 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidMultipleUnaryOperatorsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidMultipleUnaryOperatorsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidMultipleUnaryOperatorsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidUsingOctalValuesTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidUsingOctalValuesTest.java index 968d7ca76b..9b396d1519 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidUsingOctalValuesTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidUsingOctalValuesTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidUsingOctalValuesTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/BrokenNullCheckTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/BrokenNullCheckTest.java index 2b1ba4ff7e..bf48e3784a 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/BrokenNullCheckTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/BrokenNullCheckTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class BrokenNullCheckTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CallSuperFirstTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CallSuperFirstTest.java index 311a13ff74..930906b275 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CallSuperFirstTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CallSuperFirstTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class CallSuperFirstTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CallSuperLastTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CallSuperLastTest.java index a368b2bc75..c9102640ca 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CallSuperLastTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CallSuperLastTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class CallSuperLastTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CheckSkipResultTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CheckSkipResultTest.java index 55bb58982b..26fc541489 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CheckSkipResultTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CheckSkipResultTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class CheckSkipResultTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ClassCastExceptionWithToArrayTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ClassCastExceptionWithToArrayTest.java index dfd5d2066f..502cf5ea4f 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ClassCastExceptionWithToArrayTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ClassCastExceptionWithToArrayTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ClassCastExceptionWithToArrayTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloneMethodMustBePublicTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloneMethodMustBePublicTest.java index 2a96cb6855..371d240c06 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloneMethodMustBePublicTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloneMethodMustBePublicTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class CloneMethodMustBePublicTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloneMethodMustImplementCloneableTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloneMethodMustImplementCloneableTest.java index 9aef788c64..3f37f37eaf 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloneMethodMustImplementCloneableTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloneMethodMustImplementCloneableTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class CloneMethodMustImplementCloneableTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloneMethodReturnTypeMustMatchClassNameTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloneMethodReturnTypeMustMatchClassNameTest.java index 717ac81df4..63df372d7a 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloneMethodReturnTypeMustMatchClassNameTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloneMethodReturnTypeMustMatchClassNameTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class CloneMethodReturnTypeMustMatchClassNameTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloseResourceTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloseResourceTest.java index bdbf15e7c2..20856ab956 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloseResourceTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloseResourceTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class CloseResourceTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CompareObjectsWithEqualsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CompareObjectsWithEqualsTest.java index 05acb24255..25e111a8fa 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CompareObjectsWithEqualsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CompareObjectsWithEqualsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class CompareObjectsWithEqualsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ComparisonWithNaNTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ComparisonWithNaNTest.java index 723d440e4c..1015af42ed 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ComparisonWithNaNTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ComparisonWithNaNTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ComparisonWithNaNTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ConstructorCallsOverridableMethodTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ConstructorCallsOverridableMethodTest.java index 2440994922..8420a865ab 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ConstructorCallsOverridableMethodTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ConstructorCallsOverridableMethodTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ConstructorCallsOverridableMethodTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DetachedTestCaseTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DetachedTestCaseTest.java index 74a15e36ae..f2def6539a 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DetachedTestCaseTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DetachedTestCaseTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class DetachedTestCaseTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotCallGarbageCollectionExplicitlyTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotCallGarbageCollectionExplicitlyTest.java index 4796425f69..46202e927a 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotCallGarbageCollectionExplicitlyTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotCallGarbageCollectionExplicitlyTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class DoNotCallGarbageCollectionExplicitlyTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotExtendJavaLangThrowableTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotExtendJavaLangThrowableTest.java index 7e5494958d..6a849194f6 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotExtendJavaLangThrowableTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotExtendJavaLangThrowableTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class DoNotExtendJavaLangThrowableTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotHardCodeSDCardTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotHardCodeSDCardTest.java index dd4a99f308..bdfd5d58cb 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotHardCodeSDCardTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotHardCodeSDCardTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class DoNotHardCodeSDCardTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotTerminateVMTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotTerminateVMTest.java index f6cc3a8bb1..dcb0f8f4ee 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotTerminateVMTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotTerminateVMTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class DoNotTerminateVMTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotThrowExceptionInFinallyTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotThrowExceptionInFinallyTest.java index aed669dc83..7eefe57ee0 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotThrowExceptionInFinallyTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotThrowExceptionInFinallyTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class DoNotThrowExceptionInFinallyTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DontImportSunTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DontImportSunTest.java index 1498a6db2a..f4c0ae4184 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DontImportSunTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DontImportSunTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class DontImportSunTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DontUseFloatTypeForLoopIndicesTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DontUseFloatTypeForLoopIndicesTest.java index eedf01e2d5..1572170e72 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DontUseFloatTypeForLoopIndicesTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DontUseFloatTypeForLoopIndicesTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class DontUseFloatTypeForLoopIndicesTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/EmptyCatchBlockTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/EmptyCatchBlockTest.java index a953c3e013..9a5537230b 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/EmptyCatchBlockTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/EmptyCatchBlockTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class EmptyCatchBlockTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/EmptyFinalizerTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/EmptyFinalizerTest.java index 6f7cd4674f..cd31622ab2 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/EmptyFinalizerTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/EmptyFinalizerTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class EmptyFinalizerTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/EqualsNullTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/EqualsNullTest.java index fc903ce4bb..f0cfd64e5c 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/EqualsNullTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/EqualsNullTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class EqualsNullTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/FinalizeDoesNotCallSuperFinalizeTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/FinalizeDoesNotCallSuperFinalizeTest.java index a8de36f386..d1747d4885 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/FinalizeDoesNotCallSuperFinalizeTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/FinalizeDoesNotCallSuperFinalizeTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class FinalizeDoesNotCallSuperFinalizeTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/FinalizeOnlyCallsSuperFinalizeTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/FinalizeOnlyCallsSuperFinalizeTest.java index f94cb50b83..7da75fa5c1 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/FinalizeOnlyCallsSuperFinalizeTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/FinalizeOnlyCallsSuperFinalizeTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class FinalizeOnlyCallsSuperFinalizeTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/FinalizeOverloadedTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/FinalizeOverloadedTest.java index 9df63b451b..c529f24a4a 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/FinalizeOverloadedTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/FinalizeOverloadedTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class FinalizeOverloadedTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/FinalizeShouldBeProtectedTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/FinalizeShouldBeProtectedTest.java index ddc8e610b3..e2cab4ed1a 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/FinalizeShouldBeProtectedTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/FinalizeShouldBeProtectedTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class FinalizeShouldBeProtectedTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/IdempotentOperationsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/IdempotentOperationsTest.java index b636426e8d..424df37768 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/IdempotentOperationsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/IdempotentOperationsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class IdempotentOperationsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ImplicitSwitchFallThroughTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ImplicitSwitchFallThroughTest.java index 99ad4868f7..3a14a27009 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ImplicitSwitchFallThroughTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ImplicitSwitchFallThroughTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ImplicitSwitchFallThroughTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/InstantiationToGetClassTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/InstantiationToGetClassTest.java index c85239d5ea..f575d90629 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/InstantiationToGetClassTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/InstantiationToGetClassTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class InstantiationToGetClassTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/InvalidLogMessageFormatTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/InvalidLogMessageFormatTest.java index 7e9abea98c..933231b1bc 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/InvalidLogMessageFormatTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/InvalidLogMessageFormatTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class InvalidLogMessageFormatTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/JUnitSpellingTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/JUnitSpellingTest.java index 047f7313e3..faaffea06c 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/JUnitSpellingTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/JUnitSpellingTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class JUnitSpellingTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/JUnitStaticSuiteTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/JUnitStaticSuiteTest.java index 6d7a5b846d..858cc27ba4 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/JUnitStaticSuiteTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/JUnitStaticSuiteTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class JUnitStaticSuiteTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/JumbledIncrementerTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/JumbledIncrementerTest.java index db5032bbfa..ac16e6555e 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/JumbledIncrementerTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/JumbledIncrementerTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class JumbledIncrementerTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MethodWithSameNameAsEnclosingClassTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MethodWithSameNameAsEnclosingClassTest.java index 386383efd1..fe78042cbf 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MethodWithSameNameAsEnclosingClassTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MethodWithSameNameAsEnclosingClassTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class MethodWithSameNameAsEnclosingClassTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MisplacedNullCheckTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MisplacedNullCheckTest.java index ca68722bec..3f5c5a0106 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MisplacedNullCheckTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MisplacedNullCheckTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class MisplacedNullCheckTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MissingSerialVersionUIDTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MissingSerialVersionUIDTest.java index a7358da129..bb338c5969 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MissingSerialVersionUIDTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MissingSerialVersionUIDTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class MissingSerialVersionUIDTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MissingStaticMethodInNonInstantiatableClassTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MissingStaticMethodInNonInstantiatableClassTest.java index 5cf642ed8e..cadf17f5f9 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MissingStaticMethodInNonInstantiatableClassTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MissingStaticMethodInNonInstantiatableClassTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class MissingStaticMethodInNonInstantiatableClassTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MoreThanOneLoggerTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MoreThanOneLoggerTest.java index f1deb552a7..fedc2ed326 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MoreThanOneLoggerTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MoreThanOneLoggerTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class MoreThanOneLoggerTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonCaseLabelInSwitchStatementTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonCaseLabelInSwitchStatementTest.java index d19b90912d..9d914a9552 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonCaseLabelInSwitchStatementTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonCaseLabelInSwitchStatementTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class NonCaseLabelInSwitchStatementTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonSerializableClassTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonSerializableClassTest.java index 9fc73d7ba0..5cc867bdb8 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonSerializableClassTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonSerializableClassTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class NonSerializableClassTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonStaticInitializerTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonStaticInitializerTest.java index 543bd5d56c..a971ea77c3 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonStaticInitializerTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonStaticInitializerTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class NonStaticInitializerTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NullAssignmentTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NullAssignmentTest.java index 84845a7d57..140df2e813 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NullAssignmentTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NullAssignmentTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class NullAssignmentTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/OverrideBothEqualsAndHashcodeTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/OverrideBothEqualsAndHashcodeTest.java index bed7dd18c3..7611bfaa34 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/OverrideBothEqualsAndHashcodeTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/OverrideBothEqualsAndHashcodeTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class OverrideBothEqualsAndHashcodeTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ProperCloneImplementationTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ProperCloneImplementationTest.java index caf7485fac..a6f9bbe99a 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ProperCloneImplementationTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ProperCloneImplementationTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ProperCloneImplementationTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ProperLoggerTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ProperLoggerTest.java index e301881e75..602ad8bdd5 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ProperLoggerTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ProperLoggerTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ProperLoggerTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ReturnEmptyCollectionRatherThanNullTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ReturnEmptyCollectionRatherThanNullTest.java index 88dc7a7593..499e6d6728 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ReturnEmptyCollectionRatherThanNullTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ReturnEmptyCollectionRatherThanNullTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ReturnEmptyCollectionRatherThanNullTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ReturnFromFinallyBlockTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ReturnFromFinallyBlockTest.java index 3a53638de2..b3e87a6011 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ReturnFromFinallyBlockTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ReturnFromFinallyBlockTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ReturnFromFinallyBlockTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SimpleDateFormatNeedsLocaleTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SimpleDateFormatNeedsLocaleTest.java index efe247e0c8..51199fb499 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SimpleDateFormatNeedsLocaleTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SimpleDateFormatNeedsLocaleTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class SimpleDateFormatNeedsLocaleTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SingleMethodSingletonTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SingleMethodSingletonTest.java index ff818721ae..e77ffe6cb0 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SingleMethodSingletonTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SingleMethodSingletonTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class SingleMethodSingletonTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SingletonClassReturningNewInstanceTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SingletonClassReturningNewInstanceTest.java index 838a2b4cd6..2b178c9b72 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SingletonClassReturningNewInstanceTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SingletonClassReturningNewInstanceTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class SingletonClassReturningNewInstanceTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/StaticEJBFieldShouldBeFinalTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/StaticEJBFieldShouldBeFinalTest.java index cfabdd6c67..0b3916d131 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/StaticEJBFieldShouldBeFinalTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/StaticEJBFieldShouldBeFinalTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class StaticEJBFieldShouldBeFinalTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/StringBufferInstantiationWithCharTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/StringBufferInstantiationWithCharTest.java index 60250e0167..f33dfcfd38 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/StringBufferInstantiationWithCharTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/StringBufferInstantiationWithCharTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class StringBufferInstantiationWithCharTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SuspiciousEqualsMethodNameTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SuspiciousEqualsMethodNameTest.java index 9536facef4..0193d8d266 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SuspiciousEqualsMethodNameTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SuspiciousEqualsMethodNameTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class SuspiciousEqualsMethodNameTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SuspiciousHashcodeMethodNameTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SuspiciousHashcodeMethodNameTest.java index 9d234b5800..6e341e0ebd 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SuspiciousHashcodeMethodNameTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SuspiciousHashcodeMethodNameTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class SuspiciousHashcodeMethodNameTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SuspiciousOctalEscapeTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SuspiciousOctalEscapeTest.java index 36a97b83ba..5c17a20755 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SuspiciousOctalEscapeTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SuspiciousOctalEscapeTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class SuspiciousOctalEscapeTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/TestClassWithoutTestCasesTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/TestClassWithoutTestCasesTest.java index 39f0f4fc47..b0a4edebce 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/TestClassWithoutTestCasesTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/TestClassWithoutTestCasesTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class TestClassWithoutTestCasesTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnconditionalIfStatementTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnconditionalIfStatementTest.java index e9fb6da5a1..6485314b6c 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnconditionalIfStatementTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnconditionalIfStatementTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnconditionalIfStatementTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnnecessaryBooleanAssertionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnnecessaryBooleanAssertionTest.java index e652838fc1..87621208a9 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnnecessaryBooleanAssertionTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnnecessaryBooleanAssertionTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnnecessaryBooleanAssertionTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnnecessaryCaseChangeTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnnecessaryCaseChangeTest.java index c2e0d37c4c..1a39ba29be 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnnecessaryCaseChangeTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnnecessaryCaseChangeTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnnecessaryCaseChangeTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnnecessaryConversionTemporaryTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnnecessaryConversionTemporaryTest.java index 4a08348e6b..54dfa6fc6c 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnnecessaryConversionTemporaryTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnnecessaryConversionTemporaryTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnnecessaryConversionTemporaryTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnusedNullCheckInEqualsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnusedNullCheckInEqualsTest.java index eaea9ff7e5..03383eca02 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnusedNullCheckInEqualsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnusedNullCheckInEqualsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnusedNullCheckInEqualsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UseCorrectExceptionLoggingTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UseCorrectExceptionLoggingTest.java index 8c735a1623..deda76b27e 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UseCorrectExceptionLoggingTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UseCorrectExceptionLoggingTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UseCorrectExceptionLoggingTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UseEqualsToCompareStringsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UseEqualsToCompareStringsTest.java index cca09e5922..482ed8de75 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UseEqualsToCompareStringsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UseEqualsToCompareStringsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UseEqualsToCompareStringsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UseLocaleWithCaseConversionsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UseLocaleWithCaseConversionsTest.java index 7c000a37b2..d592198d36 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UseLocaleWithCaseConversionsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UseLocaleWithCaseConversionsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UseLocaleWithCaseConversionsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UseProperClassLoaderTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UseProperClassLoaderTest.java index 7c968906b3..c310e27248 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UseProperClassLoaderTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UseProperClassLoaderTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UseProperClassLoaderTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UselessOperationOnImmutableTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UselessOperationOnImmutableTest.java index cee396363f..eb8596e34e 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UselessOperationOnImmutableTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UselessOperationOnImmutableTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UselessOperationOnImmutableTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/internal/DataflowPassTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/internal/DataflowPassTest.java index 131e1de98e..3fb0c5506d 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/internal/DataflowPassTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/internal/DataflowPassTest.java @@ -23,12 +23,12 @@ class DataflowPassTest extends BaseParserTest { void testSimple() { ASTCompilationUnit ast = java.parseResource( - "/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsInEnhancedFor.java", - "20-preview" + "/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatterns.java", + "21" ); DataflowResult dataflow = DataflowPass.getDataflowResult(ast); - assertThat(dataflow.getUnusedAssignments(), Matchers.hasSize(2)); + assertThat(dataflow.getUnusedAssignments(), Matchers.hasSize(0)); } diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/AvoidSynchronizedAtMethodLevelTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/AvoidSynchronizedAtMethodLevelTest.java index 5552da8928..dd623cd341 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/AvoidSynchronizedAtMethodLevelTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/AvoidSynchronizedAtMethodLevelTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.multithreading; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidSynchronizedAtMethodLevelTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/AvoidThreadGroupTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/AvoidThreadGroupTest.java index 322be8e579..0c06cbd520 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/AvoidThreadGroupTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/AvoidThreadGroupTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.multithreading; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidThreadGroupTest extends PmdRuleTst { // Used by AvoidThreadGroup test cases diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/AvoidUsingVolatileTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/AvoidUsingVolatileTest.java index 76a2a33966..5b34e87a17 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/AvoidUsingVolatileTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/AvoidUsingVolatileTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.multithreading; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidUsingVolatileTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/DoNotUseThreadsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/DoNotUseThreadsTest.java index a1ee5cbb12..dc8b383e6b 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/DoNotUseThreadsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/DoNotUseThreadsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.multithreading; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class DoNotUseThreadsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/DontCallThreadRunTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/DontCallThreadRunTest.java index 6c19a37681..53120d9528 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/DontCallThreadRunTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/DontCallThreadRunTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.multithreading; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class DontCallThreadRunTest extends PmdRuleTst { // Used by DontCallThreadRun test cases diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/DoubleCheckedLockingTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/DoubleCheckedLockingTest.java index 2dd1f220dc..903ad31b5f 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/DoubleCheckedLockingTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/DoubleCheckedLockingTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.multithreading; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class DoubleCheckedLockingTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/NonThreadSafeSingletonTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/NonThreadSafeSingletonTest.java index 5de60a32d9..b3ff3d7dba 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/NonThreadSafeSingletonTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/NonThreadSafeSingletonTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.multithreading; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class NonThreadSafeSingletonTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/UnsynchronizedStaticFormatterTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/UnsynchronizedStaticFormatterTest.java index 6581d6ae33..0d3f1cbd57 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/UnsynchronizedStaticFormatterTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/UnsynchronizedStaticFormatterTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.multithreading; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnsynchronizedStaticFormatterTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/UseConcurrentHashMapTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/UseConcurrentHashMapTest.java index 30b6abe091..2959aeaee6 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/UseConcurrentHashMapTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/UseConcurrentHashMapTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.multithreading; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UseConcurrentHashMapTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/UseNotifyAllInsteadOfNotifyTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/UseNotifyAllInsteadOfNotifyTest.java index d9c2cde3f2..5a93c3355b 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/UseNotifyAllInsteadOfNotifyTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/UseNotifyAllInsteadOfNotifyTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.multithreading; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UseNotifyAllInsteadOfNotifyTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AddEmptyStringTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AddEmptyStringTest.java index 6d774c1f03..37fddac850 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AddEmptyStringTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AddEmptyStringTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AddEmptyStringTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AppendCharacterWithCharTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AppendCharacterWithCharTest.java index b2def502e2..46ece8b851 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AppendCharacterWithCharTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AppendCharacterWithCharTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AppendCharacterWithCharTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AvoidArrayLoopsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AvoidArrayLoopsTest.java index 9dc04979f6..a0bca3e5f5 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AvoidArrayLoopsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AvoidArrayLoopsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidArrayLoopsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AvoidCalendarDateCreationTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AvoidCalendarDateCreationTest.java index c065428ce7..dfbab65527 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AvoidCalendarDateCreationTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AvoidCalendarDateCreationTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidCalendarDateCreationTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AvoidFileStreamTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AvoidFileStreamTest.java index 1fb6565a3b..5df006ff24 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AvoidFileStreamTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AvoidFileStreamTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidFileStreamTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AvoidInstantiatingObjectsInLoopsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AvoidInstantiatingObjectsInLoopsTest.java index 88ebdd345a..852c358a13 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AvoidInstantiatingObjectsInLoopsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AvoidInstantiatingObjectsInLoopsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidInstantiatingObjectsInLoopsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/BigIntegerInstantiationTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/BigIntegerInstantiationTest.java index 08343bb36d..61670a7828 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/BigIntegerInstantiationTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/BigIntegerInstantiationTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class BigIntegerInstantiationTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/ConsecutiveAppendsShouldReuseTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/ConsecutiveAppendsShouldReuseTest.java index 9a15a27b88..d0579e70f7 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/ConsecutiveAppendsShouldReuseTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/ConsecutiveAppendsShouldReuseTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ConsecutiveAppendsShouldReuseTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/ConsecutiveLiteralAppendsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/ConsecutiveLiteralAppendsTest.java index e93c5fc95f..7c8a188152 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/ConsecutiveLiteralAppendsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/ConsecutiveLiteralAppendsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ConsecutiveLiteralAppendsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/InefficientEmptyStringCheckTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/InefficientEmptyStringCheckTest.java index 223946a1be..480a307698 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/InefficientEmptyStringCheckTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/InefficientEmptyStringCheckTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class InefficientEmptyStringCheckTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/InefficientStringBufferingTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/InefficientStringBufferingTest.java index ff0675aafa..54ffe496af 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/InefficientStringBufferingTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/InefficientStringBufferingTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class InefficientStringBufferingTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/InsufficientStringBufferDeclarationTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/InsufficientStringBufferDeclarationTest.java index 91d0e92985..e98a01ad11 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/InsufficientStringBufferDeclarationTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/InsufficientStringBufferDeclarationTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class InsufficientStringBufferDeclarationTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/OptimizableToArrayCallTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/OptimizableToArrayCallTest.java index d0c1e11209..e5f1e92834 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/OptimizableToArrayCallTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/OptimizableToArrayCallTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class OptimizableToArrayCallTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/RedundantFieldInitializerTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/RedundantFieldInitializerTest.java index d8b57190f4..515a3ea422 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/RedundantFieldInitializerTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/RedundantFieldInitializerTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class RedundantFieldInitializerTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/StringInstantiationTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/StringInstantiationTest.java index 1f0b88431f..893a5a4332 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/StringInstantiationTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/StringInstantiationTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class StringInstantiationTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/StringToStringTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/StringToStringTest.java index 826f9d275f..54ceb4ad7d 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/StringToStringTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/StringToStringTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class StringToStringTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/TooFewBranchesForASwitchStatementTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/TooFewBranchesForASwitchStatementTest.java index 7a34936d2d..3916959a96 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/TooFewBranchesForASwitchStatementTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/TooFewBranchesForASwitchStatementTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class TooFewBranchesForASwitchStatementTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseArrayListInsteadOfVectorTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseArrayListInsteadOfVectorTest.java index 6a6f20f34b..57a489e815 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseArrayListInsteadOfVectorTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseArrayListInsteadOfVectorTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UseArrayListInsteadOfVectorTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseArraysAsListTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseArraysAsListTest.java index 6a8a9908f8..db1b6dc67b 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseArraysAsListTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseArraysAsListTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UseArraysAsListTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseIOStreamsWithApacheCommonsFileItemTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseIOStreamsWithApacheCommonsFileItemTest.java index 6f10cf35c6..53cca44137 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseIOStreamsWithApacheCommonsFileItemTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseIOStreamsWithApacheCommonsFileItemTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UseIOStreamsWithApacheCommonsFileItemTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseIndexOfCharTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseIndexOfCharTest.java index 68837b160e..fdb10da98c 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseIndexOfCharTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseIndexOfCharTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UseIndexOfCharTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseStringBufferForStringAppendsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseStringBufferForStringAppendsTest.java index 1cc6ed59a2..f7b764b30b 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseStringBufferForStringAppendsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseStringBufferForStringAppendsTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UseStringBufferForStringAppendsTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseStringBufferLengthTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseStringBufferLengthTest.java index af3368b481..a79cf05c1a 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseStringBufferLengthTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseStringBufferLengthTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UseStringBufferLengthTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UselessStringValueOfTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UselessStringValueOfTest.java index b18c5b6b9b..4ddf1ee025 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UselessStringValueOfTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UselessStringValueOfTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.performance; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UselessStringValueOfTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/security/HardCodedCryptoKeyTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/security/HardCodedCryptoKeyTest.java index 09046eec59..df2d6542ad 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/security/HardCodedCryptoKeyTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/security/HardCodedCryptoKeyTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.security; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class HardCodedCryptoKeyTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/security/InsecureCryptoIvTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/security/InsecureCryptoIvTest.java index a502887680..019b3e8dd0 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/security/InsecureCryptoIvTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/security/InsecureCryptoIvTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.security; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class InsecureCryptoIvTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/xpath/internal/BaseXPathFunctionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/xpath/internal/BaseXPathFunctionTest.java index d59517e7c3..3f6f6dd9ac 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/xpath/internal/BaseXPathFunctionTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/xpath/internal/BaseXPathFunctionTest.java @@ -15,7 +15,6 @@ import org.checkerframework.checker.nullness.qual.NonNull; import net.sourceforge.pmd.lang.LanguageProcessor; import net.sourceforge.pmd.lang.ast.FileAnalysisException; -import net.sourceforge.pmd.lang.ast.test.TestUtilsKt; import net.sourceforge.pmd.lang.java.BaseParserTest; import net.sourceforge.pmd.lang.java.JavaLanguageModule; import net.sourceforge.pmd.lang.rule.Rule; @@ -23,6 +22,7 @@ import net.sourceforge.pmd.lang.rule.xpath.PmdXPathException; import net.sourceforge.pmd.lang.rule.xpath.PmdXPathException.Phase; import net.sourceforge.pmd.lang.rule.xpath.XPathRule; import net.sourceforge.pmd.lang.rule.xpath.XPathVersion; +import net.sourceforge.pmd.lang.test.ast.TestUtilsKt; import net.sourceforge.pmd.reporting.Report; /** diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/types/TypesTreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/types/TypesTreeDumpTest.java index 597b2526f8..d85783803c 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/types/TypesTreeDumpTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/types/TypesTreeDumpTest.java @@ -10,9 +10,9 @@ import org.checkerframework.checker.nullness.qual.NonNull; import org.junit.jupiter.api.Test; import net.sourceforge.pmd.lang.ast.Node; -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; -import net.sourceforge.pmd.lang.ast.test.BaseTreeDumpTest; -import net.sourceforge.pmd.lang.ast.test.RelevantAttributePrinter; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; +import net.sourceforge.pmd.lang.test.ast.BaseTreeDumpTest; +import net.sourceforge.pmd.lang.test.ast.RelevantAttributePrinter; import net.sourceforge.pmd.lang.java.JavaParsingHelper; import net.sourceforge.pmd.lang.java.ast.ASTAssignableExpr.ASTNamedReferenceExpr; import net.sourceforge.pmd.lang.java.ast.ASTMethodDeclaration; diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTAnnotationTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTAnnotationTest.kt index ef1de16c16..3ee795c82f 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTAnnotationTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTAnnotationTest.kt @@ -5,7 +5,7 @@ package net.sourceforge.pmd.lang.java.ast import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.ast.JavaVersion.Companion.Earliest import net.sourceforge.pmd.lang.java.ast.JavaVersion.Companion.Latest import net.sourceforge.pmd.lang.java.ast.JavaVersion.J1_3 diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTAnonymousClassTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTAnonymousClassTest.kt index 9443e7e55a..d209ba43da 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTAnonymousClassTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTAnonymousClassTest.kt @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.java.ast import io.kotest.matchers.should import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.ast.ModifierOwner.Visibility.V_ANONYMOUS class ASTAnonymousClassTest : ParserTestSpec({ diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTArrayAccessTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTArrayAccessTest.kt index 213d687ab6..a667e208ad 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTArrayAccessTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTArrayAccessTest.kt @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.ast -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe /** * Nodes that previously corresponded to ASTAllocationExpression. diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTArrayAllocationTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTArrayAllocationTest.kt index ba92d24450..b8d6e8502d 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTArrayAllocationTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTArrayAllocationTest.kt @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.ast -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.INT /** diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTArrayTypeTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTArrayTypeTest.kt index 59c17e7482..26f70800ba 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTArrayTypeTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTArrayTypeTest.kt @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.ast -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe /** diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTAssignmentExpressionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTAssignmentExpressionTest.kt index 53c5b73398..8706831bfd 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTAssignmentExpressionTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTAssignmentExpressionTest.kt @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.ast -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.ast.ASTAssignableExpr.AccessType.READ import net.sourceforge.pmd.lang.java.ast.ASTAssignableExpr.AccessType.WRITE import net.sourceforge.pmd.lang.java.ast.AssignmentOp.* diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTCastExpressionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTCastExpressionTest.kt index ed3cb48cea..bf7f77c20a 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTCastExpressionTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTCastExpressionTest.kt @@ -4,10 +4,9 @@ package net.sourceforge.pmd.lang.java.ast -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.ast.JavaVersion.Companion.Earliest import net.sourceforge.pmd.lang.java.ast.JavaVersion.Companion.Latest -import net.sourceforge.pmd.lang.java.ast.ExpressionParsingCtx import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.* class ASTCastExpressionTest : ParserTestSpec({ diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTCatchClauseTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTCatchClauseTest.kt index dbfe402bea..4039461e8e 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTCatchClauseTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTCatchClauseTest.kt @@ -5,7 +5,7 @@ package net.sourceforge.pmd.lang.java.ast import io.kotest.matchers.string.shouldContain -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.ast.JavaVersion.* import net.sourceforge.pmd.lang.java.ast.JavaVersion.Companion.Earliest import net.sourceforge.pmd.lang.java.ast.JavaVersion.Companion.Latest diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTClassDeclarationTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTClassDeclarationTest.kt index bd0919054d..9ca8a75c99 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTClassDeclarationTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTClassDeclarationTest.kt @@ -5,7 +5,7 @@ package net.sourceforge.pmd.lang.java.ast -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe class ASTClassDeclarationTest : ParserTestSpec({ diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTClassLiteralTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTClassLiteralTest.kt index 46f1adbaf9..6a1276e645 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTClassLiteralTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTClassLiteralTest.kt @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.ast -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.* /** diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTConstructorCallTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTConstructorCallTest.kt index fdcb0df4bc..5077fdfa89 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTConstructorCallTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTConstructorCallTest.kt @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.ast -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.ast.ASTAssignableExpr.AccessType.READ class ASTConstructorCallTest : ParserTestSpec({ diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTConstructorDeclarationTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTConstructorDeclarationTest.kt index 8b50566636..aa0d9bc631 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTConstructorDeclarationTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTConstructorDeclarationTest.kt @@ -5,7 +5,7 @@ package net.sourceforge.pmd.lang.java.ast import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.* class ASTConstructorDeclarationTest : ParserTestSpec({ diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTEnumConstantTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTEnumConstantTest.kt index a6dc2550b8..23328aa275 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTEnumConstantTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTEnumConstantTest.kt @@ -7,7 +7,7 @@ package net.sourceforge.pmd.lang.java.ast import io.kotest.matchers.collections.beEmpty import io.kotest.matchers.collections.shouldContainExactly import io.kotest.matchers.should -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.ast.JModifier.* class ASTEnumConstantTest : ParserTestSpec({ diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTExplicitConstructorInvocationTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTExplicitConstructorInvocationTest.kt index a70887f661..2f318c9b2d 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTExplicitConstructorInvocationTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTExplicitConstructorInvocationTest.kt @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.ast -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe class ASTExplicitConstructorInvocationTest : ParserTestSpec({ diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTFieldAccessTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTFieldAccessTest.kt index b259b9c1bc..60571e0731 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTFieldAccessTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTFieldAccessTest.kt @@ -4,15 +4,14 @@ package net.sourceforge.pmd.lang.java.ast -import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe /** * @author Clément Fournier */ class ASTFieldAccessTest : ParserTestSpec({ - parserTest("Field access exprs") { + parserTest("Field access expressions") { inContext(ExpressionParsingCtx) { diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTFieldDeclarationTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTFieldDeclarationTest.kt index 47306a36da..247a1da412 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTFieldDeclarationTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTFieldDeclarationTest.kt @@ -6,8 +6,8 @@ package net.sourceforge.pmd.lang.java.ast import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBe -import net.sourceforge.pmd.lang.ast.test.textOfReportLocation +import net.sourceforge.pmd.lang.test.ast.shouldBe +import net.sourceforge.pmd.lang.test.ast.textOfReportLocation import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.* class ASTFieldDeclarationTest : ParserTestSpec({ diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTInstanceOfExpressionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTInstanceOfExpressionTest.kt index 104328a259..3c3a4682e3 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTInstanceOfExpressionTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTInstanceOfExpressionTest.kt @@ -5,7 +5,7 @@ package net.sourceforge.pmd.lang.java.ast -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind class ASTInstanceOfExpressionTest : ParserTestSpec({ diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLambdaExpressionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLambdaExpressionTest.kt index eb355dda7b..9be4a6400e 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLambdaExpressionTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLambdaExpressionTest.kt @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.ast -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.ast.JavaVersion.Companion.Latest import net.sourceforge.pmd.lang.java.ast.JavaVersion.J1_8 import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.* diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLiteralTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLiteralTest.kt index 233a6a07aa..92d43cdffd 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLiteralTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLiteralTest.kt @@ -5,8 +5,7 @@ package net.sourceforge.pmd.lang.java.ast import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.* -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.ast.JavaVersion.* import net.sourceforge.pmd.lang.java.ast.JavaVersion.Companion.Earliest import net.sourceforge.pmd.lang.java.ast.JavaVersion.Companion.Latest @@ -14,6 +13,9 @@ import net.sourceforge.pmd.lang.java.ast.JavaVersion.Companion.since import net.sourceforge.pmd.lang.java.ast.UnaryOp.UNARY_MINUS import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.* +import net.sourceforge.pmd.lang.test.ast.NodeSpec +import net.sourceforge.pmd.lang.test.ast.ValuedNodeSpec +import net.sourceforge.pmd.lang.test.ast.shouldHaveText /** * @author Clément Fournier diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLocalVariableDeclarationTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLocalVariableDeclarationTest.kt index eeaafcd524..064f8fd8a2 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLocalVariableDeclarationTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLocalVariableDeclarationTest.kt @@ -5,7 +5,7 @@ package net.sourceforge.pmd.lang.java.ast -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.INT class ASTLocalVariableDeclarationTest : ParserTestSpec({ diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodCallTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodCallTest.kt index e22d343589..a08cbf76df 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodCallTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodCallTest.kt @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.ast -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe /** * @author Clément Fournier @@ -13,7 +13,7 @@ import net.sourceforge.pmd.lang.ast.test.shouldBe class ASTMethodCallTest : ParserTestSpec({ - parserTest("Method call exprs") { + parserTest("Method call expressions") { inContext(ExpressionParsingCtx) { diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodDeclarationTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodDeclarationTest.kt index ff47a82431..3702e4b924 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodDeclarationTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodDeclarationTest.kt @@ -7,8 +7,8 @@ package net.sourceforge.pmd.lang.java.ast import io.kotest.matchers.should import io.kotest.matchers.shouldBe import io.kotest.matchers.shouldNot -import net.sourceforge.pmd.lang.ast.test.shouldBe -import net.sourceforge.pmd.lang.ast.test.textOfReportLocation +import net.sourceforge.pmd.lang.test.ast.shouldBe +import net.sourceforge.pmd.lang.test.ast.textOfReportLocation import net.sourceforge.pmd.lang.java.ast.ModifierOwner.Visibility.V_PRIVATE import net.sourceforge.pmd.lang.java.ast.ModifierOwner.Visibility.V_PUBLIC import net.sourceforge.pmd.lang.java.ast.JModifier.* @@ -138,7 +138,7 @@ class ASTMethodDeclarationTest : ParserTestSpec({ } } - // default abstract is an invalid combination of modifiers so we won't encounter it in real analysis + // default abstract is an invalid combination of modifiers, so we won't encounter it in real analysis } parserTest("Throws list") { diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodReferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodReferenceTest.kt index 55ab0f5d51..97791223ea 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodReferenceTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodReferenceTest.kt @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.ast -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.* /** diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTModuleDeclarationTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTModuleDeclarationTest.kt index ec40f586ec..fdce63d865 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTModuleDeclarationTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTModuleDeclarationTest.kt @@ -8,8 +8,8 @@ import com.github.oowekyala.treeutils.matchers.TreeNodeWrapper import io.kotest.matchers.collections.shouldBeEmpty import io.kotest.matchers.shouldBe import net.sourceforge.pmd.lang.ast.Node -import net.sourceforge.pmd.lang.ast.test.NodeSpec -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.NodeSpec +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.ast.JavaVersion.Companion.since import net.sourceforge.pmd.lang.java.ast.JavaVersion.J9 import net.sourceforge.pmd.lang.java.symbols.JClassSymbol diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTPatternTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTPatternTest.kt index 80549663cd..b9ba5114a4 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTPatternTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTPatternTest.kt @@ -5,7 +5,6 @@ package net.sourceforge.pmd.lang.java.ast import io.kotest.matchers.shouldBe -import io.kotest.matchers.shouldNot import net.sourceforge.pmd.lang.java.ast.JavaVersion.J16 import java.io.IOException diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTStatementsTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTStatementsTest.kt index 986d7623bf..a0d0284216 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTStatementsTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTStatementsTest.kt @@ -5,7 +5,7 @@ package net.sourceforge.pmd.lang.java.ast -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.INT class ASTStatementsTest : ParserTestSpec({ diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTSuperExpressionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTSuperExpressionTest.kt index bd2bd9096f..112d98edc6 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTSuperExpressionTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTSuperExpressionTest.kt @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.ast -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe /** * @author Clément Fournier @@ -31,7 +31,7 @@ class ASTSuperExpressionTest : ParserTestSpec({ // a method call, field access, or method reference "super" shouldNot parse() - // type arguments and annots are disallowed on the qualifier + // type arguments and annotations are disallowed on the qualifier "T.B.super::foo" shouldNot parse() "T.B.super.foo()" shouldNot parse() "T.@F B.super.foo()" shouldNot parse() diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTSwitchExpressionTests.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTSwitchExpressionTests.kt index b1be8e2041..0c80b00810 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTSwitchExpressionTests.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTSwitchExpressionTests.kt @@ -5,8 +5,8 @@ package net.sourceforge.pmd.lang.java.ast import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldMatchN +import net.sourceforge.pmd.lang.test.ast.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldMatchN import net.sourceforge.pmd.lang.java.ast.BinaryOp.* import net.sourceforge.pmd.lang.java.ast.JavaVersion.* import net.sourceforge.pmd.lang.java.ast.JavaVersion.Companion.Earliest diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTThisExpressionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTThisExpressionTest.kt index dc49ff18d4..c0654423da 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTThisExpressionTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTThisExpressionTest.kt @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.ast -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe /** * @author Clément Fournier @@ -47,7 +47,7 @@ class ASTThisExpressionTest : ParserTestSpec({ parserTest("Neg cases") { inContext(ExpressionParsingCtx) { - // type arguments and annots are disallowed on the qualifier + // type arguments and annotations are disallowed on the qualifier "T.B.this" shouldNot parse() "T.@F B.this" shouldNot parse() } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTTryStatementTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTTryStatementTest.kt index 091a931fe8..ad2c6a3682 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTTryStatementTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTTryStatementTest.kt @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.ast -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.ast.JavaVersion.Companion.Latest import net.sourceforge.pmd.lang.java.ast.JavaVersion.J1_7 import net.sourceforge.pmd.lang.java.ast.JavaVersion.J9 diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTTypeTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTTypeTest.kt index bee2963f29..71092f20cf 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTTypeTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTTypeTest.kt @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.ast -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe /** * @author Clément Fournier @@ -59,9 +59,9 @@ class ASTTypeTest : ParserTestSpec({ // So @B binds to "java" // If the annotation is not applicable to TYPE_USE then it doesn't compile - // this happens in type context, eg in a cast, or in an extends list + // this happens in type context, e.g. in a cast, or in an extends list - // TYPE_USE annotations are prohibited eg before a declaration + // TYPE_USE annotations are prohibited e.g. before a declaration inContext(TypeParsingCtx) { diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTUnaryExpressionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTUnaryExpressionTest.kt index fd2bb913fc..d13cb2483c 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTUnaryExpressionTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTUnaryExpressionTest.kt @@ -84,7 +84,7 @@ class ASTUnaryExpressionTest : ParserTestSpec({ parserTest("Unary expression ambiguity corner cases") { - // the following cases test ambiguity between cast of unary, and eg parenthesized additive expr + // the following cases test ambiguity between cast of unary, and e.g. parenthesized additive expr // see https://docs.oracle.com/javase/specs/jls/se9/html/jls-15.html#jls-UnaryExpressionNotPlusMinus // comments about ambiguity are below grammar diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTWildcardTypeTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTWildcardTypeTest.kt index 7a30b86ed3..2178115173 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTWildcardTypeTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTWildcardTypeTest.kt @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.ast -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.ast.JavaVersion.Companion.Latest import net.sourceforge.pmd.lang.java.ast.JavaVersion.J1_5 import net.sourceforge.pmd.lang.java.ast.JavaVersion.J1_8 diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ConstValuesKotlinTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ConstValuesKotlinTest.kt index c0457ac822..9c2e147443 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ConstValuesKotlinTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ConstValuesKotlinTest.kt @@ -5,7 +5,7 @@ package net.sourceforge.pmd.lang.java.ast import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBeA +import net.sourceforge.pmd.lang.test.ast.shouldBeA import net.sourceforge.pmd.lang.java.symbols.JFieldSymbol /** diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/Java11Test.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/Java11Test.kt index 8a0e225520..9d621fadfc 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/Java11Test.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/Java11Test.kt @@ -4,11 +4,9 @@ package net.sourceforge.pmd.lang.java.ast -import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBe -import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.ast.JavaVersion.* import net.sourceforge.pmd.lang.java.ast.JavaVersion.Companion.Latest +import net.sourceforge.pmd.lang.test.ast.shouldBe class Java11Test : ParserTestSpec({ diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/Java15KotlinTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/Java15KotlinTest.kt index 1063b8b919..03e2b01cf8 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/Java15KotlinTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/Java15KotlinTest.kt @@ -5,7 +5,7 @@ package net.sourceforge.pmd.lang.java.ast import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe class Java15KotlinTest : ParserTestSpec({ diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/JavaTextAccessTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/JavaTextAccessTest.kt index b11f001382..7609f2a3cc 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/JavaTextAccessTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/JavaTextAccessTest.kt @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.java.ast import io.kotest.matchers.shouldBe import net.sourceforge.pmd.lang.ast.TextAvailableNode -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.* // Use a string for comparison because CharSequence are not necessarily diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/JavaUnicodeEscapesTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/JavaUnicodeEscapesTest.kt index b84c3ba443..88f6225067 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/JavaUnicodeEscapesTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/JavaUnicodeEscapesTest.kt @@ -8,8 +8,8 @@ import io.kotest.assertions.throwables.shouldThrow import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.string.shouldContain import net.sourceforge.pmd.lang.ast.impl.javacc.MalformedSourceException -import net.sourceforge.pmd.lang.ast.test.IntelliMarker -import net.sourceforge.pmd.lang.ast.test.shouldBeA +import net.sourceforge.pmd.lang.test.ast.IntelliMarker +import net.sourceforge.pmd.lang.test.ast.shouldBeA import net.sourceforge.pmd.lang.document.TextDocument import net.sourceforge.pmd.lang.java.JavaParsingHelper diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/KotlinTestingDsl.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/KotlinTestingDsl.kt index 791df7c2a3..c1c97245a6 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/KotlinTestingDsl.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/KotlinTestingDsl.kt @@ -13,10 +13,9 @@ import io.kotest.matchers.Matcher import io.kotest.matchers.MatcherResult import io.kotest.matchers.collections.shouldContainAll import net.sourceforge.pmd.lang.ast.* -import net.sourceforge.pmd.lang.ast.test.* -import net.sourceforge.pmd.lang.java.JavaLanguageModule import net.sourceforge.pmd.lang.java.JavaParsingHelper import net.sourceforge.pmd.lang.java.JavaParsingHelper.* +import net.sourceforge.pmd.lang.test.ast.* import java.beans.PropertyDescriptor import java.io.PrintStream import java.util.* @@ -34,14 +33,13 @@ enum class JavaVersion : Comparable { J17, J18, J19, - J20, J20__PREVIEW, - J21, J21__PREVIEW; + J20, + J21, J21__PREVIEW, + J22, J22__PREVIEW; /** Name suitable for use with e.g. [JavaParsingHelper.parse] */ val pmdName: String = name.removePrefix("J").replaceFirst("__", "-").replace('_', '.').lowercase() - val pmdVersion get() = JavaLanguageModule.getInstance().getVersion(pmdName) - val parser: JavaParsingHelper = DEFAULT.withDefaultVersion(pmdName) operator fun not(): List = values().toList() - this @@ -64,9 +62,9 @@ enum class JavaVersion : Comparable { fun since(v: JavaVersion) = v.rangeTo(Latest) fun except(v1: JavaVersion, vararg versions: JavaVersion) = - values().toList() - v1 - versions + values().toList() - v1 - versions.toSet() - fun except(versions: List) = values().toList() - versions + fun except(versions: List) = values().toList() - versions.toSet() } } @@ -151,8 +149,8 @@ inline fun JavaNode?.shouldMatchNode(ignoreChildren: Boolean * Can be used inside of a [ParserTestSpec] with [ParserTestSpec.parserTest]. * * Parsing contexts allow to parse a string containing only the node you're interested - * in instead of writing up a full class that the parser can handle. See [parseExpression], - * [parseStatement]. + * in instead of writing up a full class that the parser can handle. See [ExpressionParsingCtx], + * [StatementParsingCtx]. * * These are implicitly used by [matchExpr] and [matchStmt], which specify a matcher directly * on the strings, using their type parameter and the info in this test context to parse, find @@ -169,7 +167,7 @@ inline fun JavaNode?.shouldMatchNode(ignoreChildren: Boolean * Import statements in the parsing contexts can be configured by adding types to [importedTypes], * or strings to [otherImports]. * - * Technically the utilities provided by this class may be used outside of [io.kotest.specs.FunSpec]s, + * Technically the utilities provided by this class may be used outside of [io.kotest.core.spec.Spec]s, * e.g. in regular JUnit tests, but I think we should strive to uniformize our testing style, * especially since KotlinTest defines so many. * @@ -224,7 +222,7 @@ open class ParserTestCtx(testScope: TestScope, /** * Places all node parsing contexts inside the declaration of the given class * of the given class. - * It's like you were writing eg expressions inside the class, with the method + * It's like you were writing e.g. expressions inside the class, with the method * declarations around it and all. * * LIMITATIONS: diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ModifiersTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ModifiersTest.kt index b4fcb2c962..3b38656fa6 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ModifiersTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ModifiersTest.kt @@ -5,7 +5,7 @@ package net.sourceforge.pmd.lang.java.ast -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.ast.ModifierOwner.Visibility.* import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.INT diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/NodeParsingCtx.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/NodeParsingCtx.kt index 2bf63f7669..cecc164d17 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/NodeParsingCtx.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/NodeParsingCtx.kt @@ -5,6 +5,7 @@ package net.sourceforge.pmd.lang.java.ast import net.sourceforge.pmd.lang.ast.Node +import net.sourceforge.pmd.lang.ast.ParseException import net.sourceforge.pmd.lang.java.JavaParsingHelper /** @@ -139,7 +140,7 @@ $construct } override fun retrieveNode(acu: ASTCompilationUnit): ASTBodyDeclaration = - acu.typeDeclarations.firstOrThrow().getDeclarations().firstOrThrow() + acu.typeDeclarations.firstOrThrow().declarations.firstOrThrow() } object TopLevelTypeDeclarationParsingCtx : NodeParsingCtx("top-level declaration") { diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ParenthesesTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ParenthesesTest.kt index d5a59df21a..8ada650628 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ParenthesesTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ParenthesesTest.kt @@ -5,7 +5,7 @@ package net.sourceforge.pmd.lang.java.ast import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.INT /** @@ -73,7 +73,7 @@ class ParenthesesTest : ParserTestSpec({ it::getParenthesisDepth shouldBe 2 it::isParenthesized shouldBe true - it.tokenList().map { it.image } shouldBe listOf("(", "(", "a", ")", ")") + it.tokenList().map { token -> token.image } shouldBe listOf("(", "(", "a", ")", ")") } } } @@ -95,7 +95,7 @@ class ParenthesesTest : ParserTestSpec({ it::getParenthesisDepth shouldBe 1 it::isParenthesized shouldBe true - it.tokenList().map { it.image } shouldBe listOf("(", "a", ")") + it.tokenList().map { token -> token.image } shouldBe listOf("(", "a", ")") } } } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ParserTestSpec.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ParserTestSpec.kt index c12f489053..7fd12125b3 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ParserTestSpec.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ParserTestSpec.kt @@ -17,10 +17,10 @@ import io.kotest.core.test.TestType import io.kotest.matchers.Matcher import net.sourceforge.pmd.lang.ast.Node import net.sourceforge.pmd.lang.ast.ParseException -import net.sourceforge.pmd.lang.ast.test.Assertions -import net.sourceforge.pmd.lang.ast.test.IntelliMarker -import net.sourceforge.pmd.lang.ast.test.ValuedNodeSpec -import net.sourceforge.pmd.lang.ast.test.shouldMatchN +import net.sourceforge.pmd.lang.test.ast.Assertions +import net.sourceforge.pmd.lang.test.ast.IntelliMarker +import net.sourceforge.pmd.lang.test.ast.ValuedNodeSpec +import net.sourceforge.pmd.lang.test.ast.shouldMatchN import net.sourceforge.pmd.lang.java.types.JTypeMirror import net.sourceforge.pmd.lang.java.types.TypeDslMixin import net.sourceforge.pmd.lang.java.types.TypeDslOf diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TestExtensions.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TestExtensions.kt index 1759e7c91b..bb3fed6787 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TestExtensions.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TestExtensions.kt @@ -13,9 +13,9 @@ import io.kotest.matchers.shouldNotBe import io.kotest.matchers.types.shouldBeInstanceOf import net.sourceforge.pmd.lang.ast.Node import net.sourceforge.pmd.lang.ast.impl.javacc.JavaccToken -import net.sourceforge.pmd.lang.ast.test.NodeSpec -import net.sourceforge.pmd.lang.ast.test.ValuedNodeSpec -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.NodeSpec +import net.sourceforge.pmd.lang.test.ast.ValuedNodeSpec +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.ast.internal.PrettyPrintingUtil import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.* @@ -256,8 +256,8 @@ fun TreeNodeWrapper.returnStatement(contents: ValuedNodeSpec.forLoop(body: ValuedNodeSpec = { null }) = child { - val body = body() - if (body != null) it::getBody shouldBe body + val expectedBody = body() + if (expectedBody != null) it::getBody shouldBe expectedBody else unspecifiedChildren(it.numChildren) } @@ -280,22 +280,22 @@ fun TreeNodeWrapper.statementExprList(body: NodeSpec.foreachLoop(body: ValuedNodeSpec = { null }) = child { - val body = body() - if (body != null) it::getBody shouldBe body + val expectedBody = body() + if (expectedBody != null) it::getBody shouldBe expectedBody else unspecifiedChildren(it.numChildren) } fun TreeNodeWrapper.doLoop(body: ValuedNodeSpec = { null }) = child { - val body = body() - if (body != null) it::getBody shouldBe body + val expectedBody = body() + if (expectedBody != null) it::getBody shouldBe expectedBody else unspecifiedChildren(it.numChildren) } fun TreeNodeWrapper.whileLoop(body: ValuedNodeSpec = { null }) = child { - val body = body() - if (body != null) it::getBody shouldBe body + val expectedBody = body() + if (expectedBody != null) it::getBody shouldBe expectedBody else unspecifiedChildren(it.numChildren) } @@ -398,7 +398,7 @@ fun TreeNodeWrapper.unionType(contents: NodeSpec = EmptyA contents() } -fun TreeNodeWrapper.voidType() = child() {} +fun TreeNodeWrapper.voidType() = child {} fun TreeNodeWrapper.typeExpr(contents: ValuedNodeSpec) = @@ -425,7 +425,7 @@ fun TreeNodeWrapper.arrayType(contents: NodeSpec = EmptyA fun TreeNodeWrapper.primitiveType(type: PrimitiveTypeKind, assertions: NodeSpec = EmptyAssertions) = child { it::getKind shouldBe type - PrettyPrintingUtil.prettyPrintType(it) shouldBe type.toString(); + PrettyPrintingUtil.prettyPrintType(it) shouldBe type.toString() assertions() } @@ -586,8 +586,8 @@ fun TreeNodeWrapper.switchStmt(assertions: NodeSpec fun TreeNodeWrapper.switchArrow(rhs: ValuedNodeSpec = { null }) = child { - val rhs = rhs() - if (rhs != null) it::getRightHandSide shouldBe rhs + val expectedRhs = rhs() + if (expectedRhs != null) it::getRightHandSide shouldBe expectedRhs else unspecifiedChildren(2) // label + rhs } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TokenUtilsTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TokenUtilsTest.kt index c035c51635..40666304eb 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TokenUtilsTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TokenUtilsTest.kt @@ -9,8 +9,8 @@ import io.kotest.core.spec.style.FunSpec import io.kotest.core.test.TestScope import io.kotest.matchers.shouldBe import net.sourceforge.pmd.lang.ast.impl.javacc.JavaccToken -import net.sourceforge.pmd.lang.ast.test.Assertions -import net.sourceforge.pmd.lang.ast.test.IntelliMarker +import net.sourceforge.pmd.lang.test.ast.Assertions +import net.sourceforge.pmd.lang.test.ast.IntelliMarker /** * @author Clément Fournier diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TypeDisambiguationTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TypeDisambiguationTest.kt index 7cf336cf72..fa37adf86c 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TypeDisambiguationTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TypeDisambiguationTest.kt @@ -8,11 +8,11 @@ import io.kotest.matchers.collections.shouldBeEmpty import io.kotest.matchers.collections.shouldHaveSize import io.kotest.matchers.shouldBe import io.kotest.matchers.types.shouldBeSameInstanceAs -import net.sourceforge.pmd.lang.ast.test.* -import net.sourceforge.pmd.lang.ast.test.shouldBe import net.sourceforge.pmd.lang.java.symbols.JClassSymbol import net.sourceforge.pmd.lang.java.symbols.table.internal.JavaSemanticErrors.* import net.sourceforge.pmd.lang.java.types.JClassType +import net.sourceforge.pmd.lang.test.ast.* +import net.sourceforge.pmd.lang.test.ast.shouldBe import kotlin.test.assertEquals import kotlin.test.assertNull @@ -246,18 +246,18 @@ class TypeDisambiguationTest : ParserTestSpec({ val outerUnresolved = m0.qualifier!! val outerT = outerUnresolved.typeMirror.shouldBeA { - it.symbol.shouldBeA { - it::isUnresolved shouldBe true - it::getSimpleName shouldBe "OuterUnresolved" + it.symbol.shouldBeA { classSymbol -> + classSymbol::isUnresolved shouldBe true + classSymbol::getSimpleName shouldBe "OuterUnresolved" } } val innerT = m0.typeMirror.shouldBeA { it::getEnclosingType shouldBe outerT - it.symbol.shouldBeA { - it::isUnresolved shouldBe true - it::getSimpleName shouldBe "InnerUnresolved" - it.enclosingClass.shouldBeSameInstanceAs(outerT.symbol) + it.symbol.shouldBeA { classSymbol -> + classSymbol::isUnresolved shouldBe true + classSymbol::getSimpleName shouldBe "InnerUnresolved" + classSymbol.enclosingClass.shouldBeSameInstanceAs(outerT.symbol) } } @@ -314,7 +314,7 @@ class TypeDisambiguationTest : ParserTestSpec({ // before all classes of the CU have been visited enableProcessing() - val acu = parser.parse(""" + @Suppress("UNUSED_VARIABLE") val acu = parser.parse(""" package p; import static p.Assert2.*; diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/UsageResolutionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/UsageResolutionTest.kt index bf332c059f..390f485dd3 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/UsageResolutionTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/UsageResolutionTest.kt @@ -8,8 +8,8 @@ import io.kotest.matchers.collections.shouldBeSingleton import io.kotest.matchers.collections.shouldContainExactly import io.kotest.matchers.collections.shouldHaveSize import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBeA +import net.sourceforge.pmd.lang.test.ast.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBeA import net.sourceforge.pmd.lang.java.ast.ASTAssignableExpr.AccessType.WRITE import net.sourceforge.pmd.lang.java.symbols.JFieldSymbol import net.sourceforge.pmd.lang.java.symbols.JFormalParamSymbol @@ -65,13 +65,13 @@ class UsageResolutionTest : ProcessorTestSpec({ p::isRecordComponent shouldBe true p.localUsages.shouldHaveSize(2) p.localUsages[0].shouldBeA { - it.referencedSym!!.shouldBeA { - it.tryGetNode() shouldBe p + it.referencedSym!!.shouldBeA { symbol -> + symbol.tryGetNode() shouldBe p } } p.localUsages[1].shouldBeA { - it.referencedSym!!.shouldBeA { - it.tryGetNode() shouldBe p + it.referencedSym!!.shouldBeA { symbol -> + symbol.tryGetNode() shouldBe p } } } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/VarDisambiguationTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/VarDisambiguationTest.kt index d890ddd97d..56fd0976fd 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/VarDisambiguationTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/VarDisambiguationTest.kt @@ -5,13 +5,12 @@ package net.sourceforge.pmd.lang.java.ast import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBeA -import net.sourceforge.pmd.lang.ast.test.shouldMatchN +import net.sourceforge.pmd.lang.test.ast.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBeA +import net.sourceforge.pmd.lang.test.ast.shouldMatchN import net.sourceforge.pmd.lang.java.JavaParsingHelper import net.sourceforge.pmd.lang.java.symbols.JClassSymbol import net.sourceforge.pmd.lang.java.symbols.JTypeParameterSymbol -import net.sourceforge.pmd.lang.java.symbols.table.internal.JavaSemanticErrors import net.sourceforge.pmd.lang.java.symbols.table.internal.JavaSemanticErrors.* class VarDisambiguationTest : ParserTestSpec({ diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/AstSymbolResolverTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/AstSymbolResolverTest.kt index 2ed8e06068..650033a3f4 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/AstSymbolResolverTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/AstSymbolResolverTest.kt @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.java.symbols.internal import io.kotest.matchers.types.shouldBeSameInstanceAs import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBeA +import net.sourceforge.pmd.lang.test.ast.shouldBeA import net.sourceforge.pmd.lang.java.ast.InternalApiBridge import net.sourceforge.pmd.lang.java.ast.ProcessorTestSpec import net.sourceforge.pmd.lang.java.symbols.JClassSymbol diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/AstSymbolTests.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/AstSymbolTests.kt index cb8c48b9c8..e6a19c4981 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/AstSymbolTests.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/AstSymbolTests.kt @@ -4,16 +4,16 @@ package net.sourceforge.pmd.lang.java.symbols.internal +import io.kotest.matchers.collections.haveSize import io.kotest.matchers.collections.shouldBeEmpty import io.kotest.matchers.collections.shouldHaveSize -import io.kotest.matchers.collections.haveSize import io.kotest.matchers.should import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.* -import net.sourceforge.pmd.lang.ast.test.shouldBe import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.symbols.* import net.sourceforge.pmd.lang.java.types.Substitution +import net.sourceforge.pmd.lang.test.ast.* +import net.sourceforge.pmd.lang.test.ast.shouldBe import java.lang.reflect.Modifier /** @@ -386,7 +386,7 @@ class AstSymbolTests : ParserTestSpec({ val (canonCtor1, canonCtor2) = acu.descendants(ASTRecordComponentList::class.java).toList { it.symbol } val (auxCtor) = acu.descendants(ASTConstructorDeclaration::class.java).toList { it.symbol } val (xAccessor) = acu.descendants(ASTMethodDeclaration::class.java).toList { it.symbol } - val (xComp, yComp, x2Comp, y2Comp, x2Formal) = acu.descendants(ASTVariableId::class.java).toList { it.symbol } + val (xComp, yComp, _, y2Comp, _) = acu.descendants(ASTVariableId::class.java).toList { it.symbol } doTest("should reflect their modifiers") { @@ -550,7 +550,7 @@ class AstSymbolTests : ParserTestSpec({ } // all others are Runnable - (allAnons - anonsWithSuperClass).forEach { + (allAnons - anonsWithSuperClass.toSet()).forEach { it::getSuperclass shouldBe it.typeSystem.OBJECT.symbol it::getSuperInterfaces shouldBe listOf(it.typeSystem.getClassSymbol(Runnable::class.java)) } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/PrimitiveSymbolTests.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/PrimitiveSymbolTests.kt index fae15094cd..81ea2e6c58 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/PrimitiveSymbolTests.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/PrimitiveSymbolTests.kt @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.java.symbols.internal import io.kotest.core.spec.style.WordSpec import io.kotest.matchers.collections.shouldBeEmpty -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.symbols.JAccessibleElementSymbol.PRIMITIVE_PACKAGE import net.sourceforge.pmd.lang.java.symbols.JClassSymbol import net.sourceforge.pmd.lang.java.types.testTypeSystem @@ -17,7 +17,7 @@ import net.sourceforge.pmd.lang.java.types.testTypeSystem */ class PrimitiveSymbolTests : WordSpec({ - fun primitives(): List = testTypeSystem.allPrimitives.map { it.symbol!! } + fun primitives(): List = testTypeSystem.allPrimitives.map { it.symbol } "A primitive symbol" should { diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/ReflectedClassSymbolTests.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/ReflectedClassSymbolTests.kt index 5051b1396e..198e9eff07 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/ReflectedClassSymbolTests.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/ReflectedClassSymbolTests.kt @@ -7,8 +7,8 @@ package net.sourceforge.pmd.lang.java.symbols.internal import io.kotest.core.spec.style.WordSpec import io.kotest.matchers.shouldBe import io.kotest.property.checkAll -import net.sourceforge.pmd.lang.ast.test.IntelliMarker -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.IntelliMarker +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.types.testTypeSystem /** @@ -40,7 +40,7 @@ class ReflectedClassSymbolTests : IntelliMarker, WordSpec({ "reflect its superinterfaces correctly" { TestClassesGen.forAllEqual { - classSym(it)!!.superInterfaces to it.interfaces.toList().map { classSym(it) } + classSym(it)!!.superInterfaces to it.interfaces.toList().map { clazz -> classSym(clazz) } } } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/ReflectedFieldSymbolTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/ReflectedFieldSymbolTest.kt index bf09835375..6c94586930 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/ReflectedFieldSymbolTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/ReflectedFieldSymbolTest.kt @@ -6,12 +6,13 @@ package net.sourceforge.pmd.lang.java.symbols.internal import io.kotest.assertions.throwables.shouldThrow import io.kotest.core.spec.style.WordSpec +import io.kotest.matchers.ints.shouldBeExactly import io.kotest.matchers.shouldBe import io.kotest.matchers.shouldNotBe import io.kotest.property.arbitrary.filterNot import javasymbols.testdata.impls.IdenticalToSomeFields import javasymbols.testdata.impls.SomeFields -import net.sourceforge.pmd.lang.ast.test.IntelliMarker +import net.sourceforge.pmd.lang.test.ast.IntelliMarker /** * @author Clément Fournier @@ -39,8 +40,8 @@ class ReflectedFieldSymbolTest : IntelliMarker, WordSpec({ "reflect its modifiers properly" { TestClassesGen.filterNot { it.isArray }.forAllEqual { Pair( - classSym(it)!!.declaredFields.map { it.simpleName to it.modifiers }, - it.declaredFields.map { it.name to it.modifiers } + classSym(it)!!.declaredFields.map { fieldSymbol -> fieldSymbol.simpleName to fieldSymbol.modifiers }, + it.declaredFields.map { field -> field.name to field.modifiers } ) } } @@ -56,9 +57,14 @@ class ReflectedFieldSymbolTest : IntelliMarker, WordSpec({ } "be unmodifiable" { - shouldThrow { - classSym(SomeFields::class.java)!!.getDeclaredField("foo")!!.declaredAnnotations.add(null) - } + val declaredAnnotations = classSym(SomeFields::class.java)!!.getDeclaredField("foo")!!.declaredAnnotations + declaredAnnotations.size shouldBeExactly 1 + val annot = declaredAnnotations.first() + declaredAnnotations.plus(annot) + declaredAnnotations.size shouldBeExactly 1 + + // still unmodified + classSym(SomeFields::class.java)!!.getDeclaredField("foo")!!.declaredAnnotations.size shouldBeExactly 1 } } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/UnresolvedClassTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/UnresolvedClassTest.kt index 86d0561cee..454c33393f 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/UnresolvedClassTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/UnresolvedClassTest.kt @@ -7,8 +7,8 @@ package net.sourceforge.pmd.lang.java.symbols.internal import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.collections.haveSize import io.kotest.matchers.should -import net.sourceforge.pmd.lang.ast.test.IntelliMarker -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.IntelliMarker +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.types.testTypeSystem /** diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/Utils.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/Utils.kt index d83b1cafbc..549db7c9e8 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/Utils.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/Utils.kt @@ -8,7 +8,6 @@ import io.kotest.assertions.withClue import io.kotest.matchers.collections.haveSize import io.kotest.matchers.should import io.kotest.property.* -import io.kotest.property.arbitrary.arbitrary import net.sourceforge.pmd.lang.java.symbols.JClassSymbol import net.sourceforge.pmd.lang.java.symbols.SymbolResolver import net.sourceforge.pmd.lang.java.types.testTypeSystem @@ -80,7 +79,7 @@ object TestClassesGen : Arb>() { return } val files = directory.listFiles() - for (file in files) { + for (file in files!!) { if (file.isDirectory) { assert(!file.name.contains(".")) findClasses(file, packageName + "." + file.name) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/AsmLoaderTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/AsmLoaderTest.kt index a89096feb6..4ffcc088cd 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/AsmLoaderTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/AsmLoaderTest.kt @@ -20,8 +20,8 @@ import javasymbols.testdata.deep.AClassWithLocals import javasymbols.testdata.deep.`Another$ClassWith$Dollar` import javasymbols.testdata.deep.OuterWithoutDollar import javasymbols.testdata.impls.GenericClass -import net.sourceforge.pmd.lang.ast.test.IntelliMarker -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.IntelliMarker +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.types.testTypeSystem import org.objectweb.asm.Opcodes import kotlin.test.assertSame diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/BrokenClasspathTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/BrokenClasspathTest.kt index 85f988420c..8ef67a8682 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/BrokenClasspathTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/BrokenClasspathTest.kt @@ -9,7 +9,7 @@ import io.kotest.assertions.withClue import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.shouldBe import io.kotest.matchers.shouldNotBe -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.symbols.JClassSymbol import net.sourceforge.pmd.lang.java.types.JClassType import net.sourceforge.pmd.lang.java.types.TypeOps @@ -59,7 +59,7 @@ class BrokenClasspathTest : FunSpec({ // since we're loading things lazily this type hasn't tried to populate its superinterfaces val superItfType = ts.declaration(unresolvedItfSym) as JClassType val subclassType = ts.declaration(subclassSym) as JClassType - val (tvarC, tvarD) = subclassType.formalTypeParams + val (_, tvarD) = subclassType.formalTypeParams // and now since the super interface *type* is parameterized, we'll try to create SuperItf // Except SuperItf is unresolved. diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/NamesTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/NamesTest.kt index 77d0df6cf4..ad89d9715b 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/NamesTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/NamesTest.kt @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.java.symbols.internal.asm import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.IntelliMarker +import net.sourceforge.pmd.lang.test.ast.IntelliMarker class NamesTest : IntelliMarker, FunSpec({ diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/SigParserTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/SigParserTest.kt index 4d16fdc868..723d288eaa 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/SigParserTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/SigParserTest.kt @@ -7,14 +7,12 @@ package net.sourceforge.pmd.lang.java.symbols.internal.asm import io.kotest.assertions.throwables.shouldThrow import io.kotest.assertions.withClue import io.kotest.core.spec.style.FunSpec -import io.kotest.matchers.Matcher import io.kotest.matchers.collections.shouldHaveSize -import io.kotest.matchers.should import io.kotest.matchers.shouldBe import io.kotest.matchers.string.shouldContain import javasymbols.testdata.impls.SomeInnerClasses -import net.sourceforge.pmd.lang.ast.test.IntelliMarker -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.IntelliMarker +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.symbols.JTypeParameterSymbol import net.sourceforge.pmd.lang.java.symbols.internal.asm.GenericSigBase.LazyMethodType import net.sourceforge.pmd.lang.java.symbols.internal.asm.TypeParamsParser.BaseTypeParamsBuilder diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/HeaderScopesTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/HeaderScopesTest.kt index e580ec1ceb..b01f0de42a 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/HeaderScopesTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/HeaderScopesTest.kt @@ -7,8 +7,6 @@ package net.sourceforge.pmd.lang.java.symbols.table.internal import io.kotest.matchers.collections.* -import io.kotest.matchers.maps.shouldBeEmpty -import io.kotest.matchers.maps.shouldContain import io.kotest.matchers.nulls.shouldNotBeNull import io.kotest.matchers.should import io.kotest.matchers.shouldBe @@ -16,8 +14,8 @@ import io.kotest.matchers.shouldNotBe import javasymbols.testdata.StaticNameCollision import javasymbols.testdata.StaticsSuper import javasymbols.testdata.deep.OuterWithoutDollar -import net.sourceforge.pmd.lang.ast.test.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBeA +import net.sourceforge.pmd.lang.test.ast.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBeA import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.symbols.JClassSymbol import net.sourceforge.pmd.lang.java.symbols.JFieldSymbol @@ -252,8 +250,8 @@ class HeaderScopesTest : ProcessorTestSpec({ it.apply { scopeTag shouldBe SINGLE_IMPORT results should haveSize(2) - results.forEach { - it.symbol.enclosingClass.canonicalName shouldBe "javasymbols.testdata.StaticNameCollision" + results.forEach { methodSig -> + methodSig.symbol.enclosingClass.canonicalName shouldBe "javasymbols.testdata.StaticNameCollision" } } @@ -261,8 +259,8 @@ class HeaderScopesTest : ProcessorTestSpec({ it.apply { scopeTag shouldBe IMPORT_ON_DEMAND results should haveSize(2) - results.forEach { - it.symbol.enclosingClass.canonicalName shouldBe "javasymbols.testdata.Statics" + results.forEach { methodSig -> + methodSig.symbol.enclosingClass.canonicalName shouldBe "javasymbols.testdata.Statics" } } } @@ -276,8 +274,8 @@ class HeaderScopesTest : ProcessorTestSpec({ it.apply { scopeTag shouldBe IMPORT_ON_DEMAND results should haveSize(1) - results.forEach { - it.symbol.enclosingClass.canonicalName shouldBe "javasymbols.testdata.Statics" + results.forEach { methodSig -> + methodSig.symbol.enclosingClass.canonicalName shouldBe "javasymbols.testdata.Statics" } } } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/LocalTypeScopesTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/LocalTypeScopesTest.kt index eb874dca5e..1ef96da29e 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/LocalTypeScopesTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/LocalTypeScopesTest.kt @@ -5,7 +5,7 @@ package net.sourceforge.pmd.lang.java.symbols.table.internal import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.types.JClassType import net.sourceforge.pmd.lang.java.types.shouldHaveType @@ -112,7 +112,7 @@ class LocalTypeScopesTest : ParserTestSpec({ } """) - val (foo, inner, other) = + val (foo, inner, _) = acu.descendants(ASTClassDeclaration::class.java).toList() val (insideFoo, insideInner, insideOther) = diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/MemberInheritanceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/MemberInheritanceTest.kt index 47f9947c13..5541e02365 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/MemberInheritanceTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/MemberInheritanceTest.kt @@ -9,10 +9,10 @@ import io.kotest.matchers.collections.shouldBeSingleton import io.kotest.matchers.collections.shouldContainExactly import io.kotest.matchers.collections.shouldHaveSize import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.component6 -import net.sourceforge.pmd.lang.ast.test.component7 -import net.sourceforge.pmd.lang.ast.test.component8 -import net.sourceforge.pmd.lang.ast.test.shouldMatchN +import net.sourceforge.pmd.lang.test.ast.component6 +import net.sourceforge.pmd.lang.test.ast.component7 +import net.sourceforge.pmd.lang.test.ast.component8 +import net.sourceforge.pmd.lang.test.ast.shouldMatchN import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.symbols.table.coreimpl.ShadowChain import net.sourceforge.pmd.lang.java.types.* @@ -261,26 +261,26 @@ class MemberInheritanceTest : ParserTestSpec({ } """) - val (t_Scratch, t_Inner) = + val (typeScratch, typeInner) = acu.descendants(ASTClassDeclaration::class.java).toList { it.typeMirror } val insideFoo = acu.descendants(ASTClassBody::class.java) .crossFindBoundaries().get(2)!! - val `t_Scratch{String}Inner` = with (acu.typeDsl) { - t_Scratch[gen.t_String].selectInner(t_Inner.symbol, emptyList()) + val `typeScratch{String}Inner` = with (acu.typeDsl) { + typeScratch[gen.t_String].selectInner(typeInner.symbol, emptyList()) } insideFoo.symbolTable.types().resolve("Inner").shouldBeSingleton { - it.shouldBe(`t_Scratch{String}Inner`) + it.shouldBe(`typeScratch{String}Inner`) } val typeNode = acu.descendants(ASTClassType::class.java).first { it.simpleName == "Inner" }!! typeNode.shouldMatchN { classType("Inner") { - it shouldHaveType `t_Scratch{String}Inner` + it shouldHaveType `typeScratch{String}Inner` } } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/PatternVarScopingTests.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/PatternVarScopingTests.kt index a87634d1a4..fa253394da 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/PatternVarScopingTests.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/PatternVarScopingTests.kt @@ -5,8 +5,8 @@ package net.sourceforge.pmd.lang.java.symbols.table.internal import io.kotest.assertions.withClue -import net.sourceforge.pmd.lang.ast.test.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBeA +import net.sourceforge.pmd.lang.test.ast.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBeA import net.sourceforge.pmd.lang.java.ast.* /** diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/TypeParamScopingTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/TypeParamScopingTest.kt index a209022c13..0546cc0878 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/TypeParamScopingTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/TypeParamScopingTest.kt @@ -6,8 +6,8 @@ package net.sourceforge.pmd.lang.java.symbols.table.internal import io.kotest.matchers.shouldBe import io.kotest.matchers.types.shouldBeSameInstanceAs -import net.sourceforge.pmd.lang.ast.test.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBeA +import net.sourceforge.pmd.lang.test.ast.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBeA import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.types.JClassType import net.sourceforge.pmd.lang.java.types.JTypeVar diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/Utils.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/Utils.kt index 24875a282d..adf653406d 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/Utils.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/Utils.kt @@ -5,7 +5,7 @@ package net.sourceforge.pmd.lang.java.symbols.table.internal import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBeA +import net.sourceforge.pmd.lang.test.ast.shouldBeA import net.sourceforge.pmd.lang.java.ast.ASTVariableId import net.sourceforge.pmd.lang.java.ast.JavaNode import net.sourceforge.pmd.lang.java.symbols.JFieldSymbol diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/VarScopingTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/VarScopingTest.kt index 2435e576d5..33869571c3 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/VarScopingTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/VarScopingTest.kt @@ -4,17 +4,17 @@ package net.sourceforge.pmd.lang.java.symbols.table.internal -import io.kotest.matchers.should -import io.kotest.matchers.shouldBe import io.kotest.matchers.collections.beEmpty import io.kotest.matchers.collections.shouldBeEmpty -import net.sourceforge.pmd.lang.ast.test.* -import net.sourceforge.pmd.lang.ast.test.shouldBe +import io.kotest.matchers.should +import io.kotest.matchers.shouldBe import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.symbols.JFieldSymbol import net.sourceforge.pmd.lang.java.symbols.JFormalParamSymbol import net.sourceforge.pmd.lang.java.symbols.JLocalVariableSymbol import net.sourceforge.pmd.lang.java.types.shouldHaveType +import net.sourceforge.pmd.lang.test.ast.* +import net.sourceforge.pmd.lang.test.ast.shouldBe import java.lang.reflect.Modifier @Suppress("UNUSED_VARIABLE") @@ -426,7 +426,7 @@ class VarScopingTest : ProcessorTestSpec({ """.trimIndent()) - val (_, t_SomeEnum) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } + val (_, typeSomeEnum) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } val (enumA, enumB) = acu.descendants(ASTEnumDeclaration::class.java) @@ -443,17 +443,17 @@ class VarScopingTest : ProcessorTestSpec({ qualifiedA.referencedSym shouldBe enumA.symbol qualifiedA.referencedSym!!.tryGetNode() shouldBe enumA - qualifiedA shouldHaveType t_SomeEnum + qualifiedA shouldHaveType typeSomeEnum caseA.referencedSym shouldBe enumA.symbol caseA.referencedSym!!.tryGetNode() shouldBe enumA - caseA shouldHaveType t_SomeEnum + caseA shouldHaveType typeSomeEnum caseB.referencedSym shouldBe enumB.symbol caseB.referencedSym!!.tryGetNode() shouldBe enumB - caseB shouldHaveType t_SomeEnum + caseB shouldHaveType typeSomeEnum - e shouldHaveType t_SomeEnum + e shouldHaveType typeSomeEnum // symbol tables don't carry that info, this is documented on JSymbolTable#variables() caseB.symbolTable.variables().resolve("A").shouldBeEmpty() diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ArraySymbolTests.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ArraySymbolTests.kt index 34d72f2690..5b7fb22063 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ArraySymbolTests.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ArraySymbolTests.kt @@ -6,8 +6,8 @@ package net.sourceforge.pmd.lang.java.types import io.kotest.core.spec.style.WordSpec import io.kotest.matchers.collections.shouldHaveSize -import net.sourceforge.pmd.lang.ast.test.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBeA +import net.sourceforge.pmd.lang.test.ast.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBeA import net.sourceforge.pmd.lang.java.ast.JavaNode import net.sourceforge.pmd.lang.java.symbols.JAccessibleElementSymbol.PRIMITIVE_PACKAGE import net.sourceforge.pmd.lang.java.symbols.JConstructorSymbol @@ -21,7 +21,7 @@ import net.sourceforge.pmd.lang.java.symbols.internal.getDeclaredMethods */ class ArraySymbolTests : WordSpec({ - val INT_SYM = testTypeSystem.getClassSymbol(java.lang.Integer.TYPE) + val INT_SYM = testTypeSystem.getClassSymbol(Integer.TYPE) val STRING_SYM = testTypeSystem.getClassSymbol(java.lang.String::class.java) fun makeArraySym(comp: JTypeDeclSymbol?) = ArraySymbolImpl(testTypeSystem, comp) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/BoxingTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/BoxingTest.kt index f061b0050a..2d0739dda1 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/BoxingTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/BoxingTest.kt @@ -10,7 +10,6 @@ import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.shouldNotBe import io.kotest.matchers.types.shouldBeInstanceOf import io.kotest.matchers.types.shouldBeSameInstanceAs -import io.kotest.property.forAll import net.sourceforge.pmd.lang.java.symbols.internal.forAllEqual /** diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/CaptureTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/CaptureTest.kt index 951f12c671..03125a0a58 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/CaptureTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/CaptureTest.kt @@ -7,7 +7,6 @@ package net.sourceforge.pmd.lang.java.types import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.java.symbols.JClassSymbol import net.sourceforge.pmd.lang.java.symbols.internal.asm.createUnresolvedAsmSymbol import net.sourceforge.pmd.lang.java.types.TypeConversion.* @@ -58,7 +57,7 @@ class CaptureTest : FunSpec({ } test("Capture of malformed types") { - val sym = ts.createUnresolvedAsmSymbol("does.not.Exist") as JClassSymbol + val sym = ts.createUnresolvedAsmSymbol("does.not.Exist") val matcher = captureMatcher(`?` extends t_String).also { capture(sym[t_String, `?` extends t_String]) shouldBe sym[t_String, it] diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ClassTypeImplTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ClassTypeImplTest.kt index 3033056626..0ee4f05858 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ClassTypeImplTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ClassTypeImplTest.kt @@ -7,8 +7,8 @@ package net.sourceforge.pmd.lang.java.types import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.IntelliMarker -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.IntelliMarker +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.symbols.internal.asm.createUnresolvedAsmSymbol /** diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/GlbTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/GlbTest.kt index 95ade83763..0e9f8dff3f 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/GlbTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/GlbTest.kt @@ -10,7 +10,7 @@ import io.kotest.matchers.collections.shouldContainExactly import io.kotest.matchers.nulls.shouldBeNull import io.kotest.matchers.shouldBe import io.kotest.property.checkAll -import net.sourceforge.pmd.lang.ast.test.shouldBeA +import net.sourceforge.pmd.lang.test.ast.shouldBeA import net.sourceforge.pmd.lang.java.symbols.internal.asm.createUnresolvedAsmSymbol /** diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/InnerTypesTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/InnerTypesTest.kt index 2ac7f7d79a..3b9b28c748 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/InnerTypesTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/InnerTypesTest.kt @@ -7,8 +7,8 @@ package net.sourceforge.pmd.lang.java.types import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldMatchN +import net.sourceforge.pmd.lang.test.ast.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldMatchN import net.sourceforge.pmd.lang.java.ast.* class InnerTypesTest : ProcessorTestSpec({ diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/JPrimitiveTypeTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/JPrimitiveTypeTest.kt index d10837f433..2270f70e93 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/JPrimitiveTypeTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/JPrimitiveTypeTest.kt @@ -8,7 +8,7 @@ import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.collections.shouldBeEmpty import io.kotest.matchers.collections.shouldContain import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.IntelliMarker +import net.sourceforge.pmd.lang.test.ast.IntelliMarker import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind /** diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/SpecialTypesTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/SpecialTypesTest.kt index 0379c4ed00..092e03c6bb 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/SpecialTypesTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/SpecialTypesTest.kt @@ -7,8 +7,8 @@ package net.sourceforge.pmd.lang.java.types import io.kotest.assertions.throwables.shouldThrow import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.IntelliMarker -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.IntelliMarker +import net.sourceforge.pmd.lang.test.ast.shouldBe /** */ diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/SubtypingTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/SubtypingTest.kt index 1fdb1affa0..03cfcddb4a 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/SubtypingTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/SubtypingTest.kt @@ -13,9 +13,8 @@ import io.kotest.property.Exhaustive import io.kotest.property.checkAll import io.kotest.property.exhaustive.ints import io.kotest.property.forAll -import net.sourceforge.pmd.lang.ast.test.shouldBeA +import net.sourceforge.pmd.lang.test.ast.shouldBeA import net.sourceforge.pmd.lang.java.ast.ParserTestCtx -import net.sourceforge.pmd.lang.java.symbols.JClassSymbol import net.sourceforge.pmd.lang.java.symbols.internal.UnresolvedClassStore import net.sourceforge.pmd.lang.java.symbols.internal.asm.createUnresolvedAsmSymbol import net.sourceforge.pmd.lang.java.types.TypeConversion.* @@ -157,10 +156,10 @@ class SubtypingTest : FunSpec({ test("Test raw type is convertible to wildcard parameterized type without unchecked conversion") { val `Class{String}` = Class::class[ts.STRING] - val `Class{?}` = Class::class[`?`] + val `Class{Wildcard}` = Class::class[`?`] val Class = Class::class.raw - val `Comparable{?}` = java.lang.Comparable::class[`?`] + val `Comparable{Wildcard}` = java.lang.Comparable::class[`?`] /* Class raw = String.class; @@ -179,15 +178,15 @@ class SubtypingTest : FunSpec({ `Class{String}` shouldBeSubtypeOf Class - `Class{?}` shouldBeSubtypeOf Class + `Class{Wildcard}` shouldBeSubtypeOf Class - `Class{String}` shouldBeSubtypeOf `Class{?}` - `Class{?}` shouldNotBeSubtypeOf `Class{String}` + `Class{String}` shouldBeSubtypeOf `Class{Wildcard}` + `Class{Wildcard}` shouldNotBeSubtypeOf `Class{String}` - assertSubtype(Class, `Class{?}`) { this == UNCHECKED_NO_WARNING } + assertSubtype(Class, `Class{Wildcard}`) { this == UNCHECKED_NO_WARNING } Class shouldBeUncheckedSubtypeOf `Class{String}` - ts.STRING shouldBeSubtypeOf `Comparable{?}` + ts.STRING shouldBeSubtypeOf `Comparable{Wildcard}` } test("Test wildcard subtyping") { @@ -319,7 +318,7 @@ class SubtypingTest : FunSpec({ } test("Test non well-formed types") { - val sym = ts.createUnresolvedAsmSymbol("does.not.Exist") as JClassSymbol + val sym = ts.createUnresolvedAsmSymbol("does.not.Exist") sym[t_String, t_String] shouldBeUnrelatedTo sym[t_String] sym[t_String] shouldBeSubtypeOf sym[t_String] sym[t_String] shouldBeSubtypeOf sym[`?` extends t_String] // containment diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TestUtilitiesForTypes.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TestUtilitiesForTypes.kt index 90482a9828..af662f19e1 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TestUtilitiesForTypes.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TestUtilitiesForTypes.kt @@ -8,18 +8,18 @@ package net.sourceforge.pmd.lang.java.types import io.kotest.assertions.* -import io.kotest.assertions.print.Printed import io.kotest.assertions.print.print import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBeA import net.sourceforge.pmd.lang.java.JavaParsingHelper -import net.sourceforge.pmd.lang.java.ast.* +import net.sourceforge.pmd.lang.java.ast.InvocationNode +import net.sourceforge.pmd.lang.java.ast.TypeNode import net.sourceforge.pmd.lang.java.symbols.internal.asm.AsmSymbolResolver import net.sourceforge.pmd.lang.java.types.TypeOps.* +import net.sourceforge.pmd.lang.test.ast.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBeA import org.hamcrest.Description +import java.util.stream.Collectors import kotlin.String -import kotlin.streams.toList import kotlin.test.assertTrue /* @@ -45,7 +45,7 @@ val TypeSystem.STRING get() = declaration(getClassSymbol(String::class.java)) as typealias TypePair = Pair -fun JTypeMirror.getMethodsByName(name: String) = streamMethods { it.simpleName == name }.toList() +fun JTypeMirror.getMethodsByName(name: String): List = streamMethods { it.simpleName == name }.collect(Collectors.toList()) fun JTypeMirror.shouldBeUnresolvedClass(canonicalName: String) = this.shouldBeA { @@ -225,6 +225,7 @@ val JTypeMirror.isExlusiveIntersectionBound /** * Was added in java 12. */ +@Suppress("UNCHECKED_CAST") val Class.arrayType: Class> get() { val arr = java.lang.reflect.Array.newInstance(this, 0) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeCreationDsl.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeCreationDsl.kt index f274fd9122..e0afd0284a 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeCreationDsl.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeCreationDsl.kt @@ -7,7 +7,6 @@ package net.sourceforge.pmd.lang.java.types import net.sourceforge.pmd.lang.java.ast.JavaNode -import net.sourceforge.pmd.lang.java.ast.ParserTestSpec import net.sourceforge.pmd.lang.java.symbols.JClassSymbol import net.sourceforge.pmd.lang.java.symbols.SymbolicValue.SymAnnot import net.sourceforge.pmd.lang.java.symbols.internal.FakeSymAnnot @@ -26,7 +25,7 @@ val JavaNode.typeDsl get() = TypeDslOf(this.typeSystem) * int[][]: int.toArray(2) * List: List::class[`?` extends Number::class] * - * Use [typeDsl] (eg `with(node.typeDsl) { ... }`, + * Use [typeDsl] (eg `with(node.typeDsl) { ... }`), * or [TypeDslOf] (eg `with(TypeDslOf(ts)) { ... }`) * * to bring it into scope. @@ -125,13 +124,14 @@ interface TypeDslMixin { * List::class[`?` super String::class] * */ + @Suppress("DANGEROUS_CHARACTERS") val `?`: WildcardDsl get() = WildcardDsl(ts) } /** See [TypeDslMixin.@A]. */ -val ParserTestSpec.GroupTestCtx.VersionedTestCtx.ImplicitNodeParsingCtx<*>.AnnotA +val AnnotA get() = "@" + ClassWithTypeAnnotationsInside.A::class.java.canonicalName class TypeDslOf(override val ts: TypeSystem) : TypeDslMixin diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeEqualityTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeEqualityTest.kt index 99e363d56e..439fb9a03e 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeEqualityTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeEqualityTest.kt @@ -10,9 +10,7 @@ import io.kotest.matchers.shouldBe import io.kotest.matchers.shouldNotBe import io.kotest.property.checkAll import io.kotest.property.forAll -import net.sourceforge.pmd.lang.java.symbols.JClassSymbol import net.sourceforge.pmd.lang.java.symbols.internal.asm.createUnresolvedAsmSymbol -import net.sourceforge.pmd.lang.java.symbols.internal.forAllEqual /** * @author Clément Fournier @@ -83,7 +81,7 @@ class TypeEqualityTest : FunSpec({ test("Test non well-formed types") { - val sym = ts.createUnresolvedAsmSymbol("does.not.Exist") as JClassSymbol + val sym = ts.createUnresolvedAsmSymbol("does.not.Exist") // not equal sym[t_String, t_String] shouldNotBe sym[t_String] sym[t_String] shouldNotBe sym[t_String, t_String] diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeGenerationUtil.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeGenerationUtil.kt index 455c7ba3fd..69260414da 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeGenerationUtil.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeGenerationUtil.kt @@ -10,7 +10,9 @@ import io.kotest.property.Arb import io.kotest.property.Exhaustive import io.kotest.property.RandomSource import io.kotest.property.Sample -import io.kotest.property.arbitrary.* +import io.kotest.property.arbitrary.arbitrary +import io.kotest.property.arbitrary.filter +import io.kotest.property.arbitrary.pair import io.kotest.property.exhaustive.exhaustive import net.sourceforge.pmd.lang.java.JavaParsingHelper import net.sourceforge.pmd.lang.java.ast.ASTTypeParameter @@ -18,8 +20,7 @@ import net.sourceforge.pmd.lang.java.ast.ASTTypeParameters import net.sourceforge.pmd.lang.java.ast.ParserTestCtx import net.sourceforge.pmd.lang.java.symbols.internal.TestClassesGen import net.sourceforge.pmd.lang.java.symbols.internal.asm.createUnresolvedAsmSymbol -import javax.lang.model.type.TypeMirror -import kotlin.streams.toList +import java.util.stream.Collectors val TypeSystem.primitiveGen: Exhaustive get() = exhaustive(this.allPrimitives.toList()) @@ -48,7 +49,7 @@ class RefTypeGenArb(val ts: TypeSystem) : Arb() { // we exclude the null type because it's not ok as an array component ts.SERIALIZABLE, ts.CLONEABLE - ); + ) override fun edgecase(rs: RandomSource): JTypeMirror { return allEdgecases.random(rs.random) @@ -105,7 +106,7 @@ class RefTypeGenArb(val ts: TypeSystem) : Arb() { -@Suppress("ObjectPropertyName", "MemberVisibilityCanBePrivate") +@Suppress("MemberVisibilityCanBePrivate", "DANGEROUS_CHARACTERS") class RefTypeConstants(override val ts: TypeSystem) : TypeDslMixin { val t_String: JClassType get() = java.lang.String::class.decl @@ -192,7 +193,7 @@ fun JavaParsingHelper.makeDummyTVars(vararg names: String): List { .toStream() .map { it.typeMirror - }.toList() + }.collect(Collectors.toList()) } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeParamSubstTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeParamSubstTest.kt index 143b993da8..e57b4a7bf4 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeParamSubstTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeParamSubstTest.kt @@ -6,8 +6,8 @@ package net.sourceforge.pmd.lang.java.types import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBeA +import net.sourceforge.pmd.lang.test.ast.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBeA import net.sourceforge.pmd.lang.java.types.testdata.GenericFbound import net.sourceforge.pmd.lang.java.types.testdata.MutualTypeRecursion diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeSystemTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeSystemTest.kt index a0266f33e4..d4cdbb491d 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeSystemTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeSystemTest.kt @@ -13,9 +13,9 @@ import io.kotest.matchers.shouldNot import io.kotest.matchers.shouldNotBe import io.kotest.matchers.types.shouldBeSameInstanceAs import io.kotest.matchers.types.shouldNotBeSameInstanceAs -import net.sourceforge.pmd.lang.ast.test.IntelliMarker -import net.sourceforge.pmd.lang.ast.test.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBeA +import net.sourceforge.pmd.lang.test.ast.IntelliMarker +import net.sourceforge.pmd.lang.test.ast.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBeA import net.sourceforge.pmd.lang.java.ast.ParserTestCtx import net.sourceforge.pmd.lang.java.symbols.JClassSymbol import net.sourceforge.pmd.lang.java.symbols.internal.FakeSymAnnot diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypesFromAstTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypesFromAstTest.kt index 8dbdf6643e..b0a9f22821 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypesFromAstTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypesFromAstTest.kt @@ -5,7 +5,7 @@ package net.sourceforge.pmd.lang.java.types import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldMatchN +import net.sourceforge.pmd.lang.test.ast.shouldMatchN import net.sourceforge.pmd.lang.java.ast.ASTFieldDeclaration import net.sourceforge.pmd.lang.java.ast.ProcessorTestSpec import net.sourceforge.pmd.lang.java.ast.classType diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypesFromReflectionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypesFromReflectionTest.kt index 0e8c5a6cc3..9785fc2669 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypesFromReflectionTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypesFromReflectionTest.kt @@ -90,6 +90,7 @@ class TypesFromReflectionTest : FunSpec({ } + @Suppress("unused") private class GenericKlass /** diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ast/ConversionContextTests.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ast/ConversionContextTests.kt index b17eeae84e..03ae05f13e 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ast/ConversionContextTests.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ast/ConversionContextTests.kt @@ -7,8 +7,8 @@ package net.sourceforge.pmd.lang.java.types.ast import io.kotest.assertions.withClue import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.component6 -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.component6 +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.ast.internal.JavaAstUtils import net.sourceforge.pmd.lang.java.types.STRING @@ -49,7 +49,7 @@ class ConversionContextTests : ProcessorTestSpec({ } """) - val (ternary, _, num1, shortCast, num5) = acu.descendants(ASTExpression::class.java).toList() + val (ternary, _, num1, shortCast, _) = acu.descendants(ASTExpression::class.java).toList() spy.shouldBeOk { // ternary is in double assignment context @@ -80,7 +80,7 @@ class ConversionContextTests : ProcessorTestSpec({ } """) - val (ternary, _, integerCast, nullLit, num4) = acu.descendants(ASTExpression::class.java).toList() + val (ternary, _, integerCast, _, num4) = acu.descendants(ASTExpression::class.java).toList() spy.shouldBeOk { // ternary is in double assignment context diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/AnonCtorsTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/AnonCtorsTest.kt index 0ab0d87cdb..f97495cb6b 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/AnonCtorsTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/AnonCtorsTest.kt @@ -4,9 +4,9 @@ package net.sourceforge.pmd.lang.java.types.internal.infer import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBeA -import net.sourceforge.pmd.lang.ast.test.shouldMatchN +import net.sourceforge.pmd.lang.test.ast.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBeA +import net.sourceforge.pmd.lang.test.ast.shouldMatchN import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.symbols.JConstructorSymbol import net.sourceforge.pmd.lang.java.types.* diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/BranchingExprsTestCases.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/BranchingExprsTestCases.kt index 3810efe856..95374c4359 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/BranchingExprsTestCases.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/BranchingExprsTestCases.kt @@ -4,14 +4,13 @@ package net.sourceforge.pmd.lang.java.types.internal.infer -import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldMatchN import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.types.* import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.DOUBLE import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.INT import net.sourceforge.pmd.lang.java.types.testdata.TypeInferenceTestCases +import net.sourceforge.pmd.lang.test.ast.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldMatchN class BranchingExprsTestCases : ProcessorTestSpec({ diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/CaptureInferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/CaptureInferenceTest.kt index b4f84781af..2255c65e03 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/CaptureInferenceTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/CaptureInferenceTest.kt @@ -5,8 +5,8 @@ package net.sourceforge.pmd.lang.java.types.internal.infer import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldMatchN +import net.sourceforge.pmd.lang.test.ast.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldMatchN import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.types.* import java.util.* @@ -476,7 +476,6 @@ public class SubClass { """.trimIndent() ) - val cvar = acu.typeVar("C") val tvar = acu.typeVar("T") spy.shouldBeOk { diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/CtorInferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/CtorInferenceTest.kt index ce73c75bfb..8719732856 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/CtorInferenceTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/CtorInferenceTest.kt @@ -215,7 +215,7 @@ class CtorInferenceTest : ProcessorTestSpec({ """) - val (t_Outer, t_Inner, t_Scratch) = acu.declaredTypeSignatures() + val (t_Outer, t_Inner, _) = acu.declaredTypeSignatures() val (innerCtor) = acu.ctorDeclarations().toList() val (ctor) = acu.descendants(ASTExplicitConstructorInvocation::class.java).toList() @@ -260,7 +260,7 @@ class CtorInferenceTest : ProcessorTestSpec({ """) - val (t_Outer, t_Inner, t_Scratch) = acu.declaredTypeSignatures() + val (t_Outer, t_Inner, _) = acu.declaredTypeSignatures() val (innerCtor) = acu.ctorDeclarations().toList() val (ctor) = acu.descendants(ASTExplicitConstructorInvocation::class.java).toList() @@ -335,7 +335,7 @@ class CtorInferenceTest : ProcessorTestSpec({ parserTest("Mapping of type params doesn't fail") { - val (acu, spy) = parser.parseWithTypeInferenceSpy( + val (acu, _) = parser.parseWithTypeInferenceSpy( """ class Gen { diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/ExplicitTypesTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/ExplicitTypesTest.kt index 519b73f945..2abcd43a66 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/ExplicitTypesTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/ExplicitTypesTest.kt @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.types.internal.infer -import net.sourceforge.pmd.lang.ast.test.shouldBeA +import net.sourceforge.pmd.lang.test.ast.shouldBeA import net.sourceforge.pmd.lang.java.ast.ASTMethodCall import net.sourceforge.pmd.lang.java.ast.ProcessorTestSpec import net.sourceforge.pmd.lang.java.types.firstMethodCall diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/Java7InferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/Java7InferenceTest.kt index bb2778d52c..d95b755b30 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/Java7InferenceTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/Java7InferenceTest.kt @@ -3,7 +3,7 @@ */ package net.sourceforge.pmd.lang.java.types.internal.infer -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.ast.JavaVersion.* import net.sourceforge.pmd.lang.java.symbols.JConstructorSymbol @@ -193,7 +193,7 @@ class Java7InferenceTest : ProcessorTestSpec({ }) -private fun TypeDslMixin.ctorInfersTo( +private fun ctorInfersTo( call: ASTConstructorCall, inferredType: JClassType ) { @@ -204,7 +204,7 @@ private fun TypeDslMixin.ctorInfersTo( ) } -private fun TypeDslMixin.methodInfersTo(call: ASTMethodCall, returnType: JClassType) { +private fun methodInfersTo(call: ASTMethodCall, returnType: JClassType) { call.methodType.shouldMatchMethod( named = call.methodName, declaredIn = null, // not asserted diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/LambdaInferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/LambdaInferenceTest.kt index 05f5020c71..934ba6e60f 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/LambdaInferenceTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/LambdaInferenceTest.kt @@ -7,12 +7,15 @@ package net.sourceforge.pmd.lang.java.types.internal.infer import io.kotest.assertions.withClue import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.* -import net.sourceforge.pmd.lang.ast.test.shouldBe import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.types.* import net.sourceforge.pmd.lang.java.types.internal.infer.ast.JavaExprMirrors import net.sourceforge.pmd.lang.java.types.testdata.TypeInferenceTestCases +import net.sourceforge.pmd.lang.test.ast.component6 +import net.sourceforge.pmd.lang.test.ast.component7 +import net.sourceforge.pmd.lang.test.ast.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBeA +import net.sourceforge.pmd.lang.test.ast.shouldMatchN import java.util.function.DoubleConsumer import java.util.function.Supplier import kotlin.test.assertEquals diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/LocalVarInferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/LocalVarInferenceTest.kt index 26ee2a054c..46c240cb8e 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/LocalVarInferenceTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/LocalVarInferenceTest.kt @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java.types.internal.infer -import net.sourceforge.pmd.lang.ast.test.shouldMatchN +import net.sourceforge.pmd.lang.test.ast.shouldMatchN import net.sourceforge.pmd.lang.java.ast.ProcessorTestSpec import net.sourceforge.pmd.lang.java.ast.variableAccess import net.sourceforge.pmd.lang.java.types.* diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/MethodRefInferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/MethodRefInferenceTest.kt index 89a7c79b77..70ca35ff47 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/MethodRefInferenceTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/MethodRefInferenceTest.kt @@ -5,10 +5,10 @@ package net.sourceforge.pmd.lang.java.types.internal.infer import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.component6 -import net.sourceforge.pmd.lang.ast.test.component7 -import net.sourceforge.pmd.lang.ast.test.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldMatchN +import net.sourceforge.pmd.lang.test.ast.component6 +import net.sourceforge.pmd.lang.test.ast.component7 +import net.sourceforge.pmd.lang.test.ast.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldMatchN import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.types.* import java.util.* diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverloadResolutionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverloadResolutionTest.kt index 43c5863b97..66c8fedcd6 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverloadResolutionTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverloadResolutionTest.kt @@ -7,8 +7,8 @@ package net.sourceforge.pmd.lang.java.types.internal.infer import io.kotest.matchers.should import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldMatchN +import net.sourceforge.pmd.lang.test.ast.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldMatchN import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.types.* import net.sourceforge.pmd.lang.java.types.testdata.Overloads diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverloadSpecificityTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverloadSpecificityTest.kt index b936f608d5..a84034f07b 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverloadSpecificityTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverloadSpecificityTest.kt @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.java.types.internal.infer import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.types.* import net.sourceforge.pmd.lang.java.types.TypeOps.areOverrideEquivalent diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverridingTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverridingTest.kt index 4265682cfc..c7f41da2b8 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverridingTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverridingTest.kt @@ -10,7 +10,6 @@ import io.kotest.matchers.shouldBe import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.types.* import net.sourceforge.pmd.util.OptionalBool -import org.intellij.lang.annotations.Language import kotlin.test.assertFalse import kotlin.test.assertTrue diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/PolyResolutionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/PolyResolutionTest.kt index 73c4dcc101..6405b99afb 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/PolyResolutionTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/PolyResolutionTest.kt @@ -5,8 +5,8 @@ package net.sourceforge.pmd.lang.java.types.internal.infer -import net.sourceforge.pmd.lang.ast.test.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldMatchN +import net.sourceforge.pmd.lang.test.ast.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldMatchN import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.types.* import java.io.BufferedOutputStream diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/SpecialMethodsTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/SpecialMethodsTest.kt index 05ae0ee19a..12e83452f6 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/SpecialMethodsTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/SpecialMethodsTest.kt @@ -5,12 +5,13 @@ package net.sourceforge.pmd.lang.java.types.internal.infer import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBeA -import net.sourceforge.pmd.lang.ast.test.shouldMatchN +import io.kotest.matchers.shouldNotBe import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.symbols.JConstructorSymbol import net.sourceforge.pmd.lang.java.symbols.JFormalParamSymbol import net.sourceforge.pmd.lang.java.types.* +import net.sourceforge.pmd.lang.test.ast.shouldBeA +import net.sourceforge.pmd.lang.test.ast.shouldMatchN import java.util.function.Supplier /** @@ -44,7 +45,7 @@ class SpecialMethodsTest : ProcessorTestSpec({ val t_Scratch = acu.declaredTypeSignatures()[0] val kvar = acu.typeVar("K") - val (k, k2, raw, call) = acu.methodCalls().toList() + val (k, k2, _, call) = acu.methodCalls().toList() doTest("Test this::getClass") { spy.shouldBeOk { @@ -137,7 +138,7 @@ class SpecialMethodsTest : ProcessorTestSpec({ """.trimIndent()) - val t_Scratch = acu.descendants(ASTTypeDeclaration::class.java).firstOrThrow().typeMirror + acu.descendants(ASTTypeDeclaration::class.java).firstOrThrow().typeMirror shouldNotBe null val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/StandaloneTypesTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/StandaloneTypesTest.kt index 51729be664..e7877f7152 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/StandaloneTypesTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/StandaloneTypesTest.kt @@ -8,16 +8,13 @@ package net.sourceforge.pmd.lang.java.types.internal.infer import io.kotest.assertions.withClue import io.kotest.matchers.shouldBe import io.kotest.matchers.shouldNotBe -import io.kotest.property.arbitrary.filterNot -import io.kotest.property.checkAll -import net.sourceforge.pmd.lang.ast.test.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBeA -import net.sourceforge.pmd.lang.ast.test.shouldMatchN import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.ast.BinaryOp.* import net.sourceforge.pmd.lang.java.types.* import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.* import net.sourceforge.pmd.lang.java.types.testdata.AnnotationWithEnum +import net.sourceforge.pmd.lang.test.ast.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldMatchN class StandaloneTypesTest : ProcessorTestSpec({ diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/StressTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/StressTest.kt index 587e564fd7..1df6c2b657 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/StressTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/StressTest.kt @@ -9,8 +9,8 @@ import com.github.oowekyala.treeutils.matchers.TreeNodeWrapper import io.kotest.matchers.shouldBe import io.kotest.matchers.shouldNotBe import net.sourceforge.pmd.lang.ast.Node -import net.sourceforge.pmd.lang.ast.test.NodeSpec -import net.sourceforge.pmd.lang.ast.test.shouldBeA +import net.sourceforge.pmd.lang.test.ast.NodeSpec +import net.sourceforge.pmd.lang.test.ast.shouldBeA import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.types.JClassType import net.sourceforge.pmd.lang.java.types.shouldHaveType @@ -39,7 +39,7 @@ class StressTest : ProcessorTestSpec({ fun TreeNodeWrapper.typeIs(value: Boolean) { it.typeMirror.shouldBeA { it.symbol.binaryName shouldBe "net.sourceforge.pmd.lang.java.types.testdata.BoolLogic\$${value.toString() - .replaceFirstChar { if (it.isLowerCase()) it.titlecase(Locale.getDefault()) else it.toString() }}" + .replaceFirstChar { char -> if (char.isLowerCase()) char.titlecase(Locale.getDefault()) else char.toString() }}" } } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/TypeAnnotationsInferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/TypeAnnotationsInferenceTest.kt index b43cc4be6f..05ecc933b9 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/TypeAnnotationsInferenceTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/TypeAnnotationsInferenceTest.kt @@ -8,8 +8,6 @@ package net.sourceforge.pmd.lang.java.types.internal.infer import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.types.* -import net.sourceforge.pmd.lang.java.types.internal.infer.TypeInferenceLogger.VerboseLogger -import java.util.* /** */ diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/TypeInferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/TypeInferenceTest.kt index 8a1e246d74..d7965cd569 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/TypeInferenceTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/TypeInferenceTest.kt @@ -7,10 +7,10 @@ package net.sourceforge.pmd.lang.java.types.internal.infer import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.NodeSpec -import net.sourceforge.pmd.lang.ast.test.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBeA -import net.sourceforge.pmd.lang.ast.test.shouldMatchN +import net.sourceforge.pmd.lang.test.ast.NodeSpec +import net.sourceforge.pmd.lang.test.ast.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBeA +import net.sourceforge.pmd.lang.test.ast.shouldMatchN import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.symbols.JConstructorSymbol import net.sourceforge.pmd.lang.java.types.* @@ -248,7 +248,7 @@ class Scratch { } """.trimIndent()) - val (t_I, t_C) = acu.declaredTypeSignatures() + val (_, t_C) = acu.declaredTypeSignatures() val tParam = acu.typeVariables().first { it.name == "T" } spy.shouldBeOk { diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/UncheckedInferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/UncheckedInferenceTest.kt index 058d0f99ab..42c7061581 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/UncheckedInferenceTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/UncheckedInferenceTest.kt @@ -7,7 +7,7 @@ package net.sourceforge.pmd.lang.java.types.internal.infer import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.types.* diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/UnresolvedTypesRecoveryTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/UnresolvedTypesRecoveryTest.kt index 9c2b3e147d..5c4bb7f798 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/UnresolvedTypesRecoveryTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/UnresolvedTypesRecoveryTest.kt @@ -7,8 +7,8 @@ package net.sourceforge.pmd.lang.java.types.internal.infer import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.ast.test.shouldBeA -import net.sourceforge.pmd.lang.ast.test.shouldMatchN +import net.sourceforge.pmd.lang.test.ast.shouldBeA +import net.sourceforge.pmd.lang.test.ast.shouldMatchN import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.symbols.JClassSymbol import net.sourceforge.pmd.lang.java.types.* @@ -261,7 +261,7 @@ class C { val (fooM, idM) = acu.descendants(ASTMethodDeclaration::class.java).toList { it.symbol } val t_Foo = fooM.getReturnType(Substitution.EMPTY).shouldBeUnresolvedClass("ooo.Foo") - val t_Bound = idM.typeParameters[0].upperBound.shouldBeUnresolvedClass("ooo.Bound") + idM.typeParameters[0].upperBound.shouldBeUnresolvedClass("ooo.Bound") val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/ant/classpathtest/ruleset.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ant/classpathtest/ruleset.xml similarity index 100% rename from pmd-java/src/test/resources/net/sourceforge/pmd/ant/classpathtest/ruleset.xml rename to pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ant/classpathtest/ruleset.xml diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/ant/xml/custom_ruleset.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ant/xml/custom_ruleset.xml similarity index 100% rename from pmd-java/src/test/resources/net/sourceforge/pmd/ant/xml/custom_ruleset.xml rename to pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ant/xml/custom_ruleset.xml diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/ant/xml/pmdtasktest.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ant/xml/pmdtasktest.xml similarity index 96% rename from pmd-java/src/test/resources/net/sourceforge/pmd/ant/xml/pmdtasktest.xml rename to pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ant/xml/pmdtasktest.xml index a1abe53864..4378af2f1e 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/ant/xml/pmdtasktest.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ant/xml/pmdtasktest.xml @@ -101,9 +101,7 @@ - - - + diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/PatternMatchingInstanceof.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/PatternMatchingInstanceof.txt index 00d7c929e5..cef1af04e5 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/PatternMatchingInstanceof.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/PatternMatchingInstanceof.txt @@ -33,7 +33,7 @@ | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -85,7 +85,7 @@ | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 1, @Parenthesized = true] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -118,7 +118,7 @@ | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -144,7 +144,7 @@ | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -169,7 +169,7 @@ | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -201,7 +201,7 @@ | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- Annotation[@SimpleName = "Deprecated"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Deprecated"] @@ -235,7 +235,7 @@ | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"] | | | +- Annotation[@SimpleName = "Deprecated"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Deprecated"] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/DealingWithNull.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/DealingWithNull.java deleted file mode 100644 index 69c05218b9..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/DealingWithNull.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -/** - * @see JEP 433: Pattern Matching for switch (Fourth Preview) - */ -public class DealingWithNull { - - static void testFooBar(String s) { - switch (s) { - case null -> System.out.println("Oops"); - case "Foo", "Bar" -> System.out.println("Great"); // CaseConstant - default -> System.out.println("Ok"); - } - } - - static void testStringOrNull(Object o) { - switch (o) { - case String s -> System.out.println("String: " + s); // CasePattern - case null -> System.out.println("null"); - default -> System.out.println("default case"); - } - } - - static void testStringOrDefaultNull(Object o) { - switch (o) { - case String s -> System.out.println("String: " + s); - case null, default -> System.out.println("null or default case"); - } - } - - static void test2(Object o) { - switch (o) { - case null -> throw new NullPointerException(); - case String s -> System.out.println("String: "+s); - case Integer i -> System.out.println("Integer"); - default -> System.out.println("default"); - } - } - - - static void test3(Object o) { - switch(o) { - case null: - System.out.println("null"); - break; // note: fall-through to a CasePattern is not allowed, as the pattern variable is not initialized - case String s: - System.out.println("String"); - break; - default: - System.out.println("default case"); - break; - } - - switch(o) { - case null -> System.out.println("null"); - case String s -> System.out.println("String"); - default -> System.out.println("default case"); - } - - switch(o) { - case null: default: - System.out.println("The rest (including null)"); - } - - switch(o) { - case null, default -> - System.out.println("The rest (including null)"); - } - } - - public static void main(String[] args) { - testStringOrDefaultNull("test"); - test2(2); - try { - test2(null); - } catch (NullPointerException e) { - System.out.println(e); - } - test3(3); - test3("test"); - test3(null); - - testFooBar(null); - testFooBar("Foo"); - testFooBar("Bar"); - testFooBar("baz"); - - testStringOrNull(null); - testStringOrNull("some string"); - } -} diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/DealingWithNull.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/DealingWithNull.txt deleted file mode 100644 index 90ec5a71ab..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/DealingWithNull.txt +++ /dev/null @@ -1,347 +0,0 @@ -+- CompilationUnit[@PackageName = ""] - +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "DealingWithNull", @CanonicalName = "DealingWithNull", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "DealingWithNull", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] - +- ClassBody[@Empty = false, @Size = 6] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testFooBar", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Oops", @Empty = false, @Image = "\"Oops\"", @Length = 4, @LiteralText = "\"Oops\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Foo", @Empty = false, @Image = "\"Foo\"", @Length = 3, @LiteralText = "\"Foo\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Bar", @Empty = false, @Image = "\"Bar\"", @Length = 3, @LiteralText = "\"Bar\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Great", @Empty = false, @Image = "\"Great\"", @Length = 5, @LiteralText = "\"Great\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- SwitchArrowBranch[@Default = true] - | +- SwitchLabel[@Default = true] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Ok", @Empty = false, @Image = "\"Ok\"", @Length = 2, @LiteralText = "\"Ok\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testStringOrNull", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String: ", @Empty = false, @Image = "\"String: \"", @Length = 8, @LiteralText = "\"String: \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "null", @Empty = false, @Image = "\"null\"", @Length = 4, @LiteralText = "\"null\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- SwitchArrowBranch[@Default = true] - | +- SwitchLabel[@Default = true] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "default case", @Empty = false, @Image = "\"default case\"", @Length = 12, @LiteralText = "\"default case\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testStringOrDefaultNull", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String: ", @Empty = false, @Image = "\"String: \"", @Length = 8, @LiteralText = "\"String: \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchArrowBranch[@Default = true] - | +- SwitchLabel[@Default = true] - | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "null or default case", @Empty = false, @Image = "\"null or default case\"", @Length = 20, @LiteralText = "\"null or default case\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "test2", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ThrowStatement[] - | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "NullPointerException"] - | | +- ArgumentList[@Empty = true, @Size = 0] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String: ", @Empty = false, @Image = "\"String: \"", @Length = 8, @LiteralText = "\"String: \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Integer", @Empty = false, @Image = "\"Integer\"", @Length = 7, @LiteralText = "\"Integer\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- SwitchArrowBranch[@Default = true] - | +- SwitchLabel[@Default = true] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "default", @Empty = false, @Image = "\"default\"", @Length = 7, @LiteralText = "\"default\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "test3", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 4, @containsComment = false] - | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- SwitchFallthroughBranch[@Default = false] - | | | +- SwitchLabel[@Default = false] - | | | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ExpressionStatement[] - | | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "null", @Empty = false, @Image = "\"null\"", @Length = 4, @LiteralText = "\"null\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | | +- BreakStatement[@Label = null] - | | +- SwitchFallthroughBranch[@Default = false] - | | | +- SwitchLabel[@Default = false] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ExpressionStatement[] - | | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String", @Empty = false, @Image = "\"String\"", @Length = 6, @LiteralText = "\"String\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | | +- BreakStatement[@Label = null] - | | +- SwitchFallthroughBranch[@Default = true] - | | +- SwitchLabel[@Default = true] - | | +- ExpressionStatement[] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "default case", @Empty = false, @Image = "\"default case\"", @Length = 12, @LiteralText = "\"default case\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- BreakStatement[@Label = null] - | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- SwitchArrowBranch[@Default = false] - | | | +- SwitchLabel[@Default = false] - | | | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "null", @Empty = false, @Image = "\"null\"", @Length = 4, @LiteralText = "\"null\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- SwitchArrowBranch[@Default = false] - | | | +- SwitchLabel[@Default = false] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String", @Empty = false, @Image = "\"String\"", @Length = 6, @LiteralText = "\"String\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- SwitchArrowBranch[@Default = true] - | | +- SwitchLabel[@Default = true] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "default case", @Empty = false, @Image = "\"default case\"", @Length = 12, @LiteralText = "\"default case\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- SwitchFallthroughBranch[@Default = false] - | | | +- SwitchLabel[@Default = false] - | | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- SwitchFallthroughBranch[@Default = true] - | | +- SwitchLabel[@Default = true] - | | +- ExpressionStatement[] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "The rest (including null)", @Empty = false, @Image = "\"The rest (including null)\"", @Length = 25, @LiteralText = "\"The rest (including null)\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchArrowBranch[@Default = true] - | +- SwitchLabel[@Default = true] - | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "The rest (including null)", @Empty = false, @Image = "\"The rest (including null)\"", @Length = 25, @LiteralText = "\"The rest (including null)\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] - +- VoidType[] - +- FormalParameters[@Empty = false, @Size = 1] - | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- ArrayType[@ArrayDepth = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- ArrayDimensions[@Empty = false, @Size = 1] - | | +- ArrayTypeDim[@Varargs = false] - | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - +- Block[@Empty = false, @Size = 12, @containsComment = false] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "testStringOrDefaultNull", @MethodName = "testStringOrDefaultNull", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "test", @Empty = false, @Image = "\"test\"", @Length = 4, @LiteralText = "\"test\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "test2", @MethodName = "test2", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] - +- TryStatement[@TryWithResources = false] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | | +- ExpressionStatement[] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "test2", @MethodName = "test2", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] - | +- CatchClause[] - | +- CatchParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Multicatch = false, @Name = "e", @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "NullPointerException"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "e", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "e", @Name = "e", @ParenthesisDepth = 0, @Parenthesized = false] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "test3", @MethodName = "test3", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LiteralText = "3", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "test3", @MethodName = "test3", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "test", @Empty = false, @Image = "\"test\"", @Length = 4, @LiteralText = "\"test\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "test3", @MethodName = "test3", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "testFooBar", @MethodName = "testFooBar", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "testFooBar", @MethodName = "testFooBar", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Foo", @Empty = false, @Image = "\"Foo\"", @Length = 3, @LiteralText = "\"Foo\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "testFooBar", @MethodName = "testFooBar", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Bar", @Empty = false, @Image = "\"Bar\"", @Length = 3, @LiteralText = "\"Bar\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "testFooBar", @MethodName = "testFooBar", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "baz", @Empty = false, @Image = "\"baz\"", @Length = 3, @LiteralText = "\"baz\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "testStringOrNull", @MethodName = "testStringOrNull", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] - +- ExpressionStatement[] - +- MethodCall[@CompileTimeConstant = false, @Image = "testStringOrNull", @MethodName = "testStringOrNull", @ParenthesisDepth = 0, @Parenthesized = false] - +- ArgumentList[@Empty = false, @Size = 1] - +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "some string", @Empty = false, @Image = "\"some string\"", @Length = 11, @LiteralText = "\"some string\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/EnhancedTypeCheckingSwitch.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/EnhancedTypeCheckingSwitch.java deleted file mode 100644 index ed3951e62e..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/EnhancedTypeCheckingSwitch.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -/** - * @see JEP 433: Pattern Matching for switch (Fourth Preview) - */ -public class EnhancedTypeCheckingSwitch { - - - static void typeTester(Object o) { - switch (o) { - case null -> System.out.println("null"); - case String s -> System.out.println("String"); - case Color c -> System.out.println("Color with " + c.values().length + " values"); - case Point p -> System.out.println("Record class: " + p.toString()); - case int[] ia -> System.out.println("Array of ints of length " + ia.length); - default -> System.out.println("Something else"); - } - } - - public static void main(String[] args) { - Object o = "test"; - typeTester(o); - typeTester(Color.BLUE); - - o = new int[] {1, 2, 3, 4}; - typeTester(o); - - o = new Point(7, 8); - typeTester(o); - - o = new Object(); - typeTester(o); - } -} - -record Point(int i, int j) {} -enum Color { RED, GREEN, BLUE; } diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/EnhancedTypeCheckingSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/EnhancedTypeCheckingSwitch.txt deleted file mode 100644 index 00c467d2ef..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/EnhancedTypeCheckingSwitch.txt +++ /dev/null @@ -1,188 +0,0 @@ -+- CompilationUnit[@PackageName = ""] - +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "EnhancedTypeCheckingSwitch", @CanonicalName = "EnhancedTypeCheckingSwitch", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "EnhancedTypeCheckingSwitch", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] - | +- ClassBody[@Empty = false, @Size = 2] - | +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "typeTester", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | | +- VoidType[] - | | +- FormalParameters[@Empty = false, @Size = 1] - | | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- SwitchArrowBranch[@Default = false] - | | | +- SwitchLabel[@Default = false] - | | | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "null", @Empty = false, @Image = "\"null\"", @Length = 4, @LiteralText = "\"null\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- SwitchArrowBranch[@Default = false] - | | | +- SwitchLabel[@Default = false] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String", @Empty = false, @Image = "\"String\"", @Length = 6, @LiteralText = "\"String\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- SwitchArrowBranch[@Default = false] - | | | +- SwitchLabel[@Default = false] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Color with ", @Empty = false, @Image = "\"Color with \"", @Length = 11, @LiteralText = "\"Color with \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "length", @Name = "length", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- MethodCall[@CompileTimeConstant = false, @Image = "values", @MethodName = "values", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ArgumentList[@Empty = true, @Size = 0] - | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = " values", @Empty = false, @Image = "\" values\"", @Length = 7, @LiteralText = "\" values\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- SwitchArrowBranch[@Default = false] - | | | +- SwitchLabel[@Default = false] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Record class: ", @Empty = false, @Image = "\"Record class: \"", @Length = 14, @LiteralText = "\"Record class: \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "toString", @MethodName = "toString", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "p", @Name = "p", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ArgumentList[@Empty = true, @Size = 0] - | | +- SwitchArrowBranch[@Default = false] - | | | +- SwitchLabel[@Default = false] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | | +- ArrayType[@ArrayDepth = 1] - | | | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | | | | +- ArrayDimensions[@Empty = false, @Size = 1] - | | | | | +- ArrayTypeDim[@Varargs = false] - | | | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "ia", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Array of ints of length ", @Empty = false, @Image = "\"Array of ints of length \"", @Length = 24, @LiteralText = "\"Array of ints of length \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "length", @Name = "length", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "ia", @Name = "ia", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- SwitchArrowBranch[@Default = true] - | | +- SwitchLabel[@Default = true] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Something else", @Empty = false, @Image = "\"Something else\"", @Length = 14, @LiteralText = "\"Something else\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ArrayType[@ArrayDepth = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- ArrayDimensions[@Empty = false, @Size = 1] - | | | +- ArrayTypeDim[@Varargs = false] - | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 9, @containsComment = false] - | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableDeclarator[@Initializer = true, @Name = "o"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "test", @Empty = false, @Image = "\"test\"", @Length = 4, @LiteralText = "\"test\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- ExpressionStatement[] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "typeTester", @MethodName = "typeTester", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ExpressionStatement[] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "typeTester", @MethodName = "typeTester", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "BLUE", @Name = "BLUE", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] - | +- ExpressionStatement[] - | | +- AssignmentExpression[@CompileTimeConstant = false, @Compound = false, @Operator = AssignmentOp.ASSIGN, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ArrayAllocation[@ArrayDepth = 1, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ArrayType[@ArrayDepth = 1] - | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | | +- ArrayDimensions[@Empty = false, @Size = 1] - | | | +- ArrayTypeDim[@Varargs = false] - | | +- ArrayInitializer[@CompileTimeConstant = false, @Length = 4, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] - | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] - | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LiteralText = "3", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3] - | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "4", @IntLiteral = true, @Integral = true, @LiteralText = "4", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 4.0, @ValueAsFloat = 4.0, @ValueAsInt = 4, @ValueAsLong = 4] - | +- ExpressionStatement[] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "typeTester", @MethodName = "typeTester", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ExpressionStatement[] - | | +- AssignmentExpression[@CompileTimeConstant = false, @Compound = false, @Operator = AssignmentOp.ASSIGN, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] - | | +- ArgumentList[@Empty = false, @Size = 2] - | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "7", @IntLiteral = true, @Integral = true, @LiteralText = "7", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 7.0, @ValueAsFloat = 7.0, @ValueAsInt = 7, @ValueAsLong = 7] - | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "8", @IntLiteral = true, @Integral = true, @LiteralText = "8", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 8.0, @ValueAsFloat = 8.0, @ValueAsInt = 8, @ValueAsLong = 8] - | +- ExpressionStatement[] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "typeTester", @MethodName = "typeTester", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ExpressionStatement[] - | | +- AssignmentExpression[@CompileTimeConstant = false, @Compound = false, @Operator = AssignmentOp.ASSIGN, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- ArgumentList[@Empty = true, @Size = 0] - | +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "typeTester", @MethodName = "typeTester", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Point", @CanonicalName = "Point", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Point", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{}"] - | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] - | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] - | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] - | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] - | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "j", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] - | +- RecordBody[@Empty = true, @Size = 0] - +- EnumDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Color", @CanonicalName = "Color", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = true, @Final = true, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Color", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE] - +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{}"] - +- EnumBody[@Empty = false, @SeparatorSemi = true, @Size = 3, @TrailingComma = false] - +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "RED", @MethodName = "new", @Name = "RED", @Visibility = Visibility.V_PUBLIC] - | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "RED", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] - +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "GREEN", @MethodName = "new", @Name = "GREEN", @Visibility = Visibility.V_PUBLIC] - | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "GREEN", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] - +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "BLUE", @MethodName = "new", @Name = "BLUE", @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] - +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "BLUE", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ExhaustiveSwitch.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ExhaustiveSwitch.java deleted file mode 100644 index 3918654e57..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ExhaustiveSwitch.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -/** - * @see JEP 433: Pattern Matching for switch (Fourth Preview) - */ -public class ExhaustiveSwitch { - - static int coverage(Object o) { - return switch (o) { - case String s -> s.length(); - case Integer i -> i; - default -> 0; - }; - } - - static void coverageStatement(Object o) { - switch (o) { - case String s: - System.out.println(s); - break; - case Integer i: - System.out.println("Integer"); - break; - default: // Now exhaustive! - break; - } - } - - sealed interface S permits A, B, C {} - final static class A implements S {} - final static class B implements S {} - record C(int i) implements S {} // Implicitly final - - static int testSealedExhaustive(S s) { - return switch (s) { - case A a -> 1; - case B b -> 2; - case C c -> 3; - }; - } - - static void switchStatementExhaustive(S s) { - switch (s) { - case A a : - System.out.println("A"); - break; - case C c : - System.out.println("C"); - break; - default: - System.out.println("default case, should be B"); - break; - }; - } - sealed interface I permits E, F {} - final static class E implements I {} - final static class F implements I {} - - static int testGenericSealedExhaustive(I i) { - return switch (i) { - // Exhaustive as no E case possible! - case F bi -> 42; - }; - } - - public static void main(String[] args) { - System.out.println(coverage("a string")); - System.out.println(coverage(42)); - System.out.println(coverage(new Object())); - - coverageStatement("a string"); - coverageStatement(21); - coverageStatement(new Object()); - - System.out.println("A:" + testSealedExhaustive(new A())); - System.out.println("B:" + testSealedExhaustive(new B())); - System.out.println("C:" + testSealedExhaustive(new C(1))); - - switchStatementExhaustive(new A()); - switchStatementExhaustive(new B()); - switchStatementExhaustive(new C(2)); - - System.out.println("F:" + testGenericSealedExhaustive(new F())); - } -} diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ExhaustiveSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ExhaustiveSwitch.txt deleted file mode 100644 index f60c2c795c..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ExhaustiveSwitch.txt +++ /dev/null @@ -1,365 +0,0 @@ -+- CompilationUnit[@PackageName = ""] - +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ExhaustiveSwitch", @CanonicalName = "ExhaustiveSwitch", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "ExhaustiveSwitch", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] - +- ClassBody[@Empty = false, @Size = 13] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "coverage", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- ReturnStatement[] - | +- SwitchExpression[@CompileTimeConstant = false, @DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ArgumentList[@Empty = true, @Size = 0] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchArrowBranch[@Default = true] - | +- SwitchLabel[@Default = true] - | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "coverageStatement", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchFallthroughBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ExpressionStatement[] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- BreakStatement[@Label = null] - | +- SwitchFallthroughBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ExpressionStatement[] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Integer", @Empty = false, @Image = "\"Integer\"", @Length = 7, @LiteralText = "\"Integer\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- BreakStatement[@Label = null] - | +- SwitchFallthroughBranch[@Default = true] - | +- SwitchLabel[@Default = true] - | +- BreakStatement[@Label = null] - +- ClassDeclaration[@Abstract = true, @Annotation = false, @Anonymous = false, @BinaryName = "ExhaustiveSwitch$S", @CanonicalName = "ExhaustiveSwitch.S", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = true, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = true, @SimpleName = "S", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{sealed, abstract, static}", @ExplicitModifiers = "{sealed}"] - | +- PermitsList[@Empty = false, @Size = 3] - | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "B"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "C"] - | +- ClassBody[@Empty = true, @Size = 0] - +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ExhaustiveSwitch$A", @CanonicalName = "ExhaustiveSwitch.A", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "A", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{static, final}"] - | +- ImplementsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "S"] - | +- ClassBody[@Empty = true, @Size = 0] - +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ExhaustiveSwitch$B", @CanonicalName = "ExhaustiveSwitch.B", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "B", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{static, final}"] - | +- ImplementsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "S"] - | +- ClassBody[@Empty = true, @Size = 0] - +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ExhaustiveSwitch$C", @CanonicalName = "ExhaustiveSwitch.C", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "C", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] - | +- RecordComponentList[@Empty = false, @Size = 1, @Varargs = false] - | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] - | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] - | +- ImplementsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "S"] - | +- RecordBody[@Empty = true, @Size = 0] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testSealedExhaustive", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "S"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- ReturnStatement[] - | +- SwitchExpression[@CompileTimeConstant = false, @DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "B"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] - | +- SwitchArrowBranch[@Default = false] - | +- SwitchLabel[@Default = false] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "C"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LiteralText = "3", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "switchStatementExhaustive", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "S"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 2, @containsComment = false] - | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- SwitchFallthroughBranch[@Default = false] - | | | +- SwitchLabel[@Default = false] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ExpressionStatement[] - | | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "A", @Empty = false, @Image = "\"A\"", @Length = 1, @LiteralText = "\"A\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | | +- BreakStatement[@Label = null] - | | +- SwitchFallthroughBranch[@Default = false] - | | | +- SwitchLabel[@Default = false] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "C"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ExpressionStatement[] - | | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "C", @Empty = false, @Image = "\"C\"", @Length = 1, @LiteralText = "\"C\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | | +- BreakStatement[@Label = null] - | | +- SwitchFallthroughBranch[@Default = true] - | | +- SwitchLabel[@Default = true] - | | +- ExpressionStatement[] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "default case, should be B", @Empty = false, @Image = "\"default case, should be B\"", @Length = 25, @LiteralText = "\"default case, should be B\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- BreakStatement[@Label = null] - | +- EmptyStatement[] - +- ClassDeclaration[@Abstract = true, @Annotation = false, @Anonymous = false, @BinaryName = "ExhaustiveSwitch$I", @CanonicalName = "ExhaustiveSwitch.I", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = true, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = true, @SimpleName = "I", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{sealed, abstract, static}", @ExplicitModifiers = "{sealed}"] - | +- TypeParameters[@Empty = false, @Size = 1] - | | +- TypeParameter[@Image = "T", @Name = "T", @TypeBound = false] - | +- PermitsList[@Empty = false, @Size = 2] - | | +- ClassType[@FullyQualified = false, @SimpleName = "E"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "F"] - | +- ClassBody[@Empty = true, @Size = 0] - +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ExhaustiveSwitch$E", @CanonicalName = "ExhaustiveSwitch.E", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "E", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{static, final}"] - | +- TypeParameters[@Empty = false, @Size = 1] - | | +- TypeParameter[@Image = "X", @Name = "X", @TypeBound = false] - | +- ImplementsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] - | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | +- ClassBody[@Empty = true, @Size = 0] - +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ExhaustiveSwitch$F", @CanonicalName = "ExhaustiveSwitch.F", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "F", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{static, final}"] - | +- TypeParameters[@Empty = false, @Size = 1] - | | +- TypeParameter[@Image = "Y", @Name = "Y", @TypeBound = false] - | +- ImplementsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] - | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Y"] - | +- ClassBody[@Empty = true, @Size = 0] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testGenericSealedExhaustive", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] - | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- ReturnStatement[] - | +- SwitchExpression[@CompileTimeConstant = false, @DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchArrowBranch[@Default = false] - | +- SwitchLabel[@Default = false] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "F"] - | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "bi", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "42", @IntLiteral = true, @Integral = true, @LiteralText = "42", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] - +- VoidType[] - +- FormalParameters[@Empty = false, @Size = 1] - | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- ArrayType[@ArrayDepth = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- ArrayDimensions[@Empty = false, @Size = 1] - | | +- ArrayTypeDim[@Varargs = false] - | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - +- Block[@Empty = false, @Size = 13, @containsComment = false] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- MethodCall[@CompileTimeConstant = false, @Image = "coverage", @MethodName = "coverage", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a string", @Empty = false, @Image = "\"a string\"", @Length = 8, @LiteralText = "\"a string\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- MethodCall[@CompileTimeConstant = false, @Image = "coverage", @MethodName = "coverage", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "42", @IntLiteral = true, @Integral = true, @LiteralText = "42", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- MethodCall[@CompileTimeConstant = false, @Image = "coverage", @MethodName = "coverage", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | +- ArgumentList[@Empty = true, @Size = 0] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "coverageStatement", @MethodName = "coverageStatement", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a string", @Empty = false, @Image = "\"a string\"", @Length = 8, @LiteralText = "\"a string\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "coverageStatement", @MethodName = "coverageStatement", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "21", @IntLiteral = true, @Integral = true, @LiteralText = "21", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 21.0, @ValueAsFloat = 21.0, @ValueAsInt = 21, @ValueAsLong = 21] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "coverageStatement", @MethodName = "coverageStatement", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | +- ArgumentList[@Empty = true, @Size = 0] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "A:", @Empty = false, @Image = "\"A:\"", @Length = 2, @LiteralText = "\"A:\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- MethodCall[@CompileTimeConstant = false, @Image = "testSealedExhaustive", @MethodName = "testSealedExhaustive", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "A"] - | +- ArgumentList[@Empty = true, @Size = 0] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "B:", @Empty = false, @Image = "\"B:\"", @Length = 2, @LiteralText = "\"B:\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- MethodCall[@CompileTimeConstant = false, @Image = "testSealedExhaustive", @MethodName = "testSealedExhaustive", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "B"] - | +- ArgumentList[@Empty = true, @Size = 0] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "C:", @Empty = false, @Image = "\"C:\"", @Length = 2, @LiteralText = "\"C:\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- MethodCall[@CompileTimeConstant = false, @Image = "testSealedExhaustive", @MethodName = "testSealedExhaustive", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "C"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "switchStatementExhaustive", @MethodName = "switchStatementExhaustive", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "A"] - | +- ArgumentList[@Empty = true, @Size = 0] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "switchStatementExhaustive", @MethodName = "switchStatementExhaustive", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "B"] - | +- ArgumentList[@Empty = true, @Size = 0] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "switchStatementExhaustive", @MethodName = "switchStatementExhaustive", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "C"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] - +- ExpressionStatement[] - +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - +- ArgumentList[@Empty = false, @Size = 1] - +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "F:", @Empty = false, @Image = "\"F:\"", @Length = 2, @LiteralText = "\"F:\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- MethodCall[@CompileTimeConstant = false, @Image = "testGenericSealedExhaustive", @MethodName = "testGenericSealedExhaustive", @ParenthesisDepth = 0, @Parenthesized = false] - +- ArgumentList[@Empty = false, @Size = 1] - +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - +- ClassType[@FullyQualified = false, @SimpleName = "F"] - | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] - +- ArgumentList[@Empty = true, @Size = 0] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/GuardedAndParenthesizedPatterns.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/GuardedAndParenthesizedPatterns.java deleted file mode 100644 index 41e2a343fe..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/GuardedAndParenthesizedPatterns.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -/** - * @see JEP 433: Pattern Matching for switch (Fourth Preview) - */ -public class GuardedAndParenthesizedPatterns { - - - static void test(Object o) { - switch (o) { - case String s when s.length() == 1 -> System.out.println("single char string"); - case String s -> System.out.println("string"); - case Integer i when i.intValue() == 1 -> System.out.println("integer 1"); - case (Long l) when l.longValue() == 1L -> System.out.println("long 1 with parens"); - case (((Double d))) -> System.out.println("double with parens"); - default -> System.out.println("default case"); - } - } - - // verify that "when" can still be used as an identifier -> formal parameter - void testIdentifierWhen(String when) { - System.out.println(when); - } - - // verify that "when" can still be used as an identifier -> local variable - void testIdentifierWhen() { - int when = 1; - System.out.println(when); - } - - // verify that "when" can still be used as a type name - private static class when {} - - static void testWithNull(Object o) { - switch (o) { - case String s when (s.length() == 1) -> System.out.println("single char string"); - case String s -> System.out.println("string"); - case (Integer i) when i.intValue() == 1 -> System.out.println("integer 1"); - case ((Long l)) when ((l.longValue() == 1L)) -> System.out.println("long 1 with parens"); - case (((Double d))) -> System.out.println("double with parens"); - case null -> System.out.println("null!"); - default -> System.out.println("default case"); - } - } - - - static void instanceOfPattern(Object o) { - if (o instanceof String s && s.length() > 2) { - System.out.println("A string containing at least two characters"); - } - if (o != null && (o instanceof String s && s.length() > 3)) { - System.out.println("A string containing at least three characters"); - } - - // note: with this 3rd preview, the following is not allowed anymore: - // if (o instanceof (String s && s.length() > 4)) { - // > An alternative to guarded pattern labels is to support guarded patterns directly as a special pattern form, - // > e.g. p && e. Having experimented with this in previous previews, the resulting ambiguity with boolean - // > expressions have lead us to prefer when clauses in pattern switches. - if ((o instanceof String s) && (s.length() > 4)) { - System.out.println("A string containing at least four characters"); - } - } - - static void testScopeOfPatternVariableDeclarations(Object obj) { - if ((obj instanceof String s) && s.length() > 3) { - System.out.println(s); - } else { - System.out.println("Not a string"); - } - } - - public static void main(String[] args) { - test("a"); - test("fooo"); - test(1); - test(1L); - instanceOfPattern("abcde"); - try { - test(null); // throws NPE - } catch (NullPointerException e) { - e.printStackTrace(); - } - testWithNull(null); - testScopeOfPatternVariableDeclarations("a"); - testScopeOfPatternVariableDeclarations("long enough"); - } -} diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/GuardedAndParenthesizedPatterns.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/GuardedAndParenthesizedPatterns.txt deleted file mode 100644 index f923ef63d7..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/GuardedAndParenthesizedPatterns.txt +++ /dev/null @@ -1,422 +0,0 @@ -+- CompilationUnit[@PackageName = ""] - +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "GuardedAndParenthesizedPatterns", @CanonicalName = "GuardedAndParenthesizedPatterns", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "GuardedAndParenthesizedPatterns", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] - +- ClassBody[@Empty = false, @Size = 8] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "test", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- Guard[] - | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ArgumentList[@Empty = true, @Size = 0] - | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "single char string", @Empty = false, @Image = "\"single char string\"", @Length = 18, @LiteralText = "\"single char string\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "string", @Empty = false, @Image = "\"string\"", @Length = 6, @LiteralText = "\"string\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- Guard[] - | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "intValue", @MethodName = "intValue", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ArgumentList[@Empty = true, @Size = 0] - | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "integer 1", @Empty = false, @Image = "\"integer 1\"", @Length = 9, @LiteralText = "\"integer 1\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 1, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Long"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "l", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- Guard[] - | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "longValue", @MethodName = "longValue", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "l", @Name = "l", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ArgumentList[@Empty = true, @Size = 0] - | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1L", @IntLiteral = false, @Integral = true, @LiteralText = "1L", @LongLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "long 1 with parens", @Empty = false, @Image = "\"long 1 with parens\"", @Length = 18, @LiteralText = "\"long 1 with parens\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 3, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Double"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "double with parens", @Empty = false, @Image = "\"double with parens\"", @Length = 18, @LiteralText = "\"double with parens\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- SwitchArrowBranch[@Default = true] - | +- SwitchLabel[@Default = true] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "default case", @Empty = false, @Image = "\"default case\"", @Length = 12, @LiteralText = "\"default case\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testIdentifierWhen", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "when", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "when", @Name = "when", @ParenthesisDepth = 0, @Parenthesized = false] - +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testIdentifierWhen", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- VoidType[] - | +- FormalParameters[@Empty = true, @Size = 0] - | +- Block[@Empty = false, @Size = 2, @containsComment = false] - | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | +- VariableDeclarator[@Initializer = true, @Name = "when"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "when", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] - | +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "when", @Name = "when", @ParenthesisDepth = 0, @Parenthesized = false] - +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "GuardedAndParenthesizedPatterns$when", @CanonicalName = "GuardedAndParenthesizedPatterns.when", @EffectiveVisibility = Visibility.V_PRIVATE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "when", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PRIVATE] - | +- ModifierList[@EffectiveModifiers = "{private, static}", @ExplicitModifiers = "{private, static}"] - | +- ClassBody[@Empty = true, @Size = 0] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testWithNull", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- Guard[] - | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 1, @Parenthesized = true] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ArgumentList[@Empty = true, @Size = 0] - | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "single char string", @Empty = false, @Image = "\"single char string\"", @Length = 18, @LiteralText = "\"single char string\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "string", @Empty = false, @Image = "\"string\"", @Length = 6, @LiteralText = "\"string\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 1, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- Guard[] - | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "intValue", @MethodName = "intValue", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ArgumentList[@Empty = true, @Size = 0] - | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "integer 1", @Empty = false, @Image = "\"integer 1\"", @Length = 9, @LiteralText = "\"integer 1\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 2, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Long"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "l", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- Guard[] - | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 2, @Parenthesized = true] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "longValue", @MethodName = "longValue", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "l", @Name = "l", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ArgumentList[@Empty = true, @Size = 0] - | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1L", @IntLiteral = false, @Integral = true, @LiteralText = "1L", @LongLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "long 1 with parens", @Empty = false, @Image = "\"long 1 with parens\"", @Length = 18, @LiteralText = "\"long 1 with parens\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 3, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Double"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "double with parens", @Empty = false, @Image = "\"double with parens\"", @Length = 18, @LiteralText = "\"double with parens\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "null!", @Empty = false, @Image = "\"null!\"", @Length = 5, @LiteralText = "\"null!\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- SwitchArrowBranch[@Default = true] - | +- SwitchLabel[@Default = true] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "default case", @Empty = false, @Image = "\"default case\"", @Length = 12, @LiteralText = "\"default case\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "instanceOfPattern", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 3, @containsComment = false] - | +- IfStatement[@Else = false] - | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.CONDITIONAL_AND, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ArgumentList[@Empty = true, @Size = 0] - | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] - | | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | | +- ExpressionStatement[] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "A string containing at least two characters", @Empty = false, @Image = "\"A string containing at least two characters\"", @Length = 43, @LiteralText = "\"A string containing at least two characters\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- IfStatement[@Else = false] - | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.CONDITIONAL_AND, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.NE, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.CONDITIONAL_AND, @ParenthesisDepth = 1, @Parenthesized = true] - | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ArgumentList[@Empty = true, @Size = 0] - | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LiteralText = "3", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3] - | | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | | +- ExpressionStatement[] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "A string containing at least three characters", @Empty = false, @Image = "\"A string containing at least three characters\"", @Length = 45, @LiteralText = "\"A string containing at least three characters\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- IfStatement[@Else = false] - | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.CONDITIONAL_AND, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 1, @Parenthesized = true] - | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 1, @Parenthesized = true] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ArgumentList[@Empty = true, @Size = 0] - | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "4", @IntLiteral = true, @Integral = true, @LiteralText = "4", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 4.0, @ValueAsFloat = 4.0, @ValueAsInt = 4, @ValueAsLong = 4] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "A string containing at least four characters", @Empty = false, @Image = "\"A string containing at least four characters\"", @Length = 44, @LiteralText = "\"A string containing at least four characters\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testScopeOfPatternVariableDeclarations", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "obj", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- IfStatement[@Else = true] - | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.CONDITIONAL_AND, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 1, @Parenthesized = true] - | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ArgumentList[@Empty = true, @Size = 0] - | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LiteralText = "3", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | | +- ExpressionStatement[] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Not a string", @Empty = false, @Image = "\"Not a string\"", @Length = 12, @LiteralText = "\"Not a string\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] - +- VoidType[] - +- FormalParameters[@Empty = false, @Size = 1] - | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- ArrayType[@ArrayDepth = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- ArrayDimensions[@Empty = false, @Size = 1] - | | +- ArrayTypeDim[@Varargs = false] - | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - +- Block[@Empty = false, @Size = 9, @containsComment = false] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "test", @MethodName = "test", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "test", @MethodName = "test", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "fooo", @Empty = false, @Image = "\"fooo\"", @Length = 4, @LiteralText = "\"fooo\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "test", @MethodName = "test", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "test", @MethodName = "test", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1L", @IntLiteral = false, @Integral = true, @LiteralText = "1L", @LongLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "instanceOfPattern", @MethodName = "instanceOfPattern", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "abcde", @Empty = false, @Image = "\"abcde\"", @Length = 5, @LiteralText = "\"abcde\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- TryStatement[@TryWithResources = false] - | +- Block[@Empty = false, @Size = 1, @containsComment = true] - | | +- ExpressionStatement[] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "test", @MethodName = "test", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] - | +- CatchClause[] - | +- CatchParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Multicatch = false, @Name = "e", @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "NullPointerException"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "e", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "printStackTrace", @MethodName = "printStackTrace", @ParenthesisDepth = 0, @Parenthesized = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "e", @Name = "e", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = true, @Size = 0] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "testWithNull", @MethodName = "testWithNull", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "testScopeOfPatternVariableDeclarations", @MethodName = "testScopeOfPatternVariableDeclarations", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- ExpressionStatement[] - +- MethodCall[@CompileTimeConstant = false, @Image = "testScopeOfPatternVariableDeclarations", @MethodName = "testScopeOfPatternVariableDeclarations", @ParenthesisDepth = 0, @Parenthesized = false] - +- ArgumentList[@Empty = false, @Size = 1] - +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "long enough", @Empty = false, @Image = "\"long enough\"", @Length = 11, @LiteralText = "\"long enough\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/PatternsInSwitchLabels.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/PatternsInSwitchLabels.java deleted file mode 100644 index 210c03f066..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/PatternsInSwitchLabels.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -/** - * @see JEP 433: Pattern Matching for switch (Fourth Preview) - */ -public class PatternsInSwitchLabels { - - - public static void main(String[] args) { - Object o = 123L; - String formatted = switch (o) { - case Integer i -> String.format("int %d", i); - case Long l -> String.format("long %d", l); - case Double d -> String.format("double %f", d); - case String s -> String.format("String %s", s); - default -> o.toString(); - }; - System.out.println(formatted); - } -} diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/PatternsInSwitchLabels.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/PatternsInSwitchLabels.txt deleted file mode 100644 index abb2f972ed..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/PatternsInSwitchLabels.txt +++ /dev/null @@ -1,89 +0,0 @@ -+- CompilationUnit[@PackageName = ""] - +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "PatternsInSwitchLabels", @CanonicalName = "PatternsInSwitchLabels", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "PatternsInSwitchLabels", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] - +- ClassBody[@Empty = false, @Size = 1] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] - +- VoidType[] - +- FormalParameters[@Empty = false, @Size = 1] - | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- ArrayType[@ArrayDepth = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- ArrayDimensions[@Empty = false, @Size = 1] - | | +- ArrayTypeDim[@Varargs = false] - | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - +- Block[@Empty = false, @Size = 3, @containsComment = false] - +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | +- VariableDeclarator[@Initializer = true, @Name = "o"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "123L", @IntLiteral = false, @Integral = true, @LiteralText = "123L", @LongLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 123.0, @ValueAsFloat = 123.0, @ValueAsInt = 123, @ValueAsLong = 123] - +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | +- VariableDeclarator[@Initializer = true, @Name = "formatted"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "formatted", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- SwitchExpression[@CompileTimeConstant = false, @DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- ArgumentList[@Empty = false, @Size = 2] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "int %d", @Empty = false, @Image = "\"int %d\"", @Length = 6, @LiteralText = "\"int %d\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Long"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "l", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- ArgumentList[@Empty = false, @Size = 2] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "long %d", @Empty = false, @Image = "\"long %d\"", @Length = 7, @LiteralText = "\"long %d\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "l", @Name = "l", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Double"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- ArgumentList[@Empty = false, @Size = 2] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "double %f", @Empty = false, @Image = "\"double %f\"", @Length = 9, @LiteralText = "\"double %f\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "d", @Name = "d", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- ArgumentList[@Empty = false, @Size = 2] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String %s", @Empty = false, @Image = "\"String %s\"", @Length = 9, @LiteralText = "\"String %s\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchArrowBranch[@Default = true] - | +- SwitchLabel[@Default = true] - | +- MethodCall[@CompileTimeConstant = false, @Image = "toString", @MethodName = "toString", @ParenthesisDepth = 0, @Parenthesized = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = true, @Size = 0] - +- ExpressionStatement[] - +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - +- ArgumentList[@Empty = false, @Size = 1] - +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "formatted", @Name = "formatted", @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatterns.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatterns.java deleted file mode 100644 index 2ae278af1e..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatterns.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -/** - * @see JEP 432: Record Patterns (Second Preview) - */ -public class RecordPatterns { - - record Point(int x, int y) {} - enum Color { RED, GREEN, BLUE } - record ColoredPoint(Point p, Color c) {} - record Rectangle(ColoredPoint upperLeft, ColoredPoint lowerRight) {} - - void printSum1(Object o) { - if (o instanceof Point p) { - int x = p.x(); - int y = p.y(); - System.out.println(x+y); - } - } - - // record pattern - void printSum2(Object o) { - if (o instanceof Point(int x, int y)) { - System.out.println(x+y); - } - } - - void printUpperLeftColoredPoint(Rectangle r) { - if (r instanceof Rectangle(ColoredPoint ul, ColoredPoint lr)) { - System.out.println(ul.c()); - } - } - - // nested record pattern - void printColorOfUpperLeftPoint(Rectangle r) { - if (r instanceof Rectangle(ColoredPoint(Point p, Color c), - ColoredPoint lr)) { - System.out.println(c); - } - } - - Rectangle createRectangle(int x1, int y1, Color c1, int x2, int y2, Color c2) { - Rectangle r = new Rectangle(new ColoredPoint(new Point(x1, y1), c1), - new ColoredPoint(new Point(x2, y2), c2)); - return r; - } - - // fully nested record pattern, also using "var" - void printXCoordOfUpperLeftPointWithPatterns(Rectangle r) { - if (r instanceof Rectangle(ColoredPoint(Point(var x, var y), var c), - var lr)) { - System.out.println("Upper-left corner: " + x); - } - } - - record Pair(Object x, Object y) {} - void nestedPatternsCanFailToMatch() { - Pair p = new Pair(42, 42); - if (p instanceof Pair(String s, String t)) { - System.out.println(s + ", " + t); - } else { - System.out.println("Not a pair of strings"); - } - } - - // record patterns with generic types - record Box(T t) {} - void test1a(Box bo) { - if (bo instanceof Box(String s)) { - System.out.println("String " + s); - } - } - void test1(Box bo) { - if (bo instanceof Box(var s)) { - System.out.println("String " + s); - } - } - - // type argument is inferred - void test2(Box bo) { - if (bo instanceof Box(var s)) { // Inferred to be Box(var s) - System.out.println("String " + s); - } - } - - // nested record patterns - void test3(Box> bo) { - if (bo instanceof Box>(Box(var s))) { - System.out.println("String " + s); - } - } - - void test4(Box> bo) { - if (bo instanceof Box(Box(var s))) { - System.out.println("String " + s); - } - } -} diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatterns.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatterns.txt deleted file mode 100644 index 7e0d61f1ad..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatterns.txt +++ /dev/null @@ -1,557 +0,0 @@ -+- CompilationUnit[@PackageName = ""] - +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns", @CanonicalName = "RecordPatterns", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "RecordPatterns", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] - +- ClassBody[@Empty = false, @Size = 18] - +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns$Point", @CanonicalName = "RecordPatterns.Point", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Point", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] - | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] - | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] - | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] - | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] - | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] - | +- RecordBody[@Empty = true, @Size = 0] - +- EnumDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns$Color", @CanonicalName = "RecordPatterns.Color", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = true, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Color", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] - | +- EnumBody[@Empty = false, @SeparatorSemi = false, @Size = 3, @TrailingComma = false] - | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "RED", @MethodName = "new", @Name = "RED", @Visibility = Visibility.V_PUBLIC] - | | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "RED", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] - | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "GREEN", @MethodName = "new", @Name = "GREEN", @Visibility = Visibility.V_PUBLIC] - | | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "GREEN", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] - | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "BLUE", @MethodName = "new", @Name = "BLUE", @Visibility = Visibility.V_PUBLIC] - | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "BLUE", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] - +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns$ColoredPoint", @CanonicalName = "RecordPatterns.ColoredPoint", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "ColoredPoint", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] - | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] - | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] - | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] - | +- RecordBody[@Empty = true, @Size = 0] - +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns$Rectangle", @CanonicalName = "RecordPatterns.Rectangle", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Rectangle", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] - | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] - | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "upperLeft", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] - | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lowerRight", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] - | +- RecordBody[@Empty = true, @Size = 0] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "printSum1", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- IfStatement[@Else = false] - | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 3, @containsComment = false] - | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | +- VariableDeclarator[@Initializer = true, @Name = "x"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "x", @MethodName = "x", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "p", @Name = "p", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ArgumentList[@Empty = true, @Size = 0] - | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | +- VariableDeclarator[@Initializer = true, @Name = "y"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "y", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "y", @MethodName = "y", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "p", @Name = "p", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ArgumentList[@Empty = true, @Size = 0] - | +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "y", @Name = "y", @ParenthesisDepth = 0, @Parenthesized = false] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "printSum2", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- IfStatement[@Else = false] - | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] - | | +- PatternList[@Empty = false, @Size = 2] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "y", @Name = "y", @ParenthesisDepth = 0, @Parenthesized = false] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "printUpperLeftColoredPoint", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- IfStatement[@Else = false] - | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] - | | +- PatternList[@Empty = false, @Size = 2] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "ul", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- MethodCall[@CompileTimeConstant = false, @Image = "c", @MethodName = "c", @ParenthesisDepth = 0, @Parenthesized = false] - | +- AmbiguousName[@CompileTimeConstant = false, @Image = "ul", @Name = "ul", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = true, @Size = 0] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "printColorOfUpperLeftPoint", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- IfStatement[@Else = false] - | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] - | | +- PatternList[@Empty = false, @Size = 2] - | | +- RecordPattern[@ParenthesisDepth = 0] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] - | | | +- PatternList[@Empty = false, @Size = 2] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false] - +- MethodDeclaration[@Abstract = false, @Arity = 6, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "createRectangle", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] - | +- FormalParameters[@Empty = false, @Size = 6] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "x1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "y1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "c1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "x2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "y2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "c2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 2, @containsComment = false] - | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] - | | +- VariableDeclarator[@Initializer = true, @Name = "r"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] - | | +- ArgumentList[@Empty = false, @Size = 2] - | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] - | | | +- ArgumentList[@Empty = false, @Size = 2] - | | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] - | | | | +- ArgumentList[@Empty = false, @Size = 2] - | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x1", @Name = "x1", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "y1", @Name = "y1", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "c1", @Name = "c1", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] - | | +- ArgumentList[@Empty = false, @Size = 2] - | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] - | | | +- ArgumentList[@Empty = false, @Size = 2] - | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x2", @Name = "x2", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "y2", @Name = "y2", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "c2", @Name = "c2", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ReturnStatement[] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "printXCoordOfUpperLeftPointWithPatterns", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- IfStatement[@Else = false] - | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] - | | +- PatternList[@Empty = false, @Size = 2] - | | +- RecordPattern[@ParenthesisDepth = 0] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] - | | | +- PatternList[@Empty = false, @Size = 2] - | | | +- RecordPattern[@ParenthesisDepth = 0] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] - | | | | +- PatternList[@Empty = false, @Size = 2] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] - | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Upper-left corner: ", @Empty = false, @Image = "\"Upper-left corner: \"", @Length = 19, @LiteralText = "\"Upper-left corner: \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] - +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns$Pair", @CanonicalName = "RecordPatterns.Pair", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Pair", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] - | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] - | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] - | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] - | +- RecordBody[@Empty = true, @Size = 0] - +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "nestedPatternsCanFailToMatch", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- VoidType[] - | +- FormalParameters[@Empty = true, @Size = 0] - | +- Block[@Empty = false, @Size = 2, @containsComment = false] - | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] - | | +- VariableDeclarator[@Initializer = true, @Name = "p"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "p", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] - | | +- ArgumentList[@Empty = false, @Size = 2] - | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "42", @IntLiteral = true, @Integral = true, @LiteralText = "42", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42] - | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "42", @IntLiteral = true, @Integral = true, @LiteralText = "42", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42] - | +- IfStatement[@Else = true] - | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "p", @Name = "p", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] - | | +- PatternList[@Empty = false, @Size = 2] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | | +- ExpressionStatement[] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = ", ", @Empty = false, @Image = "\", \"", @Length = 2, @LiteralText = "\", \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "t", @Name = "t", @ParenthesisDepth = 0, @Parenthesized = false] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Not a pair of strings", @Empty = false, @Image = "\"Not a pair of strings\"", @Length = 21, @LiteralText = "\"Not a pair of strings\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns$Box", @CanonicalName = "RecordPatterns.Box", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Box", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] - | +- TypeParameters[@Empty = false, @Size = 1] - | | +- TypeParameter[@Image = "T", @Name = "T", @TypeBound = false] - | +- RecordComponentList[@Empty = false, @Size = 1, @Varargs = false] - | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "T"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] - | +- RecordBody[@Empty = true, @Size = 0] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "test1a", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] - | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- IfStatement[@Else = false] - | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "bo", @Name = "bo", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] - | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- PatternList[@Empty = false, @Size = 1] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String ", @Empty = false, @Image = "\"String \"", @Length = 7, @LiteralText = "\"String \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "test1", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] - | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- IfStatement[@Else = false] - | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "bo", @Name = "bo", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] - | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- PatternList[@Empty = false, @Size = 1] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String ", @Empty = false, @Image = "\"String \"", @Length = 7, @LiteralText = "\"String \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "test2", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] - | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- IfStatement[@Else = false] - | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "bo", @Name = "bo", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] - | | +- PatternList[@Empty = false, @Size = 1] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String ", @Empty = false, @Image = "\"String \"", @Length = 7, @LiteralText = "\"String \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "test3", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] - | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] - | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- IfStatement[@Else = false] - | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "bo", @Name = "bo", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] - | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] - | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- PatternList[@Empty = false, @Size = 1] - | | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] - | | +- PatternList[@Empty = false, @Size = 1] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String ", @Empty = false, @Image = "\"String \"", @Length = 7, @LiteralText = "\"String \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "test4", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - +- VoidType[] - +- FormalParameters[@Empty = false, @Size = 1] - | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] - | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] - | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - +- Block[@Empty = false, @Size = 1, @containsComment = false] - +- IfStatement[@Else = false] - +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "bo", @Name = "bo", @ParenthesisDepth = 0, @Parenthesized = false] - | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- RecordPattern[@ParenthesisDepth = 0] - | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] - | +- PatternList[@Empty = false, @Size = 1] - | +- RecordPattern[@ParenthesisDepth = 0] - | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] - | +- PatternList[@Empty = false, @Size = 1] - | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- ClassType[@FullyQualified = false, @SimpleName = "var"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - +- Block[@Empty = false, @Size = 1, @containsComment = false] - +- ExpressionStatement[] - +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - +- ArgumentList[@Empty = false, @Size = 1] - +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String ", @Empty = false, @Image = "\"String \"", @Length = 7, @LiteralText = "\"String \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsExhaustiveSwitch.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsExhaustiveSwitch.java deleted file mode 100644 index 7fb9f1250e..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsExhaustiveSwitch.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -/** - * @see JEP 432: Record Patterns (Second Preview) - */ -public class RecordPatternsExhaustiveSwitch { - class A {} - class B extends A {} - sealed interface I permits C, D {} - final class C implements I {} - final class D implements I {} - record Pair(T x, T y) {} - - static void test() { - Pair p1 = null; - Pair p2 = null; - - switch (p1) { // Error! - case Pair(A a, B b) -> System.out.println("a"); - case Pair(B b, A a) -> System.out.println("a"); - case Pair(A a1, A a2) -> System.out.println("exhaustive now"); // without this case, compile error - } - - switch (p2) { - case Pair(I i, C c) -> System.out.println("a"); - case Pair(I i, D d) -> System.out.println("a"); - } - - switch (p2) { - case Pair(C c, I i) -> System.out.println("a"); - case Pair(D d, C c) -> System.out.println("a"); - case Pair(D d1, D d2) -> System.out.println("a"); - } - } -} diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsExhaustiveSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsExhaustiveSwitch.txt deleted file mode 100644 index 3c87e4ce4a..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsExhaustiveSwitch.txt +++ /dev/null @@ -1,237 +0,0 @@ -+- CompilationUnit[@PackageName = ""] - +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch", @CanonicalName = "RecordPatternsExhaustiveSwitch", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "RecordPatternsExhaustiveSwitch", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] - +- ClassBody[@Empty = false, @Size = 7] - +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch$A", @CanonicalName = "RecordPatternsExhaustiveSwitch.A", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "A", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- ClassBody[@Empty = true, @Size = 0] - +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch$B", @CanonicalName = "RecordPatternsExhaustiveSwitch.B", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "B", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- ExtendsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] - | +- ClassBody[@Empty = true, @Size = 0] - +- ClassDeclaration[@Abstract = true, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch$I", @CanonicalName = "RecordPatternsExhaustiveSwitch.I", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = true, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = true, @SimpleName = "I", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{sealed, abstract, static}", @ExplicitModifiers = "{sealed}"] - | +- PermitsList[@Empty = false, @Size = 2] - | | +- ClassType[@FullyQualified = false, @SimpleName = "C"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "D"] - | +- ClassBody[@Empty = true, @Size = 0] - +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch$C", @CanonicalName = "RecordPatternsExhaustiveSwitch.C", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "C", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"] - | +- ImplementsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] - | +- ClassBody[@Empty = true, @Size = 0] - +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch$D", @CanonicalName = "RecordPatternsExhaustiveSwitch.D", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "D", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"] - | +- ImplementsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] - | +- ClassBody[@Empty = true, @Size = 0] - +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch$Pair", @CanonicalName = "RecordPatternsExhaustiveSwitch.Pair", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Pair", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] - | +- TypeParameters[@Empty = false, @Size = 1] - | | +- TypeParameter[@Image = "T", @Name = "T", @TypeBound = false] - | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] - | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "T"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] - | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "T"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] - | +- RecordBody[@Empty = true, @Size = 0] - +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "test", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - +- VoidType[] - +- FormalParameters[@Empty = true, @Size = 0] - +- Block[@Empty = false, @Size = 5, @containsComment = false] - +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] - | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] - | +- VariableDeclarator[@Initializer = true, @Name = "p1"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "p1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] - +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] - | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] - | +- VariableDeclarator[@Initializer = true, @Name = "p2"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "p2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] - +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "p1", @Name = "p1", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- RecordPattern[@ParenthesisDepth = 0] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] - | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] - | | | +- PatternList[@Empty = false, @Size = 2] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "B"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- RecordPattern[@ParenthesisDepth = 0] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] - | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] - | | | +- PatternList[@Empty = false, @Size = 2] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "B"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- SwitchArrowBranch[@Default = false] - | +- SwitchLabel[@Default = false] - | | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] - | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] - | | +- PatternList[@Empty = false, @Size = 2] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a1", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a2", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "exhaustive now", @Empty = false, @Image = "\"exhaustive now\"", @Length = 14, @LiteralText = "\"exhaustive now\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "p2", @Name = "p2", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- RecordPattern[@ParenthesisDepth = 0] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] - | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] - | | | +- PatternList[@Empty = false, @Size = 2] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "C"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- SwitchArrowBranch[@Default = false] - | +- SwitchLabel[@Default = false] - | | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] - | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] - | | +- PatternList[@Empty = false, @Size = 2] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "D"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] - +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "p2", @Name = "p2", @ParenthesisDepth = 0, @Parenthesized = false] - +- SwitchArrowBranch[@Default = false] - | +- SwitchLabel[@Default = false] - | | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] - | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] - | | +- PatternList[@Empty = false, @Size = 2] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "C"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- SwitchArrowBranch[@Default = false] - | +- SwitchLabel[@Default = false] - | | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] - | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] - | | +- PatternList[@Empty = false, @Size = 2] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "D"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "C"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- SwitchArrowBranch[@Default = false] - +- SwitchLabel[@Default = false] - | +- RecordPattern[@ParenthesisDepth = 0] - | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] - | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] - | +- PatternList[@Empty = false, @Size = 2] - | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "D"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d1", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- ClassType[@FullyQualified = false, @SimpleName = "D"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d2", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - +- ArgumentList[@Empty = false, @Size = 1] - +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsInEnhancedFor.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsInEnhancedFor.java deleted file mode 100644 index 0f3b5f2274..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsInEnhancedFor.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -/** - * @see JEP 432: Record Patterns (Second Preview) - */ -public class RecordPatternsInEnhancedFor { - record Point(int x, int y) {} - enum Color { RED, GREEN, BLUE } - record ColoredPoint(Point p, Color c) {} - record Rectangle(ColoredPoint upperLeft, ColoredPoint lowerRight) {} - - // record patterns in for-each loop (enhanced for statement) - static void dump(Point[] pointArray) { - for (Point(var x, var y) : pointArray) { // Record Pattern in header! - System.out.println("(" + x + ", " + y + ")"); - } - } - - // nested record patterns in enhanced for statement - static void printUpperLeftColors(Rectangle[] r) { - for (Rectangle(ColoredPoint(Point p, Color c), ColoredPoint lr): r) { - System.out.println(c); - } - } - - record Pair(Object fst, Object snd){} - static void exceptionTest() { - Pair[] ps = new Pair[]{ - new Pair(1,2), - null, - new Pair("hello","world") - }; - for (Pair(var f, var s): ps) { // Run-time MatchException - System.out.println(f + " -> " + s); - } - } - - public static void main(String[] args) { - exceptionTest(); - } -} diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsInEnhancedFor.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsInEnhancedFor.txt deleted file mode 100644 index 7d7e0b52c2..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsInEnhancedFor.txt +++ /dev/null @@ -1,215 +0,0 @@ -+- CompilationUnit[@PackageName = ""] - +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsInEnhancedFor", @CanonicalName = "RecordPatternsInEnhancedFor", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "RecordPatternsInEnhancedFor", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] - +- ClassBody[@Empty = false, @Size = 9] - +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsInEnhancedFor$Point", @CanonicalName = "RecordPatternsInEnhancedFor.Point", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Point", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] - | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] - | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] - | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] - | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] - | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] - | +- RecordBody[@Empty = true, @Size = 0] - +- EnumDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsInEnhancedFor$Color", @CanonicalName = "RecordPatternsInEnhancedFor.Color", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = true, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Color", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] - | +- EnumBody[@Empty = false, @SeparatorSemi = false, @Size = 3, @TrailingComma = false] - | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "RED", @MethodName = "new", @Name = "RED", @Visibility = Visibility.V_PUBLIC] - | | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "RED", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] - | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "GREEN", @MethodName = "new", @Name = "GREEN", @Visibility = Visibility.V_PUBLIC] - | | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "GREEN", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] - | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "BLUE", @MethodName = "new", @Name = "BLUE", @Visibility = Visibility.V_PUBLIC] - | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "BLUE", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] - +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsInEnhancedFor$ColoredPoint", @CanonicalName = "RecordPatternsInEnhancedFor.ColoredPoint", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "ColoredPoint", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] - | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] - | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] - | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] - | +- RecordBody[@Empty = true, @Size = 0] - +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsInEnhancedFor$Rectangle", @CanonicalName = "RecordPatternsInEnhancedFor.Rectangle", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Rectangle", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] - | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] - | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "upperLeft", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] - | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lowerRight", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] - | +- RecordBody[@Empty = true, @Size = 0] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "dump", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ArrayType[@ArrayDepth = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] - | | | +- ArrayDimensions[@Empty = false, @Size = 1] - | | | +- ArrayTypeDim[@Varargs = false] - | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "pointArray", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- ForeachStatement[] - | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] - | | +- PatternList[@Empty = false, @Size = 2] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "pointArray", @Name = "pointArray", @ParenthesisDepth = 0, @Parenthesized = false] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "(", @Empty = false, @Image = "\"(\"", @Length = 1, @LiteralText = "\"(\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = ", ", @Empty = false, @Image = "\", \"", @Length = 2, @LiteralText = "\", \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "y", @Name = "y", @ParenthesisDepth = 0, @Parenthesized = false] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = ")", @Empty = false, @Image = "\")\"", @Length = 1, @LiteralText = "\")\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "printUpperLeftColors", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ArrayType[@ArrayDepth = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] - | | | +- ArrayDimensions[@Empty = false, @Size = 1] - | | | +- ArrayTypeDim[@Varargs = false] - | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- ForeachStatement[] - | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] - | | +- PatternList[@Empty = false, @Size = 2] - | | +- RecordPattern[@ParenthesisDepth = 0] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] - | | | +- PatternList[@Empty = false, @Size = 2] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false] - +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsInEnhancedFor$Pair", @CanonicalName = "RecordPatternsInEnhancedFor.Pair", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Pair", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] - | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] - | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "fst", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] - | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "snd", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] - | +- RecordBody[@Empty = true, @Size = 0] - +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "exceptionTest", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | +- VoidType[] - | +- FormalParameters[@Empty = true, @Size = 0] - | +- Block[@Empty = false, @Size = 2, @containsComment = false] - | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ArrayType[@ArrayDepth = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] - | | | +- ArrayDimensions[@Empty = false, @Size = 1] - | | | +- ArrayTypeDim[@Varargs = false] - | | +- VariableDeclarator[@Initializer = true, @Name = "ps"] - | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "ps", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ArrayAllocation[@ArrayDepth = 1, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ArrayType[@ArrayDepth = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] - | | | +- ArrayDimensions[@Empty = false, @Size = 1] - | | | +- ArrayTypeDim[@Varargs = false] - | | +- ArrayInitializer[@CompileTimeConstant = false, @Length = 3, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] - | | | +- ArgumentList[@Empty = false, @Size = 2] - | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] - | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] - | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] - | | +- ArgumentList[@Empty = false, @Size = 2] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "hello", @Empty = false, @Image = "\"hello\"", @Length = 5, @LiteralText = "\"hello\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "world", @Empty = false, @Image = "\"world\"", @Length = 5, @LiteralText = "\"world\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- ForeachStatement[] - | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] - | | +- PatternList[@Empty = false, @Size = 2] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "f", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "ps", @Name = "ps", @ParenthesisDepth = 0, @Parenthesized = false] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "f", @Name = "f", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = " -> ", @Empty = false, @Image = "\" -> \"", @Length = 4, @LiteralText = "\" -> \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] - +- VoidType[] - +- FormalParameters[@Empty = false, @Size = 1] - | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- ArrayType[@ArrayDepth = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- ArrayDimensions[@Empty = false, @Size = 1] - | | +- ArrayTypeDim[@Varargs = false] - | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - +- Block[@Empty = false, @Size = 1, @containsComment = false] - +- ExpressionStatement[] - +- MethodCall[@CompileTimeConstant = false, @Image = "exceptionTest", @MethodName = "exceptionTest", @ParenthesisDepth = 0, @Parenthesized = false] - +- ArgumentList[@Empty = true, @Size = 0] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RefiningPatternsInSwitch.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RefiningPatternsInSwitch.java deleted file mode 100644 index c2eadc6711..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RefiningPatternsInSwitch.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -/** - * @see JEP 433: Pattern Matching for switch (Fourth Preview) - */ -public class RefiningPatternsInSwitch { - - static class Shape {} - static class Rectangle extends Shape {} - static class Triangle extends Shape { - private int area; - Triangle(int area) { - this.area = area; - } - int calculateArea() { return area; } - } - - static void testTriangle(Shape s) { - switch (s) { - case null: - break; - case Triangle t: - if (t.calculateArea() > 100) { - System.out.println("Large triangle"); - break; - } - default: - System.out.println("A shape, possibly a small triangle"); - } - } - - static void testTriangleRefined(Shape s) { - switch (s) { - case null -> - { break; } - case Triangle t - when t.calculateArea() > 100 -> - System.out.println("Large triangle"); - default -> - System.out.println("A shape, possibly a small triangle"); - } - } - - static void testTriangleRefined2(Shape s) { - switch (s) { - case null -> - { break; } - case Triangle t - when t.calculateArea() > 100 -> - System.out.println("Large triangle"); - case Triangle t -> - System.out.println("Small triangle"); - default -> - System.out.println("Non-triangle"); - } - } - - public static void main(String[] args) { - Triangle large = new Triangle(200); - Triangle small = new Triangle(10); - Rectangle rect = new Rectangle(); - - testTriangle(large); - testTriangle(small); - testTriangle(rect); - - testTriangleRefined(large); - testTriangleRefined(small); - testTriangleRefined(rect); - - testTriangleRefined2(large); - testTriangleRefined2(small); - testTriangleRefined2(rect); - } -} diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RefiningPatternsInSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RefiningPatternsInSwitch.txt deleted file mode 100644 index 800addcdf0..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RefiningPatternsInSwitch.txt +++ /dev/null @@ -1,257 +0,0 @@ -+- CompilationUnit[@PackageName = ""] - +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RefiningPatternsInSwitch", @CanonicalName = "RefiningPatternsInSwitch", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "RefiningPatternsInSwitch", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] - +- ClassBody[@Empty = false, @Size = 7] - +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RefiningPatternsInSwitch$Shape", @CanonicalName = "RefiningPatternsInSwitch.Shape", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Shape", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | +- ClassBody[@Empty = true, @Size = 0] - +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RefiningPatternsInSwitch$Rectangle", @CanonicalName = "RefiningPatternsInSwitch.Rectangle", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Rectangle", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | +- ExtendsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Shape"] - | +- ClassBody[@Empty = true, @Size = 0] - +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RefiningPatternsInSwitch$Triangle", @CanonicalName = "RefiningPatternsInSwitch.Triangle", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Triangle", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | +- ExtendsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Shape"] - | +- ClassBody[@Empty = false, @Size = 3] - | +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private}", @ExplicitModifiers = "{private}"] - | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | +- VariableDeclarator[@Initializer = false, @Name = "area"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "area", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] - | +- ConstructorDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "Triangle", @Name = "Triangle", @Varargs = false, @Visibility = Visibility.V_PACKAGE, @containsComment = false] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- FormalParameters[@Empty = false, @Size = 1] - | | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "area", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | | +- ExpressionStatement[] - | | +- AssignmentExpression[@CompileTimeConstant = false, @Compound = false, @Operator = AssignmentOp.ASSIGN, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "area", @Name = "area", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ThisExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "area", @Name = "area", @ParenthesisDepth = 0, @Parenthesized = false] - | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "calculateArea", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | +- FormalParameters[@Empty = true, @Size = 0] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- ReturnStatement[] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "area", @Name = "area", @ParenthesisDepth = 0, @Parenthesized = false] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testTriangle", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Shape"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchFallthroughBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- BreakStatement[@Label = null] - | +- SwitchFallthroughBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- IfStatement[@Else = false] - | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "calculateArea", @MethodName = "calculateArea", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "t", @Name = "t", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ArgumentList[@Empty = true, @Size = 0] - | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "100", @IntLiteral = true, @Integral = true, @LiteralText = "100", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 100.0, @ValueAsFloat = 100.0, @ValueAsInt = 100, @ValueAsLong = 100] - | | +- Block[@Empty = false, @Size = 2, @containsComment = false] - | | +- ExpressionStatement[] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Large triangle", @Empty = false, @Image = "\"Large triangle\"", @Length = 14, @LiteralText = "\"Large triangle\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- BreakStatement[@Label = null] - | +- SwitchFallthroughBranch[@Default = true] - | +- SwitchLabel[@Default = true] - | +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "A shape, possibly a small triangle", @Empty = false, @Image = "\"A shape, possibly a small triangle\"", @Length = 34, @LiteralText = "\"A shape, possibly a small triangle\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testTriangleRefined", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Shape"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | | +- BreakStatement[@Label = null] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- Guard[] - | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "calculateArea", @MethodName = "calculateArea", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "t", @Name = "t", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ArgumentList[@Empty = true, @Size = 0] - | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "100", @IntLiteral = true, @Integral = true, @LiteralText = "100", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 100.0, @ValueAsFloat = 100.0, @ValueAsInt = 100, @ValueAsLong = 100] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Large triangle", @Empty = false, @Image = "\"Large triangle\"", @Length = 14, @LiteralText = "\"Large triangle\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- SwitchArrowBranch[@Default = true] - | +- SwitchLabel[@Default = true] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "A shape, possibly a small triangle", @Empty = false, @Image = "\"A shape, possibly a small triangle\"", @Length = 34, @LiteralText = "\"A shape, possibly a small triangle\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testTriangleRefined2", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Shape"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | | +- BreakStatement[@Label = null] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- Guard[] - | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "calculateArea", @MethodName = "calculateArea", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "t", @Name = "t", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ArgumentList[@Empty = true, @Size = 0] - | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "100", @IntLiteral = true, @Integral = true, @LiteralText = "100", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 100.0, @ValueAsFloat = 100.0, @ValueAsInt = 100, @ValueAsLong = 100] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Large triangle", @Empty = false, @Image = "\"Large triangle\"", @Length = 14, @LiteralText = "\"Large triangle\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Small triangle", @Empty = false, @Image = "\"Small triangle\"", @Length = 14, @LiteralText = "\"Small triangle\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- SwitchArrowBranch[@Default = true] - | +- SwitchLabel[@Default = true] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Non-triangle", @Empty = false, @Image = "\"Non-triangle\"", @Length = 12, @LiteralText = "\"Non-triangle\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] - +- VoidType[] - +- FormalParameters[@Empty = false, @Size = 1] - | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- ArrayType[@ArrayDepth = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- ArrayDimensions[@Empty = false, @Size = 1] - | | +- ArrayTypeDim[@Varargs = false] - | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - +- Block[@Empty = false, @Size = 12, @containsComment = false] - +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"] - | +- VariableDeclarator[@Initializer = true, @Name = "large"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "large", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "200", @IntLiteral = true, @Integral = true, @LiteralText = "200", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 200.0, @ValueAsFloat = 200.0, @ValueAsInt = 200, @ValueAsLong = 200] - +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"] - | +- VariableDeclarator[@Initializer = true, @Name = "small"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "small", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "10", @IntLiteral = true, @Integral = true, @LiteralText = "10", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 10.0, @ValueAsFloat = 10.0, @ValueAsInt = 10, @ValueAsLong = 10] - +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] - | +- VariableDeclarator[@Initializer = true, @Name = "rect"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "rect", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] - | +- ArgumentList[@Empty = true, @Size = 0] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "testTriangle", @MethodName = "testTriangle", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "large", @Name = "large", @ParenthesisDepth = 0, @Parenthesized = false] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "testTriangle", @MethodName = "testTriangle", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "small", @Name = "small", @ParenthesisDepth = 0, @Parenthesized = false] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "testTriangle", @MethodName = "testTriangle", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "rect", @Name = "rect", @ParenthesisDepth = 0, @Parenthesized = false] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "testTriangleRefined", @MethodName = "testTriangleRefined", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "large", @Name = "large", @ParenthesisDepth = 0, @Parenthesized = false] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "testTriangleRefined", @MethodName = "testTriangleRefined", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "small", @Name = "small", @ParenthesisDepth = 0, @Parenthesized = false] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "testTriangleRefined", @MethodName = "testTriangleRefined", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "rect", @Name = "rect", @ParenthesisDepth = 0, @Parenthesized = false] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "testTriangleRefined2", @MethodName = "testTriangleRefined2", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "large", @Name = "large", @ParenthesisDepth = 0, @Parenthesized = false] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "testTriangleRefined2", @MethodName = "testTriangleRefined2", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "small", @Name = "small", @ParenthesisDepth = 0, @Parenthesized = false] - +- ExpressionStatement[] - +- MethodCall[@CompileTimeConstant = false, @Image = "testTriangleRefined2", @MethodName = "testTriangleRefined2", @ParenthesisDepth = 0, @Parenthesized = false] - +- ArgumentList[@Empty = false, @Size = 1] - +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "rect", @Name = "rect", @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ScopeOfPatternVariableDeclarations.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ScopeOfPatternVariableDeclarations.java deleted file mode 100644 index d65340e4da..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ScopeOfPatternVariableDeclarations.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -/** - * @see JEP 433: Pattern Matching for switch (Fourth Preview) - */ -public class ScopeOfPatternVariableDeclarations { - - static void testSwitchBlock(Object obj) { - switch (obj) { - case Character c - when c.charValue() == 7: - System.out.println("Ding!"); - break; - default: - break; - } - } - - static void testSwitchRule(Object o) { - switch (o) { - case Character c -> { - if (c.charValue() == 7) { - System.out.println("Ding!"); - } - System.out.println("Character"); - } - case Integer i -> - throw new IllegalStateException("Invalid Integer argument of value " + i.intValue()); - default -> { - break; - } - } - } - - - static void test2(Object o) { - switch (o) { - case Character c: - if (c.charValue() == 7) { - System.out.print("Ding "); - } - if (c.charValue() == 9) { - System.out.print("Tab "); - } - System.out.println("character"); - default: - System.out.println("fall-through"); - } - } - - - public static void main(String[] args) { - testSwitchBlock('\u0007'); - testSwitchRule('A'); - try { - testSwitchRule(42); // throws - } catch (IllegalStateException e) { - System.out.println(e); - } - test2('\t'); - } -} diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ScopeOfPatternVariableDeclarations.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ScopeOfPatternVariableDeclarations.txt deleted file mode 100644 index e51ef27eda..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ScopeOfPatternVariableDeclarations.txt +++ /dev/null @@ -1,200 +0,0 @@ -+- CompilationUnit[@PackageName = ""] - +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ScopeOfPatternVariableDeclarations", @CanonicalName = "ScopeOfPatternVariableDeclarations", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "ScopeOfPatternVariableDeclarations", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] - +- ClassBody[@Empty = false, @Size = 4] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testSwitchBlock", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "obj", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchFallthroughBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Character"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- Guard[] - | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "charValue", @MethodName = "charValue", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ArgumentList[@Empty = true, @Size = 0] - | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "7", @IntLiteral = true, @Integral = true, @LiteralText = "7", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 7.0, @ValueAsFloat = 7.0, @ValueAsInt = 7, @ValueAsLong = 7] - | | +- ExpressionStatement[] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Ding!", @Empty = false, @Image = "\"Ding!\"", @Length = 5, @LiteralText = "\"Ding!\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- BreakStatement[@Label = null] - | +- SwitchFallthroughBranch[@Default = true] - | +- SwitchLabel[@Default = true] - | +- BreakStatement[@Label = null] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testSwitchRule", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Character"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- Block[@Empty = false, @Size = 2, @containsComment = false] - | | +- IfStatement[@Else = false] - | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- MethodCall[@CompileTimeConstant = false, @Image = "charValue", @MethodName = "charValue", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | | +- ArgumentList[@Empty = true, @Size = 0] - | | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "7", @IntLiteral = true, @Integral = true, @LiteralText = "7", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 7.0, @ValueAsFloat = 7.0, @ValueAsInt = 7, @ValueAsLong = 7] - | | | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | | | +- ExpressionStatement[] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Ding!", @Empty = false, @Image = "\"Ding!\"", @Length = 5, @LiteralText = "\"Ding!\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- ExpressionStatement[] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Character", @Empty = false, @Image = "\"Character\"", @Length = 9, @LiteralText = "\"Character\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ThrowStatement[] - | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "IllegalStateException"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Invalid Integer argument of value ", @Empty = false, @Image = "\"Invalid Integer argument of value \"", @Length = 34, @LiteralText = "\"Invalid Integer argument of value \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "intValue", @MethodName = "intValue", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ArgumentList[@Empty = true, @Size = 0] - | +- SwitchArrowBranch[@Default = true] - | +- SwitchLabel[@Default = true] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- BreakStatement[@Label = null] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "test2", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] - | +- VoidType[] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchFallthroughBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Character"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- IfStatement[@Else = false] - | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- MethodCall[@CompileTimeConstant = false, @Image = "charValue", @MethodName = "charValue", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | | +- ArgumentList[@Empty = true, @Size = 0] - | | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "7", @IntLiteral = true, @Integral = true, @LiteralText = "7", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 7.0, @ValueAsFloat = 7.0, @ValueAsInt = 7, @ValueAsLong = 7] - | | | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | | | +- ExpressionStatement[] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "print", @MethodName = "print", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Ding ", @Empty = false, @Image = "\"Ding \"", @Length = 5, @LiteralText = "\"Ding \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- IfStatement[@Else = false] - | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- MethodCall[@CompileTimeConstant = false, @Image = "charValue", @MethodName = "charValue", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | | +- ArgumentList[@Empty = true, @Size = 0] - | | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "9", @IntLiteral = true, @Integral = true, @LiteralText = "9", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 9.0, @ValueAsFloat = 9.0, @ValueAsInt = 9, @ValueAsLong = 9] - | | | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | | | +- ExpressionStatement[] - | | | +- MethodCall[@CompileTimeConstant = false, @Image = "print", @MethodName = "print", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Tab ", @Empty = false, @Image = "\"Tab \"", @Length = 4, @LiteralText = "\"Tab \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- ExpressionStatement[] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "character", @Empty = false, @Image = "\"character\"", @Length = 9, @LiteralText = "\"character\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | +- SwitchFallthroughBranch[@Default = true] - | +- SwitchLabel[@Default = true] - | +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "fall-through", @Empty = false, @Image = "\"fall-through\"", @Length = 12, @LiteralText = "\"fall-through\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] - +- VoidType[] - +- FormalParameters[@Empty = false, @Size = 1] - | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | +- ArrayType[@ArrayDepth = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- ArrayDimensions[@Empty = false, @Size = 1] - | | +- ArrayTypeDim[@Varargs = false] - | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - +- Block[@Empty = false, @Size = 4, @containsComment = false] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "testSwitchBlock", @MethodName = "testSwitchBlock", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- CharLiteral[@CompileTimeConstant = true, @Image = "\'\u0007\'", @LiteralText = "\'\u0007\'", @ParenthesisDepth = 0, @Parenthesized = false] - +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "testSwitchRule", @MethodName = "testSwitchRule", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- CharLiteral[@CompileTimeConstant = true, @Image = "\'A\'", @LiteralText = "\'A\'", @ParenthesisDepth = 0, @Parenthesized = false] - +- TryStatement[@TryWithResources = false] - | +- Block[@Empty = false, @Size = 1, @containsComment = true] - | | +- ExpressionStatement[] - | | +- MethodCall[@CompileTimeConstant = false, @Image = "testSwitchRule", @MethodName = "testSwitchRule", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "42", @IntLiteral = true, @Integral = true, @LiteralText = "42", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42] - | +- CatchClause[] - | +- CatchParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Multicatch = false, @Name = "e", @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "IllegalStateException"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "e", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "e", @Name = "e", @ParenthesisDepth = 0, @Parenthesized = false] - +- ExpressionStatement[] - +- MethodCall[@CompileTimeConstant = false, @Image = "test2", @MethodName = "test2", @ParenthesisDepth = 0, @Parenthesized = false] - +- ArgumentList[@Empty = false, @Size = 1] - +- CharLiteral[@CompileTimeConstant = true, @Image = "\'\\t\'", @LiteralText = "\'\\t\'", @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/DealingWithNull.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/DealingWithNull.txt index 90ec5a71ab..c0f15806af 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/DealingWithNull.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/DealingWithNull.txt @@ -53,7 +53,7 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -95,7 +95,7 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -136,7 +136,7 @@ | | +- ArgumentList[@Empty = true, @Size = 0] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -150,7 +150,7 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -192,7 +192,7 @@ | | | +- BreakStatement[@Label = null] | | +- SwitchFallthroughBranch[@Default = false] | | | +- SwitchLabel[@Default = false] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -227,7 +227,7 @@ | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "null", @Empty = false, @Image = "\"null\"", @Length = 4, @LiteralText = "\"null\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- SwitchArrowBranch[@Default = false] | | | +- SwitchLabel[@Default = false] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/EnhancedTypeCheckingSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/EnhancedTypeCheckingSwitch.txt index ea36cde53a..9ebc269936 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/EnhancedTypeCheckingSwitch.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/EnhancedTypeCheckingSwitch.txt @@ -48,7 +48,7 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "null", @Empty = false, @Image = "\"null\"", @Length = 4, @LiteralText = "\"null\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -60,7 +60,7 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String", @Empty = false, @Image = "\"String\"", @Length = 6, @LiteralText = "\"String\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -76,7 +76,7 @@ | | +- ArgumentList[@Empty = true, @Size = 0] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -92,7 +92,7 @@ | | +- ArgumentList[@Empty = true, @Size = 0] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ArrayType[@ArrayDepth = 1] | | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ExhaustiveSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ExhaustiveSwitch.txt index a62132bff0..06e21ac6e4 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ExhaustiveSwitch.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ExhaustiveSwitch.txt @@ -16,7 +16,7 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -25,7 +25,7 @@ | | +- ArgumentList[@Empty = true, @Size = 0] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -46,7 +46,7 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchFallthroughBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -60,7 +60,7 @@ | | +- BreakStatement[@Label = null] | +- SwitchFallthroughBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -116,21 +116,21 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "B"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] | +- SwitchArrowBranch[@Default = false] | +- SwitchLabel[@Default = false] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "C"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -148,7 +148,7 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] | | +- SwitchFallthroughBranch[@Default = false] | | | +- SwitchLabel[@Default = false] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -162,7 +162,7 @@ | | | +- BreakStatement[@Label = null] | | +- SwitchFallthroughBranch[@Default = false] | | | +- SwitchLabel[@Default = false] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "C"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -227,7 +227,7 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | +- SwitchLabel[@Default = false] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "F"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/GuardedPatterns.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/GuardedPatterns.txt index 9b3deddd57..9d0c0e74fe 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/GuardedPatterns.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/GuardedPatterns.txt @@ -15,7 +15,7 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -33,7 +33,7 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "single char string", @Empty = false, @Image = "\"single char string\"", @Length = 18, @LiteralText = "\"single char string\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -45,7 +45,7 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "string", @Empty = false, @Image = "\"string\"", @Length = 6, @LiteralText = "\"string\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -119,7 +119,7 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -137,7 +137,7 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "single char string", @Empty = false, @Image = "\"single char string\"", @Length = 18, @LiteralText = "\"single char string\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -149,7 +149,7 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "string", @Empty = false, @Image = "\"string\"", @Length = 6, @LiteralText = "\"string\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -196,7 +196,7 @@ | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -222,7 +222,7 @@ | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -244,7 +244,7 @@ | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 1, @Parenthesized = true] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -275,7 +275,7 @@ | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 1, @Parenthesized = true] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep440_RecordPatterns.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep440_RecordPatterns.txt index 646dad960d..1a3f366681 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep440_RecordPatterns.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep440_RecordPatterns.txt @@ -27,14 +27,14 @@ | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] | | +- PatternList[@Empty = false, @Size = 2] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -97,21 +97,21 @@ | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] | | +- PatternList[@Empty = false, @Size = 2] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] | | | +- PatternList[@Empty = false, @Size = 2] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -136,28 +136,28 @@ | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] | | +- PatternList[@Empty = false, @Size = 2] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] | | | +- PatternList[@Empty = false, @Size = 2] - | | | +- RecordPattern[@ParenthesisDepth = 0] + | | | +- RecordPattern[] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] | | | | +- PatternList[@Empty = false, @Size = 2] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -202,14 +202,14 @@ | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "p", @Name = "p", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] | | +- PatternList[@Empty = false, @Size = 2] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -265,14 +265,14 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "pair", @Name = "pair", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | +- SwitchLabel[@Default = false] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | +- ClassType[@FullyQualified = false, @SimpleName = "MyPair"] | | +- PatternList[@Empty = false, @Size = 2] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "f", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -309,17 +309,17 @@ | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "bbs", @Name = "bbs", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- PatternList[@Empty = false, @Size = 1] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | +- PatternList[@Empty = false, @Size = 1] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -350,13 +350,13 @@ +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "bbs", @Name = "bbs", @ParenthesisDepth = 0, @Parenthesized = false] | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- RecordPattern[@ParenthesisDepth = 0] + | +- RecordPattern[] | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | +- PatternList[@Empty = false, @Size = 1] - | +- RecordPattern[@ParenthesisDepth = 0] + | +- RecordPattern[] | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | +- PatternList[@Empty = false, @Size = 1] - | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | +- ClassType[@FullyQualified = false, @SimpleName = "var"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep441_PatternMatchingForSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep441_PatternMatchingForSwitch.txt index 2dd50e02ab..dcfeefbe4d 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep441_PatternMatchingForSwitch.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep441_PatternMatchingForSwitch.txt @@ -16,7 +16,7 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -28,7 +28,7 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Long"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "l", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -40,7 +40,7 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "l", @Name = "l", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Double"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -52,7 +52,7 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "d", @Name = "d", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -122,7 +122,7 @@ | | +- Block[@Empty = true, @Size = 0, @containsComment = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -141,7 +141,7 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "You got it", @Empty = false, @Image = "\"You got it\"", @Length = 10, @LiteralText = "\"You got it\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -160,7 +160,7 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Shame", @Empty = false, @Image = "\"Shame\"", @Length = 5, @LiteralText = "\"Shame\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | +- SwitchLabel[@Default = false] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -213,7 +213,7 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Shame", @Empty = false, @Image = "\"Shame\"", @Length = 5, @LiteralText = "\"Shame\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -232,7 +232,7 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "You got it", @Empty = false, @Image = "\"You got it\"", @Length = 10, @LiteralText = "\"You got it\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -251,7 +251,7 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Shame", @Empty = false, @Image = "\"Shame\"", @Length = 5, @LiteralText = "\"Shame\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | +- SwitchLabel[@Default = false] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -304,7 +304,7 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Suit"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -324,7 +324,7 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "It\'s clubs", @Empty = false, @Image = "\"It\'s clubs\"", @Length = 10, @LiteralText = "\"It\'s clubs\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Suit"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -344,7 +344,7 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "It\'s diamonds", @Empty = false, @Image = "\"It\'s diamonds\"", @Length = 13, @LiteralText = "\"It\'s diamonds\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Suit"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -364,7 +364,7 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "It\'s hearts", @Empty = false, @Image = "\"It\'s hearts\"", @Length = 11, @LiteralText = "\"It\'s hearts\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Suit"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -378,7 +378,7 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "It\'s spades", @Empty = false, @Image = "\"It\'s spades\"", @Length = 11, @LiteralText = "\"It\'s spades\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | +- SwitchLabel[@Default = false] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "Tarot"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -455,7 +455,7 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "It\'s spades", @Empty = false, @Image = "\"It\'s spades\"", @Length = 11, @LiteralText = "\"It\'s spades\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | +- SwitchLabel[@Default = false] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "Tarot"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/PatternsInSwitchLabels.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/PatternsInSwitchLabels.txt index abb2f972ed..ce62ae92dc 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/PatternsInSwitchLabels.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/PatternsInSwitchLabels.txt @@ -29,7 +29,7 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -41,7 +41,7 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Long"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "l", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -53,7 +53,7 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "l", @Name = "l", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Double"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -65,7 +65,7 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "d", @Name = "d", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatterns.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatterns.txt index 7e0d61f1ad..1db00066df 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatterns.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatterns.txt @@ -63,7 +63,7 @@ | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -106,14 +106,14 @@ | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] | | +- PatternList[@Empty = false, @Size = 2] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -140,14 +140,14 @@ | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] | | +- PatternList[@Empty = false, @Size = 2] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "ul", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -174,21 +174,21 @@ | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] | | +- PatternList[@Empty = false, @Size = 2] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] | | | +- PatternList[@Empty = false, @Size = 2] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -270,28 +270,28 @@ | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] | | +- PatternList[@Empty = false, @Size = 2] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] | | | +- PatternList[@Empty = false, @Size = 2] - | | | +- RecordPattern[@ParenthesisDepth = 0] + | | | +- RecordPattern[] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] | | | | +- PatternList[@Empty = false, @Size = 2] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -336,14 +336,14 @@ | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "p", @Name = "p", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] | | +- PatternList[@Empty = false, @Size = 2] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -392,12 +392,12 @@ | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "bo", @Name = "bo", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | | +- PatternList[@Empty = false, @Size = 1] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -426,12 +426,12 @@ | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "bo", @Name = "bo", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- PatternList[@Empty = false, @Size = 1] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -460,10 +460,10 @@ | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "bo", @Name = "bo", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | +- PatternList[@Empty = false, @Size = 1] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -494,17 +494,17 @@ | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "bo", @Name = "bo", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- PatternList[@Empty = false, @Size = 1] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | +- PatternList[@Empty = false, @Size = 1] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -535,13 +535,13 @@ +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "bo", @Name = "bo", @ParenthesisDepth = 0, @Parenthesized = false] | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- RecordPattern[@ParenthesisDepth = 0] + | +- RecordPattern[] | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | +- PatternList[@Empty = false, @Size = 1] - | +- RecordPattern[@ParenthesisDepth = 0] + | +- RecordPattern[] | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | +- PatternList[@Empty = false, @Size = 1] - | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | +- ClassType[@FullyQualified = false, @SimpleName = "var"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatternsExhaustiveSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatternsExhaustiveSwitch.txt index 3c87e4ce4a..bee481fa9c 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatternsExhaustiveSwitch.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatternsExhaustiveSwitch.txt @@ -65,16 +65,16 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "p1", @Name = "p1", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- RecordPattern[@ParenthesisDepth = 0] + | | | +- RecordPattern[] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] | | | +- PatternList[@Empty = false, @Size = 2] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "B"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -86,16 +86,16 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- RecordPattern[@ParenthesisDepth = 0] + | | | +- RecordPattern[] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] | | | +- PatternList[@Empty = false, @Size = 2] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "B"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -107,16 +107,16 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | +- SwitchLabel[@Default = false] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] | | +- PatternList[@Empty = false, @Size = 2] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a1", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a2", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -130,16 +130,16 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "p2", @Name = "p2", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- RecordPattern[@ParenthesisDepth = 0] + | | | +- RecordPattern[] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] | | | +- PatternList[@Empty = false, @Size = 2] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "C"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -151,16 +151,16 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | +- SwitchLabel[@Default = false] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] | | +- PatternList[@Empty = false, @Size = 2] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "D"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -174,16 +174,16 @@ +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "p2", @Name = "p2", @ParenthesisDepth = 0, @Parenthesized = false] +- SwitchArrowBranch[@Default = false] | +- SwitchLabel[@Default = false] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] | | +- PatternList[@Empty = false, @Size = 2] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "C"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -195,16 +195,16 @@ | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- SwitchArrowBranch[@Default = false] | +- SwitchLabel[@Default = false] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] | | +- PatternList[@Empty = false, @Size = 2] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "D"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "C"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -216,16 +216,16 @@ | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- SwitchArrowBranch[@Default = false] +- SwitchLabel[@Default = false] - | +- RecordPattern[@ParenthesisDepth = 0] + | +- RecordPattern[] | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] | +- PatternList[@Empty = false, @Size = 2] - | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "D"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d1", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | +- ClassType[@FullyQualified = false, @SimpleName = "D"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d2", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RefiningPatternsInSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RefiningPatternsInSwitch.txt index 800addcdf0..6cb3616f8f 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RefiningPatternsInSwitch.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RefiningPatternsInSwitch.txt @@ -57,7 +57,7 @@ | | +- BreakStatement[@Label = null] | +- SwitchFallthroughBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -103,7 +103,7 @@ | | +- BreakStatement[@Label = null] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -145,7 +145,7 @@ | | +- BreakStatement[@Label = null] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -163,7 +163,7 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Large triangle", @Empty = false, @Image = "\"Large triangle\"", @Length = 14, @LiteralText = "\"Large triangle\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ScopeOfPatternVariableDeclarations.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ScopeOfPatternVariableDeclarations.txt index e51ef27eda..70447ca705 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ScopeOfPatternVariableDeclarations.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ScopeOfPatternVariableDeclarations.txt @@ -15,7 +15,7 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchFallthroughBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Character"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -49,7 +49,7 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Character"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -77,7 +77,7 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Character", @Empty = false, @Image = "\"Character\"", @Length = 9, @LiteralText = "\"Character\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -107,7 +107,7 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchFallthroughBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Character"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep430_StringTemplates.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep430_StringTemplates.txt index ba9fb0bb3c..cbe8f11d45 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep430_StringTemplates.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep430_StringTemplates.txt @@ -48,11 +48,11 @@ | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Template[] - | | +- TemplateFragment[@Image = "\"\\{"] + | | +- TemplateFragment[@Content = "\"\\{"] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "firstName", @Name = "firstName", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TemplateFragment[@Image = "} \\{"] + | | +- TemplateFragment[@Content = "} \\{"] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "lastName", @Name = "lastName", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TemplateFragment[@Image = "}\""] + | | +- TemplateFragment[@Content = "}\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] @@ -61,11 +61,11 @@ | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Template[] - | | +- TemplateFragment[@Image = "\"\\{"] + | | +- TemplateFragment[@Content = "\"\\{"] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "lastName", @Name = "lastName", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TemplateFragment[@Image = "}, \\{"] + | | +- TemplateFragment[@Content = "}, \\{"] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "firstName", @Name = "firstName", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TemplateFragment[@Image = "}\""] + | | +- TemplateFragment[@Content = "}\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] @@ -83,15 +83,15 @@ | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Template[] - | | +- TemplateFragment[@Image = "\"\\{"] + | | +- TemplateFragment[@Content = "\"\\{"] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TemplateFragment[@Image = "} + \\{"] + | | +- TemplateFragment[@Content = "} + \\{"] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "y", @Name = "y", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TemplateFragment[@Image = "} = \\{"] + | | +- TemplateFragment[@Content = "} = \\{"] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "y", @Name = "y", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TemplateFragment[@Image = "}\""] + | | +- TemplateFragment[@Content = "}\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] @@ -100,10 +100,10 @@ | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Template[] - | | +- TemplateFragment[@Image = "\"You have a \\{"] + | | +- TemplateFragment[@Content = "\"You have a \\{"] | | +- MethodCall[@CompileTimeConstant = false, @Image = "getOfferType", @MethodName = "getOfferType", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ArgumentList[@Empty = true, @Size = 0] - | | +- TemplateFragment[@Image = "} waiting for you!\""] + | | +- TemplateFragment[@Content = "} waiting for you!\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "Request"] @@ -123,16 +123,16 @@ | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Template[] - | | +- TemplateFragment[@Image = "\"Access at \\{"] + | | +- TemplateFragment[@Content = "\"Access at \\{"] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "date", @Name = "date", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "req", @Name = "req", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TemplateFragment[@Image = "} \\{"] + | | +- TemplateFragment[@Content = "} \\{"] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "time", @Name = "time", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "req", @Name = "req", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TemplateFragment[@Image = "} from \\{"] + | | +- TemplateFragment[@Content = "} from \\{"] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "ipAddress", @Name = "ipAddress", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "req", @Name = "req", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TemplateFragment[@Image = "}\""] + | | +- TemplateFragment[@Content = "}\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] @@ -175,16 +175,16 @@ | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Template[] - | | +- TemplateFragment[@Image = "\"The file \\{"] + | | +- TemplateFragment[@Content = "\"The file \\{"] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "filePath", @Name = "filePath", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TemplateFragment[@Image = "} \\{"] + | | +- TemplateFragment[@Content = "} \\{"] | | +- ConditionalExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "exists", @MethodName = "exists", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "file", @Name = "file", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- ArgumentList[@Empty = true, @Size = 0] | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "does", @Empty = false, @Image = "\"does\"", @Length = 4, @LiteralText = "\"does\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "does not", @Empty = false, @Image = "\"does not\"", @Length = 8, @LiteralText = "\"does not\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- TemplateFragment[@Image = "} exist\""] + | | +- TemplateFragment[@Content = "} exist\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] @@ -193,7 +193,7 @@ | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Template[] - | | +- TemplateFragment[@Image = "\"The time is \\{"] + | | +- TemplateFragment[@Content = "\"The time is \\{"] | | +- MethodCall[@CompileTimeConstant = false, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "ofPattern", @MethodName = "ofPattern", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] @@ -205,7 +205,7 @@ | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "LocalTime"] | | | +- ArgumentList[@Empty = true, @Size = 0] - | | +- TemplateFragment[@Image = "} right now\""] + | | +- TemplateFragment[@Content = "} right now\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] @@ -220,19 +220,19 @@ | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Template[] - | | +- TemplateFragment[@Image = "\"\\{"] + | | +- TemplateFragment[@Content = "\"\\{"] | | +- UnaryExpression[@CompileTimeConstant = false, @Operator = UnaryOp.POST_INCREMENT, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "index", @Name = "index", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TemplateFragment[@Image = "}, \\{"] + | | +- TemplateFragment[@Content = "}, \\{"] | | +- UnaryExpression[@CompileTimeConstant = false, @Operator = UnaryOp.POST_INCREMENT, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "index", @Name = "index", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TemplateFragment[@Image = "}, \\{"] + | | +- TemplateFragment[@Content = "}, \\{"] | | +- UnaryExpression[@CompileTimeConstant = false, @Operator = UnaryOp.POST_INCREMENT, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "index", @Name = "index", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TemplateFragment[@Image = "}, \\{"] + | | +- TemplateFragment[@Content = "}, \\{"] | | +- UnaryExpression[@CompileTimeConstant = false, @Operator = UnaryOp.POST_INCREMENT, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "index", @Name = "index", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TemplateFragment[@Image = "}\""] + | | +- TemplateFragment[@Content = "}\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | +- ArrayType[@ArrayDepth = 1] @@ -253,24 +253,24 @@ | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Template[] - | | +- TemplateFragment[@Image = "\"\\{"] + | | +- TemplateFragment[@Content = "\"\\{"] | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "fruit", @Name = "fruit", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] - | | +- TemplateFragment[@Image = "}, \\{"] + | | +- TemplateFragment[@Content = "}, \\{"] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- Template[] - | | | +- TemplateFragment[@Image = "\"\\{"] + | | | +- TemplateFragment[@Content = "\"\\{"] | | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "fruit", @Name = "fruit", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] - | | | +- TemplateFragment[@Image = "}, \\{"] + | | | +- TemplateFragment[@Content = "}, \\{"] | | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "fruit", @Name = "fruit", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] - | | | +- TemplateFragment[@Image = "}\""] - | | +- TemplateFragment[@Image = "}\""] + | | | +- TemplateFragment[@Content = "}\""] + | | +- TemplateFragment[@Content = "}\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] @@ -279,24 +279,24 @@ | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | +- Template[] - | +- TemplateFragment[@Image = "\"\\{"] + | +- TemplateFragment[@Content = "\"\\{"] | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "fruit", @Name = "fruit", @ParenthesisDepth = 0, @Parenthesized = false] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] - | +- TemplateFragment[@Image = "}, \\{"] + | +- TemplateFragment[@Content = "}, \\{"] | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Template[] - | | +- TemplateFragment[@Image = "\"\\{"] + | | +- TemplateFragment[@Content = "\"\\{"] | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "fruit", @Name = "fruit", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] - | | +- TemplateFragment[@Image = "}, \\{"] + | | +- TemplateFragment[@Content = "}, \\{"] | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "fruit", @Name = "fruit", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] - | | +- TemplateFragment[@Image = "}\""] - | +- TemplateFragment[@Image = "}\""] + | | +- TemplateFragment[@Content = "}\""] + | +- TemplateFragment[@Content = "}\""] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "getOfferType", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] @@ -329,11 +329,11 @@ | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Template[] - | | +- TemplateFragment[@Image = "\"\"\"\n \n \n \\{"] + | | +- TemplateFragment[@Content = "\"\"\"\n <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, @Name = "FMTTemplateProcessor", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] | +- VoidType[] @@ -520,75 +520,75 @@ | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "FMT", @Name = "FMT", @ParenthesisDepth = 0, @Parenthesized = false] | +- Template[] - | +- TemplateFragment[@Image = "\"\"\"\n Description Width Height Area\n %-12s\\{"] + | +- TemplateFragment[@Content = "\"\"\"\n Description Width Height Area\n %-12s\\{"] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] - | +- TemplateFragment[@Image = "} %7.2f\\{"] + | +- TemplateFragment[@Content = "} %7.2f\\{"] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "width", @Name = "width", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] - | +- TemplateFragment[@Image = "} %7.2f\\{"] + | +- TemplateFragment[@Content = "} %7.2f\\{"] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "height", @Name = "height", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] - | +- TemplateFragment[@Image = "} %7.2f\\{"] + | +- TemplateFragment[@Content = "} %7.2f\\{"] | +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] | | +- ArgumentList[@Empty = true, @Size = 0] - | +- TemplateFragment[@Image = "}\n %-12s\\{"] + | +- TemplateFragment[@Content = "}\n %-12s\\{"] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] - | +- TemplateFragment[@Image = "} %7.2f\\{"] + | +- TemplateFragment[@Content = "} %7.2f\\{"] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "width", @Name = "width", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] - | +- TemplateFragment[@Image = "} %7.2f\\{"] + | +- TemplateFragment[@Content = "} %7.2f\\{"] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "height", @Name = "height", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] - | +- TemplateFragment[@Image = "} %7.2f\\{"] + | +- TemplateFragment[@Content = "} %7.2f\\{"] | +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] | | +- ArgumentList[@Empty = true, @Size = 0] - | +- TemplateFragment[@Image = "}\n %-12s\\{"] + | +- TemplateFragment[@Content = "}\n %-12s\\{"] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] - | +- TemplateFragment[@Image = "} %7.2f\\{"] + | +- TemplateFragment[@Content = "} %7.2f\\{"] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "width", @Name = "width", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] - | +- TemplateFragment[@Image = "} %7.2f\\{"] + | +- TemplateFragment[@Content = "} %7.2f\\{"] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "height", @Name = "height", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] - | +- TemplateFragment[@Image = "} %7.2f\\{"] + | +- TemplateFragment[@Content = "} %7.2f\\{"] | +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] | | +- ArgumentList[@Empty = true, @Size = 0] - | +- TemplateFragment[@Image = "}\n \\{"] + | +- TemplateFragment[@Content = "}\n \\{"] | +- MethodCall[@CompileTimeConstant = false, @Image = "repeat", @MethodName = "repeat", @ParenthesisDepth = 0, @Parenthesized = false] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = " ", @Empty = false, @Image = "\" \"", @Length = 1, @LiteralText = "\" \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "28", @IntLiteral = true, @Integral = true, @LiteralText = "28", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 28.0, @ValueAsFloat = 28.0, @ValueAsInt = 28, @ValueAsLong = 28] - | +- TemplateFragment[@Image = "} Total %7.2f\\{"] + | +- TemplateFragment[@Content = "} Total %7.2f\\{"] | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false] @@ -606,7 +606,7 @@ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] | | +- ArgumentList[@Empty = true, @Size = 0] - | +- TemplateFragment[@Image = "}\n \"\"\""] + | +- TemplateFragment[@Content = "}\n \"\"\""] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "ensuringSafety", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] | +- VoidType[] @@ -626,9 +626,9 @@ | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "RAW", @Name = "RAW", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Template[] - | | +- TemplateFragment[@Image = "\"My name is \\{"] + | | +- TemplateFragment[@Content = "\"My name is \\{"] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TemplateFragment[@Image = "}\""] + | | +- TemplateFragment[@Content = "}\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] @@ -681,15 +681,15 @@ | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | +- Template[] - | +- TemplateFragment[@Image = "\"Welcome, \\{"] + | +- TemplateFragment[@Content = "\"Welcome, \\{"] | +- MethodCall[@CompileTimeConstant = false, @Image = "firstName", @MethodName = "firstName", @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "user", @Name = "user", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArgumentList[@Empty = true, @Size = 0] - | +- TemplateFragment[@Image = "}, to your account \\{"] + | +- TemplateFragment[@Content = "}, to your account \\{"] | +- MethodCall[@CompileTimeConstant = false, @Image = "accountNumber", @MethodName = "accountNumber", @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "user", @Name = "user", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArgumentList[@Empty = true, @Size = 0] - | +- TemplateFragment[@Image = "}\""] + | +- TemplateFragment[@Content = "}\""] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "emptyEmbeddedExpression", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] +- VoidType[] @@ -703,5 +703,5 @@ +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] +- Template[] - +- TemplateFragment[@Image = "\"Test \\{"] - +- TemplateFragment[@Image = "}\""] + +- TemplateFragment[@Content = "\"Test \\{"] + +- TemplateFragment[@Content = "}\""] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep443_UnnamedPatternsAndVariables.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep443_UnnamedPatternsAndVariables.txt index d15b0ab2ef..c42b1cc26f 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep443_UnnamedPatternsAndVariables.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep443_UnnamedPatternsAndVariables.txt @@ -67,14 +67,14 @@ | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- RecordPattern[@ParenthesisDepth = 0] + | | | +- RecordPattern[] | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] | | | +- PatternList[@Empty = false, @Size = 2] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -98,21 +98,21 @@ | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] | | +- PatternList[@Empty = false, @Size = 2] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] | | | +- PatternList[@Empty = false, @Size = 2] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- UnnamedPattern[@ParenthesisDepth = 0] + | | +- UnnamedPattern[] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -182,10 +182,10 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false] | | +- SwitchArrowBranch[@Default = false] | | | +- SwitchLabel[@Default = false] - | | | | +- RecordPattern[@ParenthesisDepth = 0] + | | | | +- RecordPattern[] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | | +- PatternList[@Empty = false, @Size = 1] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "RedBall"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -194,10 +194,10 @@ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false] | | +- SwitchArrowBranch[@Default = false] | | | +- SwitchLabel[@Default = false] - | | | | +- RecordPattern[@ParenthesisDepth = 0] + | | | | +- RecordPattern[] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | | +- PatternList[@Empty = false, @Size = 1] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "BlueBall"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -206,10 +206,10 @@ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false] | | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- RecordPattern[@ParenthesisDepth = 0] + | | | +- RecordPattern[] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | +- PatternList[@Empty = false, @Size = 1] - | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "GreenBall"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -219,17 +219,17 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false] | | +- SwitchArrowBranch[@Default = false] | | | +- SwitchLabel[@Default = false] - | | | | +- RecordPattern[@ParenthesisDepth = 0] + | | | | +- RecordPattern[] | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | | | +- PatternList[@Empty = false, @Size = 1] - | | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "RedBall"] | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | | +- RecordPattern[@ParenthesisDepth = 0] + | | | | +- RecordPattern[] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | | +- PatternList[@Empty = false, @Size = 1] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "BlueBall"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -238,10 +238,10 @@ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false] | | +- SwitchArrowBranch[@Default = false] | | | +- SwitchLabel[@Default = false] - | | | | +- RecordPattern[@ParenthesisDepth = 0] + | | | | +- RecordPattern[] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | | +- PatternList[@Empty = false, @Size = 1] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "GreenBall"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -249,10 +249,10 @@ | | | +- ArgumentList[@Empty = true, @Size = 0] | | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- RecordPattern[@ParenthesisDepth = 0] + | | | +- RecordPattern[] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | +- PatternList[@Empty = false, @Size = 1] - | | | +- UnnamedPattern[@ParenthesisDepth = 0] + | | | +- UnnamedPattern[] | | +- MethodCall[@CompileTimeConstant = false, @Image = "pickAnotherBox", @MethodName = "pickAnotherBox", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArgumentList[@Empty = true, @Size = 0] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -265,17 +265,17 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- RecordPattern[@ParenthesisDepth = 0] + | | | +- RecordPattern[] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | | +- PatternList[@Empty = false, @Size = 1] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "RedBall"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- RecordPattern[@ParenthesisDepth = 0] + | | | +- RecordPattern[] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | | +- PatternList[@Empty = false, @Size = 1] - | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE] + | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "BlueBall"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -288,10 +288,10 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | +- SwitchLabel[@Default = false] - | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- RecordPattern[] | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | +- PatternList[@Empty = false, @Size = 1] - | | +- UnnamedPattern[@ParenthesisDepth = 0] + | | +- UnnamedPattern[] | +- MethodCall[@CompileTimeConstant = false, @Image = "pickAnotherBox", @MethodName = "pickAnotherBox", @ParenthesisDepth = 0, @Parenthesized = false] | +- ArgumentList[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Name = "processBox", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = true] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep443_UnnamedPatternsAndVariables2.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep443_UnnamedPatternsAndVariables2.java deleted file mode 100644 index 7d690d41e5..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep443_UnnamedPatternsAndVariables2.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - - -import java.util.ArrayDeque; -import java.util.List; -import java.util.Queue; -import java.util.stream.Collectors; - -/** - * @see JEP 443: Unnamed Patterns and Variables (Preview) - */ -class Jep443_UnamedPatternsAndVariables2 { - record Point(int x, int y) { } - enum Color { RED, GREEN, BLUE } - record ColoredPoint(Point p, Color c) { } - - void unnamedPatterns1() { - ColoredPoint r = new ColoredPoint(new Point(3,4), Color.GREEN); - - if (r instanceof ColoredPoint(Point(int x, int y), _)) { - System.out.println(x + " " + y); - } - } -} diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22/Jep456_UnnamedPatternsAndVariables.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22/Jep456_UnnamedPatternsAndVariables.java new file mode 100644 index 0000000000..a9d8cb8004 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22/Jep456_UnnamedPatternsAndVariables.java @@ -0,0 +1,124 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + + +import java.util.ArrayDeque; +import java.util.List; +import java.util.Queue; +import java.util.stream.Collectors; + +/** + * @see JEP 443: Unnamed Patterns and Variables (Preview) (Java 21) + * @see JEP 456: Unnamed Variables & Patterns (Java 22) + */ +class Jep456_UnamedPatternsAndVariables { + record Point(int x, int y) { } + enum Color { RED, GREEN, BLUE } + record ColoredPoint(Point p, Color c) { } + + void unnamedPatterns1() { + ColoredPoint r = new ColoredPoint(new Point(3,4), Color.GREEN); + + if (r instanceof ColoredPoint(Point p, Color _)) { + System.out.println(p.x() + " " + p.y()); + } + + if (r instanceof ColoredPoint(Point(int x, int y), _)) { + System.out.println(x + " " + y); + } + } + + sealed abstract class Ball permits RedBall, BlueBall, GreenBall { } + final class RedBall extends Ball { } + final class BlueBall extends Ball { } + final class GreenBall extends Ball { } + + record Box(T content) { } + + void unnamedPatterns2() { + Box 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/java22/Jep456_UnnamedPatternsAndVariables.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22/Jep456_UnnamedPatternsAndVariables.txt new file mode 100644 index 0000000000..ae94a215f0 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22/Jep456_UnnamedPatternsAndVariables.txt @@ -0,0 +1,608 @@ ++- CompilationUnit[@PackageName = ""] + +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.util.ArrayDeque", @ImportedSimpleName = "ArrayDeque", @PackageName = "java.util", @Static = false] + +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.util.List", @ImportedSimpleName = "List", @PackageName = "java.util", @Static = false] + +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.util.Queue", @ImportedSimpleName = "Queue", @PackageName = "java.util", @Static = false] + +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.util.stream.Collectors", @ImportedSimpleName = "Collectors", @PackageName = "java.util.stream", @Static = false] + +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep456_UnamedPatternsAndVariables", @CanonicalName = "Jep456_UnamedPatternsAndVariables", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Jep456_UnamedPatternsAndVariables", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE] + +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + +- ClassBody[@Empty = false, @Size = 19] + +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep456_UnamedPatternsAndVariables$Point", @CanonicalName = "Jep456_UnamedPatternsAndVariables.Point", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Point", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] + | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] + | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] + | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] + | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] + | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | +- RecordBody[@Empty = true, @Size = 0] + +- EnumDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep456_UnamedPatternsAndVariables$Color", @CanonicalName = "Jep456_UnamedPatternsAndVariables.Color", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = true, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Color", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] + | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] + | +- EnumBody[@Empty = false, @SeparatorSemi = false, @Size = 3, @TrailingComma = false] + | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "RED", @MethodName = "new", @Name = "RED", @Visibility = Visibility.V_PUBLIC] + | | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "RED", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] + | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "GREEN", @MethodName = "new", @Name = "GREEN", @Visibility = Visibility.V_PUBLIC] + | | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "GREEN", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] + | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "BLUE", @MethodName = "new", @Name = "BLUE", @Visibility = Visibility.V_PUBLIC] + | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "BLUE", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] + +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep456_UnamedPatternsAndVariables$ColoredPoint", @CanonicalName = "Jep456_UnamedPatternsAndVariables.ColoredPoint", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "ColoredPoint", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] + | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] + | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] + | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] + | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] + | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | +- RecordBody[@Empty = true, @Size = 0] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "unnamedPatterns1", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] + | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- VoidType[] + | +- FormalParameters[@Empty = true, @Size = 0] + | +- Block[@Empty = false, @Size = 3, @containsComment = false] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] + | | +- VariableDeclarator[@Initializer = true, @Name = "r"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] + | | +- ArgumentList[@Empty = false, @Size = 2] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] + | | | +- ArgumentList[@Empty = false, @Size = 2] + | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LiteralText = "3", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3] + | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "4", @IntLiteral = true, @Integral = true, @LiteralText = "4", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 4.0, @ValueAsFloat = 4.0, @ValueAsInt = 4, @ValueAsLong = 4] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "GREEN", @Name = "GREEN", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] + | +- IfStatement[@Else = false] + | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- RecordPattern[] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] + | | | +- PatternList[@Empty = false, @Size = 2] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] + | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] + | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | +- ExpressionStatement[] + | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Image = "x", @MethodName = "x", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "p", @Name = "p", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ArgumentList[@Empty = true, @Size = 0] + | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = " ", @Empty = false, @Image = "\" \"", @Length = 1, @LiteralText = "\" \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | | +- MethodCall[@CompileTimeConstant = false, @Image = "y", @MethodName = "y", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "p", @Name = "p", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- IfStatement[@Else = false] + | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- RecordPattern[] + | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] + | | +- PatternList[@Empty = false, @Size = 2] + | | +- RecordPattern[] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] + | | | +- PatternList[@Empty = false, @Size = 2] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] + | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] + | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- UnnamedPattern[] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = " ", @Empty = false, @Image = "\" \"", @Length = 1, @LiteralText = "\" \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "y", @Name = "y", @ParenthesisDepth = 0, @Parenthesized = false] + +- ClassDeclaration[@Abstract = true, @Annotation = false, @Anonymous = false, @BinaryName = "Jep456_UnamedPatternsAndVariables$Ball", @CanonicalName = "Jep456_UnamedPatternsAndVariables.Ball", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Ball", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] + | +- ModifierList[@EffectiveModifiers = "{sealed, abstract}", @ExplicitModifiers = "{sealed, abstract}"] + | +- PermitsList[@Empty = false, @Size = 3] + | | +- ClassType[@FullyQualified = false, @SimpleName = "RedBall"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "BlueBall"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "GreenBall"] + | +- ClassBody[@Empty = true, @Size = 0] + +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep456_UnamedPatternsAndVariables$RedBall", @CanonicalName = "Jep456_UnamedPatternsAndVariables.RedBall", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "RedBall", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] + | +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"] + | +- ExtendsList[@Empty = false, @Size = 1] + | | +- ClassType[@FullyQualified = false, @SimpleName = "Ball"] + | +- ClassBody[@Empty = true, @Size = 0] + +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep456_UnamedPatternsAndVariables$BlueBall", @CanonicalName = "Jep456_UnamedPatternsAndVariables.BlueBall", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "BlueBall", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] + | +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"] + | +- ExtendsList[@Empty = false, @Size = 1] + | | +- ClassType[@FullyQualified = false, @SimpleName = "Ball"] + | +- ClassBody[@Empty = true, @Size = 0] + +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep456_UnamedPatternsAndVariables$GreenBall", @CanonicalName = "Jep456_UnamedPatternsAndVariables.GreenBall", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "GreenBall", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] + | +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"] + | +- ExtendsList[@Empty = false, @Size = 1] + | | +- ClassType[@FullyQualified = false, @SimpleName = "Ball"] + | +- ClassBody[@Empty = true, @Size = 0] + +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep456_UnamedPatternsAndVariables$Box", @CanonicalName = "Jep456_UnamedPatternsAndVariables.Box", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Box", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] + | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] + | +- TypeParameters[@Empty = false, @Size = 1] + | | +- TypeParameter[@Image = "T", @Name = "T", @TypeBound = true] + | | +- ClassType[@FullyQualified = false, @SimpleName = "Ball"] + | +- RecordComponentList[@Empty = false, @Size = 1, @Varargs = false] + | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] + | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "T"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "content", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | +- RecordBody[@Empty = true, @Size = 0] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "unnamedPatterns2", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] + | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- VoidType[] + | +- FormalParameters[@Empty = true, @Size = 0] + | +- Block[@Empty = false, @Size = 5, @containsComment = false] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | | +- WildcardType[@LowerBound = false, @UpperBound = true] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "Ball"] + | | +- VariableDeclarator[@Initializer = true, @Name = "b"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "b", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | | +- TypeArguments[@Diamond = true, @Empty = true, @Size = 0] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | +- ClassType[@FullyQualified = false, @SimpleName = "RedBall"] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- SwitchArrowBranch[@Default = false] + | | | +- SwitchLabel[@Default = false] + | | | | +- RecordPattern[] + | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | | | +- PatternList[@Empty = false, @Size = 1] + | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] + | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ClassType[@FullyQualified = false, @SimpleName = "RedBall"] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- MethodCall[@CompileTimeConstant = false, @Image = "processBox", @MethodName = "processBox", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ArgumentList[@Empty = false, @Size = 1] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- SwitchArrowBranch[@Default = false] + | | | +- SwitchLabel[@Default = false] + | | | | +- RecordPattern[] + | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | | | +- PatternList[@Empty = false, @Size = 1] + | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] + | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ClassType[@FullyQualified = false, @SimpleName = "BlueBall"] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- MethodCall[@CompileTimeConstant = false, @Image = "processBox", @MethodName = "processBox", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ArgumentList[@Empty = false, @Size = 1] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- RecordPattern[] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | | +- PatternList[@Empty = false, @Size = 1] + | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] + | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "GreenBall"] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- MethodCall[@CompileTimeConstant = false, @Image = "stopProcessing", @MethodName = "stopProcessing", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- SwitchArrowBranch[@Default = false] + | | | +- SwitchLabel[@Default = false] + | | | | +- RecordPattern[] + | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | | | | +- PatternList[@Empty = false, @Size = 1] + | | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] + | | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "RedBall"] + | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- RecordPattern[] + | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | | | +- PatternList[@Empty = false, @Size = 1] + | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] + | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ClassType[@FullyQualified = false, @SimpleName = "BlueBall"] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- MethodCall[@CompileTimeConstant = false, @Image = "processBox", @MethodName = "processBox", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ArgumentList[@Empty = false, @Size = 1] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- SwitchArrowBranch[@Default = false] + | | | +- SwitchLabel[@Default = false] + | | | | +- RecordPattern[] + | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | | | +- PatternList[@Empty = false, @Size = 1] + | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] + | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ClassType[@FullyQualified = false, @SimpleName = "GreenBall"] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- MethodCall[@CompileTimeConstant = false, @Image = "stopProcessing", @MethodName = "stopProcessing", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ArgumentList[@Empty = true, @Size = 0] + | | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- RecordPattern[] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | | +- PatternList[@Empty = false, @Size = 1] + | | | +- UnnamedPattern[] + | | +- MethodCall[@CompileTimeConstant = false, @Image = "pickAnotherBox", @MethodName = "pickAnotherBox", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] + | | +- VariableDeclarator[@Initializer = true, @Name = "x"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "42", @IntLiteral = true, @Integral = true, @LiteralText = "42", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42] + | +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- RecordPattern[] + | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | | | +- PatternList[@Empty = false, @Size = 1] + | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] + | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ClassType[@FullyQualified = false, @SimpleName = "RedBall"] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- RecordPattern[] + | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | | | +- PatternList[@Empty = false, @Size = 1] + | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] + | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ClassType[@FullyQualified = false, @SimpleName = "BlueBall"] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- Guard[] + | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "42", @IntLiteral = true, @Integral = true, @LiteralText = "42", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42] + | | +- MethodCall[@CompileTimeConstant = false, @Image = "processBox", @MethodName = "processBox", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchArrowBranch[@Default = false] + | +- SwitchLabel[@Default = false] + | | +- RecordPattern[] + | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | +- PatternList[@Empty = false, @Size = 1] + | | +- UnnamedPattern[] + | +- MethodCall[@CompileTimeConstant = false, @Image = "pickAnotherBox", @MethodName = "pickAnotherBox", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = true, @Size = 0] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Name = "processBox", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = true] + | +- ModifierList[@EffectiveModifiers = "{private}", @ExplicitModifiers = "{private}"] + | +- VoidType[] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | | +- WildcardType[@LowerBound = false, @UpperBound = true] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "Ball"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- Block[@Empty = true, @Size = 0, @containsComment = false] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Name = "stopProcessing", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = true] + | +- ModifierList[@EffectiveModifiers = "{private}", @ExplicitModifiers = "{private}"] + | +- VoidType[] + | +- FormalParameters[@Empty = true, @Size = 0] + | +- Block[@Empty = true, @Size = 0, @containsComment = false] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Name = "pickAnotherBox", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = true] + | +- ModifierList[@EffectiveModifiers = "{private}", @ExplicitModifiers = "{private}"] + | +- VoidType[] + | +- FormalParameters[@Empty = true, @Size = 0] + | +- Block[@Empty = true, @Size = 0, @containsComment = false] + +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep456_UnamedPatternsAndVariables$Order", @CanonicalName = "Jep456_UnamedPatternsAndVariables.Order", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Order", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] + | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ClassBody[@Empty = true, @Size = 0] + +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = true, @Visibility = Visibility.V_PRIVATE] + | +- ModifierList[@EffectiveModifiers = "{private, static, final}", @ExplicitModifiers = "{private, static, final}"] + | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] + | +- VariableDeclarator[@Initializer = true, @Name = "LIMIT"] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "LIMIT", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "10", @IntLiteral = true, @Integral = true, @LiteralText = "10", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 10.0, @ValueAsFloat = 10.0, @ValueAsInt = 10, @ValueAsLong = 10] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Name = "sideEffect", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = false] + | +- ModifierList[@EffectiveModifiers = "{private}", @ExplicitModifiers = "{private}"] + | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] + | +- FormalParameters[@Empty = true, @Size = 0] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ReturnStatement[] + | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "unnamedVariables", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] + | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- VoidType[] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "List"] + | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "Order"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "orders", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- Block[@Empty = false, @Size = 7, @containsComment = false] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] + | | +- VariableDeclarator[@Initializer = true, @Name = "total"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "total", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + | +- ForeachStatement[] + | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "Order"] + | | | +- VariableDeclarator[@Initializer = false, @Name = "_"] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = true, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "orders", @Name = "orders", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | +- IfStatement[@Else = false] + | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.LT, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "total", @Name = "total", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = true, @Image = "LIMIT", @Name = "LIMIT", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | +- ExpressionStatement[] + | | +- UnaryExpression[@CompileTimeConstant = false, @Operator = UnaryOp.POST_INCREMENT, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "total", @Name = "total", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ExpressionStatement[] + | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "total: ", @Empty = false, @Image = "\"total: \"", @Length = 7, @LiteralText = "\"total: \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "total", @Name = "total", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ForStatement[] + | | +- ForInit[] + | | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] + | | | +- VariableDeclarator[@Initializer = true, @Name = "i"] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = true, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + | | | +- VariableDeclarator[@Initializer = true, @Name = "_"] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = true, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- MethodCall[@CompileTimeConstant = false, @Image = "sideEffect", @MethodName = "sideEffect", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ArgumentList[@Empty = true, @Size = 0] + | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.LT, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "10", @IntLiteral = true, @Integral = true, @LiteralText = "10", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 10.0, @ValueAsFloat = 10.0, @ValueAsInt = 10, @ValueAsLong = 10] + | | +- ForUpdate[] + | | | +- StatementExpressionList[@Empty = false, @Size = 1] + | | | +- UnaryExpression[@CompileTimeConstant = false, @Operator = UnaryOp.POST_INCREMENT, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | +- ExpressionStatement[] + | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "Queue"] + | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] + | | +- VariableDeclarator[@Initializer = true, @Name = "q"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "q", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | +- ClassType[@FullyQualified = false, @SimpleName = "ArrayDeque"] + | | | +- TypeArguments[@Diamond = true, @Empty = true, @Size = 0] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- WhileStatement[] + | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GE, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Image = "size", @MethodName = "size", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ArgumentList[@Empty = true, @Size = 0] + | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LiteralText = "3", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3] + | | +- Block[@Empty = false, @Size = 4, @containsComment = false] + | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] + | | | +- VariableDeclarator[@Initializer = true, @Name = "x"] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- MethodCall[@CompileTimeConstant = false, @Image = "remove", @MethodName = "remove", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ArgumentList[@Empty = true, @Size = 0] + | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] + | | | +- VariableDeclarator[@Initializer = true, @Name = "y"] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "y", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- MethodCall[@CompileTimeConstant = false, @Image = "remove", @MethodName = "remove", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ArgumentList[@Empty = true, @Size = 0] + | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] + | | | +- VariableDeclarator[@Initializer = true, @Name = "_"] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- MethodCall[@CompileTimeConstant = false, @Image = "remove", @MethodName = "remove", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ArgumentList[@Empty = true, @Size = 0] + | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] + | | +- VariableDeclarator[@Initializer = true, @Name = "p"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "p", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] + | | +- ArgumentList[@Empty = false, @Size = 2] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "y", @Name = "y", @ParenthesisDepth = 0, @Parenthesized = false] + | +- WhileStatement[] + | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GE, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- MethodCall[@CompileTimeConstant = false, @Image = "size", @MethodName = "size", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ArgumentList[@Empty = true, @Size = 0] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LiteralText = "3", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3] + | +- Block[@Empty = false, @Size = 4, @containsComment = false] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- VariableDeclarator[@Initializer = true, @Name = "x"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] + | | +- MethodCall[@CompileTimeConstant = false, @Image = "remove", @MethodName = "remove", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- VariableDeclarator[@Initializer = true, @Name = "_"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] + | | +- MethodCall[@CompileTimeConstant = false, @Image = "remove", @MethodName = "remove", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- VariableDeclarator[@Initializer = true, @Name = "_"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] + | | +- MethodCall[@CompileTimeConstant = false, @Image = "remove", @MethodName = "remove", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] + | +- VariableDeclarator[@Initializer = true, @Name = "p"] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "p", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] + | +- ArgumentList[@Empty = false, @Size = 2] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] + | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep456_UnamedPatternsAndVariables$ScopedContext", @CanonicalName = "Jep456_UnamedPatternsAndVariables.ScopedContext", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "ScopedContext", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] + | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ImplementsList[@Empty = false, @Size = 1] + | | +- ClassType[@FullyQualified = false, @SimpleName = "AutoCloseable"] + | +- ClassBody[@Empty = false, @Size = 2] + | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "close", @Overridden = true, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] + | | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | | | +- Annotation[@SimpleName = "Override"] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "Override"] + | | +- VoidType[] + | | +- FormalParameters[@Empty = true, @Size = 0] + | | +- Block[@Empty = true, @Size = 0, @containsComment = false] + | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "acquire", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] + | +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] + | +- ClassType[@FullyQualified = false, @SimpleName = "ScopedContext"] + | +- FormalParameters[@Empty = true, @Size = 0] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ReturnStatement[] + | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | +- ClassType[@FullyQualified = false, @SimpleName = "ScopedContext"] + | +- ArgumentList[@Empty = true, @Size = 0] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "unusedVariables2", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] + +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + +- VoidType[] + +- FormalParameters[@Empty = true, @Size = 0] + +- Block[@Empty = false, @Size = 4, @containsComment = false] + +- TryStatement[@TryWithResources = true] + | +- ResourceList[@Empty = false, @Size = 1, @TrailingSemiColon = false] + | | +- Resource[@ConciseResource = false, @StableName = "_"] + | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = true, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{}"] + | | +- VariableDeclarator[@Initializer = true, @Name = "_"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] + | | +- MethodCall[@CompileTimeConstant = false, @Image = "acquire", @MethodName = "acquire", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "ScopedContext"] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- Block[@Empty = true, @Size = 0, @containsComment = true] + +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- VariableDeclarator[@Initializer = true, @Name = "s"] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "123", @Empty = false, @Image = "\"123\"", @Length = 3, @LiteralText = "\"123\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + +- TryStatement[@TryWithResources = false] + | +- Block[@Empty = false, @Size = 2, @containsComment = false] + | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] + | | | +- VariableDeclarator[@Initializer = true, @Name = "i"] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- MethodCall[@CompileTimeConstant = false, @Image = "parseInt", @MethodName = "parseInt", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] + | | | +- ArgumentList[@Empty = false, @Size = 1] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ExpressionStatement[] + | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] + | +- CatchClause[] + | | +- CatchParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Multicatch = false, @Name = "_", @Visibility = Visibility.V_PACKAGE] + | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "NumberFormatException"] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] + | | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | +- ExpressionStatement[] + | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Bad number: ", @Empty = false, @Image = "\"Bad number: \"", @Length = 12, @LiteralText = "\"Bad number: \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] + | +- CatchClause[] + | +- CatchParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Multicatch = false, @Name = "_", @Visibility = Visibility.V_PACKAGE] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "Exception"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "error...", @Empty = false, @Image = "\"error...\"", @Length = 8, @LiteralText = "\"error...\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + +- ExpressionStatement[] + +- MethodCall[@CompileTimeConstant = false, @Image = "collect", @MethodName = "collect", @ParenthesisDepth = 0, @Parenthesized = false] + +- MethodCall[@CompileTimeConstant = false, @Image = "stream", @MethodName = "stream", @ParenthesisDepth = 0, @Parenthesized = false] + | +- MethodCall[@CompileTimeConstant = false, @Image = "of", @MethodName = "of", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "List"] + | | +- ArgumentList[@Empty = false, @Size = 2] + | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "b", @Empty = false, @Image = "\"b\"", @Length = 1, @LiteralText = "\"b\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | +- ArgumentList[@Empty = true, @Size = 0] + +- ArgumentList[@Empty = false, @Size = 1] + +- MethodCall[@CompileTimeConstant = false, @Image = "toMap", @MethodName = "toMap", @ParenthesisDepth = 0, @Parenthesized = false] + +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | +- ClassType[@FullyQualified = false, @SimpleName = "Collectors"] + +- ArgumentList[@Empty = false, @Size = 2] + +- MethodReference[@CompileTimeConstant = false, @ConstructorReference = false, @MethodName = "toUpperCase", @ParenthesisDepth = 0, @Parenthesized = false] + | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] + +- LambdaParameterList[@Empty = false, @Size = 1] + | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] + | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] + +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "NO_DATA", @Empty = false, @Image = "\"NO_DATA\"", @Length = 7, @LiteralText = "\"NO_DATA\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep447_StatementsBeforeSuper.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep447_StatementsBeforeSuper.java new file mode 100644 index 0000000000..de3b25ddaf --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep447_StatementsBeforeSuper.java @@ -0,0 +1,86 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +import java.math.BigInteger; +import java.nio.charset.StandardCharsets; +import java.security.cert.Certificate; +import java.security.interfaces.DSAPublicKey; +import java.security.interfaces.RSAKey; + +/** + * @see JEP 447: Statements before super(...) (Preview) (Java 22) + */ +class Jep447_StatementsBeforeSuper { + // To test backwards compatibility - "normal" explicit constructor invocation + public static class Old { + public Old() { + super(); + } + } + + // Example: Validating superclass constructor arguments + public static class PositiveBigInteger extends BigInteger { + + public PositiveBigInteger(long value) { + if (value <= 0) + throw new IllegalArgumentException("non-positive value"); + final String valueAsString = String.valueOf(value); + super(valueAsString); + } + } + + // Example: Preparing superclass constructor arguments + public static class Super { + public Super(byte[] bytes) {} + } + + public class Sub extends Super { + public Sub(Certificate certificate) { + var publicKey = certificate.getPublicKey(); + if (publicKey == null) + throw new IllegalArgumentException("null certificate"); + final byte[] byteArray = switch (publicKey) { + case RSAKey rsaKey -> rsaKey.toString().getBytes(StandardCharsets.UTF_8); + case DSAPublicKey dsaKey -> dsaKey.toString().getBytes(StandardCharsets.UTF_8); + default -> new byte[0]; + }; + super(byteArray); + } + } + + // Example: Sharing superclass constructor arguments + public static class F {} + public static class Super2 { + public Super2(F f1, F f2) {} + } + public class Sub2 extends Super2 { + public Sub2(int i) { + var f = new F(); + super(f, f); + // ... i ... + } + } + + // Example with records + public record Range(int lo, int hi) { + public Range(int lo, int hi, int maxDistance) { + if (lo > hi) + throw new IllegalArgumentException(String.format("(%d,%d)", lo, hi)); + if (hi - lo > maxDistance) + throw new IllegalArgumentException(String.format("(%d,%d,%d", lo, hi, maxDistance)); + this(lo, hi); + } + } + + // Example with enum + public enum Color { + BLUE(1); + private Color() { + } + private Color(int a) { + if (a < 0) throw new IllegalArgumentException(); + this(); + }; + } +} diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep447_StatementsBeforeSuper.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep447_StatementsBeforeSuper.txt new file mode 100644 index 0000000000..5d4c451e61 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep447_StatementsBeforeSuper.txt @@ -0,0 +1,283 @@ ++- CompilationUnit[@PackageName = ""] + +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.math.BigInteger", @ImportedSimpleName = "BigInteger", @PackageName = "java.math", @Static = false] + +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.nio.charset.StandardCharsets", @ImportedSimpleName = "StandardCharsets", @PackageName = "java.nio.charset", @Static = false] + +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.security.cert.Certificate", @ImportedSimpleName = "Certificate", @PackageName = "java.security.cert", @Static = false] + +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.security.interfaces.DSAPublicKey", @ImportedSimpleName = "DSAPublicKey", @PackageName = "java.security.interfaces", @Static = false] + +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.security.interfaces.RSAKey", @ImportedSimpleName = "RSAKey", @PackageName = "java.security.interfaces", @Static = false] + +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep447_StatementsBeforeSuper", @CanonicalName = "Jep447_StatementsBeforeSuper", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Jep447_StatementsBeforeSuper", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE] + +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + +- ClassBody[@Empty = false, @Size = 9] + +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep447_StatementsBeforeSuper$Old", @CanonicalName = "Jep447_StatementsBeforeSuper.Old", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Old", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] + | +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] + | +- ClassBody[@Empty = false, @Size = 1] + | +- ConstructorDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "Old", @Name = "Old", @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false] + | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- FormalParameters[@Empty = true, @Size = 0] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ExplicitConstructorInvocation[@ArgumentCount = 0, @MethodName = "new", @Qualified = false, @Super = true, @This = false] + | +- ArgumentList[@Empty = true, @Size = 0] + +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep447_StatementsBeforeSuper$PositiveBigInteger", @CanonicalName = "Jep447_StatementsBeforeSuper.PositiveBigInteger", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "PositiveBigInteger", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] + | +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] + | +- ExtendsList[@Empty = false, @Size = 1] + | | +- ClassType[@FullyQualified = false, @SimpleName = "BigInteger"] + | +- ClassBody[@Empty = false, @Size = 1] + | +- ConstructorDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "PositiveBigInteger", @Name = "PositiveBigInteger", @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false] + | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- PrimitiveType[@Kind = PrimitiveTypeKind.LONG] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "value", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- Block[@Empty = false, @Size = 3, @containsComment = false] + | +- IfStatement[@Else = false] + | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.LE, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "value", @Name = "value", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + | | +- ThrowStatement[] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | +- ClassType[@FullyQualified = false, @SimpleName = "IllegalArgumentException"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "non-positive value", @Empty = false, @Image = "\"non-positive value\"", @Length = 18, @LiteralText = "\"non-positive value\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = true, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- VariableDeclarator[@Initializer = true, @Name = "valueAsString"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "valueAsString", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- MethodCall[@CompileTimeConstant = false, @Image = "valueOf", @MethodName = "valueOf", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "value", @Name = "value", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ExplicitConstructorInvocation[@ArgumentCount = 1, @MethodName = "new", @Qualified = false, @Super = true, @This = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "valueAsString", @Name = "valueAsString", @ParenthesisDepth = 0, @Parenthesized = false] + +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep447_StatementsBeforeSuper$Super", @CanonicalName = "Jep447_StatementsBeforeSuper.Super", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Super", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] + | +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] + | +- ClassBody[@Empty = false, @Size = 1] + | +- ConstructorDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "Super", @Name = "Super", @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false] + | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ArrayType[@ArrayDepth = 1] + | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.BYTE] + | | | +- ArrayDimensions[@Empty = false, @Size = 1] + | | | +- ArrayTypeDim[@Varargs = false] + | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "bytes", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- Block[@Empty = true, @Size = 0, @containsComment = false] + +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep447_StatementsBeforeSuper$Sub", @CanonicalName = "Jep447_StatementsBeforeSuper.Sub", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Sub", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] + | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- ExtendsList[@Empty = false, @Size = 1] + | | +- ClassType[@FullyQualified = false, @SimpleName = "Super"] + | +- ClassBody[@Empty = false, @Size = 1] + | +- ConstructorDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "Sub", @Name = "Sub", @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false] + | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "Certificate"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "certificate", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- Block[@Empty = false, @Size = 4, @containsComment = false] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- VariableDeclarator[@Initializer = true, @Name = "publicKey"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "publicKey", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] + | | +- MethodCall[@CompileTimeConstant = false, @Image = "getPublicKey", @MethodName = "getPublicKey", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "certificate", @Name = "certificate", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- IfStatement[@Else = false] + | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "publicKey", @Name = "publicKey", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ThrowStatement[] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | +- ClassType[@FullyQualified = false, @SimpleName = "IllegalArgumentException"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "null certificate", @Empty = false, @Image = "\"null certificate\"", @Length = 16, @LiteralText = "\"null certificate\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = true, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"] + | | +- ArrayType[@ArrayDepth = 1] + | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.BYTE] + | | | +- ArrayDimensions[@Empty = false, @Size = 1] + | | | +- ArrayTypeDim[@Varargs = false] + | | +- VariableDeclarator[@Initializer = true, @Name = "byteArray"] + | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "byteArray", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- SwitchExpression[@CompileTimeConstant = false, @DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "publicKey", @Name = "publicKey", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- SwitchArrowBranch[@Default = false] + | | | +- SwitchLabel[@Default = false] + | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] + | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ClassType[@FullyQualified = false, @SimpleName = "RSAKey"] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "rsaKey", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- MethodCall[@CompileTimeConstant = false, @Image = "getBytes", @MethodName = "getBytes", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Image = "toString", @MethodName = "toString", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "rsaKey", @Name = "rsaKey", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ArgumentList[@Empty = true, @Size = 0] + | | | +- ArgumentList[@Empty = false, @Size = 1] + | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "UTF_8", @Name = "UTF_8", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "StandardCharsets"] + | | +- SwitchArrowBranch[@Default = false] + | | | +- SwitchLabel[@Default = false] + | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] + | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ClassType[@FullyQualified = false, @SimpleName = "DSAPublicKey"] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "dsaKey", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- MethodCall[@CompileTimeConstant = false, @Image = "getBytes", @MethodName = "getBytes", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Image = "toString", @MethodName = "toString", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "dsaKey", @Name = "dsaKey", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ArgumentList[@Empty = true, @Size = 0] + | | | +- ArgumentList[@Empty = false, @Size = 1] + | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "UTF_8", @Name = "UTF_8", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "StandardCharsets"] + | | +- SwitchArrowBranch[@Default = true] + | | +- SwitchLabel[@Default = true] + | | +- ArrayAllocation[@ArrayDepth = 1, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayType[@ArrayDepth = 1] + | | +- PrimitiveType[@Kind = PrimitiveTypeKind.BYTE] + | | +- ArrayDimensions[@Empty = false, @Size = 1] + | | +- ArrayDimExpr[@Varargs = false] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + | +- ExplicitConstructorInvocation[@ArgumentCount = 1, @MethodName = "new", @Qualified = false, @Super = true, @This = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "byteArray", @Name = "byteArray", @ParenthesisDepth = 0, @Parenthesized = false] + +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep447_StatementsBeforeSuper$F", @CanonicalName = "Jep447_StatementsBeforeSuper.F", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "F", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] + | +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] + | +- ClassBody[@Empty = true, @Size = 0] + +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep447_StatementsBeforeSuper$Super2", @CanonicalName = "Jep447_StatementsBeforeSuper.Super2", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Super2", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] + | +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] + | +- ClassBody[@Empty = false, @Size = 1] + | +- ConstructorDeclaration[@Abstract = false, @Arity = 2, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "Super2", @Name = "Super2", @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false] + | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- FormalParameters[@Empty = false, @Size = 2] + | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] + | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "F"] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "f1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "F"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "f2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- Block[@Empty = true, @Size = 0, @containsComment = false] + +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep447_StatementsBeforeSuper$Sub2", @CanonicalName = "Jep447_StatementsBeforeSuper.Sub2", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Sub2", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] + | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- ExtendsList[@Empty = false, @Size = 1] + | | +- ClassType[@FullyQualified = false, @SimpleName = "Super2"] + | +- ClassBody[@Empty = false, @Size = 1] + | +- ConstructorDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "Sub2", @Name = "Sub2", @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = true] + | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- Block[@Empty = false, @Size = 2, @containsComment = true] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- VariableDeclarator[@Initializer = true, @Name = "f"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "f", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | +- ClassType[@FullyQualified = false, @SimpleName = "F"] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- ExplicitConstructorInvocation[@ArgumentCount = 2, @MethodName = "new", @Qualified = false, @Super = true, @This = false] + | +- ArgumentList[@Empty = false, @Size = 2] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "f", @Name = "f", @ParenthesisDepth = 0, @Parenthesized = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "f", @Name = "f", @ParenthesisDepth = 0, @Parenthesized = false] + +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep447_StatementsBeforeSuper$Range", @CanonicalName = "Jep447_StatementsBeforeSuper.Range", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Range", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] + | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{public}"] + | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] + | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] + | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lo", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] + | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "hi", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | +- RecordBody[@Empty = false, @Size = 1] + | +- ConstructorDeclaration[@Abstract = false, @Arity = 3, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "Range", @Name = "Range", @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false] + | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- FormalParameters[@Empty = false, @Size = 3] + | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] + | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "lo", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] + | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "hi", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "maxDistance", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- Block[@Empty = false, @Size = 3, @containsComment = false] + | +- IfStatement[@Else = false] + | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "lo", @Name = "lo", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "hi", @Name = "hi", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ThrowStatement[] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | +- ClassType[@FullyQualified = false, @SimpleName = "IllegalArgumentException"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- MethodCall[@CompileTimeConstant = false, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ArgumentList[@Empty = false, @Size = 3] + | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "(%d,%d)", @Empty = false, @Image = "\"(%d,%d)\"", @Length = 7, @LiteralText = "\"(%d,%d)\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "lo", @Name = "lo", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "hi", @Name = "hi", @ParenthesisDepth = 0, @Parenthesized = false] + | +- IfStatement[@Else = false] + | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.SUB, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "hi", @Name = "hi", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "lo", @Name = "lo", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "maxDistance", @Name = "maxDistance", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ThrowStatement[] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | +- ClassType[@FullyQualified = false, @SimpleName = "IllegalArgumentException"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- MethodCall[@CompileTimeConstant = false, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ArgumentList[@Empty = false, @Size = 4] + | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "(%d,%d,%d", @Empty = false, @Image = "\"(%d,%d,%d\"", @Length = 9, @LiteralText = "\"(%d,%d,%d\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "lo", @Name = "lo", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "hi", @Name = "hi", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "maxDistance", @Name = "maxDistance", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ExplicitConstructorInvocation[@ArgumentCount = 2, @MethodName = "new", @Qualified = false, @Super = false, @This = true] + | +- ArgumentList[@Empty = false, @Size = 2] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "lo", @Name = "lo", @ParenthesisDepth = 0, @Parenthesized = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "hi", @Name = "hi", @ParenthesisDepth = 0, @Parenthesized = false] + +- EnumDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep447_StatementsBeforeSuper$Color", @CanonicalName = "Jep447_StatementsBeforeSuper.Color", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = true, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Color", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] + +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{public}"] + +- EnumBody[@Empty = false, @SeparatorSemi = true, @Size = 4, @TrailingComma = false] + +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "BLUE", @MethodName = "new", @Name = "BLUE", @Visibility = Visibility.V_PUBLIC] + | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "BLUE", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + +- ConstructorDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PRIVATE, @Image = "Color", @Name = "Color", @Varargs = false, @Visibility = Visibility.V_PRIVATE, @containsComment = false] + | +- ModifierList[@EffectiveModifiers = "{private}", @ExplicitModifiers = "{private}"] + | +- FormalParameters[@Empty = true, @Size = 0] + | +- Block[@Empty = true, @Size = 0, @containsComment = false] + +- ConstructorDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PRIVATE, @Image = "Color", @Name = "Color", @Varargs = false, @Visibility = Visibility.V_PRIVATE, @containsComment = false] + | +- ModifierList[@EffectiveModifiers = "{private}", @ExplicitModifiers = "{private}"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- Block[@Empty = false, @Size = 2, @containsComment = false] + | +- IfStatement[@Else = false] + | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.LT, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "a", @Name = "a", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + | | +- ThrowStatement[] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | +- ClassType[@FullyQualified = false, @SimpleName = "IllegalArgumentException"] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- ExplicitConstructorInvocation[@ArgumentCount = 0, @MethodName = "new", @Qualified = false, @Super = false, @This = true] + | +- ArgumentList[@Empty = true, @Size = 0] + +- EmptyDeclaration[] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep459_StringTemplates.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep459_StringTemplates.java new file mode 100644 index 0000000000..1d4cc98254 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep459_StringTemplates.java @@ -0,0 +1,194 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +import static java.lang.StringTemplate.RAW; +import static java.util.FormatProcessor.FMT; + +import java.io.File; +import java.time.format.DateTimeFormatter; +import java.time.LocalTime; + +/** + * @see JEP 430: String Templates (Preview) (Java 21) + * @see JEP 459: String Templates (Second Preview) (Java 22) + */ +class Jep459_StringTemplates { + record Request(String date, String time, String ipAddress) {} + + static void STRTemplateProcessor() { + // Embedded expressions can be strings + String firstName = "Bill"; + String lastName = "Duck"; + String fullName = STR."\{firstName} \{lastName}"; + // | "Bill Duck" + String sortName = STR."\{lastName}, \{firstName}"; + // | "Duck, Bill" + + // Embedded expressions can perform arithmetic + int x = 10, y = 20; + String s1 = STR."\{x} + \{y} = \{x + y}"; + // | "10 + 20 = 30" + + // Embedded expressions can invoke methods and access fields + String s2 = STR."You have a \{getOfferType()} waiting for you!"; + // | "You have a gift waiting for you!" + Request req = new Request("2022-03-25", "15:34", "8.8.8.8"); + String t = STR."Access at \{req.date} \{req.time} from \{req.ipAddress}"; + //| "Access at 2022-03-25 15:34 from 8.8.8.8" + + String filePath = "tmp.dat"; + File file = new File(filePath); + String old = "The file " + filePath + " " + (file.exists() ? "does" : "does not") + " exist"; + String msg = STR."The file \{filePath} \{file.exists() ? "does" : "does not"} exist"; + // | "The file tmp.dat does exist" or "The file tmp.dat does not exist" + + // spread over multiple lines + String time = STR."The time is \{ + // The java.time.format package is very useful + DateTimeFormatter + .ofPattern("HH:mm:ss") + .format(LocalTime.now()) + } right now"; + // | "The time is 12:34:56 right now" + + // Left to right + // Embedded expressions can be postfix increment expressions + int index = 0; + String data = STR."\{index++}, \{index++}, \{index++}, \{index++}"; + // | "0, 1, 2, 3" + + // Embedded expression is a (nested) template expression + String[] fruit = { "apples", "oranges", "peaches" }; + String s3 = STR."\{fruit[0]}, \{STR."\{fruit[1]}, \{fruit[2]}"}"; + // | "apples, oranges, peaches" + String s4 = STR."\{fruit[0]}, \{ + STR."\{fruit[1]}, \{fruit[2]}" + }"; + } + + static String getOfferType() { return "_getOfferType_"; } + + static void multilineTemplateExpressions() { + String title = "My Web Page"; + String text = "Hello, world"; + String html = STR.""" + + + \{title} + + +

\{text}

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

Hello, world

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

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

\n \n \n \"\"\""] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- VariableDeclarator[@Initializer = true, @Name = "name"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "name", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Joan Smith", @Empty = false, @Image = "\"Joan Smith\"", @Length = 10, @LiteralText = "\"Joan Smith\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- VariableDeclarator[@Initializer = true, @Name = "phone"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "phone", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "555-123-4567", @Empty = false, @Image = "\"555-123-4567\"", @Length = 12, @LiteralText = "\"555-123-4567\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- VariableDeclarator[@Initializer = true, @Name = "address"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "address", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "1 Maple Drive, Anytown", @Empty = false, @Image = "\"1 Maple Drive, Anytown\"", @Length = 22, @LiteralText = "\"1 Maple Drive, Anytown\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- VariableDeclarator[@Initializer = true, @Name = "json"] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "json", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] + | +- Template[] + | +- TemplateFragment[@Content = "\"\"\"\n {\n \"name\": \"\\{"] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false] + | +- TemplateFragment[@Content = "}\",\n \"phone\": \"\\{"] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "phone", @Name = "phone", @ParenthesisDepth = 0, @Parenthesized = false] + | +- TemplateFragment[@Content = "}\",\n \"address\": \"\\{"] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "address", @Name = "address", @ParenthesisDepth = 0, @Parenthesized = false] + | +- TemplateFragment[@Content = "}\"\n }\n \"\"\";\n /*\n | \"\"\"\n | {\n | \"name\": \"Joan Smith\",\n | \"phone\": \"555-123-4567\",\n | \"address\": \"1 Maple Drive, Anytown\"\n | }\n | \"\"\"\n */\n\n record Rectangle(String name, double width, double height) {\n double area() {\n return width * height;\n }\n }\n Rectangle[] zone = new Rectangle[] {\n new Rectangle(\"Alfa\", 17.8, 31.4),\n new Rectangle(\"Bravo\", 9.6, 12.4),\n new Rectangle(\"Charlie\", 7.1, 11.23),\n };\n String table = STR.\"\"\"\n Description Width Height Area\n \\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + | +- TemplateFragment[@Content = "} \\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "width", @Name = "width", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + | +- TemplateFragment[@Content = "} \\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "height", @Name = "height", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + | +- TemplateFragment[@Content = "} \\{"] + | +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- TemplateFragment[@Content = "}\n \\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + | +- TemplateFragment[@Content = "} \\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "width", @Name = "width", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + | +- TemplateFragment[@Content = "} \\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "height", @Name = "height", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + | +- TemplateFragment[@Content = "} \\{"] + | +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- TemplateFragment[@Content = "}\n \\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] + | +- TemplateFragment[@Content = "} \\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "width", @Name = "width", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] + | +- TemplateFragment[@Content = "} \\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "height", @Name = "height", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] + | +- TemplateFragment[@Content = "} \\{"] + | +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- TemplateFragment[@Content = "}\n Total \\{"] + | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + | | | | +- ArgumentList[@Empty = true, @Size = 0] + | | | +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + | | | +- ArgumentList[@Empty = true, @Size = 0] + | | +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- TemplateFragment[@Content = "}\n \"\"\""] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "FMTTemplateProcessor", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] + | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- VoidType[] + | +- FormalParameters[@Empty = true, @Size = 0] + | +- Block[@Empty = false, @Size = 4, @containsComment = false] + | +- LocalClassStatement[] + | | +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep459_StringTemplates$1Rectangle", @CanonicalName = null, @EffectiveVisibility = Visibility.V_LOCAL, @Enum = false, @Final = true, @Interface = false, @Local = true, @Nested = false, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Rectangle", @Static = true, @TopLevel = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] + | | +- RecordComponentList[@Empty = false, @Size = 3, @Varargs = false] + | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] + | | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "name", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] + | | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.DOUBLE] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "width", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] + | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.DOUBLE] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "height", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | +- RecordBody[@Empty = false, @Size = 1] + | | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Name = "area", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- PrimitiveType[@Kind = PrimitiveTypeKind.DOUBLE] + | | +- FormalParameters[@Empty = true, @Size = 0] + | | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | +- ReturnStatement[] + | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.MUL, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "width", @Name = "width", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "height", @Name = "height", @ParenthesisDepth = 0, @Parenthesized = false] + | +- EmptyStatement[] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ArrayType[@ArrayDepth = 1] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] + | | | +- ArrayDimensions[@Empty = false, @Size = 1] + | | | +- ArrayTypeDim[@Varargs = false] + | | +- VariableDeclarator[@Initializer = true, @Name = "zone"] + | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "zone", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ArrayAllocation[@ArrayDepth = 1, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayType[@ArrayDepth = 1] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] + | | | +- ArrayDimensions[@Empty = false, @Size = 1] + | | | +- ArrayTypeDim[@Varargs = false] + | | +- ArrayInitializer[@CompileTimeConstant = false, @Length = 3, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] + | | | +- ArgumentList[@Empty = false, @Size = 3] + | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Alfa", @Empty = false, @Image = "\"Alfa\"", @Length = 4, @LiteralText = "\"Alfa\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "17.8", @IntLiteral = false, @Integral = false, @LiteralText = "17.8", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 17.8, @ValueAsFloat = 17.8, @ValueAsInt = 17, @ValueAsLong = 17] + | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "31.4", @IntLiteral = false, @Integral = false, @LiteralText = "31.4", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 31.4, @ValueAsFloat = 31.4, @ValueAsInt = 31, @ValueAsLong = 31] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] + | | | +- ArgumentList[@Empty = false, @Size = 3] + | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Bravo", @Empty = false, @Image = "\"Bravo\"", @Length = 5, @LiteralText = "\"Bravo\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "9.6", @IntLiteral = false, @Integral = false, @LiteralText = "9.6", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 9.6, @ValueAsFloat = 9.6, @ValueAsInt = 9, @ValueAsLong = 9] + | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "12.4", @IntLiteral = false, @Integral = false, @LiteralText = "12.4", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 12.4, @ValueAsFloat = 12.4, @ValueAsInt = 12, @ValueAsLong = 12] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] + | | +- ArgumentList[@Empty = false, @Size = 3] + | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Charlie", @Empty = false, @Image = "\"Charlie\"", @Length = 7, @LiteralText = "\"Charlie\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "7.1", @IntLiteral = false, @Integral = false, @LiteralText = "7.1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 7.1, @ValueAsFloat = 7.1, @ValueAsInt = 7, @ValueAsLong = 7] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "11.23", @IntLiteral = false, @Integral = false, @LiteralText = "11.23", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 11.23, @ValueAsFloat = 11.23, @ValueAsInt = 11, @ValueAsLong = 11] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- VariableDeclarator[@Initializer = true, @Name = "table"] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "table", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "FMT", @Name = "FMT", @ParenthesisDepth = 0, @Parenthesized = false] + | +- Template[] + | +- TemplateFragment[@Content = "\"\"\"\n Description Width Height Area\n %-12s\\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + | +- TemplateFragment[@Content = "} %7.2f\\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "width", @Name = "width", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + | +- TemplateFragment[@Content = "} %7.2f\\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "height", @Name = "height", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + | +- TemplateFragment[@Content = "} %7.2f\\{"] + | +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- TemplateFragment[@Content = "}\n %-12s\\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + | +- TemplateFragment[@Content = "} %7.2f\\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "width", @Name = "width", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + | +- TemplateFragment[@Content = "} %7.2f\\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "height", @Name = "height", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + | +- TemplateFragment[@Content = "} %7.2f\\{"] + | +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- TemplateFragment[@Content = "}\n %-12s\\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] + | +- TemplateFragment[@Content = "} %7.2f\\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "width", @Name = "width", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] + | +- TemplateFragment[@Content = "} %7.2f\\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "height", @Name = "height", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] + | +- TemplateFragment[@Content = "} %7.2f\\{"] + | +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- TemplateFragment[@Content = "}\n \\{"] + | +- MethodCall[@CompileTimeConstant = false, @Image = "repeat", @MethodName = "repeat", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = " ", @Empty = false, @Image = "\" \"", @Length = 1, @LiteralText = "\" \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "28", @IntLiteral = true, @Integral = true, @LiteralText = "28", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 28.0, @ValueAsFloat = 28.0, @ValueAsInt = 28, @ValueAsLong = 28] + | +- TemplateFragment[@Content = "} Total %7.2f\\{"] + | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + | | | | +- ArgumentList[@Empty = true, @Size = 0] + | | | +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + | | | +- ArgumentList[@Empty = true, @Size = 0] + | | +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- TemplateFragment[@Content = "}\n \"\"\""] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "ensuringSafety", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] + | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- VoidType[] + | +- FormalParameters[@Empty = true, @Size = 0] + | +- Block[@Empty = false, @Size = 3, @containsComment = false] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- VariableDeclarator[@Initializer = true, @Name = "name"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "name", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Joan", @Empty = false, @Image = "\"Joan\"", @Length = 4, @LiteralText = "\"Joan\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "StringTemplate"] + | | +- VariableDeclarator[@Initializer = true, @Name = "st"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "st", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "RAW", @Name = "RAW", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- Template[] + | | +- TemplateFragment[@Content = "\"My name is \\{"] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TemplateFragment[@Content = "}\""] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- VariableDeclarator[@Initializer = true, @Name = "info"] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "info", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- MethodCall[@CompileTimeConstant = false, @Image = "process", @MethodName = "process", @ParenthesisDepth = 0, @Parenthesized = false] + | +- AmbiguousName[@CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "st", @Name = "st", @ParenthesisDepth = 0, @Parenthesized = false] + +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep459_StringTemplates$User", @CanonicalName = "Jep459_StringTemplates.User", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "User", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] + | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] + | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] + | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] + | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "firstName", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] + | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "accountNumber", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | +- RecordBody[@Empty = true, @Size = 0] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "literalsInsideTemplateExpressions", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] + | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- VoidType[] + | +- FormalParameters[@Empty = true, @Size = 0] + | +- Block[@Empty = false, @Size = 3, @containsComment = false] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- VariableDeclarator[@Initializer = true, @Name = "s1"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Welcome to your account", @Empty = false, @Image = "\"Welcome to your account\"", @Length = 23, @LiteralText = "\"Welcome to your account\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ClassType[@FullyQualified = false, @SimpleName = "User"] + | | +- VariableDeclarator[@Initializer = true, @Name = "user"] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "user", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | +- ClassType[@FullyQualified = false, @SimpleName = "User"] + | | +- ArgumentList[@Empty = false, @Size = 2] + | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Lisa", @Empty = false, @Image = "\"Lisa\"", @Length = 4, @LiteralText = "\"Lisa\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "12345", @IntLiteral = true, @Integral = true, @LiteralText = "12345", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 12345.0, @ValueAsFloat = 12345.0, @ValueAsInt = 12345, @ValueAsLong = 12345] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- VariableDeclarator[@Initializer = true, @Name = "s2"] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] + | +- Template[] + | +- TemplateFragment[@Content = "\"Welcome, \\{"] + | +- MethodCall[@CompileTimeConstant = false, @Image = "firstName", @MethodName = "firstName", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "user", @Name = "user", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- TemplateFragment[@Content = "}, to your account \\{"] + | +- MethodCall[@CompileTimeConstant = false, @Image = "accountNumber", @MethodName = "accountNumber", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "user", @Name = "user", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- TemplateFragment[@Content = "}\""] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "emptyEmbeddedExpression", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] + +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + +- VoidType[] + +- FormalParameters[@Empty = true, @Size = 0] + +- Block[@Empty = false, @Size = 1, @containsComment = false] + +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + +- ClassType[@FullyQualified = false, @SimpleName = "String"] + +- VariableDeclarator[@Initializer = true, @Name = "s1"] + +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] + +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] + +- Template[] + +- TemplateFragment[@Content = "\"Test \\{"] + +- TemplateFragment[@Content = "}\""] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses1.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses1.java new file mode 100644 index 0000000000..fc1cea6d7c --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses1.java @@ -0,0 +1,14 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + + + +/** + * @see JEP 445: Unnamed Classes and Instance Main Methods (Preview) (Java 21) + * @see JEP 463: Implicitly Declared Classes and Instance Main Methods (Second Preview) (Java 22) + */ + +void main() { + System.out.println("Hello World"); +} diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses1.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses1.txt new file mode 100644 index 0000000000..8bafb59ab5 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses1.txt @@ -0,0 +1,13 @@ ++- CompilationUnit[@PackageName = ""] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] + +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + +- VoidType[] + +- FormalParameters[@Empty = true, @Size = 0] + +- Block[@Empty = false, @Size = 1, @containsComment = false] + +- ExpressionStatement[] + +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + +- ArgumentList[@Empty = false, @Size = 1] + +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Hello World", @Empty = false, @Image = "\"Hello World\"", @Length = 11, @LiteralText = "\"Hello World\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses2.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses2.java new file mode 100644 index 0000000000..1e2d223c24 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses2.java @@ -0,0 +1,16 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + + + +/** + * @see JEP 445: Unnamed Classes and Instance Main Methods (Preview) (Java 21) + * @see JEP 463: Implicitly Declared Classes and Instance Main Methods (Second Preview) (Java 22) + */ + +String greeting() { return "Hello, World!"; } + +void main() { + System.out.println(greeting()); +} diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses2.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses2.txt new file mode 100644 index 0000000000..200582f309 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses2.txt @@ -0,0 +1,21 @@ ++- CompilationUnit[@PackageName = ""] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "greeting", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] + | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- FormalParameters[@Empty = true, @Size = 0] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ReturnStatement[] + | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Hello, World!", @Empty = false, @Image = "\"Hello, World!\"", @Length = 13, @LiteralText = "\"Hello, World!\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] + +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + +- VoidType[] + +- FormalParameters[@Empty = true, @Size = 0] + +- Block[@Empty = false, @Size = 1, @containsComment = false] + +- ExpressionStatement[] + +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + +- ArgumentList[@Empty = false, @Size = 1] + +- MethodCall[@CompileTimeConstant = false, @Image = "greeting", @MethodName = "greeting", @ParenthesisDepth = 0, @Parenthesized = false] + +- ArgumentList[@Empty = true, @Size = 0] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses3.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses3.java new file mode 100644 index 0000000000..3cbde1d0e5 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses3.java @@ -0,0 +1,16 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + + + +/** + * @see JEP 445: Unnamed Classes and Instance Main Methods (Preview) (Java 21) + * @see JEP 463: Implicitly Declared Classes and Instance Main Methods (Second Preview) (Java 22) + */ + +String greeting = "Hello, World!"; + +void main() { + System.out.println(greeting); +} diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses3.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses3.txt new file mode 100644 index 0000000000..2c78364825 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses3.txt @@ -0,0 +1,19 @@ ++- CompilationUnit[@PackageName = ""] + +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PACKAGE, @Static = false, @Visibility = Visibility.V_PACKAGE] + | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- VariableDeclarator[@Initializer = true, @Name = "greeting"] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "greeting", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] + | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Hello, World!", @Empty = false, @Image = "\"Hello, World!\"", @Length = 13, @LiteralText = "\"Hello, World!\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] + +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + +- VoidType[] + +- FormalParameters[@Empty = true, @Size = 0] + +- Block[@Empty = false, @Size = 1, @containsComment = false] + +- ExpressionStatement[] + +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + +- ArgumentList[@Empty = false, @Size = 1] + +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "greeting", @Name = "greeting", @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses4WithImports.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses4WithImports.java new file mode 100644 index 0000000000..b22ef710d0 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses4WithImports.java @@ -0,0 +1,17 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +import java.util.Arrays; +import java.util.stream.Collectors; + +/** + * @see JEP 445: Unnamed Classes and Instance Main Methods (Preview) (Java 21) + * @see JEP 463: Implicitly Declared Classes and Instance Main Methods (Second Preview) (Java 22) + */ + +String greeting = Arrays.asList("Hello", "World!").stream().collect(Collectors.joining(", ")); + +void main() { + System.out.println(greeting); +} diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses4WithImports.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses4WithImports.txt new file mode 100644 index 0000000000..ab0ba4f8de --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses4WithImports.txt @@ -0,0 +1,35 @@ ++- CompilationUnit[@PackageName = ""] + +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.util.Arrays", @ImportedSimpleName = "Arrays", @PackageName = "java.util", @Static = false] + +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.util.stream.Collectors", @ImportedSimpleName = "Collectors", @PackageName = "java.util.stream", @Static = false] + +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PACKAGE, @Static = false, @Visibility = Visibility.V_PACKAGE] + | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- VariableDeclarator[@Initializer = true, @Name = "greeting"] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "greeting", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] + | +- MethodCall[@CompileTimeConstant = false, @Image = "collect", @MethodName = "collect", @ParenthesisDepth = 0, @Parenthesized = false] + | +- MethodCall[@CompileTimeConstant = false, @Image = "stream", @MethodName = "stream", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- MethodCall[@CompileTimeConstant = false, @Image = "asList", @MethodName = "asList", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Arrays"] + | | | +- ArgumentList[@Empty = false, @Size = 2] + | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Hello", @Empty = false, @Image = "\"Hello\"", @Length = 5, @LiteralText = "\"Hello\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "World!", @Empty = false, @Image = "\"World!\"", @Length = 6, @LiteralText = "\"World!\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- MethodCall[@CompileTimeConstant = false, @Image = "joining", @MethodName = "joining", @ParenthesisDepth = 0, @Parenthesized = false] + | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassType[@FullyQualified = false, @SimpleName = "Collectors"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = ", ", @Empty = false, @Image = "\", \"", @Length = 2, @LiteralText = "\", \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] + +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + +- VoidType[] + +- FormalParameters[@Empty = true, @Size = 0] + +- Block[@Empty = false, @Size = 1, @containsComment = false] + +- ExpressionStatement[] + +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] + | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + +- ArgumentList[@Empty = false, @Size = 1] + +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "greeting", @Name = "greeting", @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/documentation/xml/CommentRequired.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/documentation/xml/CommentRequired.xml index b8328ba236..6f4158572f 100755 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/documentation/xml/CommentRequired.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/documentation/xml/CommentRequired.xml @@ -514,17 +514,7 @@ public class CommentRequired { - #1683 [java] CommentRequired property names are inconsistent - use deprecated property - Unwanted - 1 - - - - - #1683 [java] CommentRequired property names are inconsistent - use new property + #1683 [java] CommentRequired property names are inconsistent Unwanted 1 + + + [java] SingletonClassReturningNewInstance false positive with double assignment #932 - variant 1 + 0 + + + + + [java] SingletonClassReturningNewInstance false positive with double assignment #932 - variant 2 + 0 + + diff --git a/pmd-javascript/pom.xml b/pmd-javascript/pom.xml index 1fb4bb9ea9..39cd2edf07 100644 --- a/pmd-javascript/pom.xml +++ b/pmd-javascript/pom.xml @@ -49,7 +49,7 @@ - + diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/LanguageVersionTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/LanguageVersionTest.java index de8217aae9..c835b51951 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/LanguageVersionTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/LanguageVersionTest.java @@ -7,7 +7,7 @@ package net.sourceforge.pmd.lang.ecmascript; import java.util.Arrays; import java.util.Collection; -import net.sourceforge.pmd.AbstractLanguageVersionTest; +import net.sourceforge.pmd.test.AbstractLanguageVersionTest; class LanguageVersionTest extends AbstractLanguageVersionTest { diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/ant/PMDTaskTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/PMDTaskTest.java similarity index 75% rename from pmd-javascript/src/test/java/net/sourceforge/pmd/ant/PMDTaskTest.java rename to pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/PMDTaskTest.java index 79bc52e1f5..c77cdb9cce 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/ant/PMDTaskTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/PMDTaskTest.java @@ -2,13 +2,16 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.ant; +package net.sourceforge.pmd.lang.ecmascript; import org.junit.jupiter.api.Test; +import net.sourceforge.pmd.test.AbstractAntTestHelper; + class PMDTaskTest extends AbstractAntTestHelper { PMDTaskTest() { + super.pathToTestScript = "target/test-classes/net/sourceforge/pmd/lang/ecmascript/ant/xml"; super.antTestScriptFilename = "pmdtasktest.xml"; } diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/ReportTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/ReportTest.java similarity index 85% rename from pmd-javascript/src/test/java/net/sourceforge/pmd/ReportTest.java rename to pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/ReportTest.java index 292986f722..be7fc68b18 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/ReportTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/ReportTest.java @@ -2,10 +2,10 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd; +package net.sourceforge.pmd.lang.ecmascript; -import static net.sourceforge.pmd.lang.ast.test.TestUtilsKt.assertSize; -import static net.sourceforge.pmd.lang.ast.test.TestUtilsKt.assertSuppressed; +import static net.sourceforge.pmd.lang.test.ast.TestUtilsKt.assertSize; +import static net.sourceforge.pmd.lang.test.ast.TestUtilsKt.assertSuppressed; import org.junit.jupiter.api.Test; diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/RuleSetFactoryTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/RuleSetFactoryTest.java index 32b1211d9d..61cfb5bfc0 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/RuleSetFactoryTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/RuleSetFactoryTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.ecmascript; -import net.sourceforge.pmd.lang.rule.AbstractRuleSetFactoryTest; +import net.sourceforge.pmd.test.lang.rule.AbstractRuleSetFactoryTest; /** * Test javascript's rulesets diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/ast/JsParsingHelper.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/ast/JsParsingHelper.java index 0c0f2520fd..5fbc2a573d 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/ast/JsParsingHelper.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/ast/JsParsingHelper.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.ecmascript.ast; -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; import net.sourceforge.pmd.lang.ecmascript.EcmascriptLanguageModule; public final class JsParsingHelper extends BaseParsingHelper { diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/ast/JsTreeDumpTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/ast/JsTreeDumpTest.java index cdff450c60..1420aeea59 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/ast/JsTreeDumpTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/ast/JsTreeDumpTest.java @@ -7,9 +7,9 @@ package net.sourceforge.pmd.lang.ecmascript.ast; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; -import net.sourceforge.pmd.lang.ast.test.BaseTreeDumpTest; -import net.sourceforge.pmd.lang.ast.test.NodePrintersKt; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; +import net.sourceforge.pmd.lang.test.ast.BaseTreeDumpTest; +import net.sourceforge.pmd.lang.test.ast.NodePrintersKt; class JsTreeDumpTest extends BaseTreeDumpTest { JsTreeDumpTest() { diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/cpd/AnyCpdLexerForTypescriptTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/cpd/AnyCpdLexerForTypescriptTest.java index c159efd6e9..b7d8f05d88 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/cpd/AnyCpdLexerForTypescriptTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/cpd/AnyCpdLexerForTypescriptTest.java @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.ecmascript.cpd; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest; +import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest; import net.sourceforge.pmd.lang.ecmascript.EcmascriptLanguageModule; /** diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/cpd/EcmascriptCpdLexerTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/cpd/EcmascriptCpdLexerTest.java index 16b176bf43..35d420cdb3 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/cpd/EcmascriptCpdLexerTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/cpd/EcmascriptCpdLexerTest.java @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.ecmascript.cpd; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest; +import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest; import net.sourceforge.pmd.lang.ecmascript.EcmascriptLanguageModule; diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/AvoidWithStatementTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/AvoidWithStatementTest.java index 5d308cf576..be636f6ca7 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/AvoidWithStatementTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/AvoidWithStatementTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.ecmascript.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidWithStatementTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/ConsistentReturnTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/ConsistentReturnTest.java index 65afa849ce..0d2066ec8b 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/ConsistentReturnTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/ConsistentReturnTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.ecmascript.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ConsistentReturnTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/GlobalVariableTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/GlobalVariableTest.java index 0645d97bd6..e949d1e498 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/GlobalVariableTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/GlobalVariableTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.ecmascript.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class GlobalVariableTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/ScopeForInVariableTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/ScopeForInVariableTest.java index 03052f13ed..390b61c5f0 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/ScopeForInVariableTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/ScopeForInVariableTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.ecmascript.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ScopeForInVariableTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/UseBaseWithParseIntTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/UseBaseWithParseIntTest.java index c3dc0e1f8a..b6aab8d246 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/UseBaseWithParseIntTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/UseBaseWithParseIntTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.ecmascript.rule.bestpractices; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UseBaseWithParseIntTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/AssignmentInOperandTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/AssignmentInOperandTest.java index 09d7db44c8..8d83dfa58c 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/AssignmentInOperandTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/AssignmentInOperandTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.ecmascript.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AssignmentInOperandTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/ForLoopsMustUseBracesTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/ForLoopsMustUseBracesTest.java index 1ad9afc710..c992b704b9 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/ForLoopsMustUseBracesTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/ForLoopsMustUseBracesTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.ecmascript.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class ForLoopsMustUseBracesTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/IfElseStmtsMustUseBracesTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/IfElseStmtsMustUseBracesTest.java index b122d7a4b6..d2afcf84f1 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/IfElseStmtsMustUseBracesTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/IfElseStmtsMustUseBracesTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.ecmascript.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class IfElseStmtsMustUseBracesTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/IfStmtsMustUseBracesTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/IfStmtsMustUseBracesTest.java index 0d8595570d..e5d996f654 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/IfStmtsMustUseBracesTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/IfStmtsMustUseBracesTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.ecmascript.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class IfStmtsMustUseBracesTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/NoElseReturnTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/NoElseReturnTest.java index 92b91cd7d7..abbe38ecbb 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/NoElseReturnTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/NoElseReturnTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.ecmascript.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class NoElseReturnTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/UnnecessaryBlockTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/UnnecessaryBlockTest.java index 53c6ceb9c4..97390b04c5 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/UnnecessaryBlockTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/UnnecessaryBlockTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.ecmascript.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnnecessaryBlockTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/UnnecessaryParenthesesTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/UnnecessaryParenthesesTest.java index c94b0b9e40..b50f4927af 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/UnnecessaryParenthesesTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/UnnecessaryParenthesesTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.ecmascript.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnnecessaryParenthesesTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/UnreachableCodeTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/UnreachableCodeTest.java index e60cb484c9..438e03aa2f 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/UnreachableCodeTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/UnreachableCodeTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.ecmascript.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class UnreachableCodeTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/WhileLoopsMustUseBracesTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/WhileLoopsMustUseBracesTest.java index d681626c2c..4878c6aac6 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/WhileLoopsMustUseBracesTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/WhileLoopsMustUseBracesTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.ecmascript.rule.codestyle; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class WhileLoopsMustUseBracesTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/errorprone/AvoidTrailingCommaTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/errorprone/AvoidTrailingCommaTest.java index d865674576..2406d43308 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/errorprone/AvoidTrailingCommaTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/errorprone/AvoidTrailingCommaTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.ecmascript.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class AvoidTrailingCommaTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/errorprone/EqualComparisonTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/errorprone/EqualComparisonTest.java index 86e1b9defc..b794703157 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/errorprone/EqualComparisonTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/errorprone/EqualComparisonTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.ecmascript.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class EqualComparisonTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/errorprone/InnaccurateNumericLiteralTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/errorprone/InnaccurateNumericLiteralTest.java index 4cdd66abbd..73cbf9e509 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/errorprone/InnaccurateNumericLiteralTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/errorprone/InnaccurateNumericLiteralTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.ecmascript.rule.errorprone; -import net.sourceforge.pmd.testframework.PmdRuleTst; +import net.sourceforge.pmd.test.PmdRuleTst; class InnaccurateNumericLiteralTest extends PmdRuleTst { // no additional unit tests diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/typescript/cpd/TypeScriptCpdLexerTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/typescript/cpd/TypeScriptCpdLexerTest.java index aa2d7f84df..f37676926e 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/typescript/cpd/TypeScriptCpdLexerTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/typescript/cpd/TypeScriptCpdLexerTest.java @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.typescript.cpd; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest; +import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest; import net.sourceforge.pmd.lang.typescript.TsLanguageModule; class TypeScriptCpdLexerTest extends CpdTextComparisonTest { diff --git a/pmd-javascript/src/test/resources/net/sourceforge/pmd/cli/ExampleFile.js b/pmd-javascript/src/test/resources/net/sourceforge/pmd/cli/ExampleFile.js deleted file mode 100644 index 2b5c200d55..0000000000 --- a/pmd-javascript/src/test/resources/net/sourceforge/pmd/cli/ExampleFile.js +++ /dev/null @@ -1,4 +0,0 @@ -/** - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ -// just some js file for net.sourceforge.pmd.cli.CLITest diff --git a/pmd-javascript/src/test/resources/net/sourceforge/pmd/ant/xml/pmdtasktest.xml b/pmd-javascript/src/test/resources/net/sourceforge/pmd/lang/ecmascript/ant/xml/pmdtasktest.xml similarity index 91% rename from pmd-javascript/src/test/resources/net/sourceforge/pmd/ant/xml/pmdtasktest.xml rename to pmd-javascript/src/test/resources/net/sourceforge/pmd/lang/ecmascript/ant/xml/pmdtasktest.xml index 529d3cb514..c01e130009 100644 --- a/pmd-javascript/src/test/resources/net/sourceforge/pmd/ant/xml/pmdtasktest.xml +++ b/pmd-javascript/src/test/resources/net/sourceforge/pmd/lang/ecmascript/ant/xml/pmdtasktest.xml @@ -6,7 +6,7 @@ - + diff --git a/pmd-javascript/src/test/resources/net/sourceforge/pmd/ant/xml/ruleset.xml b/pmd-javascript/src/test/resources/net/sourceforge/pmd/lang/ecmascript/ant/xml/ruleset.xml similarity index 100% rename from pmd-javascript/src/test/resources/net/sourceforge/pmd/ant/xml/ruleset.xml rename to pmd-javascript/src/test/resources/net/sourceforge/pmd/lang/ecmascript/ant/xml/ruleset.xml diff --git a/pmd-jsp/pom.xml b/pmd-jsp/pom.xml index 42bb314996..357e96396c 100644 --- a/pmd-jsp/pom.xml +++ b/pmd-jsp/pom.xml @@ -42,7 +42,7 @@ - + diff --git a/pmd-jsp/src/test/java/net/sourceforge/pmd/LanguageVersionDiscovererTest.java b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/LanguageVersionDiscovererTest.java similarity index 97% rename from pmd-jsp/src/test/java/net/sourceforge/pmd/LanguageVersionDiscovererTest.java rename to pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/LanguageVersionDiscovererTest.java index 4f2e0a60bb..ceb1147568 100644 --- a/pmd-jsp/src/test/java/net/sourceforge/pmd/LanguageVersionDiscovererTest.java +++ b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/LanguageVersionDiscovererTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd; +package net.sourceforge.pmd.lang.jsp; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotEquals; diff --git a/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/LanguageVersionTest.java b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/LanguageVersionTest.java index eb2eb31267..303be4dbd6 100644 --- a/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/LanguageVersionTest.java +++ b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/LanguageVersionTest.java @@ -7,7 +7,7 @@ package net.sourceforge.pmd.lang.jsp; import java.util.Arrays; import java.util.Collection; -import net.sourceforge.pmd.AbstractLanguageVersionTest; +import net.sourceforge.pmd.test.AbstractLanguageVersionTest; class LanguageVersionTest extends AbstractLanguageVersionTest { diff --git a/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/RuleSetFactoryTest.java b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/RuleSetFactoryTest.java index 531bde227b..e9e19c024c 100644 --- a/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/RuleSetFactoryTest.java +++ b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/RuleSetFactoryTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.jsp; -import net.sourceforge.pmd.lang.rule.AbstractRuleSetFactoryTest; +import net.sourceforge.pmd.test.lang.rule.AbstractRuleSetFactoryTest; /** * Test jsp's rulesets diff --git a/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/ast/JspParsingHelper.java b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/ast/JspParsingHelper.java index 3cfed74953..83f7c1b6c9 100644 --- a/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/ast/JspParsingHelper.java +++ b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/ast/JspParsingHelper.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.jsp.ast; -import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; import net.sourceforge.pmd.lang.jsp.JspLanguageModule; public final class JspParsingHelper extends BaseParsingHelper { 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-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-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/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-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/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-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-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-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 95% 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..1ab10b4c2f 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 @@ -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" } 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 82% 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..11d2006d60 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 @@ -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/test/ast/NodePrinters.kt similarity index 90% 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..4d7d47fec7 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 @@ -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/test/ast/TestUtils.kt similarity index 94% 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..41f8def741 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 @@ -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/cpd/test/CpdTextComparisonTest.kt b/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/test/cpd/CpdTextComparisonTest.kt similarity index 91% 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..b5b5e5ea11 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 /** @@ -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-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-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-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/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-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/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-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/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/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-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/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-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/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-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 { 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/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/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/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-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-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-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/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/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-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/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 80% 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 b4ac2eff13..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.cpd.test.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-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-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/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-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/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-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-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 + + @@ -718,7 +731,7 @@ org.ow2.asm asm - 9.5 + 9.6 org.pcollections @@ -1275,7 +1288,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 @@ -1283,8 +1295,8 @@ pmd-test pmd-test-schema pmd-tsql + pmd-velocity pmd-visualforce - pmd-vm pmd-xml pmd-ant pmd-languages-deps