diff --git a/.all-contributorsrc b/.all-contributorsrc index 3356b34aa2..af7ea40ffe 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -2153,7 +2153,8 @@ "avatar_url": "https://avatars.githubusercontent.com/u/11549103?v=4", "profile": "https://github.com/cyw3", "contributions": [ - "bug" + "bug", + "doc" ] }, { @@ -7153,7 +7154,8 @@ "avatar_url": "https://avatars.githubusercontent.com/u/111259588?v=4", "profile": "https://github.com/nwcm", "contributions": [ - "doc" + "doc", + "bug" ] }, { @@ -7202,6 +7204,80 @@ "bug", "code" ] + }, + { + "login": "AndreyBozhko", + "name": "Andrey Bozhko", + "avatar_url": "https://avatars.githubusercontent.com/u/22246447?v=4", + "profile": "https://github.com/AndreyBozhko", + "contributions": [ + "doc" + ] + }, + { + "login": "rcorfieldffdc", + "name": "Richard Corfield", + "avatar_url": "https://avatars.githubusercontent.com/u/42997936?v=4", + "profile": "https://github.com/rcorfieldffdc", + "contributions": [ + "code" + ] + }, + { + "login": "m0rjc", + "name": "Richard Corfield", + "avatar_url": "https://avatars.githubusercontent.com/u/994206?v=4", + "profile": "https://github.com/m0rjc", + "contributions": [ + "bug", + "code" + ] + }, + { + "login": "eant60", + "name": "eant60", + "avatar_url": "https://avatars.githubusercontent.com/u/41472980?v=4", + "profile": "https://github.com/eant60", + "contributions": [ + "bug" + ] + }, + { + "login": "Marcono1234", + "name": "Marcono1234", + "avatar_url": "https://avatars.githubusercontent.com/u/11685886?v=4", + "profile": "https://github.com/Marcono1234", + "contributions": [ + "bug" + ] + }, + { + "login": "eugenepugach", + "name": "eugenepugach", + "avatar_url": "https://avatars.githubusercontent.com/u/133967768?v=4", + "profile": "https://github.com/eugenepugach", + "contributions": [ + "bug" + ] + }, + { + "login": "harbulot", + "name": "Bruno Harbulot", + "avatar_url": "https://avatars.githubusercontent.com/u/80994?v=4", + "profile": "http://blog.distributedmatter.net/", + "contributions": [ + "bug" + ] + }, + { + "login": "shai-bennathan", + "name": "Shai Bennathan", + "avatar_url": "https://avatars.githubusercontent.com/u/62336907?v=4", + "profile": "https://github.com/shai-bennathan", + "contributions": [ + "bug", + "code" + ] } ], "contributorsPerLine": 7, diff --git a/.ci/build.sh b/.ci/build.sh index c717eeb592..ae7280b1b3 100755 --- a/.ci/build.sh +++ b/.ci/build.sh @@ -9,7 +9,7 @@ SCRIPT_INCLUDES="log.bash utils.bash setup-secrets.bash openjdk.bash maven.bash source "$(dirname "$0")/inc/fetch_ci_scripts.bash" && fetch_ci_scripts function build() { - pmd_ci_log_group_start "Prepare Java 8+11+17, Bundler" + pmd_ci_log_group_start "Prepare Java 8+11+17+21, Bundler" pmd_ci_openjdk_install_adoptium 11 pmd_ci_openjdk_setdefault 11 PMD_MAVEN_EXTRA_OPTS=() @@ -18,7 +18,13 @@ function build() { pmd_ci_openjdk_install_adoptium 8 pmd_ci_log_info "Install openjdk17 for integration tests and pmd-regression-tests" pmd_ci_openjdk_install_adoptium 17 - PMD_MAVEN_EXTRA_OPTS=(-Djava8.home="${HOME}/openjdk8" -Djava17.home="${HOME}/openjdk17") + pmd_ci_log_info "Install openjdk21 for integration tests and pmd-regression-tests" + pmd_ci_openjdk_install_adoptium 21 + PMD_MAVEN_EXTRA_OPTS=( + -Djava8.home="${HOME}/openjdk8" + -Djava17.home="${HOME}/openjdk17" + -Djava21.home="${HOME}/openjdk21" + ) fi pmd_ci_build_setup_bundler pmd_ci_log_group_end @@ -100,7 +106,8 @@ function build() { pmd_ci_build_and_upload_doc pmd_ci_log_group_end - if pmd_ci_maven_isReleaseBuild; then + # release is published only for the case b) pmd-cli/pmd-dist release + if pmd_ci_maven_isReleaseBuild && [[ "${PMD_CI_TAG}" == *-dist ]]; then pmd_ci_log_group_start "Publishing Release" pmd_ci_gh_releases_publishRelease "$GH_RELEASE" pmd_ci_sourceforge_selectDefault "${PMD_CI_MAVEN_PROJECT_VERSION}" @@ -108,10 +115,14 @@ function build() { pmd_ci_log_group_end fi + # create a baseline for snapshot builds (when pmd-dist is built) + # or for release builds for case b) when pmd-cli/pmd-dist is released + if pmd_ci_maven_isSnapshotBuild || [[ "${PMD_CI_TAG}" == *-dist ]]; then pmd_ci_log_group_start "Creating new baseline for regression tester" regression_tester_setup_ci regression_tester_uploadBaseline pmd_ci_log_group_end + fi # # everything from here runs only on snapshots, not on release builds @@ -130,7 +141,7 @@ function build() { -Dpmd.skip \ --show-version --errors --batch-mode \ clean package \ - sonar:sonar -Dsonar.login="${SONAR_TOKEN}" -Psonar + sonar:sonar -Dsonar.login="${SONAR_TOKEN}" -Psonar,cli-dist pmd_ci_log_success "New sonar results: https://sonarcloud.io/dashboard?id=net.sourceforge.pmd%3Apmd" pmd_ci_log_group_end @@ -146,7 +157,7 @@ function build() { -DrepoToken="${COVERALLS_REPO_TOKEN}" \ --show-version --errors --batch-mode \ clean package jacoco:report \ - coveralls:report -Pcoveralls + coveralls:report -Pcoveralls,cli-dist pmd_ci_log_success "New coveralls result: https://coveralls.io/github/pmd/pmd" pmd_ci_log_group_end fi @@ -172,30 +183,58 @@ function pmd_ci_build_run() { if pmd_ci_maven_isReleaseBuild; then pmd_ci_log_info "This is a release build" mvn_profiles="${mvn_profiles},pmd-release" + + # There are two possible (release) builds: + if [[ "${PMD_CI_TAG}" != *-dist ]]; then + # a) pmd-core and languages modules + ./mvnw clean deploy -P"${mvn_profiles}",'!cli-dist' --show-version --errors --batch-mode "${PMD_MAVEN_EXTRA_OPTS[@]}" + else + # b) pmd-cli and pmd-dist + ./mvnw clean deploy -P"${mvn_profiles},cli-dist" -pl pmd-cli,pmd-dist --show-version --errors --batch-mode "${PMD_MAVEN_EXTRA_OPTS[@]}" + fi else pmd_ci_log_info "This is a snapshot build" + ./mvnw clean deploy -P"${mvn_profiles},cli-dist" --show-version --errors --batch-mode "${PMD_MAVEN_EXTRA_OPTS[@]}" fi - ./mvnw clean deploy -P${mvn_profiles} --show-version --errors --batch-mode "${PMD_MAVEN_EXTRA_OPTS[@]}" } # # Deploys the binary distribution # function pmd_ci_deploy_build_artifacts() { - # Deploy to sourceforge files https://sourceforge.net/projects/pmd/files/pmd/ - pmd_ci_sourceforge_uploadFile "pmd/${PMD_CI_MAVEN_PROJECT_VERSION}" "pmd-dist/target/pmd-dist-${PMD_CI_MAVEN_PROJECT_VERSION}-bin.zip" - pmd_ci_sourceforge_uploadFile "pmd/${PMD_CI_MAVEN_PROJECT_VERSION}" "pmd-dist/target/pmd-dist-${PMD_CI_MAVEN_PROJECT_VERSION}-src.zip" - # Deploy SBOM - cp pmd-dist/target/bom.xml "pmd-dist/target/pmd-${PMD_CI_MAVEN_PROJECT_VERSION}-cyclonedx.xml" - cp pmd-dist/target/bom.json "pmd-dist/target/pmd-${PMD_CI_MAVEN_PROJECT_VERSION}-cyclonedx.json" - pmd_ci_sourceforge_uploadFile "pmd/${PMD_CI_MAVEN_PROJECT_VERSION}" "pmd-dist/target/pmd-${PMD_CI_MAVEN_PROJECT_VERSION}-cyclonedx.xml" - pmd_ci_sourceforge_uploadFile "pmd/${PMD_CI_MAVEN_PROJECT_VERSION}" "pmd-dist/target/pmd-${PMD_CI_MAVEN_PROJECT_VERSION}-cyclonedx.json" + if pmd_ci_maven_isSnapshotBuild; then + # Deploy to sourceforge files https://sourceforge.net/projects/pmd/files/pmd/ + pmd_ci_sourceforge_uploadFile "pmd/${PMD_CI_MAVEN_PROJECT_VERSION}" "pmd-dist/target/pmd-dist-${PMD_CI_MAVEN_PROJECT_VERSION}-bin.zip" + pmd_ci_sourceforge_uploadFile "pmd/${PMD_CI_MAVEN_PROJECT_VERSION}" "pmd-dist/target/pmd-dist-${PMD_CI_MAVEN_PROJECT_VERSION}-src.zip" + # Deploy SBOM + cp pmd-dist/target/bom.xml "pmd-dist/target/pmd-${PMD_CI_MAVEN_PROJECT_VERSION}-cyclonedx.xml" + cp pmd-dist/target/bom.json "pmd-dist/target/pmd-${PMD_CI_MAVEN_PROJECT_VERSION}-cyclonedx.json" + pmd_ci_sourceforge_uploadFile "pmd/${PMD_CI_MAVEN_PROJECT_VERSION}" "pmd-dist/target/pmd-${PMD_CI_MAVEN_PROJECT_VERSION}-cyclonedx.xml" + pmd_ci_sourceforge_uploadFile "pmd/${PMD_CI_MAVEN_PROJECT_VERSION}" "pmd-dist/target/pmd-${PMD_CI_MAVEN_PROJECT_VERSION}-cyclonedx.json" + fi - if pmd_ci_maven_isReleaseBuild; then + # release build case a): only pmd-core and language modules released + if pmd_ci_maven_isReleaseBuild && [[ "${PMD_CI_TAG}" != *-dist ]]; then # create a draft github release pmd_ci_gh_releases_createDraftRelease "${PMD_CI_TAG}" "$(git rev-list -n 1 "${PMD_CI_TAG}")" GH_RELEASE="$RESULT" + fi + + # release build case b): pmd-cli and pmd-dist are released + if pmd_ci_maven_isReleaseBuild && [[ "${PMD_CI_TAG}" == *-dist ]]; then + # Deploy to sourceforge files https://sourceforge.net/projects/pmd/files/pmd/ + pmd_ci_sourceforge_uploadFile "pmd/${PMD_CI_MAVEN_PROJECT_VERSION}" "pmd-dist/target/pmd-dist-${PMD_CI_MAVEN_PROJECT_VERSION}-bin.zip" + pmd_ci_sourceforge_uploadFile "pmd/${PMD_CI_MAVEN_PROJECT_VERSION}" "pmd-dist/target/pmd-dist-${PMD_CI_MAVEN_PROJECT_VERSION}-src.zip" + # Deploy SBOM + cp pmd-dist/target/bom.xml "pmd-dist/target/pmd-${PMD_CI_MAVEN_PROJECT_VERSION}-cyclonedx.xml" + cp pmd-dist/target/bom.json "pmd-dist/target/pmd-${PMD_CI_MAVEN_PROJECT_VERSION}-cyclonedx.json" + pmd_ci_sourceforge_uploadFile "pmd/${PMD_CI_MAVEN_PROJECT_VERSION}" "pmd-dist/target/pmd-${PMD_CI_MAVEN_PROJECT_VERSION}-cyclonedx.xml" + pmd_ci_sourceforge_uploadFile "pmd/${PMD_CI_MAVEN_PROJECT_VERSION}" "pmd-dist/target/pmd-${PMD_CI_MAVEN_PROJECT_VERSION}-cyclonedx.json" + + # draft release has already been created + pmd_ci_gh_releases_getLatestDraftRelease + GH_RELEASE="$RESULT" # Deploy to github releases pmd_ci_gh_releases_uploadAsset "$GH_RELEASE" "pmd-dist/target/pmd-dist-${PMD_CI_MAVEN_PROJECT_VERSION}-bin.zip" @@ -215,7 +254,7 @@ function pmd_ci_build_and_upload_doc() { pmd_doc_create_archive pmd_ci_sourceforge_uploadFile "pmd/${PMD_CI_MAVEN_PROJECT_VERSION}" "docs/pmd-dist-${PMD_CI_MAVEN_PROJECT_VERSION}-doc.zip" - if pmd_ci_maven_isReleaseBuild; then + if pmd_ci_maven_isReleaseBuild && [[ "${PMD_CI_TAG}" != *-dist ]]; then pmd_ci_gh_releases_uploadAsset "$GH_RELEASE" "docs/pmd-dist-${PMD_CI_MAVEN_PROJECT_VERSION}-doc.zip" fi @@ -224,19 +263,21 @@ function pmd_ci_build_and_upload_doc() { # Deploy javadoc to https://docs.pmd-code.org/apidocs/*/${PMD_CI_MAVEN_PROJECT_VERSION}/ pmd_code_uploadJavadoc "${PMD_CI_MAVEN_PROJECT_VERSION}" "$(pwd)" - # render release notes - # updating github release text - rm -f .bundle/config - bundle config set --local path vendor/bundle - bundle config set --local with release_notes_preprocessing - bundle install - # renders, and skips the first 6 lines - the Jekyll front-matter - local rendered_release_notes - rendered_release_notes=$(bundle exec docs/render_release_notes.rb docs/pages/release_notes.md | tail -n +6) - local release_name - release_name="PMD ${PMD_CI_MAVEN_PROJECT_VERSION} ($(date -u +%d-%B-%Y))" - # Upload to https://sourceforge.net/projects/pmd/files/pmd/${PMD_CI_MAVEN_PROJECT_VERSION}/ReadMe.md - pmd_ci_sourceforge_uploadReleaseNotes "pmd/${PMD_CI_MAVEN_PROJECT_VERSION}" "${rendered_release_notes}" + if pmd_ci_maven_isSnapshotBuild || [[ "${PMD_CI_TAG}" != *-dist ]]; then + # render release notes + # updating github release text + rm -f .bundle/config + bundle config set --local path vendor/bundle + bundle config set --local with release_notes_preprocessing + bundle install + # renders, and skips the first 6 lines - the Jekyll front-matter + local rendered_release_notes + rendered_release_notes=$(bundle exec docs/render_release_notes.rb docs/pages/release_notes.md | tail -n +6) + local release_name + release_name="PMD ${PMD_CI_MAVEN_PROJECT_VERSION} ($(date -u +%d-%B-%Y))" + # Upload to https://sourceforge.net/projects/pmd/files/pmd/${PMD_CI_MAVEN_PROJECT_VERSION}/ReadMe.md + pmd_ci_sourceforge_uploadReleaseNotes "pmd/${PMD_CI_MAVEN_PROJECT_VERSION}" "${rendered_release_notes}" + fi if pmd_ci_maven_isSnapshotBuild && [ "${PMD_CI_BRANCH}" = "master" ]; then # only for snapshot builds from branch master: https://docs.pmd-code.org/snapshot -> pmd-doc-${PMD_CI_MAVEN_PROJECT_VERSION} @@ -248,7 +289,7 @@ function pmd_ci_build_and_upload_doc() { pmd_ci_sourceforge_rsyncSnapshotDocumentation "${PMD_CI_MAVEN_PROJECT_VERSION}" "snapshot" fi - if pmd_ci_maven_isReleaseBuild; then + if pmd_ci_maven_isReleaseBuild && [[ "${PMD_CI_TAG}" != *-dist ]]; then # documentation is already uploaded to https://docs.pmd-code.org/pmd-doc-${PMD_CI_MAVEN_PROJECT_VERSION} # we only need to setup symlinks for the released version pmd_code_createSymlink "${PMD_CI_MAVEN_PROJECT_VERSION}" "latest" diff --git a/.ci/files/all-regression-rules.xml b/.ci/files/all-regression-rules.xml index 12fceb6fec..95a1423ca0 100644 --- a/.ci/files/all-regression-rules.xml +++ b/.ci/files/all-regression-rules.xml @@ -1,4 +1,4 @@ - + > $GITHUB_ENV echo "MAVEN_OPTS=-Daether.connector.http.connectionMaxTtl=180 -DautoReleaseAfterClose=true -DstagingProgressTimeoutMinutes=30" >> $GITHUB_ENV - echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/master/scripts" >> $GITHUB_ENV + echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/22/scripts" >> $GITHUB_ENV - name: Check Environment shell: bash run: | diff --git a/.github/workflows/git-repo-sync.yml b/.github/workflows/git-repo-sync.yml index 79a78f58ae..4b79a42d6b 100644 --- a/.github/workflows/git-repo-sync.yml +++ b/.github/workflows/git-repo-sync.yml @@ -24,7 +24,7 @@ jobs: shell: bash run: | echo "LANG=en_US.UTF-8" >> $GITHUB_ENV - echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/master/scripts" >> $GITHUB_ENV + echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/22/scripts" >> $GITHUB_ENV - name: Sync run: .ci/git-repo-sync.sh shell: bash diff --git a/.github/workflows/troubleshooting.yml b/.github/workflows/troubleshooting.yml index 1d67efffca..3216333733 100644 --- a/.github/workflows/troubleshooting.yml +++ b/.github/workflows/troubleshooting.yml @@ -36,7 +36,7 @@ jobs: run: | echo "LANG=en_US.UTF-8" >> $GITHUB_ENV echo "MAVEN_OPTS=-Daether.connector.http.connectionMaxTtl=180 -DstagingProgressTimeoutMinutes=30" >> $GITHUB_ENV - echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/master/scripts" >> $GITHUB_ENV + echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/22/scripts" >> $GITHUB_ENV - name: Check Environment shell: bash run: | diff --git a/Gemfile.lock b/Gemfile.lock index 5743e66559..f7a0157baf 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,8 +1,9 @@ GEM remote: https://rubygems.org/ specs: - addressable (2.8.4) + addressable (2.8.5) public_suffix (>= 2.0.2, < 6.0) + base64 (0.1.1) claide (1.1.0) claide-plugins (0.9.2) cork @@ -12,23 +13,24 @@ GEM concurrent-ruby (1.2.2) cork (0.3.0) colored2 (~> 3.1) - danger (9.2.0) + danger (9.3.2) claide (~> 1.0) claide-plugins (>= 0.9.2) colored2 (~> 3.1) cork (~> 0.1) faraday (>= 0.9.0, < 3.0) faraday-http-cache (~> 2.0) - git (~> 1.7) + git (~> 1.13) kramdown (~> 2.3) kramdown-parser-gfm (~> 1.0) no_proxy_fix - octokit (~> 5.0) + octokit (~> 6.0) terminal-table (>= 1, < 4) differ (0.1.2) et-orbi (1.2.7) tzinfo - faraday (2.7.5) + faraday (2.7.11) + base64 faraday-net_http (>= 2.0, < 3.1) ruby2_keywords (>= 0.0.4) faraday-http-cache (2.5.0) @@ -46,13 +48,13 @@ GEM kramdown (~> 2.0) liquid (5.4.0) logger-colors (1.0.0) - mini_portile2 (2.8.2) + mini_portile2 (2.8.4) nap (1.1.0) no_proxy_fix (0.1.2) - nokogiri (1.15.2) + nokogiri (1.15.4) mini_portile2 (~> 2.8.2) racc (~> 1.4) - octokit (5.6.1) + octokit (6.1.1) faraday (>= 1, < 3) sawyer (~> 0.9) open4 (1.3.4) @@ -63,14 +65,14 @@ GEM nokogiri (~> 1.13) rufus-scheduler (~> 3.8) slop (~> 4.9) - public_suffix (5.0.1) + public_suffix (5.0.3) raabro (1.4.0) - racc (1.6.2) + racc (1.7.1) rchardet (1.8.0) - rexml (3.2.5) - rouge (4.1.1) + rexml (3.2.6) + rouge (4.1.3) ruby2_keywords (0.0.5) - rufus-scheduler (3.8.2) + rufus-scheduler (3.9.1) fugit (~> 1.1, >= 1.1.6) safe_yaml (1.0.5) sawyer (0.9.2) diff --git a/do-release.sh b/do-release.sh index 60d060c944..d597384cdb 100755 --- a/do-release.sh +++ b/do-release.sh @@ -101,8 +101,8 @@ echo " the new release based on the release notes. Also add any deprecated ru echo echo "* Update **../pmd.github.io/_config.yml** to mention the new release" echo -echo "* Update property \`pmd-designer.version\` in **pom.xml** to reference the latest pmd-designer release" -echo " See for the available releases." +echo "* Update property \`pmd-designer.version\` in **pom.xml** to reference the version, that will be released" +echo " later in this process." echo echo "Press enter to continue..." read -r @@ -170,8 +170,8 @@ git commit -a -m "Prepare pmd release ${RELEASE_VERSION}" -DreleaseVersion="${RELEASE_VERSION}" \ -DdevelopmentVersion="${DEVELOPMENT_VERSION}" \ -DscmCommentPrefix="[release] " \ - -Pgenerate-rule-docs - + -Darguments='-Pgenerate-rule-docs,!cli-dist' \ + '-Pgenerate-rule-docs,!cli-dist' echo echo "Tag has been pushed.... now check github actions: " @@ -235,14 +235,46 @@ EOF git commit -a -m "Prepare next development version [skip ci]" git push origin "${CURRENT_BRANCH}" ./mvnw -B release:clean + echo echo echo +echo "* Wait until the new version is synced to maven central and appears as latest version in" +echo " ." +echo +echo +echo "Then proceed with releasing pmd-designer..." +echo "" +echo +echo "Press enter to continue when pmd-designer is available in maven-central..." +echo "." +read -r + +echo +echo "Continuing with release of pmd-cli and pmd-dist..." +git checkout "pmd_releases/${RELEASE_VERSION}" +./mvnw versions:update-parent -DparentVersion="${RELEASE_VERSION}" -DskipResolution=true -DgenerateBackupPoms=false -pl pmd-cli,pmd-dist +git add pmd-cli/pom.xml pmd-dist/pom.xml +git commit -m "[release] prepare release pmd_releases/${RELEASE_VERSION}-dist" +git tag -m "[release] copy for tag pmd_releases/${RELEASE_VERSION}-dist" "pmd_releases/${RELEASE_VERSION}-dist" +git push origin tag "pmd_releases/${RELEASE_VERSION}-dist" +git checkout master +# make sure parent reference is correct +./mvnw versions:update-parent -DparentVersion="${DEVELOPMENT_VERSION}" -DskipResolution=true -DgenerateBackupPoms=false -pl pmd-cli,pmd-dist +git add pmd-cli/pom.xml pmd-dist/pom.xml +changes=$(git status --porcelain 2>/dev/null | grep -c -E "^[AMDRC]" || true) +if [ "$changes" -gt 0 ]; then + git commit -m "Prepare next development version [skip ci]" + git push origin "${CURRENT_BRANCH}" +fi + +echo +echo "Second tag 'pmd_releases/${RELEASE_VERSION}-dist' has been pushed ... now check github actions: " +echo +echo echo "Verify the new release on github: " echo "and the news entry at " echo -echo "* Wait until the new version is synced to maven central and appears as latest version in" -echo " ." echo "* Send out an announcement mail to the mailing list:" echo echo "To: PMD Developers List " diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock index 086ec50e59..127620dcb2 100644 --- a/docs/Gemfile.lock +++ b/docs/Gemfile.lock @@ -1,19 +1,20 @@ GEM remote: https://rubygems.org/ specs: - activesupport (7.0.5) + activesupport (7.0.8) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) - addressable (2.8.4) + addressable (2.8.5) public_suffix (>= 2.0.2, < 6.0) + base64 (0.1.1) coffee-script (2.4.1) coffee-script-source execjs coffee-script-source (1.11.1) colorator (1.1.0) - commonmarker (0.23.9) + commonmarker (0.23.10) concurrent-ruby (1.2.2) dnsruby (1.70.0) simpleidn (~> 0.2.1) @@ -23,12 +24,13 @@ GEM ethon (0.16.0) ffi (>= 1.15.0) eventmachine (1.2.7) - execjs (2.8.1) - faraday (2.7.5) + execjs (2.9.1) + faraday (2.7.11) + base64 faraday-net_http (>= 2.0, < 3.1) ruby2_keywords (>= 0.0.4) faraday-net_http (3.0.2) - ffi (1.15.5) + ffi (1.16.2) forwardable-extended (2.6.0) gemoji (3.0.1) github-pages (228) @@ -86,7 +88,7 @@ GEM activesupport (>= 2) nokogiri (>= 1.4) http_parser.rb (0.8.0) - i18n (1.13.0) + i18n (1.14.1) concurrent-ruby (~> 1.0) jekyll (3.9.3) addressable (~> 2.4) @@ -205,13 +207,13 @@ GEM rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) mercenary (0.3.6) - mini_portile2 (2.8.2) + mini_portile2 (2.8.4) minima (2.5.1) jekyll (>= 3.5, < 5.0) jekyll-feed (~> 0.9) jekyll-seo-tag (~> 2.1) - minitest (5.18.0) - nokogiri (1.15.2) + minitest (5.20.0) + nokogiri (1.15.4) mini_portile2 (~> 2.8.2) racc (~> 1.4) octokit (4.25.1) @@ -220,11 +222,11 @@ GEM pathutil (0.16.2) forwardable-extended (~> 2.6) public_suffix (4.0.7) - racc (1.6.2) + racc (1.7.1) rb-fsevent (0.11.2) rb-inotify (0.10.1) ffi (~> 1.0) - rexml (3.2.5) + rexml (3.2.6) rouge (3.26.0) ruby2_keywords (0.0.5) rubyzip (2.3.2) diff --git a/docs/pages/pmd/languages/java.md b/docs/pages/pmd/languages/java.md index 46c039021c..2a55d9f747 100644 --- a/docs/pages/pmd/languages/java.md +++ b/docs/pages/pmd/languages/java.md @@ -17,9 +17,10 @@ Usually the latest non-preview Java Version is the default version. | Java Version | Alias | Supported by PMD since | |--------------|-------|------------------------| +| 21-preview | | 7.0.0 | +| 21 (default) | | 7.0.0 | | 20-preview | | 6.55.0 | -| 20 (default) | | 6.55.0 | -| 19-preview | | 6.48.0 | +| 20 | | 6.55.0 | | 19 | | 6.48.0 | | 18 | | 6.44.0 | | 17 | | 6.37.0 | @@ -41,10 +42,10 @@ Usually the latest non-preview Java Version is the default version. ## Using Java preview features In order to analyze a project with PMD that uses preview language features, you'll need to enable -it via the environment variable `PMD_JAVA_OPTS` and select the new language version, e.g. `20-preview`: +it via the environment variable `PMD_JAVA_OPTS` and select the new language version, e.g. `21-preview`: export PMD_JAVA_OPTS=--enable-preview - pmd check --use-version java-20-preview ... + pmd check --use-version java-21-preview ... Note: we only support preview language features for the latest two java versions. diff --git a/docs/pages/pmd/projectdocs/committers/releasing.md b/docs/pages/pmd/projectdocs/committers/releasing.md index 92ddf8035c..58d12d31ea 100644 --- a/docs/pages/pmd/projectdocs/committers/releasing.md +++ b/docs/pages/pmd/projectdocs/committers/releasing.md @@ -7,8 +7,7 @@ last_updated: April 2021 This page describes the current status of the release process. -Since versions 5.4.5 / 5.5.4 there is an automated release process using [travis-ci](https://travis-ci.com) -in place. Since 6.30.0, the automated release process is using [Github Actions](https://github.com/pmd/pmd/actions). +Since 6.30.0, the automated release process is using [Github Actions](https://github.com/pmd/pmd/actions). However, there are still a few steps, that need manual examination. @@ -19,10 +18,16 @@ required in order to verify that the release was successful or in case the autom some reason. Then individual steps need to be executed manually. Because the build is reproducible, these steps can be repeated again if the same tag is used. +There is one special case in this project: The release of PMD is done in two steps: +1. All modules except pmd-cli and pmd-dist are released. That means, pmd-core and all the language modules + are released. This is, so that these libs can be used by pmd-designer to create a new release. +2. pmd-cli and pmd-dist are released afterwards. Both depend on pmd-designer, and this two-step release + process is used for now to break the cycling release dependency. + The three main steps are: -* Preparations (which creates the tag) - use `do-release.sh` for that -* The actual release (which is automated) +* Preparations (which creates the tags) - use `do-release.sh` for that +* The actual release (which is automated) - GitHub Actions will build the tags when they have been pushed. * Prepare the next release (make sure the current main branch is ready for further development) ## Preparations @@ -30,7 +35,7 @@ The three main steps are: This is the first step. It is always manual and is executed locally. It creates in the end the tag from which the release is created. -Make sure code is up to date and everything is committed and pushed with git: +Make sure code is up-to-date and everything is committed and pushed with git: $ ./mvnw clean $ git pull @@ -71,8 +76,8 @@ pmd: The release type could be one of "bugfix" (e.g. 6.34.x), "minor" (6.x.0), or "major" (x.0.0). -The release notes usual mention any new rules that have been added since the last release. -Please double check the file `pmd-core/src/main/resources/rulesets/releases/.xml`, so +The release notes usually mention any new rules that have been added since the last release. +Please double-check the file `pmd-core/src/main/resources/rulesets/releases/.xml`, so that all new rules are listed. Add the new rules as comments to the quickstart rulesets: @@ -80,12 +85,12 @@ Add the new rules as comments to the quickstart rulesets: * `pmd-java/src/main/resources/rulesets/java/quickstart.xml` The designer lives at [pmd/pmd-designer](https://github.com/pmd/pmd-designer). -Update property `pmd-designer.version` in **pom.xml** to reference the latest pmd-designer release. -See for the available releases. +Update property `pmd-designer.version` in **pom.xml** to reference the new version, that will be released +shortly. Note: This version does at the moment not exist. Starting with PMD 6.23.0 we'll provide small statistics for every release. This needs to be added to the release notes as the last section. To count the closed issues and pull requests, the milestone -on github with the title of the new release is searched. Make sure, there is a milestone +on GitHub with the title of the new release is searched. Make sure, there is a milestone on . The following snippet will create the numbers, that can be attached to the release notes as a last section: @@ -149,27 +154,31 @@ next snapshot version after the release. RELEASE_VERSION=6.34.0 DEVELOPMENT_VERSION=6.35.0-SNAPSHOT ./mvnw -B release:clean release:prepare \ - -Dtag=pmd_releases/${RELEASE_VERSION} \ - -DreleaseVersion=${RELEASE_VERSION} \ - -DdevelopmentVersion=${DEVELOPMENT_VERSION} + -Dtag="pmd_releases/${RELEASE_VERSION}" \ + -DreleaseVersion="${RELEASE_VERSION}" \ + -DdevelopmentVersion="${DEVELOPMENT_VERSION}" \ + -DscmCommentPrefix="[release] " \ + -Darguments='-Pgenerate-rule-docs,!cli-dist' \ + '-Pgenerate-rule-docs,!cli-dist' ``` Once the maven plugin has pushed the tag, github actions will start and build a new version from this tag. Since it is a tag build and a released version build, the build script will do a couple of additional stuff. This is all automated in `.ci/build.sh`. +Note: The profile "cli-dist" is deactivated, so this release command doesn't include pmd-cli and pmd-dist. +They will be released separately after pmd-designer is released. Since pmd-dist is not included in this first +step, no binaries are created yet. + Here is, what happens: * Deploy and release the build to maven central, so that it can be downloaded from . This is done automatically, if all unit tests pass and the build doesn't fail for any other reason. The plugin [nexus-staging-maven-plugin](https://github.com/sonatype/nexus-maven-plugins/tree/master/staging/maven-plugin) is used for that. -* Upload the new binaries to github releases under . It also uploads - the release notes from `docs/pages/release_notes.md`. - Note: The during the process, the release is a draft mode and not visible yet. - At the end of the process, the release will be published. -* Upload the new binaries additionally to sourceforge, so that they can be downloaded from - , including the release notes. +* Create a draft release on GitHub and upload the release notes from `docs/pages/release_notes.md`. + Note: During the process, the release is a draft mode and not visible yet. + At the end of the process, the release will be published. * Render the documentation in `docs/` with `bundle exec jekyll build` and create a zip file from it. * Upload the doc zip file to the current github release under and to . @@ -186,15 +195,47 @@ Here is, what happens: * Copy the documentation to sourceforge's web space, so that it is available as . All previously copied versions are listed under . + +The release on github actions currently takes about 30-45 minutes. Once this is done, you +can proceed with releasing pmd designer, see . +Make sure to release the version, you have used earlier for the property `pmd-designer.version`. + +Once the pmd-designer release is done, you can proceed with part 2. We'll checkout the release tag, add +a new commit with the changed versions for pmd-cli and pmd-dist on top of it and create a new tag: + +```shell +git checkout "pmd_releases/${RELEASE_VERSION}" +./mvnw versions:update-parent -DparentVersion="${RELEASE_VERSION}" -DskipResolution=true -DgenerateBackupPoms=false -pl pmd-cli,pmd-dist +git add pmd-cli/pom.xml pmd-dist/pom.xml +git commit -m "[release] prepare release pmd_releases/${RELEASE_VERSION}-dist" +git tag -m "[release] copy for tag pmd_releases/${RELEASE_VERSION}-dist" "pmd_releases/${RELEASE_VERSION}-dist" +git push origin tag "pmd_releases/${RELEASE_VERSION}-dist" +git checkout master +# make sure parent reference is correct +./mvnw versions:update-parent -DparentVersion="${DEVELOPMENT_VERSION}" -DskipResolution=true -DgenerateBackupPoms=false -pl pmd-cli,pmd-dist +git add pmd-cli/pom.xml pmd-dist/pom.xml +git commit -m "Prepare next development version [skip ci]" +git push origin "${CURRENT_BRANCH}" +``` + +Since pmd-cli/pmd-dist were not part of the first maven-release-plugin call, we might need to fix the parent references +manually to set to the new development version. + +The new created tag ends with the suffix `-dist`, and this is used as a marker for the GitHub action. The same build +script `.ci/build.sh` is executed, but now, it does the following steps: + +* Build only modules pmd-cli and pmd-dist +* Upload the new binaries to the existing draft release under . +* Upload the new binaries additionally to sourceforge, so that they can be downloaded from + , including the release notes. * After all this is done, the release on github () is published - and the news post on sourceforge (https://sourceforge.net/p/pmd/news/> is publishes as well. + and the news post on sourceforge (https://sourceforge.net/p/pmd/news/> is published as well. * The new binary at is selected as the new default for PMD. * As a last step, a new baseline for the [regression tester](https://github.com/pmd/pmd-regression-tester) is created and uploaded to . -The release on github actions currently takes about 30-45 minutes. Once this is done, you can spread additional -news: +Once this second GitHub Action run is done, you can spread additional news: * Write an email to the mailing list diff --git a/docs/pages/pmd/projectdocs/credits.md b/docs/pages/pmd/projectdocs/credits.md index dd1d86d802..d02ef3456a 100644 --- a/docs/pages/pmd/projectdocs/credits.md +++ b/docs/pages/pmd/projectdocs/credits.md @@ -13,1017 +13,1029 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

0xflotus

πŸ’» πŸ›

1henni

πŸ›

ALiNew

πŸ›

ASBrouwers

πŸ’»

Abhijit Sarkar

πŸ›

Abhishek Kumar

πŸ›

Adam

πŸ›

Adam Carroll

πŸ›

Adam Obuchowicz

πŸ›

Adrian Price

πŸ›

Adrien Lecharpentier

πŸ›

Aidan Harding

πŸ›

Akshat Bahety

πŸ’» πŸ›

Akshay Thapa

πŸ›

Alan Buttars

πŸ›

Alan Hohn

πŸ›

Alberto FernΓ‘ndez

πŸ’» πŸ›

Alex

πŸ’»

Alex

πŸ›

Alex Rentz

πŸ›

Alex Saveau

πŸ›

Alex Shesterov

πŸ’» πŸ›

Alexey Markevich

πŸ›

Alexey Naumov

πŸ›

Alexey Yudichev

πŸ›

Alix

πŸ›

Alix

πŸ›

Amish Shah

πŸ›

Amit Prasad

πŸ›

Amitosh Swain Mahapatra

πŸ›

Anand Subramanian

πŸ’» πŸ›

Anastasiia Koba

πŸ’»

Anatoly Trosinenko

πŸ’» πŸ›

Andi Pabst

πŸ’» πŸ›

Andrea

πŸ›

Andrea Aime

πŸ›

Andreas Dangel

πŸ’» πŸ“– πŸ› 🚧

Andreas Deininger

πŸ“–

Andreas Markussen

πŸ›

Andreas Schmid

πŸ›

Andreas Turban

πŸ›

Andrei Paikin

πŸ›

Andrew

πŸ›

Andrew Green

πŸ›

Andrey Fomin

πŸ›

Andrey Hitrin

πŸ›

Andrey Mochalov

πŸ’» πŸ›

Andro72

πŸ›

Andrwyw

πŸ›

AndrΓ©s CatalΓ‘n

πŸ›

Andy Pattenden

πŸ›

Andy Ray

πŸ›

Andy Robinson

πŸ›

Andy-2639

πŸ›

Ankush Somani

πŸ›

Anmol Kumar

πŸ›

Anthony Whitford

πŸ›

AnthonyKot

πŸ›

Aravind Hegde

πŸ›

Arda Aslan

πŸ›

Ari Fogel

πŸ›

Arnaud Jeansen

πŸ’» πŸ›

Arpit Koolwal

πŸ›

Artem

πŸ’» πŸ›

Artem

πŸ›

Artem Sheremet

πŸ›

Artur

πŸ›

Artur Bosch

πŸ›

Artur Dryomov

πŸ›

Artur Ossowski

πŸ›

AshTheMash

πŸ›

Ashish Rana

πŸ›

Atul Kaushal

πŸ›

August Boland

πŸ›

Aurel Hudec

πŸ›

Austin

πŸ›

Austin Shalit

πŸ›

Austin Tice

πŸ›

Ayoub Kaanich

πŸ›

BBG

πŸ’» πŸ“– πŸ›

Bailey Tjiong

πŸ’»

BarthΓ©lemy L.

πŸ›

Basavaraj K N

πŸ›

Basil Peace

πŸ›

Belle

πŸ›

Ben Lerner

πŸ›

Ben Manes

πŸ›

Ben McCann

πŸ›

BendegΓΊz Nagy

πŸ›

Bennet S Yee

πŸ›

Benoit Lacelle

πŸ›

Bernardo MacΓͺdo

πŸ›

Bernd Farka

πŸ›

Betina Cynthia Mamani

πŸ›

Bhanu Prakash Pamidi

πŸ’» πŸ›

Bhargav Thanki

πŸ›

Binu R J

πŸ›

BjΓΆrn Kautler

πŸ’» πŸ›

Blightbuster

πŸ›

Bo Zhang

πŸ›

Bob "Wombat" Hogg

πŸ›

Bobby Wertman

πŸ›

Bolarinwa Saheed Olayemi

πŸ’» πŸ›

Boris Petrov

πŸ›

Brad Kent

πŸ›

Brandon Mikeska

πŸ›

Brian Batronis

πŸ›

Brian Johnson

πŸ›

Brice Dutheil

πŸ’» πŸ›

Bruno Ferreira

πŸ›

Bruno Ritz

πŸ›

Cameron Donaldson

πŸ›

Carlos Macasaet

πŸ›

Carsten Otto

πŸ›

Charlie Housh

πŸ›

Charlie Jonas

πŸ›

Chas Honton

πŸ›

Chen Yang

πŸ›

Chotu

πŸ›

Chris Smith

πŸ›

Chris Toomey

πŸ›

Christian Hujer

πŸ›

Christian Pontesegger

πŸ›

ChristianWulf

πŸ›

Christofer Dutz

πŸ’»

Christoffer Anselm

πŸ›

Christophe Vidal

πŸ›

Christopher Dancy

πŸ›

Clemens Prill

πŸ›

Clint Chester

πŸ’» πŸ›

ClΓ©ment Fournier

πŸ’» πŸ“– πŸ› 🚧

Codacy Badger

πŸ›

Code-Nil

πŸ›

ColColonCleaner

πŸ›

Colin Ingarfield

πŸ›

Craig Andrews

πŸ›

Craig Muchinsky

πŸ›

Cyril

πŸ’» πŸ›

Dale

πŸ’»

Damien Jiang

πŸ›

Dan Berindei

πŸ›

Dan Rollo

πŸ›

Dan Ziemba

πŸ›

Daniel Gredler

πŸ’» πŸ›

Daniel Jipa

πŸ›

Daniel Paul Searles

πŸ’»

Daniel Reigada

πŸ›

Danilo Pianini

πŸ›

Darko

πŸ›

David

πŸ›

David Atkinson

πŸ›

David BurstrΓΆm

πŸ’» πŸ›

David GoatΓ©

πŸ›

David Golpira

πŸ›

David KovaΕ™Γ­k

πŸ›

David M. Karr (fullname at gmail.com)

πŸ›

David Renz

πŸ’» πŸ›

David Renz

πŸ›

Dawid Ciok

πŸ› πŸ’»

Deleted user

πŸ›

Dell Green

πŸ›

Dem Pilafian

πŸ›

Den

πŸ›

Denis Borovikov

πŸ’» πŸ›

Dennie Reniers

πŸ’» πŸ›

Dennis Kieselhorst

πŸ›

Derek P. Moore

πŸ›

Dichotomia

πŸ›

Dionisio CortΓ©s FernΓ‘ndez

πŸ’» πŸ›

Dmitri Bourlatchkov

πŸ›

Dmitriy Kuzmin

πŸ›

Dmytro Dashenkov

πŸ›

Drew Hall

πŸ›

Dumitru Postoronca

πŸ›

Dylan Adams

πŸ›

Eden Hao

πŸ›

Edward Klimoshenko

πŸ› πŸ’»

Egor Bredikhin

πŸ›

Elan P. Kugelmass

πŸ›

Elder S.

πŸ›

Eldrick Wega

πŸ“–

Emile

πŸ›

Eric

πŸ›

Eric Kintzer

πŸ›

Eric Perret

πŸ›

Eric Squires

πŸ›

Erich L Foster

πŸ›

Erik Bleske

πŸ›

Ernst Reissner

πŸ›

Ewan Tempero

πŸ›

F.W. Dekker

πŸ›

FSchliephacke

πŸ›

Facundo

πŸ›

Federico Giust

πŸ›

Fedor Sherstobitov

πŸ›

Felix Lampe

πŸ›

Filip Golonka

πŸ›

Filipe Esperandio

πŸ’» πŸ›

Filippo Nova

πŸ›

Francesco la Torre

πŸ›

Francisco Duarte

πŸ›

Frieder Bluemle

πŸ›

Frits Jalvingh

πŸ’» πŸ›

G. Bazior

πŸ›

Gabe Henkes

πŸ›

Gary Gregory

πŸ›

Genoud Magloire

πŸ›

Geoffrey555

πŸ›

Georg Romstorfer

πŸ›

Gio

πŸ›

Gol

πŸ›

Gonzalo Exequiel Ibars Ingman

πŸ’» πŸ›

GooDer

πŸ›

Gregor Riegler

πŸ›

Grzegorz Olszewski

πŸ›

Gunther Schrijvers

πŸ’» πŸ›

Gustavo Krieger

πŸ›

Guy Elsmore-Paddock

πŸ›

GΓΆrkem MΓΌlayim

πŸ›

Hanzel Godinez

πŸ›

Haoliang Chen

πŸ›

Harsh Kukreja

πŸ›

Hassan ALAMI

πŸ›

Heber

πŸ›

Henning Schmiedehausen

πŸ’» πŸ›

Henning von Bargen

πŸ’»

HervΓ© Boutemy

πŸ›

Himanshu Pandey

πŸ›

Hokwang Lee

πŸ›

Hooperbloob

πŸ’»

Hung PHAN

πŸ›

IDoCodingStuffs

πŸ’» πŸ›

Iccen Gan

πŸ›

Ignacio Mariano Tirabasso

πŸ›

Igor Melnichenko

πŸ›

Igor Moreno

πŸ›

Intelesis-MS

πŸ›

Iroha_

πŸ›

Ishan Srivastava

πŸ›

Ivano Guerini

πŸ›

Ivar Andreas Bonsaksen

πŸ›

Ivo Ε mΓ­d

πŸ›

JJengility

πŸ›

Jake Hemmerle

πŸ›

James Harrison

πŸ› πŸ’»

Jan

πŸ›

Jan Aertgeerts

πŸ’» πŸ›

Jan BrΓΌmmer

πŸ›

Jan TΕ™Γ­ska

πŸ›

Jan-Lukas Else

πŸ›

Jason Qiu

πŸ’» πŸ“–

Jason Williams

πŸ›

Jean-Paul Mayer

πŸ›

Jean-Simon Larochelle

πŸ›

Jeff Bartolotta

πŸ’» πŸ›

Jeff Hube

πŸ’» πŸ›

Jeff Jensen

πŸ›

Jeff May

πŸ›

Jens Gerdes

πŸ›

Jeroen Borgers

πŸ› πŸ’» πŸ“’

Jeroen van Wilgenburg

πŸ“–

Jerome Russ

πŸ›

JerritEic

πŸ’» πŸ“– πŸ›

Jiri Pejchal

πŸ›

Jithin Sunny

πŸ›

JiΕ™Γ­ Ε korpil

πŸ›

Joao Machado

πŸ›

Jochen Krauss

πŸ›

Johan Hammar

πŸ›

John Karp

πŸ›

John Zhang

πŸ›

John-Teng

πŸ’» πŸ›

Jon Moroney

πŸ’» πŸ›

Jonas Geiregat

πŸ›

Jonathan Wiesel

πŸ’» πŸ›

Jordan

πŸ›

Jordi Llach

πŸ›

Jorge SolΓ³rzano

πŸ›

JorneVL

πŸ›

Jose Palafox

πŸ›

Jose Stovall

πŸ›

Joseph

πŸ’»

Joseph Heenan

πŸ›

Josh Feingold

πŸ’» πŸ›

Josh Holthaus

πŸ›

Joshua S Arquilevich

πŸ›

JoΓ£o Dinis Ferreira

πŸ“–

JoΓ£o Ferreira

πŸ’» πŸ›

JoΓ£o Pedro Schmitt

πŸ›

Juan MartΓ­n Sotuyo Dodero

πŸ’» πŸ“– πŸ› 🚧

Juan Pablo Civile

πŸ›

Julian Voronetsky

πŸ›

Julien

πŸ›

Julius

πŸ›

JustPRV

πŸ›

JΓΆrn Huxhorn

πŸ›

KThompso

πŸ›

Kai Amundsen

πŸ›

Karel Vervaeke

πŸ›

Karl-Andero Mere

πŸ›

Karl-Philipp Richter

πŸ›

Karsten Silz

πŸ›

Kazuma Watanabe

πŸ›

Kev

πŸ›

Keve MΓΌller

πŸ›

Kevin Guerra

πŸ’»

Kevin Jones

πŸ› πŸ’»

Kevin Wayne

πŸ›

Kieran Black

πŸ›

Kirill Zubov

πŸ›

Kirk Clemens

πŸ’» πŸ›

Klaus Hartl

πŸ›

Koen Van Looveren

πŸ›

Kris Scheibe

πŸ’» πŸ›

Krystian Dabrowski

πŸ› πŸ’»

Kunal Thanki

πŸ›

LaLucid

πŸ’»

Larry Diamond

πŸ’» πŸ›

Lars Knickrehm

πŸ›

Leo Gutierrez

πŸ›

LiGaOg

πŸ’»

Liam Sharp

πŸ›

Lintsi

πŸ›

Linus Fernandes

πŸ›

Lixon Lookose

πŸ›

Logesh

πŸ›

Lorenzo Gabriele

πŸ›

LoΓ―c Ledoyen

πŸ›

Lucas Silva

πŸ›

Lucas Soncini

πŸ’» πŸ›

Luis Alcantar

πŸ’»

Lukasz Slonina

πŸ›

Lukebray

πŸ›

Lynn

πŸ’» πŸ›

Lyor Goldstein

πŸ›

MCMicS

πŸ›

Macarse

πŸ›

Machine account for PMD

πŸ’»

Maciek Siemczyk

πŸ›

Maikel Steneker

πŸ’» πŸ›

Maksim Moiseikin

πŸ›

Manfred Koch

πŸ›

Manuel Moya Ferrer

πŸ’» πŸ›

Manuel Ryan

πŸ›

Marat Vyshegorodtsev

πŸ›

Marcel HΓ€rle

πŸ›

Marcello Fialho

πŸ›

Marcin Rataj

πŸ›

Mark Adamcin

πŸ›

Mark Hall

πŸ’» πŸ›

Mark Kolich

πŸ›

Mark Pritchard

πŸ›

Markus Rathgeb

πŸ›

Marquis Wang

πŸ›

MartGit

πŸ›

Martin Feldsztejn

πŸ›

Martin Lehmann

πŸ›

Martin Spamer

πŸ›

Martin TarjΓ‘nyi

πŸ›

MatFl

πŸ›

Mateusz Stefanski

πŸ›

Mathieu Gouin

πŸ›

MatiasComercio

πŸ’» πŸ›

Matt Benson

πŸ›

Matt De Poorter

πŸ›

Matt Hargett

πŸ’» πŸ’΅

Matt Harrah

πŸ›

Matt Nelson

πŸ›

Matthew Amos

πŸ›

Matthew Duggan

πŸ›

Matthew Hall

πŸ›

MatΓ­as Fraga

πŸ’» πŸ›

Maxime Robert

πŸ’» πŸ›

MetaBF

πŸ›

Michael

πŸ›

Michael Bell

πŸ›

Michael Bernstein

πŸ›

Michael Clay

πŸ›

Michael Dombrowski

πŸ›

Michael Hausegger

πŸ›

Michael Hoefer

πŸ›

Michael MΓΆbius

πŸ›

Michael N. Lipp

πŸ›

Michael Pellegrini

πŸ›

Michal Kordas

πŸ›

MichaΕ‚ Borek

πŸ›

MichaΕ‚ KuliΕ„ski

πŸ›

Miguel NΓΊΓ±ez DΓ­az-Montes

πŸ›

Mihai Ionut

πŸ›

Mirek Hankus

πŸ›

Mladjan Gadzic

πŸ›

MrAngry52

πŸ›

Muminur Choudhury

πŸ›

Mykhailo Palahuta

πŸ’» πŸ›

Nagendra Kumar Singh

πŸ›

Nahuel Barrios

πŸ›

Nathan Braun

πŸ›

Nathan Reynolds

πŸ›

Nathan Reynolds

πŸ›

NathanaΓ«l

πŸ›

Naveen

πŸ’»

Nazdravi

πŸ›

Neha-Dhonde

πŸ›

Nicholas Doyle

πŸ›

Nick Butcher

πŸ›

Nico Gallinal

πŸ›

Nicola Dal Maso

πŸ›

Nicolas Filotto

πŸ’»

Nicolas Vervelle

πŸ›

Nicolas Vuillamy

πŸ“–

Nikita Chursin

πŸ›

Niklas Baudy

πŸ›

Nikolas Havrikov

πŸ›

Nilesh Virkar

πŸ›

Nimit Patel

πŸ›

Niranjan Harpale

πŸ›

Nirvik Patel

πŸ’»

Noah Sussman

πŸ›

Noah0120

πŸ›

Noam Tamim

πŸ›

Noel Grandin

πŸ›

Olaf Haalstra

πŸ›

Oleg Andreych

πŸ’» πŸ›

Oleg Pavlenko

πŸ›

Oleksii Dykov

πŸ’» πŸ›

Oliver Eikemeier

πŸ›

Oliver Siegmar

πŸ’΅

Olivier Parent

πŸ’» πŸ›

Ollie Abbey

πŸ’» πŸ›

OverDrone

πŸ›

Ozan Gulle

πŸ’» πŸ›

PUNEET JAIN

πŸ›

Parbati Bose

πŸ›

Paul Berg

πŸ›

Paul Guyot

πŸ’»

Pavel Bludov

πŸ›

Pavel Mička

πŸ›

Pedro Nuno Santos

πŸ›

Pedro Rijo

πŸ›

Pelisse Romain

πŸ’» πŸ“– πŸ›

Per Abich

πŸ’»

Pete Davids

πŸ›

Peter Bruin

πŸ›

Peter Chittum

πŸ’» πŸ›

Peter Cudmore

πŸ›

Peter Kasson

πŸ›

Peter Kofler

πŸ›

Peter Paul Bakker

πŸ’»

Pham Hai Trung

πŸ›

Philip Graf

πŸ’» πŸ›

Philip Hachey

πŸ›

Philippe Ozil

πŸ›

Phinehas Artemix

πŸ›

Phokham Nonava

πŸ›

Pim van der Loos

πŸ’» ⚠️

Piotr SzymaΕ„ski

πŸ›

Piotrek Ε»ygieΕ‚o

πŸ’» πŸ› πŸ“–

Pranay Jaiswal

πŸ›

Prasad Kamath

πŸ›

Prasanna

πŸ›

Presh-AR

πŸ›

Puneet1726

πŸ›

Rafael CortΓͺs

πŸ›

RaheemShaik999

πŸ›

RajeshR

πŸ’» πŸ›

Ramachandra Mohan

πŸ›

Ramel0921

πŸ›

Raquel Pau

πŸ›

Ravikiran Janardhana

πŸ›

Reda Benhemmouche

πŸ›

Renato Oliveira

πŸ’» πŸ›

Rich DiCroce

πŸ›

Riot R1cket

πŸ›

Rishabh Jain

πŸ›

RishabhDeep Singh

πŸ›

Robbie Martinus

πŸ’» πŸ›

Robert Henry

πŸ›

Robert Mihaly

πŸ›

Robert Painsi

πŸ›

Robert Russell

πŸ›

Robert SΓΆsemann

πŸ’» πŸ“– πŸ“’ πŸ›

Robert Whitebit

πŸ›

Robin Richtsfeld

πŸ›

Robin Stocker

πŸ’» πŸ›

Robin Wils

πŸ›

RochusOest

πŸ›

Rodolfo Noviski

πŸ›

Rodrigo Casara

πŸ›

Rodrigo Fernandes

πŸ›

Roman Salvador

πŸ’» πŸ›

Ronald Blaschke

πŸ›

RΓ³bert Papp

πŸ›

Saikat Sengupta

πŸ›

Saksham Handu

πŸ›

Saladoc

πŸ›

Salesforce Bob Lightning

πŸ›

Sam Carlberg

πŸ›

Satoshi Kubo

πŸ›

Scott Kennedy

πŸ›

Scott Wells

πŸ› πŸ’»

Scrsloota

πŸ’»

Sebastian BΓΆgl

πŸ›

Sebastian Schuberth

πŸ›

Sebastian Schwarz

πŸ›

Seren

πŸ› πŸ’»

Sergey Gorbaty

πŸ›

Sergey Kozlov

πŸ›

Sergey Yanzin

πŸ’» πŸ›

Seth Wilcox

πŸ’»

Shubham

πŸ’» πŸ›

Simon Abykov

πŸ’» πŸ›

Simon Xiao

πŸ›

Srinivasan Venkatachalam

πŸ›

Stanislav Gromov

πŸ›

Stanislav Myachenkov

πŸ’»

Stefan Birkner

πŸ›

Stefan Bohn

πŸ›

Stefan Endrullis

πŸ›

Stefan KlΓΆss-Schuster

πŸ›

Stefan Wolf

πŸ›

Stephan H. Wissel

πŸ›

Stephen

πŸ›

Stephen Friedrich

πŸ›

Steve Babula

πŸ’»

Steven Stearns

πŸ› πŸ’»

Stexxe

πŸ›

Stian LΓ₯gstad

πŸ›

StuartClayton5

πŸ›

Supun Arunoda

πŸ›

Suren Abrahamyan

πŸ›

Suvashri

πŸ“–

SwatiBGupta1110

πŸ›

SyedThoufich

πŸ›

Szymon Sasin

πŸ›

T-chuangxin

πŸ›

TERAI Atsuhiro

πŸ›

TIOBE Software

πŸ’» πŸ›

Tarush Singh

πŸ’»

Taylor Smock

πŸ›

Techeira DamiΓ‘n

πŸ’» πŸ›

Ted Husted

πŸ›

TehBakker

πŸ›

The Gitter Badger

πŸ›

Theodoor

πŸ›

Thiago Henrique HΓΌpner

πŸ›

Thibault Meyer

πŸ›

Thomas GΓΌttler

πŸ›

Thomas Jones-Low

πŸ›

Thomas Smith

πŸ’» πŸ›

ThrawnCA

πŸ›

Thunderforge

πŸ’» πŸ›

Tim van der Lippe

πŸ›

Tobias Weimer

πŸ’» πŸ›

Tom Copeland

πŸ› πŸ’» πŸ“–

Tom Daly

πŸ›

Tomer Figenblat

πŸ›

Tomi De Lucca

πŸ’» πŸ›

Torsten Kleiber

πŸ›

TrackerSB

πŸ›

Tyson Stewart

πŸ›

Ullrich Hafner

πŸ›

Utku Cuhadaroglu

πŸ’» πŸ›

Valentin Brandl

πŸ›

Valeria

πŸ›

Valery Yatsynovich

πŸ“–

Vasily Anisimov

πŸ›

Vibhor Goyal

πŸ›

Vickenty Fesunov

πŸ›

Victor NoΓ«l

πŸ›

Vincent Galloy

πŸ’»

Vincent HUYNH

πŸ›

Vincent Maurin

πŸ›

Vincent Privat

πŸ›

Vishhwas

πŸ›

Vitaly

πŸ›

Vitaly Polonetsky

πŸ›

Vojtech Polivka

πŸ›

Vsevolod Zholobov

πŸ›

Vyom Yadav

πŸ’»

Wang Shidong

πŸ›

Waqas Ahmed

πŸ›

Wayne J. Earl

πŸ›

Wchenghui

πŸ›

Wener

πŸ’»

Will Winder

πŸ›

William Brockhus

πŸ’» πŸ›

Wilson Kurniawan

πŸ›

Wim Deblauwe

πŸ›

Woongsik Choi

πŸ›

XenoAmess

πŸ’» πŸ›

Yang

πŸ’»

YaroslavTER

πŸ›

Yasar Shaikh

πŸ’»

Young Chan

πŸ’» πŸ›

YuJin Kim

πŸ›

Yuri Dolzhenko

πŸ›

Yurii Dubinka

πŸ›

Zoltan Farkas

πŸ›

Zustin

πŸ›

aaronhurst-google

πŸ› πŸ’»

alexmodis

πŸ›

andreoss

πŸ›

andrey81inmd

πŸ’» πŸ›

anicoara

πŸ›

arunprasathav

πŸ›

asiercamara

πŸ›

astillich-igniti

πŸ’»

avesolovksyy

πŸ›

avishvat

πŸ›

avivmu

πŸ›

axelbarfod1

πŸ›

b-3-n

πŸ›

balbhadra9

πŸ›

base23de

πŸ›

bergander

πŸ›

berkam

πŸ’» πŸ›

breizh31

πŸ›

caesarkim

πŸ›

carolyujing

πŸ›

cbfiddle

πŸ›

cesares-basilico

πŸ›

chrite

πŸ›

cobratbq

πŸ›

coladict

πŸ›

cosmoJFH

πŸ›

cristalp

πŸ›

crunsk

πŸ›

cwholmes

πŸ›

cyberjj999

πŸ›

cyw3

πŸ›

d1ss0nanz

πŸ›

dague1

πŸ“–

dalizi007

πŸ’»

danbrycefairsailcom

πŸ›

dariansanity

πŸ›

darrenmiliband

πŸ›

davidburstrom

πŸ›

dbirkman-paloalto

πŸ›

deepak-patra

πŸ›

dependabot[bot]

πŸ’» πŸ›

dinesh150

πŸ›

diziaq

πŸ›

dreaminpast123

πŸ›

duanyanan

πŸ›

dutt-sanjay

πŸ›

dylanleung

πŸ›

dzeigler

πŸ›

ekkirala

πŸ›

emersonmoura

πŸ›

fairy

πŸ›

filiprafalowicz

πŸ’»

foxmason

πŸ›

frankegabor

πŸ›

frankl

πŸ›

freafrea

πŸ›

fsapatin

πŸ›

gracia19

πŸ›

guo fei

πŸ›

gurmsc5

πŸ›

gwilymatgearset

πŸ’» πŸ›

haigsn

πŸ›

hemanshu070

πŸ›

henrik242

πŸ›

hongpuwu

πŸ›

hvbtup

πŸ’» πŸ›

igniti GmbH

πŸ›

ilovezfs

πŸ›

itaigilo

πŸ›

jakivey32

πŸ›

jbennett2091

πŸ›

jcamerin

πŸ›

jkeener1

πŸ›

jmetertea

πŸ›

johnra2

πŸ’»

josemanuelrolon

πŸ’» πŸ›

kabroxiko

πŸ’» πŸ›

karwer

πŸ›

kaulonline

πŸ›

kdaemonv

πŸ›

kdebski85

πŸ› πŸ’»

kenji21

πŸ’» πŸ›

kfranic

πŸ›

khalidkh

πŸ›

koalalam

πŸ›

krzyk

πŸ›

lasselindqvist

πŸ›

lgemeinhardt

πŸ›

lihuaib

πŸ›

lonelyma1021

πŸ›

lpeddy

πŸ›

lujiefsi

πŸ’»

lukelukes

πŸ’»

lyriccoder

πŸ›

marcelmore

πŸ›

matchbox

πŸ›

matthiaskraaz

πŸ›

meandonlyme

πŸ›

mikesive

πŸ›

milossesic

πŸ›

mluckam

πŸ’»

mohan-chinnappan-n

πŸ’»

mriddell95

πŸ›

mrlzh

πŸ›

msloan

πŸ›

mucharlaravalika

πŸ›

mvenneman

πŸ›

nareshl119

πŸ›

nicolas-harraudeau-sonarsource

πŸ›

noerremark

πŸ›

novsirion

πŸ›

nwcm

πŸ“–

oggboy

πŸ›

oinume

πŸ›

orimarko

πŸ’» πŸ›

pacvz

πŸ’»

pallavi agarwal

πŸ›

parksungrin

πŸ›

patpatpat123

πŸ›

patriksevallius

πŸ›

pbrajesh1

πŸ›

phoenix384

πŸ›

piotrszymanski-sc

πŸ’»

plan3d

πŸ›

poojasix

πŸ›

prabhushrikant

πŸ›

pujitha8783

πŸ›

r-r-a-j

πŸ›

raghujayjunk

πŸ›

rajeshveera

πŸ›

rajeswarreddy88

πŸ›

recdevs

πŸ›

reudismam

πŸ’» πŸ›

rijkt

πŸ›

rillig-tk

πŸ›

rmohan20

πŸ’» πŸ›

rnveach

πŸ›

rxmicro

πŸ›

ryan-gustafson

πŸ’» πŸ›

sabi0

πŸ›

scais

πŸ›

sebbASF

πŸ›

sergeygorbaty

πŸ’»

shilko2013

πŸ›

shiomiyan

πŸ“–

simeonKondr

πŸ›

snajberk

πŸ›

sniperrifle2004

πŸ›

snuyanzin

πŸ› πŸ’»

sratz

πŸ›

stonio

πŸ›

sturton

πŸ’» πŸ›

sudharmohan

πŸ›

suruchidawar

πŸ›

svenfinitiv

πŸ›

tashiscool

πŸ›

test-git-hook

πŸ›

testation21

πŸ’» πŸ›

thanosa

πŸ›

tiandiyixian

πŸ›

tobwoerk

πŸ›

tprouvot

πŸ› πŸ’»

trentchilders

πŸ›

triandicAnt

πŸ›

trishul14

πŸ›

tsui

πŸ›

winhkey

πŸ›

witherspore

πŸ›

wjljack

πŸ›

wuchiuwong

πŸ›

xingsong

πŸ›

xioayuge

πŸ›

xnYi9wRezm

πŸ’» πŸ›

xuanuy

πŸ›

xyf0921

πŸ›

yalechen-cyw3

πŸ›

yasuharu-sato

πŸ›

zenglian

πŸ›

zgrzyt93

πŸ’» πŸ›

zh3ng

πŸ›

zt_soft

πŸ›

ztt79

πŸ›

zzzzfeng

πŸ›

ÁrpÑd MagosÑnyi

πŸ›

任贡杰

πŸ›

θŒ…ε»Άε‰

πŸ’»
0xflotus
0xflotus

πŸ’» πŸ›
1henni
1henni

πŸ›
ALiNew
ALiNew

πŸ›
ASBrouwers
ASBrouwers

πŸ’»
Abhijit Sarkar
Abhijit Sarkar

πŸ›
Abhishek Kumar
Abhishek Kumar

πŸ›
Adam
Adam

πŸ›
Adam Carroll
Adam Carroll

πŸ›
Adam Obuchowicz
Adam Obuchowicz

πŸ›
Adrian Price
Adrian Price

πŸ›
Adrien Lecharpentier
Adrien Lecharpentier

πŸ›
Aidan Harding
Aidan Harding

πŸ›
Akshat Bahety
Akshat Bahety

πŸ’» πŸ›
Akshay Thapa
Akshay Thapa

πŸ›
Alan Buttars
Alan Buttars

πŸ›
Alan Hohn
Alan Hohn

πŸ›
Alberto FernΓ‘ndez
Alberto FernΓ‘ndez

πŸ’» πŸ›
Alex
Alex

πŸ’»
Alex
Alex

πŸ›
Alex Rentz
Alex Rentz

πŸ›
Alex Saveau
Alex Saveau

πŸ›
Alex Shesterov
Alex Shesterov

πŸ’» πŸ›
Alexey Markevich
Alexey Markevich

πŸ›
Alexey Naumov
Alexey Naumov

πŸ›
Alexey Yudichev
Alexey Yudichev

πŸ›
Alix
Alix

πŸ›
Alix
Alix

πŸ›
Amish Shah
Amish Shah

πŸ›
Amit Prasad
Amit Prasad

πŸ›
Amitosh Swain Mahapatra
Amitosh Swain Mahapatra

πŸ›
Anand Subramanian
Anand Subramanian

πŸ’» πŸ›
Anastasiia Koba
Anastasiia Koba

πŸ’»
Anatoly Trosinenko
Anatoly Trosinenko

πŸ’» πŸ›
Andi Pabst
Andi Pabst

πŸ’» πŸ›
Andrea
Andrea

πŸ›
Andrea Aime
Andrea Aime

πŸ›
Andreas Dangel
Andreas Dangel

πŸ’» πŸ“– πŸ› 🚧
Andreas Deininger
Andreas Deininger

πŸ“–
Andreas Markussen
Andreas Markussen

πŸ›
Andreas Schmid
Andreas Schmid

πŸ›
Andreas Turban
Andreas Turban

πŸ›
Andrei Paikin
Andrei Paikin

πŸ›
Andrew
Andrew

πŸ›
Andrew Green
Andrew Green

πŸ›
Andrey Bozhko
Andrey Bozhko

πŸ“–
Andrey Fomin
Andrey Fomin

πŸ›
Andrey Hitrin
Andrey Hitrin

πŸ›
Andrey Mochalov
Andrey Mochalov

πŸ’» πŸ›
Andro72
Andro72

πŸ›
Andrwyw
Andrwyw

πŸ›
AndrΓ©s CatalΓ‘n
AndrΓ©s CatalΓ‘n

πŸ›
Andy Pattenden
Andy Pattenden

πŸ›
Andy Ray
Andy Ray

πŸ›
Andy Robinson
Andy Robinson

πŸ›
Andy-2639
Andy-2639

πŸ›
Ankush Somani
Ankush Somani

πŸ›
Anmol Kumar
Anmol Kumar

πŸ›
Anthony Whitford
Anthony Whitford

πŸ›
AnthonyKot
AnthonyKot

πŸ›
Aravind Hegde
Aravind Hegde

πŸ›
Arda Aslan
Arda Aslan

πŸ›
Ari Fogel
Ari Fogel

πŸ›
Arnaud Jeansen
Arnaud Jeansen

πŸ’» πŸ›
Arpit Koolwal
Arpit Koolwal

πŸ›
Artem
Artem

πŸ’» πŸ›
Artem
Artem

πŸ›
Artem Sheremet
Artem Sheremet

πŸ›
Artur
Artur

πŸ›
Artur Bosch
Artur Bosch

πŸ›
Artur Dryomov
Artur Dryomov

πŸ›
Artur Ossowski
Artur Ossowski

πŸ›
AshTheMash
AshTheMash

πŸ›
Ashish Rana
Ashish Rana

πŸ›
Atul Kaushal
Atul Kaushal

πŸ›
August Boland
August Boland

πŸ›
Aurel Hudec
Aurel Hudec

πŸ›
Austin
Austin

πŸ›
Austin Shalit
Austin Shalit

πŸ›
Austin Tice
Austin Tice

πŸ›
Ayoub Kaanich
Ayoub Kaanich

πŸ›
BBG
BBG

πŸ’» πŸ“– πŸ›
Bailey Tjiong
Bailey Tjiong

πŸ’»
BarthΓ©lemy L.
BarthΓ©lemy L.

πŸ›
Basavaraj K N
Basavaraj K N

πŸ›
Basil Peace
Basil Peace

πŸ›
Belle
Belle

πŸ›
Ben Lerner
Ben Lerner

πŸ›
Ben Manes
Ben Manes

πŸ›
Ben McCann
Ben McCann

πŸ›
BendegΓΊz Nagy
BendegΓΊz Nagy

πŸ›
Bennet S Yee
Bennet S Yee

πŸ›
Benoit Lacelle
Benoit Lacelle

πŸ›
Bernardo MacΓͺdo
Bernardo MacΓͺdo

πŸ›
Bernd Farka
Bernd Farka

πŸ›
Betina Cynthia Mamani
Betina Cynthia Mamani

πŸ›
Bhanu Prakash Pamidi
Bhanu Prakash Pamidi

πŸ’» πŸ›
Bhargav Thanki
Bhargav Thanki

πŸ›
Binu R J
Binu R J

πŸ›
BjΓΆrn Kautler
BjΓΆrn Kautler

πŸ’» πŸ›
Blightbuster
Blightbuster

πŸ›
Bo Zhang
Bo Zhang

πŸ›
Bob "Wombat" Hogg
Bob "Wombat" Hogg

πŸ›
Bobby Wertman
Bobby Wertman

πŸ›
Bolarinwa Saheed Olayemi
Bolarinwa Saheed Olayemi

πŸ’» πŸ›
Boris Petrov
Boris Petrov

πŸ›
Brad Kent
Brad Kent

πŸ›
Brandon Mikeska
Brandon Mikeska

πŸ›
Brian Batronis
Brian Batronis

πŸ›
Brian Johnson
Brian Johnson

πŸ›
Brice Dutheil
Brice Dutheil

πŸ’» πŸ›
Bruno Ferreira
Bruno Ferreira

πŸ›
Bruno Harbulot
Bruno Harbulot

πŸ›
Bruno Ritz
Bruno Ritz

πŸ›
Cameron Donaldson
Cameron Donaldson

πŸ›
Carlos Macasaet
Carlos Macasaet

πŸ›
Carsten Otto
Carsten Otto

πŸ›
Charlie Housh
Charlie Housh

πŸ›
Charlie Jonas
Charlie Jonas

πŸ›
Chas Honton
Chas Honton

πŸ›
Chen Yang
Chen Yang

πŸ›
Chotu
Chotu

πŸ›
Chris Smith
Chris Smith

πŸ›
Chris Toomey
Chris Toomey

πŸ›
Christian Hujer
Christian Hujer

πŸ›
Christian Pontesegger
Christian Pontesegger

πŸ›
ChristianWulf
ChristianWulf

πŸ›
Christofer Dutz
Christofer Dutz

πŸ’»
Christoffer Anselm
Christoffer Anselm

πŸ›
Christophe Vidal
Christophe Vidal

πŸ›
Christopher Dancy
Christopher Dancy

πŸ›
Clemens Prill
Clemens Prill

πŸ›
Clint Chester
Clint Chester

πŸ’» πŸ›
ClΓ©ment Fournier
ClΓ©ment Fournier

πŸ’» πŸ“– πŸ› 🚧
Codacy Badger
Codacy Badger

πŸ›
Code-Nil
Code-Nil

πŸ›
ColColonCleaner
ColColonCleaner

πŸ›
Colin Ingarfield
Colin Ingarfield

πŸ›
Craig Andrews
Craig Andrews

πŸ›
Craig Muchinsky
Craig Muchinsky

πŸ›
Cyril
Cyril

πŸ’» πŸ›
Dale
Dale

πŸ’»
Damien Jiang
Damien Jiang

πŸ›
Dan Berindei
Dan Berindei

πŸ›
Dan Rollo
Dan Rollo

πŸ›
Dan Ziemba
Dan Ziemba

πŸ›
Daniel Gredler
Daniel Gredler

πŸ’» πŸ›
Daniel Jipa
Daniel Jipa

πŸ›
Daniel Paul Searles
Daniel Paul Searles

πŸ’»
Daniel Reigada
Daniel Reigada

πŸ›
Danilo Pianini
Danilo Pianini

πŸ›
Darko
Darko

πŸ›
David
David

πŸ›
David Atkinson
David Atkinson

πŸ›
David BurstrΓΆm
David BurstrΓΆm

πŸ’» πŸ›
David GoatΓ©
David GoatΓ©

πŸ›
David Golpira
David Golpira

πŸ›
David KovaΕ™Γ­k
David KovaΕ™Γ­k

πŸ›
David M. Karr (fullname at gmail.com)
David M. Karr (fullname at gmail.com)

πŸ›
David Renz
David Renz

πŸ’» πŸ›
David Renz
David Renz

πŸ›
Dawid Ciok
Dawid Ciok

πŸ› πŸ’»
Deleted user
Deleted user

πŸ›
Dell Green
Dell Green

πŸ›
Dem Pilafian
Dem Pilafian

πŸ›
Den
Den

πŸ›
Denis Borovikov
Denis Borovikov

πŸ’» πŸ›
Dennie Reniers
Dennie Reniers

πŸ’» πŸ›
Dennis Kieselhorst
Dennis Kieselhorst

πŸ›
Derek P. Moore
Derek P. Moore

πŸ›
Dichotomia
Dichotomia

πŸ›
Dionisio CortΓ©s FernΓ‘ndez
Dionisio CortΓ©s FernΓ‘ndez

πŸ’» πŸ›
Dmitri Bourlatchkov
Dmitri Bourlatchkov

πŸ›
Dmitriy Kuzmin
Dmitriy Kuzmin

πŸ›
Dmytro Dashenkov
Dmytro Dashenkov

πŸ›
Drew Hall
Drew Hall

πŸ›
Dumitru Postoronca
Dumitru Postoronca

πŸ›
Dylan Adams
Dylan Adams

πŸ›
Eden Hao
Eden Hao

πŸ›
Edward Klimoshenko
Edward Klimoshenko

πŸ› πŸ’»
Egor Bredikhin
Egor Bredikhin

πŸ›
Elan P. Kugelmass
Elan P. Kugelmass

πŸ›
Elder S.
Elder S.

πŸ›
Eldrick Wega
Eldrick Wega

πŸ“–
Emile
Emile

πŸ›
Eric
Eric

πŸ›
Eric Kintzer
Eric Kintzer

πŸ›
Eric Perret
Eric Perret

πŸ›
Eric Squires
Eric Squires

πŸ›
Erich L Foster
Erich L Foster

πŸ›
Erik Bleske
Erik Bleske

πŸ›
Ernst Reissner
Ernst Reissner

πŸ›
Ewan Tempero
Ewan Tempero

πŸ›
F.W. Dekker
F.W. Dekker

πŸ›
FSchliephacke
FSchliephacke

πŸ›
Facundo
Facundo

πŸ›
Federico Giust
Federico Giust

πŸ›
Fedor Sherstobitov
Fedor Sherstobitov

πŸ›
Felix Lampe
Felix Lampe

πŸ›
Filip Golonka
Filip Golonka

πŸ›
Filipe Esperandio
Filipe Esperandio

πŸ’» πŸ›
Filippo Nova
Filippo Nova

πŸ›
Francesco la Torre
Francesco la Torre

πŸ›
Francisco Duarte
Francisco Duarte

πŸ›
Frieder Bluemle
Frieder Bluemle

πŸ›
Frits Jalvingh
Frits Jalvingh

πŸ’» πŸ›
G. Bazior
G. Bazior

πŸ›
Gabe Henkes
Gabe Henkes

πŸ›
Gary Gregory
Gary Gregory

πŸ›
Genoud Magloire
Genoud Magloire

πŸ›
Geoffrey555
Geoffrey555

πŸ›
Georg Romstorfer
Georg Romstorfer

πŸ›
Gio
Gio

πŸ›
Gol
Gol

πŸ›
Gonzalo Exequiel Ibars Ingman
Gonzalo Exequiel Ibars Ingman

πŸ’» πŸ›
GooDer
GooDer

πŸ›
Gregor Riegler
Gregor Riegler

πŸ›
Grzegorz Olszewski
Grzegorz Olszewski

πŸ›
Gunther Schrijvers
Gunther Schrijvers

πŸ’» πŸ›
Gustavo Krieger
Gustavo Krieger

πŸ›
Guy Elsmore-Paddock
Guy Elsmore-Paddock

πŸ›
GΓΆrkem MΓΌlayim
GΓΆrkem MΓΌlayim

πŸ›
Hanzel Godinez
Hanzel Godinez

πŸ›
Haoliang Chen
Haoliang Chen

πŸ›
Harsh Kukreja
Harsh Kukreja

πŸ›
Hassan ALAMI
Hassan ALAMI

πŸ›
Heber
Heber

πŸ›
Henning Schmiedehausen
Henning Schmiedehausen

πŸ’» πŸ›
Henning von Bargen
Henning von Bargen

πŸ’»
HervΓ© Boutemy
HervΓ© Boutemy

πŸ›
Himanshu Pandey
Himanshu Pandey

πŸ›
Hokwang Lee
Hokwang Lee

πŸ›
Hooperbloob
Hooperbloob

πŸ’»
Hung PHAN
Hung PHAN

πŸ›
IDoCodingStuffs
IDoCodingStuffs

πŸ’» πŸ›
Iccen Gan
Iccen Gan

πŸ›
Ignacio Mariano Tirabasso
Ignacio Mariano Tirabasso

πŸ›
Igor Melnichenko
Igor Melnichenko

πŸ›
Igor Moreno
Igor Moreno

πŸ›
Intelesis-MS
Intelesis-MS

πŸ›
Iroha_
Iroha_

πŸ›
Ishan Srivastava
Ishan Srivastava

πŸ›
Ivano Guerini
Ivano Guerini

πŸ›
Ivar Andreas Bonsaksen
Ivar Andreas Bonsaksen

πŸ›
Ivo Ε mΓ­d
Ivo Ε mΓ­d

πŸ›
JJengility
JJengility

πŸ›
Jake Hemmerle
Jake Hemmerle

πŸ›
James Harrison
James Harrison

πŸ› πŸ’»
Jan
Jan

πŸ›
Jan Aertgeerts
Jan Aertgeerts

πŸ’» πŸ›
Jan BrΓΌmmer
Jan BrΓΌmmer

πŸ›
Jan TΕ™Γ­ska
Jan TΕ™Γ­ska

πŸ›
Jan-Lukas Else
Jan-Lukas Else

πŸ›
Jason Qiu
Jason Qiu

πŸ’» πŸ“–
Jason Williams
Jason Williams

πŸ›
Jean-Paul Mayer
Jean-Paul Mayer

πŸ›
Jean-Simon Larochelle
Jean-Simon Larochelle

πŸ›
Jeff Bartolotta
Jeff Bartolotta

πŸ’» πŸ›
Jeff Hube
Jeff Hube

πŸ’» πŸ›
Jeff Jensen
Jeff Jensen

πŸ›
Jeff May
Jeff May

πŸ›
Jens Gerdes
Jens Gerdes

πŸ›
Jeroen Borgers
Jeroen Borgers

πŸ› πŸ’» πŸ“’
Jeroen van Wilgenburg
Jeroen van Wilgenburg

πŸ“–
Jerome Russ
Jerome Russ

πŸ›
JerritEic
JerritEic

πŸ’» πŸ“– πŸ›
Jiri Pejchal
Jiri Pejchal

πŸ›
Jithin Sunny
Jithin Sunny

πŸ›
JiΕ™Γ­ Ε korpil
JiΕ™Γ­ Ε korpil

πŸ›
Joao Machado
Joao Machado

πŸ›
Jochen Krauss
Jochen Krauss

πŸ›
Johan Hammar
Johan Hammar

πŸ›
John Karp
John Karp

πŸ›
John Zhang
John Zhang

πŸ›
John-Teng
John-Teng

πŸ’» πŸ›
Jon Moroney
Jon Moroney

πŸ’» πŸ›
Jonas Geiregat
Jonas Geiregat

πŸ›
Jonathan Wiesel
Jonathan Wiesel

πŸ’» πŸ›
Jordan
Jordan

πŸ›
Jordi Llach
Jordi Llach

πŸ›
Jorge SolΓ³rzano
Jorge SolΓ³rzano

πŸ›
JorneVL
JorneVL

πŸ›
Jose Palafox
Jose Palafox

πŸ›
Jose Stovall
Jose Stovall

πŸ›
Joseph
Joseph

πŸ’»
Joseph Heenan
Joseph Heenan

πŸ›
Josh Feingold
Josh Feingold

πŸ’» πŸ›
Josh Holthaus
Josh Holthaus

πŸ›
Joshua S Arquilevich
Joshua S Arquilevich

πŸ›
JoΓ£o Dinis Ferreira
JoΓ£o Dinis Ferreira

πŸ“–
JoΓ£o Ferreira
JoΓ£o Ferreira

πŸ’» πŸ›
JoΓ£o Pedro Schmitt
JoΓ£o Pedro Schmitt

πŸ›
Juan MartΓ­n Sotuyo Dodero
Juan MartΓ­n Sotuyo Dodero

πŸ’» πŸ“– πŸ› 🚧
Juan Pablo Civile
Juan Pablo Civile

πŸ›
Julian Voronetsky
Julian Voronetsky

πŸ›
Julien
Julien

πŸ›
Julius
Julius

πŸ›
JustPRV
JustPRV

πŸ›
JΓΆrn Huxhorn
JΓΆrn Huxhorn

πŸ›
KThompso
KThompso

πŸ›
Kai Amundsen
Kai Amundsen

πŸ›
Karel Vervaeke
Karel Vervaeke

πŸ›
Karl-Andero Mere
Karl-Andero Mere

πŸ›
Karl-Philipp Richter
Karl-Philipp Richter

πŸ›
Karsten Silz
Karsten Silz

πŸ›
Kazuma Watanabe
Kazuma Watanabe

πŸ›
Kev
Kev

πŸ›
Keve MΓΌller
Keve MΓΌller

πŸ›
Kevin Guerra
Kevin Guerra

πŸ’»
Kevin Jones
Kevin Jones

πŸ› πŸ’»
Kevin Wayne
Kevin Wayne

πŸ›
Kieran Black
Kieran Black

πŸ›
Kirill Zubov
Kirill Zubov

πŸ›
Kirk Clemens
Kirk Clemens

πŸ’» πŸ›
Klaus Hartl
Klaus Hartl

πŸ›
Koen Van Looveren
Koen Van Looveren

πŸ›
Kris Scheibe
Kris Scheibe

πŸ’» πŸ›
Krystian Dabrowski
Krystian Dabrowski

πŸ› πŸ’»
Kunal Thanki
Kunal Thanki

πŸ›
LaLucid
LaLucid

πŸ’»
Larry Diamond
Larry Diamond

πŸ’» πŸ›
Lars Knickrehm
Lars Knickrehm

πŸ›
Leo Gutierrez
Leo Gutierrez

πŸ›
LiGaOg
LiGaOg

πŸ’»
Liam Sharp
Liam Sharp

πŸ›
Lintsi
Lintsi

πŸ›
Linus Fernandes
Linus Fernandes

πŸ›
Lixon Lookose
Lixon Lookose

πŸ›
Logesh
Logesh

πŸ›
Lorenzo Gabriele
Lorenzo Gabriele

πŸ›
LoΓ―c Ledoyen
LoΓ―c Ledoyen

πŸ›
Lucas Silva
Lucas Silva

πŸ›
Lucas Soncini
Lucas Soncini

πŸ’» πŸ›
Luis Alcantar
Luis Alcantar

πŸ’»
Lukasz Slonina
Lukasz Slonina

πŸ›
Lukebray
Lukebray

πŸ›
Lynn
Lynn

πŸ’» πŸ›
Lyor Goldstein
Lyor Goldstein

πŸ›
MCMicS
MCMicS

πŸ›
Macarse
Macarse

πŸ›
Machine account for PMD
Machine account for PMD

πŸ’»
Maciek Siemczyk
Maciek Siemczyk

πŸ›
Maikel Steneker
Maikel Steneker

πŸ’» πŸ›
Maksim Moiseikin
Maksim Moiseikin

πŸ›
Manfred Koch
Manfred Koch

πŸ›
Manuel Moya Ferrer
Manuel Moya Ferrer

πŸ’» πŸ›
Manuel Ryan
Manuel Ryan

πŸ›
Marat Vyshegorodtsev
Marat Vyshegorodtsev

πŸ›
Marcel HΓ€rle
Marcel HΓ€rle

πŸ›
Marcello Fialho
Marcello Fialho

πŸ›
Marcin Rataj
Marcin Rataj

πŸ›
Marcono1234
Marcono1234

πŸ›
Mark Adamcin
Mark Adamcin

πŸ›
Mark Hall
Mark Hall

πŸ’» πŸ›
Mark Kolich
Mark Kolich

πŸ›
Mark Pritchard
Mark Pritchard

πŸ›
Markus Rathgeb
Markus Rathgeb

πŸ›
Marquis Wang
Marquis Wang

πŸ›
MartGit
MartGit

πŸ›
Martin Feldsztejn
Martin Feldsztejn

πŸ›
Martin Lehmann
Martin Lehmann

πŸ›
Martin Spamer
Martin Spamer

πŸ›
Martin TarjΓ‘nyi
Martin TarjΓ‘nyi

πŸ›
MatFl
MatFl

πŸ›
Mateusz Stefanski
Mateusz Stefanski

πŸ›
Mathieu Gouin
Mathieu Gouin

πŸ›
MatiasComercio
MatiasComercio

πŸ’» πŸ›
Matt Benson
Matt Benson

πŸ›
Matt De Poorter
Matt De Poorter

πŸ›
Matt Hargett
Matt Hargett

πŸ’» πŸ’΅
Matt Harrah
Matt Harrah

πŸ›
Matt Nelson
Matt Nelson

πŸ›
Matthew Amos
Matthew Amos

πŸ›
Matthew Duggan
Matthew Duggan

πŸ›
Matthew Hall
Matthew Hall

πŸ›
MatΓ­as Fraga
MatΓ­as Fraga

πŸ’» πŸ›
Maxime Robert
Maxime Robert

πŸ’» πŸ›
MetaBF
MetaBF

πŸ›
Michael
Michael

πŸ›
Michael Bell
Michael Bell

πŸ›
Michael Bernstein
Michael Bernstein

πŸ›
Michael Clay
Michael Clay

πŸ›
Michael Dombrowski
Michael Dombrowski

πŸ›
Michael Hausegger
Michael Hausegger

πŸ›
Michael Hoefer
Michael Hoefer

πŸ›
Michael MΓΆbius
Michael MΓΆbius

πŸ›
Michael N. Lipp
Michael N. Lipp

πŸ›
Michael Pellegrini
Michael Pellegrini

πŸ›
Michal Kordas
Michal Kordas

πŸ›
MichaΕ‚ Borek
MichaΕ‚ Borek

πŸ›
MichaΕ‚ KuliΕ„ski
MichaΕ‚ KuliΕ„ski

πŸ›
Miguel NΓΊΓ±ez DΓ­az-Montes
Miguel NΓΊΓ±ez DΓ­az-Montes

πŸ›
Mihai Ionut
Mihai Ionut

πŸ›
Mirek Hankus
Mirek Hankus

πŸ›
Mladjan Gadzic
Mladjan Gadzic

πŸ›
MrAngry52
MrAngry52

πŸ›
Muminur Choudhury
Muminur Choudhury

πŸ›
Mykhailo Palahuta
Mykhailo Palahuta

πŸ’» πŸ›
Nagendra Kumar Singh
Nagendra Kumar Singh

πŸ›
Nahuel Barrios
Nahuel Barrios

πŸ›
Nathan Braun
Nathan Braun

πŸ›
Nathan Reynolds
Nathan Reynolds

πŸ›
Nathan Reynolds
Nathan Reynolds

πŸ›
NathanaΓ«l
NathanaΓ«l

πŸ›
Naveen
Naveen

πŸ’»
Nazdravi
Nazdravi

πŸ›
Neha-Dhonde
Neha-Dhonde

πŸ›
Nicholas Doyle
Nicholas Doyle

πŸ›
Nick Butcher
Nick Butcher

πŸ›
Nico Gallinal
Nico Gallinal

πŸ›
Nicola Dal Maso
Nicola Dal Maso

πŸ›
Nicolas Filotto
Nicolas Filotto

πŸ’»
Nicolas Vervelle
Nicolas Vervelle

πŸ›
Nicolas Vuillamy
Nicolas Vuillamy

πŸ“–
Nikita Chursin
Nikita Chursin

πŸ›
Niklas Baudy
Niklas Baudy

πŸ›
Nikolas Havrikov
Nikolas Havrikov

πŸ›
Nilesh Virkar
Nilesh Virkar

πŸ›
Nimit Patel
Nimit Patel

πŸ›
Niranjan Harpale
Niranjan Harpale

πŸ›
Nirvik Patel
Nirvik Patel

πŸ’»
Noah Sussman
Noah Sussman

πŸ›
Noah0120
Noah0120

πŸ›
Noam Tamim
Noam Tamim

πŸ›
Noel Grandin
Noel Grandin

πŸ›
Olaf Haalstra
Olaf Haalstra

πŸ›
Oleg Andreych
Oleg Andreych

πŸ’» πŸ›
Oleg Pavlenko
Oleg Pavlenko

πŸ›
Oleksii Dykov
Oleksii Dykov

πŸ’» πŸ›
Oliver Eikemeier
Oliver Eikemeier

πŸ›
Oliver Siegmar
Oliver Siegmar

πŸ’΅
Olivier Parent
Olivier Parent

πŸ’» πŸ›
Ollie Abbey
Ollie Abbey

πŸ’» πŸ›
OverDrone
OverDrone

πŸ›
Ozan Gulle
Ozan Gulle

πŸ’» πŸ›
PUNEET JAIN
PUNEET JAIN

πŸ›
Parbati Bose
Parbati Bose

πŸ›
Paul Berg
Paul Berg

πŸ›
Paul Guyot
Paul Guyot

πŸ’»
Pavel Bludov
Pavel Bludov

πŸ›
Pavel Mička
Pavel Mička

πŸ›
Pedro Nuno Santos
Pedro Nuno Santos

πŸ›
Pedro Rijo
Pedro Rijo

πŸ›
Pelisse Romain
Pelisse Romain

πŸ’» πŸ“– πŸ›
Per Abich
Per Abich

πŸ’»
Pete Davids
Pete Davids

πŸ›
Peter Bruin
Peter Bruin

πŸ›
Peter Chittum
Peter Chittum

πŸ’» πŸ›
Peter Cudmore
Peter Cudmore

πŸ›
Peter Kasson
Peter Kasson

πŸ›
Peter Kofler
Peter Kofler

πŸ›
Peter Paul Bakker
Peter Paul Bakker

πŸ’»
Pham Hai Trung
Pham Hai Trung

πŸ›
Philip Graf
Philip Graf

πŸ’» πŸ›
Philip Hachey
Philip Hachey

πŸ›
Philippe Ozil
Philippe Ozil

πŸ›
Phinehas Artemix
Phinehas Artemix

πŸ›
Phokham Nonava
Phokham Nonava

πŸ›
Pim van der Loos
Pim van der Loos

πŸ’» ⚠️
Piotr SzymaΕ„ski
Piotr SzymaΕ„ski

πŸ›
Piotrek Ε»ygieΕ‚o
Piotrek Ε»ygieΕ‚o

πŸ’» πŸ› πŸ“–
Pranay Jaiswal
Pranay Jaiswal

πŸ›
Prasad Kamath
Prasad Kamath

πŸ›
Prasanna
Prasanna

πŸ›
Presh-AR
Presh-AR

πŸ›
Puneet1726
Puneet1726

πŸ›
Rafael CortΓͺs
Rafael CortΓͺs

πŸ›
RaheemShaik999
RaheemShaik999

πŸ›
RajeshR
RajeshR

πŸ’» πŸ›
Ramachandra Mohan
Ramachandra Mohan

πŸ›
Ramel0921
Ramel0921

πŸ›
Raquel Pau
Raquel Pau

πŸ›
Ravikiran Janardhana
Ravikiran Janardhana

πŸ›
Reda Benhemmouche
Reda Benhemmouche

πŸ›
Renato Oliveira
Renato Oliveira

πŸ’» πŸ›
Rich DiCroce
Rich DiCroce

πŸ›
Richard Corfield
Richard Corfield

πŸ’»
Richard Corfield
Richard Corfield

πŸ› πŸ’»
Riot R1cket
Riot R1cket

πŸ›
Rishabh Jain
Rishabh Jain

πŸ›
RishabhDeep Singh
RishabhDeep Singh

πŸ›
Robbie Martinus
Robbie Martinus

πŸ’» πŸ›
Robert Henry
Robert Henry

πŸ›
Robert Mihaly
Robert Mihaly

πŸ›
Robert Painsi
Robert Painsi

πŸ›
Robert Russell
Robert Russell

πŸ›
Robert SΓΆsemann
Robert SΓΆsemann

πŸ’» πŸ“– πŸ“’ πŸ›
Robert Whitebit
Robert Whitebit

πŸ›
Robin Richtsfeld
Robin Richtsfeld

πŸ›
Robin Stocker
Robin Stocker

πŸ’» πŸ›
Robin Wils
Robin Wils

πŸ›
RochusOest
RochusOest

πŸ›
Rodolfo Noviski
Rodolfo Noviski

πŸ›
Rodrigo Casara
Rodrigo Casara

πŸ›
Rodrigo Fernandes
Rodrigo Fernandes

πŸ›
Roman Salvador
Roman Salvador

πŸ’» πŸ›
Ronald Blaschke
Ronald Blaschke

πŸ›
RΓ³bert Papp
RΓ³bert Papp

πŸ›
Saikat Sengupta
Saikat Sengupta

πŸ›
Saksham Handu
Saksham Handu

πŸ›
Saladoc
Saladoc

πŸ›
Salesforce Bob Lightning
Salesforce Bob Lightning

πŸ›
Sam Carlberg
Sam Carlberg

πŸ›
Satoshi Kubo
Satoshi Kubo

πŸ›
Scott Kennedy
Scott Kennedy

πŸ›
Scott Wells
Scott Wells

πŸ› πŸ’»
Scrsloota
Scrsloota

πŸ’»
Sebastian BΓΆgl
Sebastian BΓΆgl

πŸ›
Sebastian Schuberth
Sebastian Schuberth

πŸ›
Sebastian Schwarz
Sebastian Schwarz

πŸ›
Seren
Seren

πŸ› πŸ’»
Sergey Gorbaty
Sergey Gorbaty

πŸ›
Sergey Kozlov
Sergey Kozlov

πŸ›
Sergey Yanzin
Sergey Yanzin

πŸ’» πŸ›
Seth Wilcox
Seth Wilcox

πŸ’»
Shai Bennathan
Shai Bennathan

πŸ› πŸ’»
Shubham
Shubham

πŸ’» πŸ›
Simon Abykov
Simon Abykov

πŸ’» πŸ›
Simon Xiao
Simon Xiao

πŸ›
Srinivasan Venkatachalam
Srinivasan Venkatachalam

πŸ›
Stanislav Gromov
Stanislav Gromov

πŸ›
Stanislav Myachenkov
Stanislav Myachenkov

πŸ’»
Stefan Birkner
Stefan Birkner

πŸ›
Stefan Bohn
Stefan Bohn

πŸ›
Stefan Endrullis
Stefan Endrullis

πŸ›
Stefan KlΓΆss-Schuster
Stefan KlΓΆss-Schuster

πŸ›
Stefan Wolf
Stefan Wolf

πŸ›
Stephan H. Wissel
Stephan H. Wissel

πŸ›
Stephen
Stephen

πŸ›
Stephen Friedrich
Stephen Friedrich

πŸ›
Steve Babula
Steve Babula

πŸ’»
Steven Stearns
Steven Stearns

πŸ› πŸ’»
Stexxe
Stexxe

πŸ›
Stian LΓ₯gstad
Stian LΓ₯gstad

πŸ›
StuartClayton5
StuartClayton5

πŸ›
Supun Arunoda
Supun Arunoda

πŸ›
Suren Abrahamyan
Suren Abrahamyan

πŸ›
Suvashri
Suvashri

πŸ“–
SwatiBGupta1110
SwatiBGupta1110

πŸ›
SyedThoufich
SyedThoufich

πŸ›
Szymon Sasin
Szymon Sasin

πŸ›
T-chuangxin
T-chuangxin

πŸ›
TERAI Atsuhiro
TERAI Atsuhiro

πŸ›
TIOBE Software
TIOBE Software

πŸ’» πŸ›
Tarush Singh
Tarush Singh

πŸ’»
Taylor Smock
Taylor Smock

πŸ›
Techeira DamiΓ‘n
Techeira DamiΓ‘n

πŸ’» πŸ›
Ted Husted
Ted Husted

πŸ›
TehBakker
TehBakker

πŸ›
The Gitter Badger
The Gitter Badger

πŸ›
Theodoor
Theodoor

πŸ›
Thiago Henrique HΓΌpner
Thiago Henrique HΓΌpner

πŸ›
Thibault Meyer
Thibault Meyer

πŸ›
Thomas GΓΌttler
Thomas GΓΌttler

πŸ›
Thomas Jones-Low
Thomas Jones-Low

πŸ›
Thomas Smith
Thomas Smith

πŸ’» πŸ›
ThrawnCA
ThrawnCA

πŸ›
Thunderforge
Thunderforge

πŸ’» πŸ›
Tim van der Lippe
Tim van der Lippe

πŸ›
Tobias Weimer
Tobias Weimer

πŸ’» πŸ›
Tom Copeland
Tom Copeland

πŸ› πŸ’» πŸ“–
Tom Daly
Tom Daly

πŸ›
Tomer Figenblat
Tomer Figenblat

πŸ›
Tomi De Lucca
Tomi De Lucca

πŸ’» πŸ›
Torsten Kleiber
Torsten Kleiber

πŸ›
TrackerSB
TrackerSB

πŸ›
Tyson Stewart
Tyson Stewart

πŸ›
Ullrich Hafner
Ullrich Hafner

πŸ›
Utku Cuhadaroglu
Utku Cuhadaroglu

πŸ’» πŸ›
Valentin Brandl
Valentin Brandl

πŸ›
Valeria
Valeria

πŸ›
Valery Yatsynovich
Valery Yatsynovich

πŸ“–
Vasily Anisimov
Vasily Anisimov

πŸ›
Vibhor Goyal
Vibhor Goyal

πŸ›
Vickenty Fesunov
Vickenty Fesunov

πŸ›
Victor NoΓ«l
Victor NoΓ«l

πŸ›
Vincent Galloy
Vincent Galloy

πŸ’»
Vincent HUYNH
Vincent HUYNH

πŸ›
Vincent Maurin
Vincent Maurin

πŸ›
Vincent Privat
Vincent Privat

πŸ›
Vishhwas
Vishhwas

πŸ›
Vitaly
Vitaly

πŸ›
Vitaly Polonetsky
Vitaly Polonetsky

πŸ›
Vojtech Polivka
Vojtech Polivka

πŸ›
Vsevolod Zholobov
Vsevolod Zholobov

πŸ›
Vyom Yadav
Vyom Yadav

πŸ’»
Wang Shidong
Wang Shidong

πŸ›
Waqas Ahmed
Waqas Ahmed

πŸ›
Wayne J. Earl
Wayne J. Earl

πŸ›
Wchenghui
Wchenghui

πŸ›
Wener
Wener

πŸ’»
Will Winder
Will Winder

πŸ›
William Brockhus
William Brockhus

πŸ’» πŸ›
Wilson Kurniawan
Wilson Kurniawan

πŸ›
Wim Deblauwe
Wim Deblauwe

πŸ›
Woongsik Choi
Woongsik Choi

πŸ›
XenoAmess
XenoAmess

πŸ’» πŸ›
Yang
Yang

πŸ’»
YaroslavTER
YaroslavTER

πŸ›
Yasar Shaikh
Yasar Shaikh

πŸ’»
Young Chan
Young Chan

πŸ’» πŸ›
YuJin Kim
YuJin Kim

πŸ›
Yuri Dolzhenko
Yuri Dolzhenko

πŸ›
Yurii Dubinka
Yurii Dubinka

πŸ›
Zoltan Farkas
Zoltan Farkas

πŸ›
Zustin
Zustin

πŸ›
aaronhurst-google
aaronhurst-google

πŸ› πŸ’»
alexmodis
alexmodis

πŸ›
andreoss
andreoss

πŸ›
andrey81inmd
andrey81inmd

πŸ’» πŸ›
anicoara
anicoara

πŸ›
arunprasathav
arunprasathav

πŸ›
asiercamara
asiercamara

πŸ›
astillich-igniti
astillich-igniti

πŸ’»
avesolovksyy
avesolovksyy

πŸ›
avishvat
avishvat

πŸ›
avivmu
avivmu

πŸ›
axelbarfod1
axelbarfod1

πŸ›
b-3-n
b-3-n

πŸ›
balbhadra9
balbhadra9

πŸ›
base23de
base23de

πŸ›
bergander
bergander

πŸ›
berkam
berkam

πŸ’» πŸ›
breizh31
breizh31

πŸ›
caesarkim
caesarkim

πŸ›
carolyujing
carolyujing

πŸ›
cbfiddle
cbfiddle

πŸ›
cesares-basilico
cesares-basilico

πŸ›
chrite
chrite

πŸ›
cobratbq
cobratbq

πŸ›
coladict
coladict

πŸ›
cosmoJFH
cosmoJFH

πŸ›
cristalp
cristalp

πŸ›
crunsk
crunsk

πŸ›
cwholmes
cwholmes

πŸ›
cyberjj999
cyberjj999

πŸ›
cyw3
cyw3

πŸ› πŸ“–
d1ss0nanz
d1ss0nanz

πŸ›
dague1
dague1

πŸ“–
dalizi007
dalizi007

πŸ’»
danbrycefairsailcom
danbrycefairsailcom

πŸ›
dariansanity
dariansanity

πŸ›
darrenmiliband
darrenmiliband

πŸ›
davidburstrom
davidburstrom

πŸ›
dbirkman-paloalto
dbirkman-paloalto

πŸ›
deepak-patra
deepak-patra

πŸ›
dependabot[bot]
dependabot[bot]

πŸ’» πŸ›
dinesh150
dinesh150

πŸ›
diziaq
diziaq

πŸ›
dreaminpast123
dreaminpast123

πŸ›
duanyanan
duanyanan

πŸ›
dutt-sanjay
dutt-sanjay

πŸ›
dylanleung
dylanleung

πŸ›
dzeigler
dzeigler

πŸ›
eant60
eant60

πŸ›
ekkirala
ekkirala

πŸ›
emersonmoura
emersonmoura

πŸ›
eugenepugach
eugenepugach

πŸ›
fairy
fairy

πŸ›
filiprafalowicz
filiprafalowicz

πŸ’»
foxmason
foxmason

πŸ›
frankegabor
frankegabor

πŸ›
frankl
frankl

πŸ›
freafrea
freafrea

πŸ›
fsapatin
fsapatin

πŸ›
gracia19
gracia19

πŸ›
guo fei
guo fei

πŸ›
gurmsc5
gurmsc5

πŸ›
gwilymatgearset
gwilymatgearset

πŸ’» πŸ›
haigsn
haigsn

πŸ›
hemanshu070
hemanshu070

πŸ›
henrik242
henrik242

πŸ›
hongpuwu
hongpuwu

πŸ›
hvbtup
hvbtup

πŸ’» πŸ›
igniti GmbH
igniti GmbH

πŸ›
ilovezfs
ilovezfs

πŸ›
itaigilo
itaigilo

πŸ›
jakivey32
jakivey32

πŸ›
jbennett2091
jbennett2091

πŸ›
jcamerin
jcamerin

πŸ›
jkeener1
jkeener1

πŸ›
jmetertea
jmetertea

πŸ›
johnra2
johnra2

πŸ’»
josemanuelrolon
josemanuelrolon

πŸ’» πŸ›
kabroxiko
kabroxiko

πŸ’» πŸ›
karwer
karwer

πŸ›
kaulonline
kaulonline

πŸ›
kdaemonv
kdaemonv

πŸ›
kdebski85
kdebski85

πŸ› πŸ’»
kenji21
kenji21

πŸ’» πŸ›
kfranic
kfranic

πŸ›
khalidkh
khalidkh

πŸ›
koalalam
koalalam

πŸ›
krzyk
krzyk

πŸ›
lasselindqvist
lasselindqvist

πŸ›
lgemeinhardt
lgemeinhardt

πŸ›
lihuaib
lihuaib

πŸ›
lonelyma1021
lonelyma1021

πŸ›
lpeddy
lpeddy

πŸ›
lujiefsi
lujiefsi

πŸ’»
lukelukes
lukelukes

πŸ’»
lyriccoder
lyriccoder

πŸ›
marcelmore
marcelmore

πŸ›
matchbox
matchbox

πŸ›
matthiaskraaz
matthiaskraaz

πŸ›
meandonlyme
meandonlyme

πŸ›
mikesive
mikesive

πŸ›
milossesic
milossesic

πŸ›
mluckam
mluckam

πŸ’»
mohan-chinnappan-n
mohan-chinnappan-n

πŸ’»
mriddell95
mriddell95

πŸ›
mrlzh
mrlzh

πŸ›
msloan
msloan

πŸ›
mucharlaravalika
mucharlaravalika

πŸ›
mvenneman
mvenneman

πŸ›
nareshl119
nareshl119

πŸ›
nicolas-harraudeau-sonarsource
nicolas-harraudeau-sonarsource

πŸ›
noerremark
noerremark

πŸ›
novsirion
novsirion

πŸ›
nwcm
nwcm

πŸ“– πŸ›
oggboy
oggboy

πŸ›
oinume
oinume

πŸ›
orimarko
orimarko

πŸ’» πŸ›
pacvz
pacvz

πŸ’»
pallavi agarwal
pallavi agarwal

πŸ›
parksungrin
parksungrin

πŸ›
patpatpat123
patpatpat123

πŸ›
patriksevallius
patriksevallius

πŸ›
pbrajesh1
pbrajesh1

πŸ›
phoenix384
phoenix384

πŸ›
piotrszymanski-sc
piotrszymanski-sc

πŸ’»
plan3d
plan3d

πŸ›
poojasix
poojasix

πŸ›
prabhushrikant
prabhushrikant

πŸ›
pujitha8783
pujitha8783

πŸ›
r-r-a-j
r-r-a-j

πŸ›
raghujayjunk
raghujayjunk

πŸ›
rajeshveera
rajeshveera

πŸ›
rajeswarreddy88
rajeswarreddy88

πŸ›
recdevs
recdevs

πŸ›
reudismam
reudismam

πŸ’» πŸ›
rijkt
rijkt

πŸ›
rillig-tk
rillig-tk

πŸ›
rmohan20
rmohan20

πŸ’» πŸ›
rnveach
rnveach

πŸ›
rxmicro
rxmicro

πŸ›
ryan-gustafson
ryan-gustafson

πŸ’» πŸ›
sabi0
sabi0

πŸ›
scais
scais

πŸ›
sebbASF
sebbASF

πŸ›
sergeygorbaty
sergeygorbaty

πŸ’»
shilko2013
shilko2013

πŸ›
shiomiyan
shiomiyan

πŸ“–
simeonKondr
simeonKondr

πŸ›
snajberk
snajberk

πŸ›
sniperrifle2004
sniperrifle2004

πŸ›
snuyanzin
snuyanzin

πŸ› πŸ’»
sratz
sratz

πŸ›
stonio
stonio

πŸ›
sturton
sturton

πŸ’» πŸ›
sudharmohan
sudharmohan

πŸ›
suruchidawar
suruchidawar

πŸ›
svenfinitiv
svenfinitiv

πŸ›
tashiscool
tashiscool

πŸ›
test-git-hook
test-git-hook

πŸ›
testation21
testation21

πŸ’» πŸ›
thanosa
thanosa

πŸ›
tiandiyixian
tiandiyixian

πŸ›
tobwoerk
tobwoerk

πŸ›
tprouvot
tprouvot

πŸ› πŸ’»
trentchilders
trentchilders

πŸ›
triandicAnt
triandicAnt

πŸ›
trishul14
trishul14

πŸ›
tsui
tsui

πŸ›
winhkey
winhkey

πŸ›
witherspore
witherspore

πŸ›
wjljack
wjljack

πŸ›
wuchiuwong
wuchiuwong

πŸ›
xingsong
xingsong

πŸ›
xioayuge
xioayuge

πŸ›
xnYi9wRezm
xnYi9wRezm

πŸ’» πŸ›
xuanuy
xuanuy

πŸ›
xyf0921
xyf0921

πŸ›
yalechen-cyw3
yalechen-cyw3

πŸ›
yasuharu-sato
yasuharu-sato

πŸ›
zenglian
zenglian

πŸ›
zgrzyt93
zgrzyt93

πŸ’» πŸ›
zh3ng
zh3ng

πŸ›
zt_soft
zt_soft

πŸ›
ztt79
ztt79

πŸ›
zzzzfeng
zzzzfeng

πŸ›
ÁrpÑd MagosÑnyi
ÁrpÑd MagosÑnyi

πŸ›
任贡杰
任贡杰

πŸ›
θŒ…ε»Άε‰
θŒ…ε»Άε‰

πŸ’»
diff --git a/docs/pages/pmd/userdocs/cpd/cpd.md b/docs/pages/pmd/userdocs/cpd/cpd.md index 73b7368f1c..ab65964e5e 100644 --- a/docs/pages/pmd/userdocs/cpd/cpd.md +++ b/docs/pages/pmd/userdocs/cpd/cpd.md @@ -333,8 +333,14 @@ For details, see [CPD Report Formats](pmd_userdocs_cpd_report_formats.html). Andy Glover wrote an Ant task for CPD; here's how to use it: ```xml + + + + + + + - diff --git a/docs/pages/pmd/userdocs/tools/ant.md b/docs/pages/pmd/userdocs/tools/ant.md index ae3abbcbab..f259bc7149 100644 --- a/docs/pages/pmd/userdocs/tools/ant.md +++ b/docs/pages/pmd/userdocs/tools/ant.md @@ -181,7 +181,6 @@ automatically and the latest language version is used. `ruleset` nested element - another way to specify rulesets. You can specify multiple elements. Here's an example: - rulesets/java/quickstart.xml config/my-ruleset.xml @@ -213,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`. @@ -373,7 +372,6 @@ You can run pmd then with `ant pmd`. An HTML report with the "linkPrefix" and "linePrefix" properties: - diff --git a/docs/pages/pmd/userdocs/tools/tools.md b/docs/pages/pmd/userdocs/tools/tools.md index c889ef0091..2e49ca89a2 100644 --- a/docs/pages/pmd/userdocs/tools/tools.md +++ b/docs/pages/pmd/userdocs/tools/tools.md @@ -1,13 +1,14 @@ --- title: Tools / Integrations tags: [userdocs, tools] - permalink: pmd_userdocs_tools.html author: David Dixon-Peugh --- ## Automated Code Review +{% include note.html content="The tools are listed in alphabetical order without rating." %} + ### Codacy [Codacy](https://www.codacy.com/) automates code reviews and monitors code quality on every commit and pull request. @@ -42,6 +43,24 @@ The action can also be used as a code scanner to create "Code scanning alerts". * Homepage: [pmd/pmd-github-action](https://github.com/pmd/pmd-github-action) +### TCA + +[Tencent Cloud Code Analysis](http://tca.tencent.com/) (TCA for short, code-named CodeDog inside the company early) +is a comprehensive platform for code analysis and issue tracking. TCA consist of three components, server, web and +client. It integrates of a number of self-developed tools, and also supports dynamic integration of code analysis +tools in various programming languages. + +Using TCA can help team find normative, structural, security vulnerabilities and other issues in the code, +continuously monitor the quality of the project code and issue alerts. At the same time, TCA opens up APIs to +support connection with upstream and downstream systems, so as to integrate code analysis capabilities, ensure +code quality, and be more conducive to inheriting an excellent team code culture. + +With TCA you have PMD analysis out-of-the-box, and it is open source under the MIT license. + +* Homepage: [http://tca.tencent.com/](http://tca.tencent.com/) +* Source code: [https://github.com/Tencent/CodeAnalysis](https://github.com/Tencent/CodeAnalysis) +* Documentation: [https://tencent.github.io/CodeAnalysis](https://tencent.github.io/CodeAnalysis) +* Maintainer: TCA ## IDE Integrations diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 2a215a1172..5beef90203 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -34,198 +34,38 @@ for all.

{% tocmaker is_release_notes_processor %} -### Changes since 7.0.0-rc3 +### Changes since 7.0.0-rc4 This section lists the most important changes from the last release candidate. The remaining section describes the complete release notes for 7.0.0. +#### New and Noteworthy + +#### Rule Changes + +**New Rules** + +* {% rule java/codestyle/UseExplicitTypes %} reports usages of `var` keyword, which was introduced with Java 10. +* {% rule xml/bestpractices/MissingEncoding %} finds XML files without explicit encoding. + #### Fixed issues +* cli + * [#4723](https://github.com/pmd/pmd/issues/4723): \[cli] Launch fails for "bash pmd" * miscellaneous - * [#4582](https://github.com/pmd/pmd/issues/4582): \[dist] Download link broken -* core - * [#1204](https://github.com/pmd/pmd/issues/1204): \[core] Allow numeric properties in XML to be within an unbounded range - * [#3919](https://github.com/pmd/pmd/issues/3919): \[core] Merge CPD and PMD language - * [#4204](https://github.com/pmd/pmd/issues/4204): \[core] Provide a CpdAnalysis class as a programmatic entry point into CPD - * [#4301](https://github.com/pmd/pmd/issues/4301): \[core] Remove deprecated property concrete classes - * [#4302](https://github.com/pmd/pmd/issues/4302): \[core] Migrate Property Framework API to Java 8 - * [#4323](https://github.com/pmd/pmd/issues/4323): \[core] Refactor CPD integration - * [#4397](https://github.com/pmd/pmd/pull/4397): \[core] Refactor CPD - * [#4621](https://github.com/pmd/pmd/issues/4621): \[core] Make `ClasspathClassLoader::getResource` child first -* doc - * [#4294](https://github.com/pmd/pmd/issues/4294): \[doc] Migration Guide for upgrading PMD 6 ➑️ 7 - * [#4303](https://github.com/pmd/pmd/issues/4303): \[doc] Document new property framework - * [#4521](https://github.com/pmd/pmd/issues/4521): \[doc] Website is not mobile friendly -* apex-design - * [#4596](https://github.com/pmd/pmd/issues/4596): \[apex] ExcessivePublicCount ignores properties -* java - * [#4401](https://github.com/pmd/pmd/issues/4401): \[java] PMD 7 fails to build under Java 19 -* java-bestpractices - * [#4634](https://github.com/pmd/pmd/issues/4634): \[java] JUnit4TestShouldUseTestAnnotation false positive with TestNG + * [#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 +* java-codestyle + * [#2847](https://github.com/pmd/pmd/issues/2847): \[java] New Rule: Use Explicit Types + * [#4578](https://github.com/pmd/pmd/issues/4578): \[java] CommentDefaultAccessModifier comment needs to be before annotation if present +* xml-bestpractices + * [#4592](https://github.com/pmd/pmd/pull/4592): \[xml] Add MissingEncoding rule #### API Changes -**Rule properties** - -* The old deprecated classes like `IntProperty` and `StringProperty` have been removed. Please use - {% jdoc core::properties.PropertyFactory %} to create properties. -* All properties which accept multiple values now use a comma (`,`) as a delimiter. The previous default was a - pipe character (`|`). The delimiter is not configurable anymore. If needed, the comma can be escaped - with a backslash. -* The `min` and `max` attributes in property definitions in the XML are now optional and can appear separately - or be omitted. - -**New Programmatic API for CPD** - -See [Detailed Release Notes for PMD 7]({{ baseurl }}pmd_release_notes_pmd7.html#new-programmatic-api-for-cpd) -and [PR #4397](https://github.com/pmd/pmd/pull/4397) for details. - -**Removed classes and methods** - -The following previously deprecated classes have been removed: - -* pmd-core - * `net.sourceforge.pmd.cpd.AbstractTokenizer` ➑️ use {%jdoc core::cpd.AnyTokenizer %} instead - * `net.sourceforge.pmd.cpd.CPD` ➑️ use {% jdoc cli::cli.PmdCli %} from `pmd-cli` module for CLI support or use - {%jdoc core::cpd.CpdAnalysis %} for programmatic API - * `net.sourceforge.pmd.cpd.GridBagHelper` (now package private) - * `net.sourceforge.pmd.cpd.TokenEntry.State` - * `net.sourceforge.pmd.lang.document.CpdCompat` - * `net.sourceforge.pmd.properties.BooleanMultiProperty` - * `net.sourceforge.pmd.properties.BooleanProperty` - * `net.sourceforge.pmd.properties.CharacterMultiProperty` - * `net.sourceforge.pmd.properties.CharacterProperty` - * `net.sourceforge.pmd.properties.DoubleMultiProperty` - * `net.sourceforge.pmd.properties.DoubleProperty` - * `net.sourceforge.pmd.properties.EnumeratedMultiProperty` - * `net.sourceforge.pmd.properties.EnumeratedProperty` - * `net.sourceforge.pmd.properties.EnumeratedPropertyDescriptor` - * `net.sourceforge.pmd.properties.FileProperty` (note: without replacement) - * `net.sourceforge.pmd.properties.FloatMultiProperty` - * `net.sourceforge.pmd.properties.FloatProperty` - * `net.sourceforge.pmd.properties.IntegerMultiProperty` - * `net.sourceforge.pmd.properties.IntegerProperty` - * `net.sourceforge.pmd.properties.LongMultiProperty` - * `net.sourceforge.pmd.properties.LongProperty` - * `net.sourceforge.pmd.properties.MultiValuePropertyDescriptor` - * `net.sourceforge.pmd.properties.NumericPropertyDescriptor` - * `net.sourceforge.pmd.properties.PropertyDescriptorField` - * `net.sourceforge.pmd.properties.RegexProperty` - * `net.sourceforge.pmd.properties.SingleValuePropertyDescriptor` - * `net.sourceforge.pmd.properties.StringMultiProperty` - * `net.sourceforge.pmd.properties.StringProperty` - * `net.sourceforge.pmd.properties.ValueParser` - * `net.sourceforge.pmd.properties.ValueParserConstants` - * `net.sourceforge.pmd.properties.builders.MultiNumericPropertyBuilder` - * `net.sourceforge.pmd.properties.builders.MultiPackagedPropertyBuilder` - * `net.sourceforge.pmd.properties.builders.MultiValuePropertyBuilder` - * `net.sourceforge.pmd.properties.builders.PropertyDescriptorBuilder` - * `net.sourceforge.pmd.properties.builders.PropertyDescriptorBuilderConversionWrapper` - * `net.sourceforge.pmd.properties.builders.PropertyDescriptorExternalBuilder` - * `net.sourceforge.pmd.properties.builders.SingleNumericPropertyBuilder` - * `net.sourceforge.pmd.properties.builders.SinglePackagedPropertyBuilder` - * `net.sourceforge.pmd.properties.builders.SingleValuePropertyBuilder` - * `net.sourceforge.pmd.properties.modules.EnumeratedPropertyModule` - * `net.sourceforge.pmd.properties.modules.NumericPropertyModule` - -The following previously deprecated methods have been removed: - -* pmd-core - * `net.sourceforge.pmd.properties.PropertyBuilder.GenericCollectionPropertyBuilder#delim(char)` - * `net.sourceforge.pmd.properties.PropertySource#setProperty(...)` - * `net.sourceforge.pmd.properties.PropertyTypeId#factoryFor(...)` - * `net.sourceforge.pmd.properties.PropertyTypeId#typeIdFor(...)` - * `net.sourceforge.pmd.properties.PropertyDescriptor`: removed methods errorFor, type, isMultiValue, - uiOrder, compareTo, isDefinedExternally, valueFrom, asDelimitedString - -The following methods have been removed: - -* pmd-core - * {%jdoc core::cpd.CPDConfiguration %} - * `#sourceCodeFor(File)`, `#postConstruct()`, `#tokenizer()`, `#filenameFilter()` removed - * {%jdoc core::cpd.Mark %} - * `#getSourceSlice()`, `#setLineCount(int)`, `#getLineCount()`, `#setSourceCode(SourceCode)` removed - * `#getBeginColumn()`, `#getBeginLine()`, `#getEndLine()`, `#getEndColumn()` removed - ➑️ use {%jdoc core::cpd.Mark#getLocation() %} instead - * {%jdoc core::cpd.Match %} - * `#LABEL_COMPARATOR` removed - * `#setMarkSet(...)`, `#setLabel(...)`, `#getLabel()`, `#addTokenEntry(...)` removed - * `#getSourceCodeSlice()` removed - ➑️ use {%jdoc !!core::cpd.CPDReport#getSourceCodeSlice(net.sourceforge.pmd.cpd.Mark) %} instead - * {%jdoc core::cpd.TokenEntry %} - * `#getEOF()`, `#clearImages()`, `#getIdentifier()`, `#getIndex()`, `#setHashCode(int)` removed - * `#EOF` removed ➑️ use {%jdoc core::cpd.TokenEntry#isEof() %} instead - * {%jdoc core::lang.ast.Parser.ParserTask %} - * `#getFileDisplayName()` removed ➑️ use {%jdoc core::lang.ast.Parser.ParserTask#getFileId() %} instead - (`getFileId().getAbsolutePath()`) - -The following classes have been removed: - -* pmd-core - * `net.sourceforge.pmd.cpd.AbstractLanguage` - * `net.sourceforge.pmd.cpd.AnyLanguage` - * `net.sourceforge.pmd.cpd.Language` - * `net.sourceforge.pmd.cpd.LanguageFactory` - * `net.sourceforge.pmd.cpd.MatchAlgorithm` (now package private) - * `net.sourceforge.pmd.cpd.MatchCollector` (now package private) - * `net.sourceforge.pmd.cpd.SourceCode` (and all inner classes like `FileCodeLoader`, ...) - * `net.sourceforge.pmd.cpd.token.TokenFilter` - -**Moved packages** - -* pmd-core - * {%jdoc core::net.sourceforge.pmd.properties.NumericConstraints %} (old package: `net.sourceforge.pmd.properties.constraints.NumericConstraints`) - * {%jdoc core::net.sourceforge.pmd.properties.PropertyConstraint %} (old package: `net.sourceforge.pmd.properties.constraints.PropertyConstraint`) - * not experimental anymore - * {%jdoc ant::ant.ReportException %} (old package: `net.sourceforge.pmd.cpd`, moved to module `pmd-ant`) - * it is now a RuntimeException - * {%jdoc core::cpd.CPDReportRenderer %} (old package: `net.sourceforge.pmd.cpd.renderer`) - * {%jdoc core::cpd.impl.AntlrTokenFilter %} (old package: `net.sourceforge.pmd.cpd.token`) - * {%jdoc core::cpd.impl.BaseTokenFilter %} (old package: `net.sourceforge.pmd.cpd.token.internal`) - * {%jdoc core::cpd.impl.JavaCCTokenFilter %} (old package: `net.sourceforge.pmd.cpd.token`) - -**Changed types and other changes** - -* pmd-core - * {%jdoc core::net.sourceforge.pmd.properties.PropertyDescriptor %} is now a class (was an interface) - and it is not comparable anymore. - * {%jdoc !!core::AbstractConfiguration#setSourceEncoding(java.nio.charset.Charset) %} - * previously this method took a simple String for the encoding. - * {%jdoc core::PmdConfiguration %} and {%jdoc core::cpd.CPDConfiguration %} - * many getters and setters have been moved to the parent class {%jdoc core::AbstractConfiguration %} - * {%jdoc !!core::cpd.CPDListener#addedFile(int) %} - * no `File` parameter anymore - * {%jdoc !!core::cpd.CPDReport#getNumberOfTokensPerFile() %} returns a `Map` of `FileId,Integer` instead of `String` - * {%jdoc !!core::cpd.CPDReport#filterMatches(java.util.function.Predicate) %} now takes a `java.util.function.Predicate` - as parameter - * {%jdoc core::cpd.Tokenizer %} - * constants are now {%jdoc core::properties.PropertyDescriptor %} instead of `String`, - to be used as language properties - * {%jdoc core::cpd.Tokenizer#tokenize(net.sourceforge.pmd.lang.document.TextDocument, net.sourceforge.pmd.cpd.TokenFactory) %} - changed parameters. Now takes a {%jdoc core::lang.document.TextDocument %} and a {%jdoc core::cpd.TokenFactory %} - (instead of `SourceCode` and `Tokens`) - * {% jdoc core::lang.Language %} - * method `#createProcessor(LanguagePropertyBundle)` moved to {%jdoc core::lang.PmdCapableLanguage %} - * {% jdoc !!core::util.StringUtil#linesWithTrimIndent(net.sourceforge.pmd.lang.document.Chars) %} now takes a `Chars` - instead of a `String`. -* All language modules (like pmd-apex, pmd-cpp, ...) - * consistent package naming: `net.sourceforge.pmd.lang..cpd` - * adapted to use {% jdoc core::cpd.CpdCapableLanguage %} - * consistent static method `#getInstance()` - * removed constants like `ID`, `TERSE_NAME` or `NAME`. Use `getInstance().getName()` etc. instead - -**Internal APIs** - -* {% jdoc core::cpd.Tokens %} -* {% jdoc core::net.sourceforge.pmd.properties.PropertyTypeId %} - -**Deprecations** - -* {% jdoc !!core::lang.Language#getTerseName() %} ➑️ use {% jdoc core::lang.Language#getId() %} instead - #### External Contributions -* [#4528](https://github.com/pmd/pmd/pull/4528): \[apex] Update to apexlink - [Kevin Jones](https://github.com/nawforce) (@nawforce) -* [#4637](https://github.com/pmd/pmd/pull/4637): \[java] fix #4634 - JUnit4TestShouldUseTestAnnotation false positive with TestNG - [Krystian Dabrowski](https://github.com/krdabrowski) (@krdabrowski) + +* [#4640](https://github.com/pmd/pmd/pull/4640): \[cli] Launch script fails if run via "bash pmd" - [Shai Bennathan](https://github.com/shai-bennathan) (@shai-bennathan) ### πŸš€ Major Features and Enhancements @@ -330,6 +170,29 @@ module `pmd-coco`. Contributors: [Wener](https://github.com/wener-tiobe) (@wener-tiobe) +#### New: Java 21 Support + +This release of PMD brings support for Java 21. There are the following new standard language features, +that are supported now: + +* [JEP 440: Record Patterns](https://openjdk.org/jeps/440) +* [JEP 441: Pattern Matching for switch](https://openjdk.org/jeps/441) + +PMD also supports the following preview language features: + +* [JEP 430: String Templates (Preview)](https://openjdk.org/jeps/430) +* [JEP 443: Unnamed Patterns and Variables (Preview)](https://openjdk.org/jeps/443) +* [JEP 445: Unnamed Classes and Instance Main Methods (Preview)](https://openjdk.org/jeps/445) + +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 `21-preview`: + + export PMD_JAVA_OPTS=--enable-preview + pmd check --use-version java-21-preview ... + +Note: Support for Java 19 preview language features have been removed. The version "19-preview" is no longer available. + #### Changed: JavaScript support * latest version supports ES6 and also some new constructs (see [Rhino](https://github.com/mozilla/rhino)]) @@ -348,6 +211,10 @@ Contributors: [Wener](https://github.com/wener-tiobe) (@wener-tiobe) literals were ignored. The new option additional ignores identifiers as well in sequences. * See [PR #4470](https://github.com/pmd/pmd/pull/4470) for details. +#### Changed: Apex Jorje Updated + +With the new version of Apex Jorje, the new language constructs like User Mode Database Operations +can be parsed now. PMD should now be able to parse Apex code up to version 59.0 (Winter '23). #### Changed: Rule properties @@ -368,6 +235,7 @@ Contributors: [Wener](https://github.com/wener-tiobe) (@wener-tiobe) **Java** * {% rule java/codestyle/UnnecessaryBoxing %} reports boxing and unboxing conversions that may be made implicit. +* {% rule java/codestyle/UseExplicitTypes %} reports usages of `var` keyword, which was introduced with Java 10. **Kotlin** * {% rule kotlin/bestpractices/FunctionNameTooShort %} @@ -379,6 +247,9 @@ Contributors: [Wener](https://github.com/wener-tiobe) (@wener-tiobe) * {% rule swift/errorprone/ForceCast %} * {% rule swift/errorprone/ForceTry %} +**XML** +* {% rule xml/bestpractices/MissingEncoding %} finds XML files without explicit encoding. + #### Changed Rules **General changes** @@ -516,7 +387,11 @@ of the changes listed here, see [Detailed Release Notes for PMD 7]({{ baseurl }} * New Programmatic API for CPD ### πŸ’₯ Compatibility and migration notes -See [Detailed Release Notes for PMD 7]({{ baseurl }}pmd_release_notes_pmd7.html). + +A detailed documentation of required changes are available in the +[Migration Guide for PMD 7]({{ baseurl }}pmd_userdocs_migrating_to_pmd7.html). + +See also [Detailed Release Notes for PMD 7]({{ baseurl }}pmd_release_notes_pmd7.html). ### πŸ› Fixed Issues @@ -532,6 +407,9 @@ See [Detailed Release Notes for PMD 7]({{ baseurl }}pmd_release_notes_pmd7.html) * [#4462](https://github.com/pmd/pmd/issues/4462): Provide Software Bill of Materials (SBOM) * [#4460](https://github.com/pmd/pmd/pull/4460): Fix assembly-plugin warnings * [#4582](https://github.com/pmd/pmd/issues/4582): \[dist] Download link broken + * [#4586](https://github.com/pmd/pmd/pull/4586): Use explicit encoding in ruleset xml files + * [#4691](https://github.com/pmd/pmd/issues/4691): \[CVEs] Critical and High CEVs reported on PMD and PMD dependencies + * [#4699](https://github.com/pmd/pmd/pull/4699): Make PMD buildable with java 21 * ant * [#4080](https://github.com/pmd/pmd/issues/4080): \[ant] Split off Ant integration into a new submodule * core @@ -574,11 +452,13 @@ See [Detailed Release Notes for PMD 7]({{ baseurl }}pmd_release_notes_pmd7.html) * [#4420](https://github.com/pmd/pmd/pull/4420): \[core] Remove PMD.EOL * [#4425](https://github.com/pmd/pmd/pull/4425): \[core] Replace TextFile::pathId * [#4454](https://github.com/pmd/pmd/issues/4454): \[core] "Unknown option: '-min'" but is referenced in documentation + * [#4611](https://github.com/pmd/pmd/pull/4611): \[core] Fix loading language properties from env vars * [#4621](https://github.com/pmd/pmd/issues/4621): \[core] Make `ClasspathClassLoader::getResource` child first * cli * [#2234](https://github.com/pmd/pmd/issues/2234): \[core] Consolidate PMD CLI into a single command * [#3828](https://github.com/pmd/pmd/issues/3828): \[core] Progress reporting * [#4079](https://github.com/pmd/pmd/issues/4079): \[cli] Split off CLI implementation into a pmd-cli submodule + * [#4423](https://github.com/pmd/pmd/pull/4423): \[cli] Fix NPE when only `--file-list` is specified * [#4482](https://github.com/pmd/pmd/issues/4482): \[cli] pmd.bat can only be executed once * [#4484](https://github.com/pmd/pmd/issues/4484): \[cli] ast-dump with no properties produce an NPE * doc @@ -598,11 +478,15 @@ Language specific fixes: * [#1648](https://github.com/pmd/pmd/issues/1648): \[apex,vf] Remove CodeClimate dependency * [#1750](https://github.com/pmd/pmd/pull/1750): \[apex] Remove apex statistical rules * [#2836](https://github.com/pmd/pmd/pull/2836): \[apex] Remove Apex ProjectMirror + * [#3973](https://github.com/pmd/pmd/issues/3973): \[apex] Update parser to support new 'as user' keywords (User Mode for Database Operations) * [#4427](https://github.com/pmd/pmd/issues/4427): \[apex] ApexBadCrypto test failing to detect inline code + * [#4453](https://github.com/pmd/pmd/issues/4453): \[apex] \[7.0-rc1] Exception while initializing Apexlink (Index 34812 out of bounds for length 34812) * apex-design * [#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-security + * [#4646](https://github.com/pmd/pmd/issues/4646): \[apex] ApexSOQLInjection does not recognise SObjectType or SObjectField as safe variable types * java * [#520](https://github.com/pmd/pmd/issues/520): \[java] Allow `@SuppressWarnings` with constants instead of literals * [#864](https://github.com/pmd/pmd/issues/864): \[java] Similar/duplicated implementations for determining FQCN @@ -631,6 +515,7 @@ Language specific fixes: * [#4383](https://github.com/pmd/pmd/issues/4383): \[java] IllegalStateException: Object is not an array type! * [#4401](https://github.com/pmd/pmd/issues/4401): \[java] PMD 7 fails to build under Java 19 * [#4405](https://github.com/pmd/pmd/issues/4405): \[java] Processing error with ArrayIndexOutOfBoundsException + * [#4583](https://github.com/pmd/pmd/issues/4583): \[java] Support JDK 21 (LTS) * 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 @@ -684,6 +569,7 @@ Language specific fixes: * [#2528](https://github.com/pmd/pmd/issues/2528): \[java] MethodNamingConventions - JUnit 5 method naming not support ParameterizedTest * [#2739](https://github.com/pmd/pmd/issues/2739): \[java] UselessParentheses false positive for string concatenation * [#2748](https://github.com/pmd/pmd/issues/2748): \[java] UnnecessaryCast false positive with unchecked cast + * [#2847](https://github.com/pmd/pmd/issues/2847): \[java] New Rule: Use Explicit Types * [#2973](https://github.com/pmd/pmd/issues/2973): \[java] New rule: UnnecessaryBoxing * [#3195](https://github.com/pmd/pmd/pull/3195): \[java] Improve rule UnnecessaryReturn to detect more cases * [#3218](https://github.com/pmd/pmd/pull/3218): \[java] Generalize UnnecessaryCast to flag all unnecessary casts @@ -699,6 +585,7 @@ Language specific fixes: * [#4511](https://github.com/pmd/pmd/issues/4511): \[java] LocalVariableCouldBeFinal shouldn't report unused variables * [#4512](https://github.com/pmd/pmd/issues/4512): \[java] MethodArgumentCouldBeFinal shouldn't report unused parameters * [#4557](https://github.com/pmd/pmd/issues/4557): \[java] UnnecessaryImport FP with static imports of overloaded methods + * [#4578](https://github.com/pmd/pmd/issues/4578): \[java] CommentDefaultAccessModifier comment needs to be before annotation if present * java-design * [#1014](https://github.com/pmd/pmd/issues/1014): \[java] LawOfDemeter: False positive with lambda expression * [#1605](https://github.com/pmd/pmd/issues/1605): \[java] LawOfDemeter: False positive for standard UTF-8 charset name @@ -772,6 +659,8 @@ Language specific fixes: * [#1882](https://github.com/pmd/pmd/pull/1882): \[swift] UnavailableFunction Swift rule * xml * [#1800](https://github.com/pmd/pmd/pull/1800): \[xml] Unimplement org.w3c.dom.Node from the XmlNodeWrapper +* xml-bestpractices + * [#4592](https://github.com/pmd/pmd/pull/4592): \[xml] Add MissingEncoding rule ### ✨ External Contributions @@ -809,10 +698,14 @@ Language specific fixes: * [#4542](https://github.com/pmd/pmd/pull/4542): \[java] Fix #4510: A false positive about ConstructorCallsOverridableMethod and @Value - [AnnaDev](https://github.com/LynnBroe) (@LynnBroe) * [#4553](https://github.com/pmd/pmd/pull/4553): \[java] Fix #4492: GuardLogStatement gives false positive when argument is a Java method reference - [Anastasiia Koba](https://github.com/anastasiia-koba) (@anastasiia-koba) * [#4637](https://github.com/pmd/pmd/pull/4637): \[java] fix #4634 - JUnit4TestShouldUseTestAnnotation false positive with TestNG - [Krystian Dabrowski](https://github.com/krdabrowski) (@krdabrowski) +* [#4649](https://github.com/pmd/pmd/pull/4649): \[apex] Add SObjectType and SObjectField to list of injectable SOQL variable types - [Richard Corfield](https://github.com/rcorfieldffdc) (@rcorfieldffdc) +* [#4651](https://github.com/pmd/pmd/pull/4651): \[doc] Add "Tencent Cloud Code Analysis" in Tools / Integrations - [yale](https://github.com/cyw3) (@cyw3) +* [#4664](https://github.com/pmd/pmd/pull/4664): \[cli] CPD: Fix NPE when only `--file-list` is specified - [Wener](https://github.com/wener-tiobe) (@wener-tiobe) +* [#4665](https://github.com/pmd/pmd/pull/4665): \[java] Doc: Fix references AutoClosable -> AutoCloseable - [Andrey Bozhko](https://github.com/AndreyBozhko) (@AndreyBozhko) ### πŸ“ˆ Stats -* 4694 commits -* 617 closed tickets & PRs -* Days since last release: 30 +* 5007 commits +* 658 closed tickets & PRs +* Days since last release: 122 {% endtocmaker %} diff --git a/docs/pages/release_notes_old.md b/docs/pages/release_notes_old.md index 70374c0cb9..7cd6e5d5c3 100644 --- a/docs/pages/release_notes_old.md +++ b/docs/pages/release_notes_old.md @@ -7,6 +7,973 @@ Previous versions of PMD can be downloaded here: https://github.com/pmd/pmd/rele +## 30-September-2023 - 7.0.0-rc4 + +We're excited to bring you the next major version of PMD! + +Since this is a big release, we provide here only a concise version of the release notes. We prepared a separate +page with the full [Detailed Release Notes for PMD 7.0.0](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_release_notes_pmd7.html). + +
+ℹ️ Release Candidates +

PMD 7.0.0 is finally almost ready. In order to gather feedback, we are going to ship a couple of release candidates. +These are officially available on GitHub and Maven Central and can be used as usual (e.g. as a dependency). +We encourage you to try out the new features, but keep in mind that we may introduce API breaking changes between +the release candidates. It should be stable enough if you don't use custom rules.

+ +

We have still some tasks planned for the next release candidates. +You can see the progress in PMD 7 Tracking Issue #3898.

+ +

If you find any problem or difficulty while updating from PMD 6, please provide feedback via our +issue tracker. That way we can improve the experience +for all.

+
+ +### Table Of Contents + +* [Changes since 7.0.0-rc3](#changes-since-7.0.0-rc3) + * [New and Noteworthy](#new-and-noteworthy) + * [Migration Guide for PMD 7](#migration-guide-for-pmd-7) + * [Apex Jorje Updated](#apex-jorje-updated) + * [Java 21 Support](#java-21-support) + * [Fixed issues](#fixed-issues) + * [API Changes](#api-changes) + * [pmd-java](#pmd-java) + * [Rule properties](#rule-properties) + * [New Programmatic API for CPD](#new-programmatic-api-for-cpd) + * [Removed classes and methods](#removed-classes-and-methods) + * [Moved packages](#moved-packages) + * [Changed types and other changes](#changed-types-and-other-changes) + * [Internal APIs](#internal-apis) + * [Deprecated API](#deprecated-api) + * [Experimental APIs](#experimental-apis) + * [External Contributions](#external-contributions) +* [πŸš€ Major Features and Enhancements](#πŸš€-major-features-and-enhancements) + * [New official logo](#new-official-logo) + * [Revamped Java module](#revamped-java-module) + * [Revamped Command Line Interface](#revamped-command-line-interface) + * [Full Antlr support](#full-antlr-support) + * [Updated PMD Designer](#updated-pmd-designer) + * [New CPD report format cpdhtml-v2.xslt](#new-cpd-report-format-cpdhtml-v2.xslt) +* [πŸŽ‰ Language Related Changes](#πŸŽ‰-language-related-changes) + * [New: Swift support](#new:-swift-support) + * [New: Kotlin support (experimental)](#new:-kotlin-support-(experimental)) + * [New: CPD support for TypeScript](#new:-cpd-support-for-typescript) + * [New: CPD support for Julia](#new:-cpd-support-for-julia) + * [New: CPD support for Coco](#new:-cpd-support-for-coco) + * [New: Java 21 Support](#new:-java-21-support) + * [Changed: JavaScript support](#changed:-javascript-support) + * [Changed: Language versions](#changed:-language-versions) + * [Changed: CPP can now ignore identifiers in sequences (CPD)](#changed:-cpp-can-now-ignore-identifiers-in-sequences-(cpd)) + * [Changed: Apex Jorje Updated](#changed:-apex-jorje-updated) + * [Changed: Rule properties](#changed:-rule-properties) +* [🌟 New and changed rules](#🌟-new-and-changed-rules) + * [New Rules](#new-rules) + * [Changed Rules](#changed-rules) + * [Removed Rules](#removed-rules) +* [🚨 API](#🚨-api) +* [πŸ’₯ Compatibility and migration notes](#πŸ’₯-compatibility-and-migration-notes) +* [πŸ› Fixed Issues](#πŸ›-fixed-issues) +* [✨ External Contributions](#✨-external-contributions) +* [πŸ“ˆ Stats](#πŸ“ˆ-stats) + +### Changes since 7.0.0-rc3 + +This section lists the most important changes from the last release candidate. +The remaining section describes the complete release notes for 7.0.0. + +#### New and Noteworthy + +##### Migration Guide for PMD 7 + +A detailed documentation of required changes are available in the +[Migration Guide for PMD 7](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_userdocs_migrating_to_pmd7.html). + +##### Apex Jorje Updated + +With the new version of Apex Jorje, the new language constructs like User Mode Database Operations +can be parsed now. PMD should now be able to parse Apex code up to version 59.0 (Winter '23). + +##### Java 21 Support + +This release of PMD brings support for Java 21. There are the following new standard language features, +that are supported now: + +* [JEP 440: Record Patterns](https://openjdk.org/jeps/440) +* [JEP 441: Pattern Matching for switch](https://openjdk.org/jeps/441) + +PMD also supports the following preview language features: + +* [JEP 430: String Templates (Preview)](https://openjdk.org/jeps/430) +* [JEP 443: Unnamed Patterns and Variables (Preview)](https://openjdk.org/jeps/443) +* [JEP 445: Unnamed Classes and Instance Main Methods (Preview)](https://openjdk.org/jeps/445) + +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 `21-preview`: + + export PMD_JAVA_OPTS=--enable-preview + pmd check --use-version java-21-preview ... + +Note: Support for Java 19 preview language features have been removed. The version "19-preview" is no longer available. + +#### Fixed issues + +* miscellaneous + * [#4582](https://github.com/pmd/pmd/issues/4582): \[dist] Download link broken + * [#4691](https://github.com/pmd/pmd/issues/4691): \[CVEs] Critical and High CEVs reported on PMD and PMD dependencies +* core + * [#1204](https://github.com/pmd/pmd/issues/1204): \[core] Allow numeric properties in XML to be within an unbounded range + * [#3919](https://github.com/pmd/pmd/issues/3919): \[core] Merge CPD and PMD language + * [#4204](https://github.com/pmd/pmd/issues/4204): \[core] Provide a CpdAnalysis class as a programmatic entry point into CPD + * [#4301](https://github.com/pmd/pmd/issues/4301): \[core] Remove deprecated property concrete classes + * [#4302](https://github.com/pmd/pmd/issues/4302): \[core] Migrate Property Framework API to Java 8 + * [#4323](https://github.com/pmd/pmd/issues/4323): \[core] Refactor CPD integration + * [#4397](https://github.com/pmd/pmd/pull/4397): \[core] Refactor CPD + * [#4611](https://github.com/pmd/pmd/pull/4611): \[core] Fix loading language properties from env vars + * [#4621](https://github.com/pmd/pmd/issues/4621): \[core] Make `ClasspathClassLoader::getResource` child first +* cli + * [#4423](https://github.com/pmd/pmd/pull/4423): \[cli] Fix NPE when only `--file-list` is specified +* doc + * [#4294](https://github.com/pmd/pmd/issues/4294): \[doc] Migration Guide for upgrading PMD 6 ➑️ 7 + * [#4303](https://github.com/pmd/pmd/issues/4303): \[doc] Document new property framework + * [#4521](https://github.com/pmd/pmd/issues/4521): \[doc] Website is not mobile friendly +* apex + * [#3973](https://github.com/pmd/pmd/issues/3973): \[apex] Update parser to support new 'as user' keywords (User Mode for Database Operations) + * [#4453](https://github.com/pmd/pmd/issues/4453): \[apex] \[7.0-rc1] Exception while initializing Apexlink (Index 34812 out of bounds for length 34812) +* apex-design + * [#4596](https://github.com/pmd/pmd/issues/4596): \[apex] ExcessivePublicCount ignores properties +* apex-security + * [#4646](https://github.com/pmd/pmd/issues/4646): \[apex] ApexSOQLInjection does not recognise SObjectType or SObjectField as safe variable types +* java + * [#4401](https://github.com/pmd/pmd/issues/4401): \[java] PMD 7 fails to build under Java 19 + * [#4583](https://github.com/pmd/pmd/issues/4583): \[java] Support JDK 21 (LTS) +* java-bestpractices + * [#4634](https://github.com/pmd/pmd/issues/4634): \[java] JUnit4TestShouldUseTestAnnotation false positive with TestNG + +#### API Changes + +##### pmd-java + +* Support for Java 19 preview language features have been removed. The version "19-preview" is no longer available. + +##### Rule properties + +* The old deprecated classes like `IntProperty` and `StringProperty` have been removed. Please use + PropertyFactory to create properties. +* All properties which accept multiple values now use a comma (`,`) as a delimiter. The previous default was a + pipe character (`|`). The delimiter is not configurable anymore. If needed, the comma can be escaped + with a backslash. +* The `min` and `max` attributes in property definitions in the XML are now optional and can appear separately + or be omitted. + +##### New Programmatic API for CPD + +See [Detailed Release Notes for PMD 7](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_release_notes_pmd7.html#new-programmatic-api-for-cpd) +and [PR #4397](https://github.com/pmd/pmd/pull/4397) for details. + +##### Removed classes and methods + +The following previously deprecated classes have been removed: + +* pmd-core + * `net.sourceforge.pmd.cpd.AbstractTokenizer` ➑️ use AnyTokenizer instead + * `net.sourceforge.pmd.cpd.CPD` ➑️ use PmdCli from `pmd-cli` module for CLI support or use + CpdAnalysis for programmatic API + * `net.sourceforge.pmd.cpd.GridBagHelper` (now package private) + * `net.sourceforge.pmd.cpd.TokenEntry.State` + * `net.sourceforge.pmd.lang.document.CpdCompat` + * `net.sourceforge.pmd.properties.BooleanMultiProperty` + * `net.sourceforge.pmd.properties.BooleanProperty` + * `net.sourceforge.pmd.properties.CharacterMultiProperty` + * `net.sourceforge.pmd.properties.CharacterProperty` + * `net.sourceforge.pmd.properties.DoubleMultiProperty` + * `net.sourceforge.pmd.properties.DoubleProperty` + * `net.sourceforge.pmd.properties.EnumeratedMultiProperty` + * `net.sourceforge.pmd.properties.EnumeratedProperty` + * `net.sourceforge.pmd.properties.EnumeratedPropertyDescriptor` + * `net.sourceforge.pmd.properties.FileProperty` (note: without replacement) + * `net.sourceforge.pmd.properties.FloatMultiProperty` + * `net.sourceforge.pmd.properties.FloatProperty` + * `net.sourceforge.pmd.properties.IntegerMultiProperty` + * `net.sourceforge.pmd.properties.IntegerProperty` + * `net.sourceforge.pmd.properties.LongMultiProperty` + * `net.sourceforge.pmd.properties.LongProperty` + * `net.sourceforge.pmd.properties.MultiValuePropertyDescriptor` + * `net.sourceforge.pmd.properties.NumericPropertyDescriptor` + * `net.sourceforge.pmd.properties.PropertyDescriptorField` + * `net.sourceforge.pmd.properties.RegexProperty` + * `net.sourceforge.pmd.properties.SingleValuePropertyDescriptor` + * `net.sourceforge.pmd.properties.StringMultiProperty` + * `net.sourceforge.pmd.properties.StringProperty` + * `net.sourceforge.pmd.properties.ValueParser` + * `net.sourceforge.pmd.properties.ValueParserConstants` + * `net.sourceforge.pmd.properties.builders.MultiNumericPropertyBuilder` + * `net.sourceforge.pmd.properties.builders.MultiPackagedPropertyBuilder` + * `net.sourceforge.pmd.properties.builders.MultiValuePropertyBuilder` + * `net.sourceforge.pmd.properties.builders.PropertyDescriptorBuilder` + * `net.sourceforge.pmd.properties.builders.PropertyDescriptorBuilderConversionWrapper` + * `net.sourceforge.pmd.properties.builders.PropertyDescriptorExternalBuilder` + * `net.sourceforge.pmd.properties.builders.SingleNumericPropertyBuilder` + * `net.sourceforge.pmd.properties.builders.SinglePackagedPropertyBuilder` + * `net.sourceforge.pmd.properties.builders.SingleValuePropertyBuilder` + * `net.sourceforge.pmd.properties.modules.EnumeratedPropertyModule` + * `net.sourceforge.pmd.properties.modules.NumericPropertyModule` + +The following previously deprecated methods have been removed: + +* pmd-core + * `net.sourceforge.pmd.properties.PropertyBuilder.GenericCollectionPropertyBuilder#delim(char)` + * `net.sourceforge.pmd.properties.PropertySource#setProperty(...)` + * `net.sourceforge.pmd.properties.PropertyTypeId#factoryFor(...)` + * `net.sourceforge.pmd.properties.PropertyTypeId#typeIdFor(...)` + * `net.sourceforge.pmd.properties.PropertyDescriptor`: removed methods errorFor, type, isMultiValue, + uiOrder, compareTo, isDefinedExternally, valueFrom, asDelimitedString + +The following methods have been removed: + +* pmd-core + * CPDConfiguration + * `#sourceCodeFor(File)`, `#postConstruct()`, `#tokenizer()`, `#filenameFilter()` removed + * Mark + * `#getSourceSlice()`, `#setLineCount(int)`, `#getLineCount()`, `#setSourceCode(SourceCode)` removed + * `#getBeginColumn()`, `#getBeginLine()`, `#getEndLine()`, `#getEndColumn()` removed + ➑️ use getLocation instead + * Match + * `#LABEL_COMPARATOR` removed + * `#setMarkSet(...)`, `#setLabel(...)`, `#getLabel()`, `#addTokenEntry(...)` removed + * `#getSourceCodeSlice()` removed + ➑️ use CPDReport#getSourceCodeSlice instead + * TokenEntry + * `#getEOF()`, `#clearImages()`, `#getIdentifier()`, `#getIndex()`, `#setHashCode(int)` removed + * `#EOF` removed ➑️ use isEof instead + * Parser.ParserTask + * `#getFileDisplayName()` removed ➑️ use getFileId instead + (`getFileId().getAbsolutePath()`) + +The following classes have been removed: + +* pmd-core + * `net.sourceforge.pmd.cpd.AbstractLanguage` + * `net.sourceforge.pmd.cpd.AnyLanguage` + * `net.sourceforge.pmd.cpd.Language` + * `net.sourceforge.pmd.cpd.LanguageFactory` + * `net.sourceforge.pmd.cpd.MatchAlgorithm` (now package private) + * `net.sourceforge.pmd.cpd.MatchCollector` (now package private) + * `net.sourceforge.pmd.cpd.SourceCode` (and all inner classes like `FileCodeLoader`, ...) + * `net.sourceforge.pmd.cpd.token.TokenFilter` + +##### Moved packages + +* pmd-core + * NumericConstraints (old package: `net.sourceforge.pmd.properties.constraints.NumericConstraints`) + * PropertyConstraint (old package: `net.sourceforge.pmd.properties.constraints.PropertyConstraint`) + * not experimental anymore + * ReportException (old package: `net.sourceforge.pmd.cpd`, moved to module `pmd-ant`) + * it is now a RuntimeException + * CPDReportRenderer (old package: `net.sourceforge.pmd.cpd.renderer`) + * AntlrTokenFilter (old package: `net.sourceforge.pmd.cpd.token`) + * BaseTokenFilter (old package: `net.sourceforge.pmd.cpd.token.internal`) + * JavaCCTokenFilter (old package: `net.sourceforge.pmd.cpd.token`) + +##### Changed types and other changes + +* pmd-core + * PropertyDescriptor is now a class (was an interface) + and it is not comparable anymore. + * AbstractConfiguration#setSourceEncoding + * previously this method took a simple String for the encoding. + * PmdConfiguration and CPDConfiguration + * many getters and setters have been moved to the parent class AbstractConfiguration + * CPDListener#addedFile + * no `File` parameter anymore + * CPDReport#getNumberOfTokensPerFile returns a `Map` of `FileId,Integer` instead of `String` + * CPDReport#filterMatches now takes a `java.util.function.Predicate` + as parameter + * Tokenizer + * constants are now PropertyDescriptor instead of `String`, + to be used as language properties + * tokenize + changed parameters. Now takes a TextDocument and a TokenFactory + (instead of `SourceCode` and `Tokens`) + * Language + * method `#createProcessor(LanguagePropertyBundle)` moved to PmdCapableLanguage + * StringUtil#linesWithTrimIndent now takes a `Chars` + instead of a `String`. +* All language modules (like pmd-apex, pmd-cpp, ...) + * consistent package naming: `net.sourceforge.pmd.lang..cpd` + * adapted to use CpdCapableLanguage + * consistent static method `#getInstance()` + * removed constants like `ID`, `TERSE_NAME` or `NAME`. Use `getInstance().getName()` etc. instead + +##### Internal APIs + +* Tokens +* PropertyTypeId + +##### Deprecated API + +* Language#getTerseName ➑️ use getId instead + +* The method ASTPattern#getParenthesisDepth has been deprecated and will be removed. + It was introduced for supporting parenthesized patterns, but that was removed with Java 21. It is only used when + parsing code as java-19-preview. + +##### Experimental APIs + +* To support the Java preview language features "String Templates" and "Unnamed Patterns and Variables", the following + AST nodes have been introduced as experimental: + * ASTTemplateExpression + * ASTTemplate + * ASTTemplateFragment + * ASTUnnamedPattern +* The AST nodes for supporting "Record Patterns" and "Pattern Matching for switch" are not experimental anymore: + * ASTRecordPattern + * ASTPatternList (Note: it was renamed from `ASTComponentPatternList`) + * ast (Note: it was renamed from `ASTSwitchGuard`) + + +#### External Contributions +* [#4528](https://github.com/pmd/pmd/pull/4528): \[apex] Update to apexlink - [Kevin Jones](https://github.com/nawforce) (@nawforce) +* [#4637](https://github.com/pmd/pmd/pull/4637): \[java] fix #4634 - JUnit4TestShouldUseTestAnnotation false positive with TestNG - [Krystian Dabrowski](https://github.com/krdabrowski) (@krdabrowski) +* [#4649](https://github.com/pmd/pmd/pull/4649): \[apex] Add SObjectType and SObjectField to list of injectable SOQL variable types - [Richard Corfield](https://github.com/rcorfieldffdc) (@rcorfieldffdc) +* [#4651](https://github.com/pmd/pmd/pull/4651): \[doc] Add "Tencent Cloud Code Analysis" in Tools / Integrations - [yale](https://github.com/cyw3) (@cyw3) +* [#4664](https://github.com/pmd/pmd/pull/4664): \[cli] CPD: Fix NPE when only `--file-list` is specified - [Wener](https://github.com/wener-tiobe) (@wener-tiobe) +* [#4665](https://github.com/pmd/pmd/pull/4665): \[java] Doc: Fix references AutoClosable -> AutoCloseable - [Andrey Bozhko](https://github.com/AndreyBozhko) (@AndreyBozhko) + +### πŸš€ Major Features and Enhancements + +#### New official logo + +The new official logo of PMD: + +![New PMD Logo](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/images/logo/pmd-logo-300px.png) + +#### Revamped Java module + +* Java grammar substantially refactored - more correct regarding the Java Language Specification (JLS) +* Built-in rules have been upgraded for the changed AST +* Rewritten type resolution framework and symbol table correctly implements the JLS +* AST exposes more semantic information (method calls, field accesses) + +For more information, see the [Detailed Release Notes for PMD 7](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_release_notes_pmd7.html#revamped-java). + +Contributors: [ClΓ©ment Fournier](https://github.com/oowekyala) (@oowekyala), +[Andreas Dangel](https://github.com/adangel) (@adangel), +[Juan MartΓ­n Sotuyo Dodero](https://github.com/jsotuyod) (@jsotuyod) + +#### Revamped Command Line Interface + +* unified and consistent Command Line Interface for both Linux/Unix and Windows across our different utilities +* single script `pmd` (`pmd.bat` for Windows) to launch the different utilities: + * `pmd check` to run PMD rules and analyze a project + * `pmd cpd` to run CPD (copy paste detector) + * `pmd designer` to run the PMD Rule Designer +* progress bar support for `pmd check` +* shell completion + +![Demo](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/images/userdocs/pmd-demo.gif) + +For more information, see the [Detailed Release Notes for PMD 7](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_release_notes_pmd7.html). + +Contributors: [Juan MartΓ­n Sotuyo Dodero](https://github.com/jsotuyod) (@jsotuyod) + +#### Full Antlr support + +* [Antlr](https://www.antlr.org/) based grammars can now be used to build full-fledged PMD rules. +* Previously, Antlr grammar could only be used for CPD +* New supported languages: Swift and Kotlin + +For more information, see the [Detailed Release Notes for PMD 7](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_release_notes_pmd7.html). + +Contributors: [Lucas Soncini](https://github.com/lsoncini) (@lsoncini), +[MatΓ­as Fraga](https://github.com/matifraga) (@matifraga), +[TomΓ‘s De Lucca](https://github.com/tomidelucca) (@tomidelucca) + +#### Updated PMD Designer + +This PMD release ships a new version of the pmd-designer. +For the changes, see [PMD Designer Changelog](https://github.com/pmd/pmd-designer/releases/tag/7.0.0-rc1). + +#### New CPD report format cpdhtml-v2.xslt + +Thanks to @mohan-chinnappan-n a new CPD report format has been added which features a data table. +It uses an XSLT stylesheet to convert CPD's XML format into HTML. + +See [the example report](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/report-examples/cpdhtml-v2.html). + +### πŸŽ‰ Language Related Changes + +Note that this is just a concise listing of the highlight. +For more information on the languages, see the [Detailed Release Notes for PMD 7](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_release_notes_pmd7.html). + +#### New: Swift support + +* use PMD to analyze Swift code with PMD rules +* initially 4 built-in rules + +Contributors: [Lucas Soncini](https://github.com/lsoncini) (@lsoncini), +[MatΓ­as Fraga](https://github.com/matifraga) (@matifraga), +[TomΓ‘s De Lucca](https://github.com/tomidelucca) (@tomidelucca) + +#### New: Kotlin support (experimental) + +* use PMD to analyze Kotlin code with PMD rules +* Support for Kotlin 1.8 grammar +* initially 2 built-in rules + +#### New: CPD support for TypeScript + +Thanks to a contribution, CPD now supports the TypeScript language. It is shipped +with the rest of the JavaScript support in the module `pmd-javascript`. + +Contributors: [Paul Guyot](https://github.com/pguyot) (@pguyot) + +#### New: CPD support for Julia + +Thanks to a contribution, CPD now supports the Julia language. It is shipped +in the new module `pmd-julia`. + +Contributors: [Wener](https://github.com/wener-tiobe) (@wener-tiobe) + +#### New: CPD support for Coco + +Thanks to a contribution, CPD now supports Coco, a modern programming language +designed specifically for building event-driven software. It is shipped in the new +module `pmd-coco`. + +Contributors: [Wener](https://github.com/wener-tiobe) (@wener-tiobe) + +#### New: Java 21 Support + +This release of PMD brings support for Java 21. There are the following new standard language features, +that are supported now: + +* [JEP 440: Record Patterns](https://openjdk.org/jeps/440) +* [JEP 441: Pattern Matching for switch](https://openjdk.org/jeps/441) + +PMD also supports the following preview language features: + +* [JEP 430: String Templates (Preview)](https://openjdk.org/jeps/430) +* [JEP 443: Unnamed Patterns and Variables (Preview)](https://openjdk.org/jeps/443) +* [JEP 445: Unnamed Classes and Instance Main Methods (Preview)](https://openjdk.org/jeps/445) + +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 `21-preview`: + + export PMD_JAVA_OPTS=--enable-preview + pmd check --use-version java-21-preview ... + +Note: Support for Java 19 preview language features have been removed. The version "19-preview" is no longer available. + +#### Changed: JavaScript support + +* latest version supports ES6 and also some new constructs (see [Rhino](https://github.com/mozilla/rhino)]) +* comments are retained + +#### Changed: Language versions + +* more predefined language versions for each supported language +* can be used to limit rule execution for specific versions only with `minimumLanguageVersion` and + `maximumLanguageVersion` attributes. + +#### Changed: CPP can now ignore identifiers in sequences (CPD) + +* new command line option for CPD: `--ignore-sequences`. +* This option is used for CPP only: with the already existing option `--ignore-literal-sequences`, only + literals were ignored. The new option additional ignores identifiers as well in sequences. +* See [PR #4470](https://github.com/pmd/pmd/pull/4470) for details. + +#### Changed: Apex Jorje Updated + +With the new version of Apex Jorje, the new language constructs like User Mode Database Operations +can be parsed now. PMD should now be able to parse Apex code up to version 59.0 (Winter '23). + +#### Changed: Rule properties + +* The old deprecated classes like `IntProperty` and `StringProperty` have been removed. Please use + PropertyFactory to create properties. +* All properties which accept multiple values now use a comma (`,`) as a delimiter. The previous default was a + pipe character (`|`). The delimiter is not configurable anymore. If needed, the comma can be escaped + with a backslash. +* The `min` and `max` attributes in property definitions in the XML are now optional and can appear separately + or be omitted. + +### 🌟 New and changed rules + +#### New Rules + +**Apex** +* [`UnusedMethod`](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_apex_design.html#unusedmethod) finds unused methods in your code. + +**Java** +* [`UnnecessaryBoxing`](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_codestyle.html#unnecessaryboxing) reports boxing and unboxing conversions that may be made implicit. + +**Kotlin** +* [`FunctionNameTooShort`](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_kotlin_bestpractices.html#functionnametooshort) +* [`OverrideBothEqualsAndHashcode`](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_kotlin_errorprone.html#overridebothequalsandhashcode) + +**Swift** +* [`ProhibitedInterfaceBuilder`](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_swift_bestpractices.html#prohibitedinterfacebuilder) +* [`UnavailableFunction`](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_swift_bestpractices.html#unavailablefunction) +* [`ForceCast`](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_swift_errorprone.html#forcecast) +* [`ForceTry`](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_swift_errorprone.html#forcetry) + +#### Changed Rules + +**General changes** + +* All statistical rules (like ExcessiveClassLength, ExcessiveParameterList) have been simplified and unified. + The properties `topscore` and `sigma` have been removed. The property `minimum` is still there, however the type is not + a decimal number anymore but has been changed to an integer. This affects rules in the languages Apex, Java, PLSQL + and Velocity Template Language (vm): + * Apex: [`ExcessiveClassLength`](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_apex_design.html#excessiveclasslength), [`ExcessiveParameterList`](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_apex_design.html#excessiveparameterlist), + [`ExcessivePublicCount`](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_apex_design.html#excessivepubliccount), [`NcssConstructorCount`](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_apex_design.html#ncssconstructorcount), + [`NcssMethodCount`](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_apex_design.html#ncssmethodcount), [`NcssTypeCount`](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_apex_design.html#ncsstypecount) + * Java: [`ExcessiveImports`](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_design.html#excessiveimports), [`ExcessiveParameterList`](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_design.html#excessiveparameterlist), + [`ExcessivePublicCount`](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_design.html#excessivepubliccount), [`SwitchDensity`](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_design.html#switchdensity) + * PLSQL: [`ExcessiveMethodLength`](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_plsql_design.html#excessivemethodlength), [`ExcessiveObjectLength`](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_plsql_design.html#excessiveobjectlength), + [`ExcessivePackageBodyLength`](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_plsql_design.html#excessivepackagebodylength), [`ExcessivePackageSpecificationLength`](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_plsql_design.html#excessivepackagespecificationlength), + [`ExcessiveParameterList`](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_plsql_design.html#excessiveparameterlist), [`ExcessiveTypeLength`](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_plsql_design.html#excessivetypelength), + [`NcssMethodCount`](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_plsql_design.html#ncssmethodcount), [`NcssObjectCount`](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_plsql_design.html#ncssobjectcount), + [`NPathComplexity`](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_plsql_design.html#npathcomplexity) + * VM: [`ExcessiveTemplateLength`](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_vm_design.html#excessivetemplatelength) + +* The general property `violationSuppressXPath` which is available for all rules to + [suppress warnings](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_userdocs_suppressing_warnings.html) now uses XPath version 3.1 by default. + This version of the XPath language is mostly identical to XPath 2.0. In PMD 6, XPath 1.0 has been used. + If you upgrade from PMD 6, you need to verify your `violationSuppressXPath` properties. + +**Apex General changes** + +* The properties `cc_categories`, `cc_remediation_points_multiplier`, `cc_block_highlighting` have been removed + 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. + +**Java General changes** + +* Violations reported on methods or classes previously reported the line range of the entire method + or class. With PMD 7.0.0, the reported location is now just the identifier of the method or class. + This affects various rules, e.g. [`CognitiveComplexity`](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_design.html#cognitivecomplexity). + + The report location is controlled by the overrides of the method getReportLocation + in different node types. + + See [issue #4439](https://github.com/pmd/pmd/issues/4439) and [issue #730](https://github.com/pmd/pmd/issues/730) + for more details. + +**Java Best Practices** + +* [`ArrayIsStoredDirectly`](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_bestpractices.html#arrayisstoreddirectly): Violations are now reported on the assignment and not + anymore on the formal parameter. The reported line numbers will probably move. +* [`AvoidReassigningLoopVariables`](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_bestpractices.html#avoidreassigningloopvariables): This rule might not report anymore all + reassignments of the control variable in for-loops when the property `forReassign` is set to `skip`. + See [issue #4500](https://github.com/pmd/pmd/issues/4500) for more details. +* [`LooseCoupling`](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_bestpractices.html#loosecoupling): The rule has a new property to allow some types to be coupled + to (`allowedTypes`). +* [`UnusedLocalVariable`](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_bestpractices.html#unusedlocalvariable): This rule has some important false-negatives fixed + and finds many more cases now. For details see issues [#2130](https://github.com/pmd/pmd/issues/2130), + [#4516](https://github.com/pmd/pmd/issues/4516), and [#4517](https://github.com/pmd/pmd/issues/4517). + +**Java Codestyle** + +* [`MethodNamingConventions`](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_codestyle.html#methodnamingconventions): The property `checkNativeMethods` has been removed. The + property was deprecated since PMD 6.3.0. Use the property `nativePattern` to control whether native methods + should be considered or not. +* [`ShortVariable`](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_codestyle.html#shortvariable): This rule now also reports short enum constant names. +* [`UseDiamondOperator`](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_codestyle.html#usediamondoperator): The property `java7Compatibility` has been removed. The rule now + handles Java 7 properly without a property. +* [`UnnecessaryFullyQualifiedName`](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_codestyle.html#unnecessaryfullyqualifiedname): The rule has two new properties, + to selectively disable reporting on static field and method qualifiers. The rule also has been improved + to be more precise. +* [`UselessParentheses`](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_codestyle.html#uselessparentheses): The rule has two new properties which control how strict + the rule should be applied. With `ignoreClarifying` (default: true) parentheses that are strictly speaking + 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. + +**Java Design** + +* [`CyclomaticComplexity`](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_design.html#cyclomaticcomplexity): The property `reportLevel` has been removed. The property was + deprecated since PMD 6.0.0. The report level can now be configured separated for classes and methods using + `classReportLevel` and `methodReportLevel` instead. +* [`ImmutableField`](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_design.html#immutablefield): The property `ignoredAnnotations` has been removed. The property was + deprecated since PMD 6.52.0. +* [`LawOfDemeter`](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_design.html#lawofdemeter): The rule has a new property `trustRadius`. This defines the maximum degree + of trusted data. The default of 1 is the most restrictive. +* [`NPathComplexity`](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_design.html#npathcomplexity): The property `minimum` has been removed. It was deprecated since PMD 6.0.0. + Use the property `reportLevel` instead. +* [`SingularField`](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_design.html#singularfield): The properties `checkInnerClasses` and `disallowNotAssignment` have been removed. + The rule is now more precise and will check these cases properly. +* [`UseUtilityClass`](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_design.html#useutilityclass): The property `ignoredAnnotations` has been removed. + +**Java Documentation** + +* [`CommentContent`](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_documentation.html#commentcontent): The properties `caseSensitive` and `disallowedTerms` are removed. The + new property `forbiddenRegex` can be used now to define the disallowed terms with a single regular + expression. +* [`CommentRequired`](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_documentation.html#commentrequired): + * Overridden methods are now detected even without the `@Override` + annotation. This is relevant for the property `methodWithOverrideCommentRequirement`. + 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. +* [`CommentSize`](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_documentation.html#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). + +**Java Error Prone** + +* [`AvoidDuplicateLiterals`](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_errorprone.html#avoidduplicateliterals): The property `exceptionfile` has been removed. The property was + deprecated since PMD 6.10.0. Use the property `exceptionList` instead. +* [`DontImportSun`](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_errorprone.html#dontimportsun): `sun.misc.Signal` is not special-cased anymore. +* [`EmptyCatchBlock`](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_errorprone.html#emptycatchblock): `CloneNotSupportedException` and `InterruptedException` are not + special-cased anymore. Rename the exception parameter to `ignored` to ignore them. +* [`ImplicitSwitchFallThrough`](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_errorprone.html#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. + +#### Removed Rules + +Many rules, that were previously deprecated have been finally removed. +See [Detailed Release Notes for PMD 7](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_release_notes_pmd7.html) for the complete list. + +### 🚨 API + +The API of PMD has been growing over the years and needed some cleanup. The goal is, to +have a clear separation between a well-defined API and the implementation, which is internal. +This should help us in future development. + +Also, there are some improvement and changes in different areas. For the detailed description +of the changes listed here, see [Detailed Release Notes for PMD 7](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_release_notes_pmd7.html). + +* Miscellaneous smaller changes and cleanups +* XPath 3.1 support for XPath-based rules +* Node stream API for AST traversal +* Metrics framework +* Testing framework +* Language Lifecycle and Language Properties +* Rule Properties +* New Programmatic API for CPD + +### πŸ’₯ Compatibility and migration notes + +A detailed documentation of required changes are available in the +[Migration Guide for PMD 7](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_userdocs_migrating_to_pmd7.html). + +See also [Detailed Release Notes for PMD 7](https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_release_notes_pmd7.html). + +### πŸ› Fixed Issues + +* miscellaneous + * [#881](https://github.com/pmd/pmd/issues/881): \[all] Breaking API changes for 7.0.0 + * [#896](https://github.com/pmd/pmd/issues/896): \[all] Use slf4j + * [#1431](https://github.com/pmd/pmd/pull/1431): \[ui] Remove old GUI applications (designerold, bgastviewer) + * [#1451](https://github.com/pmd/pmd/issues/1451): \[core] RulesetFactoryCompatibility stores the whole ruleset file in memory as a string + * [#2496](https://github.com/pmd/pmd/issues/2496): Update PMD 7 Logo on landing page + * [#2497](https://github.com/pmd/pmd/issues/2497): PMD 7 Logo page + * [#2498](https://github.com/pmd/pmd/issues/2498): Update PMD 7 Logo in documentation + * [#3797](https://github.com/pmd/pmd/issues/3797): \[all] Use JUnit5 + * [#4462](https://github.com/pmd/pmd/issues/4462): Provide Software Bill of Materials (SBOM) + * [#4460](https://github.com/pmd/pmd/pull/4460): Fix assembly-plugin warnings + * [#4582](https://github.com/pmd/pmd/issues/4582): \[dist] Download link broken + * [#4691](https://github.com/pmd/pmd/issues/4691): \[CVEs] Critical and High CEVs reported on PMD and PMD dependencies +* ant + * [#4080](https://github.com/pmd/pmd/issues/4080): \[ant] Split off Ant integration into a new submodule +* core + * [#880](https://github.com/pmd/pmd/issues/880): \[core] Make visitors generic + * [#1204](https://github.com/pmd/pmd/issues/1204): \[core] Allow numeric properties in XML to be within an unbounded range + * [#1622](https://github.com/pmd/pmd/pull/1622): \[core] NodeStream API + * [#1687](https://github.com/pmd/pmd/issues/1687): \[core] Deprecate and Remove XPath 1.0 support + * [#1785](https://github.com/pmd/pmd/issues/1785): \[core] Allow abstract node types to be valid rulechain visits + * [#1825](https://github.com/pmd/pmd/pull/1825): \[core] Support NoAttribute for XPath + * [#2038](https://github.com/pmd/pmd/issues/2038): \[core] Remove DCD + * [#2218](https://github.com/pmd/pmd/issues/2218): \[core] `isFindBoundary` should not be an attribute + * [#2234](https://github.com/pmd/pmd/issues/2234): \[core] Consolidate PMD CLI into a single command + * [#2239](https://github.com/pmd/pmd/issues/2239): \[core] Merging Javacc build scripts + * [#2500](https://github.com/pmd/pmd/issues/2500): \[core] Clarify API for ANTLR based languages + * [#2518](https://github.com/pmd/pmd/issues/2518): \[core] Language properties + * [#2602](https://github.com/pmd/pmd/issues/2602): \[core] Remove ParserOptions + * [#2614](https://github.com/pmd/pmd/pull/2614): \[core] Upgrade Saxon, add XPath 3.1, remove Jaxen + * [#2696](https://github.com/pmd/pmd/pull/2696): \[core] Remove DFA + * [#2821](https://github.com/pmd/pmd/issues/2821): \[core] Rule processing error filenames are missing paths + * [#2873](https://github.com/pmd/pmd/issues/2873): \[core] Utility classes in pmd 7 + * [#2885](https://github.com/pmd/pmd/issues/2885): \[core] Error recovery mode + * [#3203](https://github.com/pmd/pmd/issues/3203): \[core] Replace RuleViolationFactory implementations with ViolationDecorator + * [#3692](https://github.com/pmd/pmd/pull/3692): \[core] Analysis listeners + * [#3782](https://github.com/pmd/pmd/issues/3782): \[core] Language lifecycle + * [#3815](https://github.com/pmd/pmd/issues/3815): \[core] Update Saxon HE to 10.7 + * [#3893](https://github.com/pmd/pmd/pull/3893): \[core] Text documents + * [#3902](https://github.com/pmd/pmd/issues/3902): \[core] Violation decorators + * [#3918](https://github.com/pmd/pmd/issues/3918): \[core] Make LanguageRegistry non static + * [#3919](https://github.com/pmd/pmd/issues/3919): \[core] Merge CPD and PMD language + * [#3922](https://github.com/pmd/pmd/pull/3922): \[core] Better error reporting for the ruleset parser + * [#4035](https://github.com/pmd/pmd/issues/4035): \[core] ConcurrentModificationException in DefaultRuleViolationFactory + * [#4120](https://github.com/pmd/pmd/issues/4120): \[core] Explicitly name all language versions + * [#4204](https://github.com/pmd/pmd/issues/4204): \[core] Provide a CpdAnalysis class as a programmatic entry point into CPD + * [#4301](https://github.com/pmd/pmd/issues/4301): \[core] Remove deprecated property concrete classes + * [#4302](https://github.com/pmd/pmd/issues/4302): \[core] Migrate Property Framework API to Java 8 + * [#4323](https://github.com/pmd/pmd/issues/4323): \[core] Refactor CPD integration + * [#4353](https://github.com/pmd/pmd/pull/4353): \[core] Micro optimizations for Node API + * [#4365](https://github.com/pmd/pmd/pull/4365): \[core] Improve benchmarking + * [#4397](https://github.com/pmd/pmd/pull/4397): \[core] Refactor CPD + * [#4420](https://github.com/pmd/pmd/pull/4420): \[core] Remove PMD.EOL + * [#4425](https://github.com/pmd/pmd/pull/4425): \[core] Replace TextFile::pathId + * [#4454](https://github.com/pmd/pmd/issues/4454): \[core] "Unknown option: '-min'" but is referenced in documentation + * [#4611](https://github.com/pmd/pmd/pull/4611): \[core] Fix loading language properties from env vars + * [#4621](https://github.com/pmd/pmd/issues/4621): \[core] Make `ClasspathClassLoader::getResource` child first +* cli + * [#2234](https://github.com/pmd/pmd/issues/2234): \[core] Consolidate PMD CLI into a single command + * [#3828](https://github.com/pmd/pmd/issues/3828): \[core] Progress reporting + * [#4079](https://github.com/pmd/pmd/issues/4079): \[cli] Split off CLI implementation into a pmd-cli submodule + * [#4423](https://github.com/pmd/pmd/pull/4423): \[cli] Fix NPE when only `--file-list` is specified + * [#4482](https://github.com/pmd/pmd/issues/4482): \[cli] pmd.bat can only be executed once + * [#4484](https://github.com/pmd/pmd/issues/4484): \[cli] ast-dump with no properties produce an NPE +* doc + * [#2501](https://github.com/pmd/pmd/issues/2501): \[doc] Verify ANTLR Documentation + * [#4294](https://github.com/pmd/pmd/issues/4294): \[doc] Migration Guide for upgrading PMD 6 ➑️ 7 + * [#4303](https://github.com/pmd/pmd/issues/4303): \[doc] Document new property framework + * [#4438](https://github.com/pmd/pmd/issues/4438): \[doc] Documentation links in VS Code are outdated + * [#4521](https://github.com/pmd/pmd/issues/4521): \[doc] Website is not mobile friendly +* 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 + +Language specific fixes: + +* apex + * [#1937](https://github.com/pmd/pmd/issues/1937): \[apex] Apex should only have a single RootNode + * [#1648](https://github.com/pmd/pmd/issues/1648): \[apex,vf] Remove CodeClimate dependency + * [#1750](https://github.com/pmd/pmd/pull/1750): \[apex] Remove apex statistical rules + * [#2836](https://github.com/pmd/pmd/pull/2836): \[apex] Remove Apex ProjectMirror + * [#3973](https://github.com/pmd/pmd/issues/3973): \[apex] Update parser to support new 'as user' keywords (User Mode for Database Operations) + * [#4427](https://github.com/pmd/pmd/issues/4427): \[apex] ApexBadCrypto test failing to detect inline code + * [#4453](https://github.com/pmd/pmd/issues/4453): \[apex] \[7.0-rc1] Exception while initializing Apexlink (Index 34812 out of bounds for length 34812) +* apex-design + * [#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-security + * [#4646](https://github.com/pmd/pmd/issues/4646): \[apex] ApexSOQLInjection does not recognise SObjectType or SObjectField as safe variable types +* java + * [#520](https://github.com/pmd/pmd/issues/520): \[java] Allow `@SuppressWarnings` with constants instead of literals + * [#864](https://github.com/pmd/pmd/issues/864): \[java] Similar/duplicated implementations for determining FQCN + * [#905](https://github.com/pmd/pmd/issues/905): \[java] Add new node for anonymous class declaration + * [#910](https://github.com/pmd/pmd/issues/910): \[java] AST inconsistency between primitive and reference type arrays + * [#997](https://github.com/pmd/pmd/issues/997): \[java] Java8 parsing corner case with annotated array types + * [#998](https://github.com/pmd/pmd/issues/998): \[java] AST inconsistencies around FormalParameter + * [#1019](https://github.com/pmd/pmd/issues/1019): \[java] Breaking Java Grammar changes for PMD 7.0.0 + * [#1124](https://github.com/pmd/pmd/issues/1124): \[java] ImmutableList implementation in the qname codebase + * [#1128](https://github.com/pmd/pmd/issues/1128): \[java] Improve ASTLocalVariableDeclaration + * [#1150](https://github.com/pmd/pmd/issues/1150): \[java] ClassOrInterfaceType AST improvements + * [#1207](https://github.com/pmd/pmd/issues/1207): \[java] Resolve explicit types using FQCNs, without hitting the classloader + * [#1367](https://github.com/pmd/pmd/issues/1367): \[java] Parsing error on annotated inner class + * [#1661](https://github.com/pmd/pmd/issues/1661): \[java] About operator nodes + * [#2366](https://github.com/pmd/pmd/pull/2366): \[java] Remove qualified names + * [#2819](https://github.com/pmd/pmd/issues/2819): \[java] GLB bugs in pmd 7 + * [#3642](https://github.com/pmd/pmd/issues/3642): \[java] Parse error on rare extra dimensions on method return type on annotation methods + * [#3763](https://github.com/pmd/pmd/issues/3763): \[java] Ambiguous reference error in valid code + * [#3749](https://github.com/pmd/pmd/issues/3749): \[java] Improve `isOverridden` in ASTMethodDeclaration + * [#3750](https://github.com/pmd/pmd/issues/3750): \[java] Make symbol table support instanceof pattern bindings + * [#3752](https://github.com/pmd/pmd/issues/3752): \[java] Expose annotations in symbol API + * [#4237](https://github.com/pmd/pmd/pull/4237): \[java] Cleanup handling of Java comments + * [#4317](https://github.com/pmd/pmd/issues/4317): \[java] Some AST nodes should not be TypeNodes + * [#4359](https://github.com/pmd/pmd/issues/4359): \[java] Type resolution fails with NPE when the scope is not a type declaration + * [#4367](https://github.com/pmd/pmd/issues/4367): \[java] Move testrule TypeResTest into internal + * [#4383](https://github.com/pmd/pmd/issues/4383): \[java] IllegalStateException: Object is not an array type! + * [#4401](https://github.com/pmd/pmd/issues/4401): \[java] PMD 7 fails to build under Java 19 + * [#4405](https://github.com/pmd/pmd/issues/4405): \[java] Processing error with ArrayIndexOutOfBoundsException + * [#4583](https://github.com/pmd/pmd/issues/4583): \[java] Support JDK 21 (LTS) +* 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 + * [#770](https://github.com/pmd/pmd/issues/770): \[java] UnusedPrivateMethod yields false positive for counter-variant arguments + * [#807](https://github.com/pmd/pmd/issues/807): \[java] AccessorMethodGeneration false positive with overloads + * [#833](https://github.com/pmd/pmd/issues/833): \[java] ForLoopCanBeForeach should consider iterating on this + * [#1189](https://github.com/pmd/pmd/issues/1189): \[java] UnusedPrivateMethod false positive from inner class via external class + * [#1205](https://github.com/pmd/pmd/issues/1205): \[java] Improve ConstantsInInterface message to mention alternatives + * [#1212](https://github.com/pmd/pmd/issues/1212): \[java] Don't raise JUnitTestContainsTooManyAsserts on JUnit 5's assertAll + * [#1422](https://github.com/pmd/pmd/issues/1422): \[java] JUnitTestsShouldIncludeAssert false positive with inherited @Rule field + * [#1455](https://github.com/pmd/pmd/issues/1455): \[java] JUnitTestsShouldIncludeAssert: False positives for assert methods named "check" and "verify" + * [#1563](https://github.com/pmd/pmd/issues/1563): \[java] ForLoopCanBeForeach false positive with method call using index variable + * [#1565](https://github.com/pmd/pmd/issues/1565): \[java] JUnitAssertionsShouldIncludeMessage false positive with AssertJ + * [#1747](https://github.com/pmd/pmd/issues/1747): \[java] PreserveStackTrace false-positive + * [#1969](https://github.com/pmd/pmd/issues/1969): \[java] MissingOverride false-positive triggered by package-private method overwritten in another package by extending class + * [#1998](https://github.com/pmd/pmd/issues/1998): \[java] AccessorClassGeneration false-negative: subclass calls private constructor + * [#2130](https://github.com/pmd/pmd/issues/2130): \[java] UnusedLocalVariable: false-negative with array + * [#2147](https://github.com/pmd/pmd/issues/2147): \[java] JUnitTestsShouldIncludeAssert - false positives with lambdas and static methods + * [#2464](https://github.com/pmd/pmd/issues/2464): \[java] LooseCoupling must ignore class literals: ArrayList.class + * [#2542](https://github.com/pmd/pmd/issues/2542): \[java] UseCollectionIsEmpty can not detect the case `foo.bar().size()` + * [#2650](https://github.com/pmd/pmd/issues/2650): \[java] UseTryWithResources false positive when AutoCloseable helper used + * [#2796](https://github.com/pmd/pmd/issues/2796): \[java] UnusedAssignment false positive with call chains + * [#2797](https://github.com/pmd/pmd/issues/2797): \[java] MissingOverride long-standing issues + * [#2806](https://github.com/pmd/pmd/issues/2806): \[java] SwitchStmtsShouldHaveDefault false-positive with Java 14 switch non-fallthrough branches + * [#2822](https://github.com/pmd/pmd/issues/2822): \[java] LooseCoupling rule: Extend to cover user defined implementations and interfaces + * [#2843](https://github.com/pmd/pmd/pull/2843): \[java] Fix UnusedAssignment FP with field accesses + * [#2882](https://github.com/pmd/pmd/issues/2882): \[java] UseTryWithResources - false negative for explicit close + * [#2883](https://github.com/pmd/pmd/issues/2883): \[java] JUnitAssertionsShouldIncludeMessage false positive with method call + * [#2890](https://github.com/pmd/pmd/issues/2890): \[java] UnusedPrivateMethod false positive with generics + * [#2946](https://github.com/pmd/pmd/issues/2946): \[java] SwitchStmtsShouldHaveDefault false positive on enum inside enums + * [#3672](https://github.com/pmd/pmd/pull/3672): \[java] LooseCoupling - fix false positive with generics + * [#3675](https://github.com/pmd/pmd/pull/3675): \[java] MissingOverride - fix false positive with mixing type vars + * [#3858](https://github.com/pmd/pmd/issues/3858): \[java] UseCollectionIsEmpty should infer local variable type from method invocation + * [#4433](https://github.com/pmd/pmd/issues/4433): \[java] \[7.0-rc1] ReplaceHashtableWithMap on java.util.Properties + * [#4492](https://github.com/pmd/pmd/issues/4492): \[java] GuardLogStatement gives false positive when argument is a Java method reference + * [#4503](https://github.com/pmd/pmd/issues/4503): \[java] JUnitTestsShouldIncludeAssert: false negative with TestNG + * [#4516](https://github.com/pmd/pmd/issues/4516): \[java] UnusedLocalVariable: false-negative with try-with-resources + * [#4517](https://github.com/pmd/pmd/issues/4517): \[java] UnusedLocalVariable: false-negative with compound assignments + * [#4518](https://github.com/pmd/pmd/issues/4518): \[java] UnusedLocalVariable: false-positive with multiple for-loop indices + * [#4634](https://github.com/pmd/pmd/issues/4634): \[java] JUnit4TestShouldUseTestAnnotation false positive with TestNG +* java-codestyle + * [#1208](https://github.com/pmd/pmd/issues/1208): \[java] PrematureDeclaration rule false-positive on variable declared to measure time + * [#1429](https://github.com/pmd/pmd/issues/1429): \[java] PrematureDeclaration as result of method call (false positive) + * [#1480](https://github.com/pmd/pmd/issues/1480): \[java] IdenticalCatchBranches false positive with return expressions + * [#1673](https://github.com/pmd/pmd/issues/1673): \[java] UselessParentheses false positive with conditional operator + * [#1790](https://github.com/pmd/pmd/issues/1790): \[java] UnnecessaryFullyQualifiedName false positive with enum constant + * [#1918](https://github.com/pmd/pmd/issues/1918): \[java] UselessParentheses false positive with boolean operators + * [#2134](https://github.com/pmd/pmd/issues/2134): \[java] PreserveStackTrace not handling `Throwable.addSuppressed(...)` + * [#2299](https://github.com/pmd/pmd/issues/2299): \[java] UnnecessaryFullyQualifiedName false positive with similar package name + * [#2391](https://github.com/pmd/pmd/issues/2391): \[java] UseDiamondOperator FP when expected type and constructed type have a different parameterization + * [#2528](https://github.com/pmd/pmd/issues/2528): \[java] MethodNamingConventions - JUnit 5 method naming not support ParameterizedTest + * [#2739](https://github.com/pmd/pmd/issues/2739): \[java] UselessParentheses false positive for string concatenation + * [#2748](https://github.com/pmd/pmd/issues/2748): \[java] UnnecessaryCast false positive with unchecked cast + * [#2973](https://github.com/pmd/pmd/issues/2973): \[java] New rule: UnnecessaryBoxing + * [#3195](https://github.com/pmd/pmd/pull/3195): \[java] Improve rule UnnecessaryReturn to detect more cases + * [#3218](https://github.com/pmd/pmd/pull/3218): \[java] Generalize UnnecessaryCast to flag all unnecessary casts + * [#3221](https://github.com/pmd/pmd/issues/3221): \[java] PrematureDeclaration false positive for unused variables + * [#3238](https://github.com/pmd/pmd/issues/3238): \[java] Improve ExprContext, fix FNs of UnnecessaryCast + * [#3500](https://github.com/pmd/pmd/pull/3500): \[java] UnnecessaryBoxing - check for Integer.valueOf(String) calls + * [#4268](https://github.com/pmd/pmd/issues/4268): \[java] CommentDefaultAccessModifier: false positive with TestNG annotations + * [#4273](https://github.com/pmd/pmd/issues/4273): \[java] CommentDefaultAccessModifier ignoredAnnotations should include "org.junit.jupiter.api.extension.RegisterExtension" by default + * [#4357](https://github.com/pmd/pmd/pull/4357): \[java] Fix IllegalStateException in UseDiamondOperator rule + * [#4432](https://github.com/pmd/pmd/issues/4432): \[java] \[7.0-rc1] UnnecessaryImport - Unused static import is being used + * [#4455](https://github.com/pmd/pmd/issues/4455): \[java] FieldNamingConventions: false positive with lombok's @UtilityClass + * [#4487](https://github.com/pmd/pmd/issues/4487): \[java] UnnecessaryConstructor: false-positive with @Inject and @Autowired + * [#4511](https://github.com/pmd/pmd/issues/4511): \[java] LocalVariableCouldBeFinal shouldn't report unused variables + * [#4512](https://github.com/pmd/pmd/issues/4512): \[java] MethodArgumentCouldBeFinal shouldn't report unused parameters + * [#4557](https://github.com/pmd/pmd/issues/4557): \[java] UnnecessaryImport FP with static imports of overloaded methods +* java-design + * [#1014](https://github.com/pmd/pmd/issues/1014): \[java] LawOfDemeter: False positive with lambda expression + * [#1605](https://github.com/pmd/pmd/issues/1605): \[java] LawOfDemeter: False positive for standard UTF-8 charset name + * [#2160](https://github.com/pmd/pmd/issues/2160): \[java] Issues with Law of Demeter + * [#2175](https://github.com/pmd/pmd/issues/2175): \[java] LawOfDemeter: False positive for chained methods with generic method call + * [#2179](https://github.com/pmd/pmd/issues/2179): \[java] LawOfDemeter: False positive with static property access - should treat class-level property as global object, not dot-accessed property + * [#2180](https://github.com/pmd/pmd/issues/2180): \[java] LawOfDemeter: False positive with Thread and ThreadLocalRandom + * [#2182](https://github.com/pmd/pmd/issues/2182): \[java] LawOfDemeter: False positive with package-private access + * [#2188](https://github.com/pmd/pmd/issues/2188): \[java] LawOfDemeter: False positive with fields assigned to local vars + * [#2536](https://github.com/pmd/pmd/issues/2536): \[java] ClassWithOnlyPrivateConstructorsShouldBeFinal can't detect inner class + * [#3668](https://github.com/pmd/pmd/pull/3668): \[java] ClassWithOnlyPrivateConstructorsShouldBeFinal - fix FP with inner private classes + * [#3754](https://github.com/pmd/pmd/issues/3754): \[java] SingularField false positive with read in while condition + * [#3786](https://github.com/pmd/pmd/issues/3786): \[java] SimplifyBooleanReturns should consider operator precedence + * [#3840](https://github.com/pmd/pmd/issues/3840): \[java] LawOfDemeter disallows method call on locally created object + * [#4238](https://github.com/pmd/pmd/pull/4238): \[java] Make LawOfDemeter not use the rulechain + * [#4254](https://github.com/pmd/pmd/issues/4254): \[java] ImmutableField - false positive with Lombok @Setter + * [#4434](https://github.com/pmd/pmd/issues/4434): \[java] \[7.0-rc1] ExceptionAsFlowControl when simply propagating + * [#4456](https://github.com/pmd/pmd/issues/4456): \[java] FinalFieldCouldBeStatic: false positive with lombok's @UtilityClass + * [#4477](https://github.com/pmd/pmd/issues/4477): \[java] SignatureDeclareThrowsException: false-positive with TestNG annotations + * [#4490](https://github.com/pmd/pmd/issues/4490): \[java] ImmutableField - false negative with Lombok @Getter + * [#4549](https://github.com/pmd/pmd/pull/4549): \[java] Make LawOfDemeter results deterministic +* java-documentation + * [#4369](https://github.com/pmd/pmd/pull/4369): \[java] Improve CommentSize + * [#4416](https://github.com/pmd/pmd/pull/4416): \[java] Fix reported line number in CommentContentRule +* java-errorprone + * [#659](https://github.com/pmd/pmd/issues/659): \[java] MissingBreakInSwitch - last default case does not contain a break + * [#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 + * [#1899](https://github.com/pmd/pmd/issues/1899): \[java] Recognize @SuppressWanings("fallthrough") for MissingBreakInSwitch + * [#2320](https://github.com/pmd/pmd/issues/2320): \[java] NullAssignment - FP with ternary and null as method argument + * [#2532](https://github.com/pmd/pmd/issues/2532): \[java] AvoidDecimalLiteralsInBigDecimalConstructor can not detect the case `new BigDecimal(Expression)` + * [#2579](https://github.com/pmd/pmd/issues/2579): \[java] MissingBreakInSwitch detects the lack of break in the last case + * [#2880](https://github.com/pmd/pmd/issues/2880): \[java] CompareObjectsWithEquals - false negative with type res + * [#2893](https://github.com/pmd/pmd/issues/2893): \[java] Remove special cases from rule EmptyCatchBlock + * [#2894](https://github.com/pmd/pmd/issues/2894): \[java] Improve MissingBreakInSwitch + * [#3071](https://github.com/pmd/pmd/issues/3071): \[java] BrokenNullCheck FP with PMD 6.30.0 + * [#3087](https://github.com/pmd/pmd/issues/3087): \[java] UnnecessaryBooleanAssertion overlaps with SimplifiableTestAssertion + * [#3100](https://github.com/pmd/pmd/issues/3100): \[java] UseCorrectExceptionLogging FP in 6.31.0 + * [#3173](https://github.com/pmd/pmd/issues/3173): \[java] UseProperClassLoader false positive + * [#3351](https://github.com/pmd/pmd/issues/3351): \[java] ConstructorCallsOverridableMethod ignores abstract methods + * [#3400](https://github.com/pmd/pmd/issues/3400): \[java] AvoidUsingOctalValues FN with underscores + * [#3843](https://github.com/pmd/pmd/issues/3843): \[java] UseEqualsToCompareStrings should consider return type + * [#4063](https://github.com/pmd/pmd/issues/4063): \[java] AvoidBranchingStatementAsLastInLoop: False-negative about try/finally block + * [#4356](https://github.com/pmd/pmd/pull/4356): \[java] Fix NPE in CloseResourceRule + * [#4449](https://github.com/pmd/pmd/issues/4449): \[java] AvoidAccessibilityAlteration: Possible false positive in AvoidAccessibilityAlteration rule when using Lambda expression + * [#4457](https://github.com/pmd/pmd/issues/4457): \[java] OverrideBothEqualsAndHashcode: false negative with anonymous classes + * [#4493](https://github.com/pmd/pmd/issues/4493): \[java] MissingStaticMethodInNonInstantiatableClass: false-positive about @Inject + * [#4505](https://github.com/pmd/pmd/issues/4505): \[java] ImplicitSwitchFallThrough NPE in PMD 7.0.0-rc1 + * [#4510](https://github.com/pmd/pmd/issues/4510): \[java] ConstructorCallsOverridableMethod: false positive with lombok's @Value + * [#4513](https://github.com/pmd/pmd/issues/4513): \[java] UselessOperationOnImmutable various false negatives with String + * [#4514](https://github.com/pmd/pmd/issues/4514): \[java] AvoidLiteralsInIfCondition false positive and negative for String literals when ignoreExpressions=true + * [#4546](https://github.com/pmd/pmd/issues/4546): \[java] OverrideBothEqualsAndHashCode ignores records +* java-multithreading + * [#2537](https://github.com/pmd/pmd/issues/2537): \[java] DontCallThreadRun can't detect the case that call run() in `this.run()` + * [#2538](https://github.com/pmd/pmd/issues/2538): \[java] DontCallThreadRun can't detect the case that call run() in `foo.bar.run()` + * [#2577](https://github.com/pmd/pmd/issues/2577): \[java] UseNotifyAllInsteadOfNotify falsely detect a special case with argument: `foo.notify(bar)` + * [#4483](https://github.com/pmd/pmd/issues/4483): \[java] NonThreadSafeSingleton false positive with double-checked locking +* java-performance + * [#1224](https://github.com/pmd/pmd/issues/1224): \[java] InefficientEmptyStringCheck false negative in anonymous class + * [#2587](https://github.com/pmd/pmd/issues/2587): \[java] AvoidArrayLoops could also check for list copy through iterated List.add() + * [#2712](https://github.com/pmd/pmd/issues/2712): \[java] SimplifyStartsWith false-positive with AssertJ + * [#3486](https://github.com/pmd/pmd/pull/3486): \[java] InsufficientStringBufferDeclaration: Fix NPE + * [#3848](https://github.com/pmd/pmd/issues/3848): \[java] StringInstantiation: false negative when using method result + * [#4070](https://github.com/pmd/pmd/issues/4070): \[java] A false positive about the rule RedundantFieldInitializer + * [#4458](https://github.com/pmd/pmd/issues/4458): \[java] RedundantFieldInitializer: false positive with lombok's @Value +* kotlin + * [#419](https://github.com/pmd/pmd/issues/419): \[kotlin] Add support for Kotlin + * [#4389](https://github.com/pmd/pmd/pull/4389): \[kotlin] Update grammar to version 1.8 +* swift + * [#1877](https://github.com/pmd/pmd/pull/1877): \[swift] Feature/swift rules + * [#1882](https://github.com/pmd/pmd/pull/1882): \[swift] UnavailableFunction Swift rule +* xml + * [#1800](https://github.com/pmd/pmd/pull/1800): \[xml] Unimplement org.w3c.dom.Node from the XmlNodeWrapper + +### ✨ External Contributions + +* [#1658](https://github.com/pmd/pmd/pull/1658): \[core] Node support for Antlr-based languages - [MatΓ­as Fraga](https://github.com/matifraga) (@matifraga) +* [#1698](https://github.com/pmd/pmd/pull/1698): \[core] [swift] Antlr Base Parser adapter and Swift Implementation - [Lucas Soncini](https://github.com/lsoncini) (@lsoncini) +* [#1774](https://github.com/pmd/pmd/pull/1774): \[core] Antlr visitor rules - [Lucas Soncini](https://github.com/lsoncini) (@lsoncini) +* [#1877](https://github.com/pmd/pmd/pull/1877): \[swift] Feature/swift rules - [MatΓ­as Fraga](https://github.com/matifraga) (@matifraga) +* [#1881](https://github.com/pmd/pmd/pull/1881): \[doc] Add ANTLR documentation - [MatΓ­as Fraga](https://github.com/matifraga) (@matifraga) +* [#1882](https://github.com/pmd/pmd/pull/1882): \[swift] UnavailableFunction Swift rule - [TomΓ‘s de Lucca](https://github.com/tomidelucca) (@tomidelucca) +* [#2830](https://github.com/pmd/pmd/pull/2830): \[apex] Apexlink POC - [Kevin Jones](https://github.com/nawforce) (@nawforce) +* [#3866](https://github.com/pmd/pmd/pull/3866): \[core] Add CLI Progress Bar - [@JerritEic](https://github.com/JerritEic) (@JerritEic) +* [#4402](https://github.com/pmd/pmd/pull/4402): \[javascript] CPD: add support for Typescript using antlr4 grammar - [Paul Guyot](https://github.com/pguyot) (@pguyot) +* [#4403](https://github.com/pmd/pmd/pull/4403): \[julia] CPD: Add support for Julia code duplication - [Wener](https://github.com/wener-tiobe) (@wener-tiobe) +* [#4412](https://github.com/pmd/pmd/pull/4412): \[doc] Added new error msg to ConstantsInInterface - [David Ljunggren](https://github.com/dague1) (@dague1) +* [#4426](https://github.com/pmd/pmd/pull/4426): \[cpd] New XML to HTML XLST report format for PMD CPD - [mohan-chinnappan-n](https://github.com/mohan-chinnappan-n) (@mohan-chinnappan-n) +* [#4428](https://github.com/pmd/pmd/pull/4428): \[apex] ApexBadCrypto bug fix for #4427 - inline detection of hard coded values - [Steven Stearns](https://github.com/sfdcsteve) (@sfdcsteve) +* [#4431](https://github.com/pmd/pmd/pull/4431): \[coco] CPD: Coco support for code duplication detection - [Wener](https://github.com/wener-tiobe) (@wener-tiobe) +* [#4444](https://github.com/pmd/pmd/pull/4444): \[java] CommentDefaultAccessModifier - ignore org.junit.jupiter.api.extension.RegisterExtension by default - [Nirvik Patel](https://github.com/nirvikpatel) (@nirvikpatel) +* [#4450](https://github.com/pmd/pmd/pull/4450): \[java] Fix #4449 AvoidAccessibilityAlteration: Correctly handle Lambda expressions in PrivilegedAction scenarios - [Seren](https://github.com/mohui1999) (@mohui1999) +* [#4452](https://github.com/pmd/pmd/pull/4452): \[doc] Update PMD_APEX_ROOT_DIRECTORY documentation reference - [nwcm](https://github.com/nwcm) (@nwcm) +* [#4470](https://github.com/pmd/pmd/pull/4470): \[cpp] CPD: Added strings as literal and ignore identifiers in sequences - [Wener](https://github.com/wener-tiobe) (@wener-tiobe) +* [#4474](https://github.com/pmd/pmd/pull/4474): \[java] ImmutableField: False positive with lombok (fixes #4254) - [Pim van der Loos](https://github.com/PimvanderLoos) (@PimvanderLoos) +* [#4488](https://github.com/pmd/pmd/pull/4488): \[java] Fix #4477: A false-positive about SignatureDeclareThrowsException - [AnnaDev](https://github.com/LynnBroe) (@LynnBroe) +* [#4494](https://github.com/pmd/pmd/pull/4494): \[java] Fix #4487: A false-positive about UnnecessaryConstructor and @Inject and @Autowired - [AnnaDev](https://github.com/LynnBroe) (@LynnBroe) +* [#4495](https://github.com/pmd/pmd/pull/4495): \[java] Fix #4493: false-positive about MissingStaticMethodInNonInstantiatableClass and @Inject - [AnnaDev](https://github.com/LynnBroe) (@LynnBroe) +* [#4507](https://github.com/pmd/pmd/pull/4507): \[java] Fix #4503: A false negative about JUnitTestsShouldIncludeAssert and testng - [AnnaDev](https://github.com/LynnBroe) (@LynnBroe) +* [#4520](https://github.com/pmd/pmd/pull/4520): \[doc] Fix typo: missing closing quotation mark after CPD-END - [JoΓ£o Dinis Ferreira](https://github.com/joaodinissf) (@joaodinissf) +* [#4528](https://github.com/pmd/pmd/pull/4528): \[apex] Update to apexlink - [Kevin Jones](https://github.com/nawforce) (@nawforce) +* [#4533](https://github.com/pmd/pmd/pull/4533): \[java] Fix #4063: False-negative about try/catch block in Loop - [AnnaDev](https://github.com/LynnBroe) (@LynnBroe) +* [#4536](https://github.com/pmd/pmd/pull/4536): \[java] Fix #4268: CommentDefaultAccessModifier - false positive with TestNG's @Test annotation - [AnnaDev](https://github.com/LynnBroe) (@LynnBroe) +* [#4537](https://github.com/pmd/pmd/pull/4537): \[java] Fix #4455: A false positive about FieldNamingConventions and UtilityClass - [AnnaDev](https://github.com/LynnBroe) (@LynnBroe) +* [#4538](https://github.com/pmd/pmd/pull/4538): \[java] Fix #4456: A false positive about FinalFieldCouldBeStatic and UtilityClass - [AnnaDev](https://github.com/LynnBroe) (@LynnBroe) +* [#4540](https://github.com/pmd/pmd/pull/4540): \[java] Fix #4457: false negative about OverrideBothEqualsAndHashcode - [AnnaDev](https://github.com/LynnBroe) (@LynnBroe) +* [#4541](https://github.com/pmd/pmd/pull/4541): \[java] Fix #4458: A false positive about RedundantFieldInitializer and @Value - [AnnaDev](https://github.com/LynnBroe) (@LynnBroe) +* [#4542](https://github.com/pmd/pmd/pull/4542): \[java] Fix #4510: A false positive about ConstructorCallsOverridableMethod and @Value - [AnnaDev](https://github.com/LynnBroe) (@LynnBroe) +* [#4553](https://github.com/pmd/pmd/pull/4553): \[java] Fix #4492: GuardLogStatement gives false positive when argument is a Java method reference - [Anastasiia Koba](https://github.com/anastasiia-koba) (@anastasiia-koba) +* [#4637](https://github.com/pmd/pmd/pull/4637): \[java] fix #4634 - JUnit4TestShouldUseTestAnnotation false positive with TestNG - [Krystian Dabrowski](https://github.com/krdabrowski) (@krdabrowski) +* [#4649](https://github.com/pmd/pmd/pull/4649): \[apex] Add SObjectType and SObjectField to list of injectable SOQL variable types - [Richard Corfield](https://github.com/rcorfieldffdc) (@rcorfieldffdc) +* [#4651](https://github.com/pmd/pmd/pull/4651): \[doc] Add "Tencent Cloud Code Analysis" in Tools / Integrations - [yale](https://github.com/cyw3) (@cyw3) +* [#4664](https://github.com/pmd/pmd/pull/4664): \[cli] CPD: Fix NPE when only `--file-list` is specified - [Wener](https://github.com/wener-tiobe) (@wener-tiobe) +* [#4665](https://github.com/pmd/pmd/pull/4665): \[java] Doc: Fix references AutoClosable -> AutoCloseable - [Andrey Bozhko](https://github.com/AndreyBozhko) (@AndreyBozhko) + +### πŸ“ˆ Stats +* 5007 commits +* 658 closed tickets & PRs +* Days since last release: 122 + + + ## 30-May-2023 - 7.0.0-rc3 We're excited to bring you the next major version of PMD! diff --git a/docs/pages/release_notes_pmd7.md b/docs/pages/release_notes_pmd7.md index ffb451ccb1..2de83e1776 100644 --- a/docs/pages/release_notes_pmd7.md +++ b/docs/pages/release_notes_pmd7.md @@ -215,6 +215,29 @@ module `pmd-coco`. Contributors: [Wener](https://github.com/wener-tiobe) (@wener-tiobe) +### New: Java 21 Support + +This release of PMD brings support for Java 21. There are the following new standard language features, +that are supported now: + +* [JEP 440: Record Patterns](https://openjdk.org/jeps/440) +* [JEP 441: Pattern Matching for switch](https://openjdk.org/jeps/441) + +PMD also supports the following preview language features: + +* [JEP 430: String Templates (Preview)](https://openjdk.org/jeps/430) +* [JEP 443: Unnamed Patterns and Variables (Preview)](https://openjdk.org/jeps/443) +* [JEP 445: Unnamed Classes and Instance Main Methods (Preview)](https://openjdk.org/jeps/445) + +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 `21-preview`: + + export PMD_JAVA_OPTS=--enable-preview + pmd check --use-version java-21-preview ... + +Note: Support for Java 19 preview language features have been removed. The version "19-preview" is no longer available. + ### New: CPD support for Apache Velocity Template Language PMD supports Apache Velocity for a very long time, but the CPD integration never got finished. @@ -248,6 +271,11 @@ Related issue: [[core] Explicitly name all language versions (#4120)](https://gi literals were ignored. The new option additional ignores identifiers as well in sequences. * See [PR #4470](https://github.com/pmd/pmd/pull/4470) for details. +### Changed: Apex Jorje Updated + +With the new version of Apex Jorje, the new language constructs like User Mode Database Operations +can be parsed now. PMD should now be able to parse Apex code up to version 59.0 (Winter '23). + ## 🌟 New and changed rules ### New Rules @@ -257,6 +285,7 @@ Related issue: [[core] Explicitly name all language versions (#4120)](https://gi **Java** * {% rule java/codestyle/UnnecessaryBoxing %} reports boxing and unboxing conversions that may be made implicit. +* {% rule java/codestyle/UseExplicitTypes %} reports usages of `var` keyword, which was introduced with Java 10. **Kotlin** * {% rule kotlin/bestpractices/FunctionNameTooShort %} @@ -268,6 +297,9 @@ Related issue: [[core] Explicitly name all language versions (#4120)](https://gi * {% rule swift/errorprone/ForceCast %} * {% rule swift/errorprone/ForceTry %} +**XML** +* {% rule xml/bestpractices/MissingEncoding %} finds XML files without explicit encoding. + ### Changed Rules **General changes** @@ -476,6 +508,11 @@ The following previously deprecated rules have been finally removed: ## πŸ’₯ Compatibility and Migration Notes +{% include note.html content=" +The full detailed documentation of the changes are available in the +[Migration Guide for PMD 7](pmd_userdocs_migrating_to_pmd7.html) +" %} + ### For endusers * PMD 7 requires Java 8 or above to execute. @@ -731,6 +768,187 @@ See [PR #4397](https://github.com/pmd/pmd/pull/4397) for details. ### API changes +#### 7.0.0-rc4 + +##### pmd-java + +* Support for Java 19 preview language features have been removed. The version "19-preview" is no longer available. + +##### Rule properties + +* The old deprecated classes like `IntProperty` and `StringProperty` have been removed. Please use + {% jdoc core::properties.PropertyFactory %} to create properties. +* All properties which accept multiple values now use a comma (`,`) as a delimiter. The previous default was a + pipe character (`|`). The delimiter is not configurable anymore. If needed, the comma can be escaped + with a backslash. +* The `min` and `max` attributes in property definitions in the XML are now optional and can appear separately + or be omitted. + +##### New Programmatic API for CPD + +See [Detailed Release Notes for PMD 7]({{ baseurl }}pmd_release_notes_pmd7.html#new-programmatic-api-for-cpd) +and [PR #4397](https://github.com/pmd/pmd/pull/4397) for details. + +##### Removed classes and methods + +The following previously deprecated classes have been removed: + +* pmd-core + * `net.sourceforge.pmd.cpd.AbstractTokenizer` ➑️ use {%jdoc core::cpd.AnyTokenizer %} instead + * `net.sourceforge.pmd.cpd.CPD` ➑️ use {% jdoc cli::cli.PmdCli %} from `pmd-cli` module for CLI support or use + {%jdoc core::cpd.CpdAnalysis %} for programmatic API + * `net.sourceforge.pmd.cpd.GridBagHelper` (now package private) + * `net.sourceforge.pmd.cpd.TokenEntry.State` + * `net.sourceforge.pmd.lang.document.CpdCompat` + * `net.sourceforge.pmd.properties.BooleanMultiProperty` + * `net.sourceforge.pmd.properties.BooleanProperty` + * `net.sourceforge.pmd.properties.CharacterMultiProperty` + * `net.sourceforge.pmd.properties.CharacterProperty` + * `net.sourceforge.pmd.properties.DoubleMultiProperty` + * `net.sourceforge.pmd.properties.DoubleProperty` + * `net.sourceforge.pmd.properties.EnumeratedMultiProperty` + * `net.sourceforge.pmd.properties.EnumeratedProperty` + * `net.sourceforge.pmd.properties.EnumeratedPropertyDescriptor` + * `net.sourceforge.pmd.properties.FileProperty` (note: without replacement) + * `net.sourceforge.pmd.properties.FloatMultiProperty` + * `net.sourceforge.pmd.properties.FloatProperty` + * `net.sourceforge.pmd.properties.IntegerMultiProperty` + * `net.sourceforge.pmd.properties.IntegerProperty` + * `net.sourceforge.pmd.properties.LongMultiProperty` + * `net.sourceforge.pmd.properties.LongProperty` + * `net.sourceforge.pmd.properties.MultiValuePropertyDescriptor` + * `net.sourceforge.pmd.properties.NumericPropertyDescriptor` + * `net.sourceforge.pmd.properties.PropertyDescriptorField` + * `net.sourceforge.pmd.properties.RegexProperty` + * `net.sourceforge.pmd.properties.SingleValuePropertyDescriptor` + * `net.sourceforge.pmd.properties.StringMultiProperty` + * `net.sourceforge.pmd.properties.StringProperty` + * `net.sourceforge.pmd.properties.ValueParser` + * `net.sourceforge.pmd.properties.ValueParserConstants` + * `net.sourceforge.pmd.properties.builders.MultiNumericPropertyBuilder` + * `net.sourceforge.pmd.properties.builders.MultiPackagedPropertyBuilder` + * `net.sourceforge.pmd.properties.builders.MultiValuePropertyBuilder` + * `net.sourceforge.pmd.properties.builders.PropertyDescriptorBuilder` + * `net.sourceforge.pmd.properties.builders.PropertyDescriptorBuilderConversionWrapper` + * `net.sourceforge.pmd.properties.builders.PropertyDescriptorExternalBuilder` + * `net.sourceforge.pmd.properties.builders.SingleNumericPropertyBuilder` + * `net.sourceforge.pmd.properties.builders.SinglePackagedPropertyBuilder` + * `net.sourceforge.pmd.properties.builders.SingleValuePropertyBuilder` + * `net.sourceforge.pmd.properties.modules.EnumeratedPropertyModule` + * `net.sourceforge.pmd.properties.modules.NumericPropertyModule` + +The following previously deprecated methods have been removed: + +* pmd-core + * `net.sourceforge.pmd.properties.PropertyBuilder.GenericCollectionPropertyBuilder#delim(char)` + * `net.sourceforge.pmd.properties.PropertySource#setProperty(...)` + * `net.sourceforge.pmd.properties.PropertyTypeId#factoryFor(...)` + * `net.sourceforge.pmd.properties.PropertyTypeId#typeIdFor(...)` + * `net.sourceforge.pmd.properties.PropertyDescriptor`: removed methods errorFor, type, isMultiValue, + uiOrder, compareTo, isDefinedExternally, valueFrom, asDelimitedString + +The following methods have been removed: + +* pmd-core + * {%jdoc core::cpd.CPDConfiguration %} + * `#sourceCodeFor(File)`, `#postConstruct()`, `#tokenizer()`, `#filenameFilter()` removed + * {%jdoc core::cpd.Mark %} + * `#getSourceSlice()`, `#setLineCount(int)`, `#getLineCount()`, `#setSourceCode(SourceCode)` removed + * `#getBeginColumn()`, `#getBeginLine()`, `#getEndLine()`, `#getEndColumn()` removed + ➑️ use {%jdoc core::cpd.Mark#getLocation() %} instead + * {%jdoc core::cpd.Match %} + * `#LABEL_COMPARATOR` removed + * `#setMarkSet(...)`, `#setLabel(...)`, `#getLabel()`, `#addTokenEntry(...)` removed + * `#getSourceCodeSlice()` removed + ➑️ use {%jdoc !!core::cpd.CPDReport#getSourceCodeSlice(net.sourceforge.pmd.cpd.Mark) %} instead + * {%jdoc core::cpd.TokenEntry %} + * `#getEOF()`, `#clearImages()`, `#getIdentifier()`, `#getIndex()`, `#setHashCode(int)` removed + * `#EOF` removed ➑️ use {%jdoc core::cpd.TokenEntry#isEof() %} instead + * {%jdoc core::lang.ast.Parser.ParserTask %} + * `#getFileDisplayName()` removed ➑️ use {%jdoc core::lang.ast.Parser.ParserTask#getFileId() %} instead + (`getFileId().getAbsolutePath()`) + +The following classes have been removed: + +* pmd-core + * `net.sourceforge.pmd.cpd.AbstractLanguage` + * `net.sourceforge.pmd.cpd.AnyLanguage` + * `net.sourceforge.pmd.cpd.Language` + * `net.sourceforge.pmd.cpd.LanguageFactory` + * `net.sourceforge.pmd.cpd.MatchAlgorithm` (now package private) + * `net.sourceforge.pmd.cpd.MatchCollector` (now package private) + * `net.sourceforge.pmd.cpd.SourceCode` (and all inner classes like `FileCodeLoader`, ...) + * `net.sourceforge.pmd.cpd.token.TokenFilter` + +##### Moved packages + +* pmd-core + * {%jdoc core::net.sourceforge.pmd.properties.NumericConstraints %} (old package: `net.sourceforge.pmd.properties.constraints.NumericConstraints`) + * {%jdoc core::net.sourceforge.pmd.properties.PropertyConstraint %} (old package: `net.sourceforge.pmd.properties.constraints.PropertyConstraint`) + * not experimental anymore + * {%jdoc ant::ant.ReportException %} (old package: `net.sourceforge.pmd.cpd`, moved to module `pmd-ant`) + * it is now a RuntimeException + * {%jdoc core::cpd.CPDReportRenderer %} (old package: `net.sourceforge.pmd.cpd.renderer`) + * {%jdoc core::cpd.impl.AntlrTokenFilter %} (old package: `net.sourceforge.pmd.cpd.token`) + * {%jdoc core::cpd.impl.BaseTokenFilter %} (old package: `net.sourceforge.pmd.cpd.token.internal`) + * {%jdoc core::cpd.impl.JavaCCTokenFilter %} (old package: `net.sourceforge.pmd.cpd.token`) + +##### Changed types and other changes + +* pmd-core + * {%jdoc core::net.sourceforge.pmd.properties.PropertyDescriptor %} is now a class (was an interface) + and it is not comparable anymore. + * {%jdoc !!core::AbstractConfiguration#setSourceEncoding(java.nio.charset.Charset) %} + * previously this method took a simple String for the encoding. + * {%jdoc core::PmdConfiguration %} and {%jdoc core::cpd.CPDConfiguration %} + * many getters and setters have been moved to the parent class {%jdoc core::AbstractConfiguration %} + * {%jdoc !!core::cpd.CPDListener#addedFile(int) %} + * no `File` parameter anymore + * {%jdoc !!core::cpd.CPDReport#getNumberOfTokensPerFile() %} returns a `Map` of `FileId,Integer` instead of `String` + * {%jdoc !!core::cpd.CPDReport#filterMatches(java.util.function.Predicate) %} now takes a `java.util.function.Predicate` + as parameter + * {%jdoc core::cpd.Tokenizer %} + * constants are now {%jdoc core::properties.PropertyDescriptor %} instead of `String`, + to be used as language properties + * {%jdoc core::cpd.Tokenizer#tokenize(net.sourceforge.pmd.lang.document.TextDocument, net.sourceforge.pmd.cpd.TokenFactory) %} + changed parameters. Now takes a {%jdoc core::lang.document.TextDocument %} and a {%jdoc core::cpd.TokenFactory %} + (instead of `SourceCode` and `Tokens`) + * {% jdoc core::lang.Language %} + * method `#createProcessor(LanguagePropertyBundle)` moved to {%jdoc core::lang.PmdCapableLanguage %} + * {% jdoc !!core::util.StringUtil#linesWithTrimIndent(net.sourceforge.pmd.lang.document.Chars) %} now takes a `Chars` + instead of a `String`. +* All language modules (like pmd-apex, pmd-cpp, ...) + * consistent package naming: `net.sourceforge.pmd.lang..cpd` + * adapted to use {% jdoc core::cpd.CpdCapableLanguage %} + * consistent static method `#getInstance()` + * removed constants like `ID`, `TERSE_NAME` or `NAME`. Use `getInstance().getName()` etc. instead + +##### Internal APIs + +* {% jdoc core::cpd.Tokens %} +* {% jdoc core::net.sourceforge.pmd.properties.PropertyTypeId %} + +##### Deprecated API + +* {% jdoc !!core::lang.Language#getTerseName() %} ➑️ use {% jdoc core::lang.Language#getId() %} instead + +* The method {%jdoc !!java::lang.java.ast.ASTPattern#getParenthesisDepth() %} has been deprecated and will be removed. + It was introduced for supporting parenthesized patterns, but that was removed with Java 21. It is only used when + parsing code as java-19-preview. + +##### Experimental APIs + +* To support the Java preview language features "String Templates" and "Unnamed Patterns and Variables", the following + AST nodes have been introduced as experimental: + * {% jdoc java::lang.java.ast.ASTTemplateExpression %} + * {% jdoc java::lang.java.ast.ASTTemplate %} + * {% jdoc java::lang.java.ast.ASTTemplateFragment %} + * {% jdoc java::lang.java.ast.ASTUnnamedPattern %} +* The AST nodes for supporting "Record Patterns" and "Pattern Matching for switch" are not experimental anymore: + * {% jdoc java::lang.jast.ast.ASTRecordPattern %} + * {% jdoc java::lang.jast.ast.ASTPatternList %} (Note: it was renamed from `ASTComponentPatternList`) + * {% jdoc java::lang.jast.ast. %} (Note: it was renamed from `ASTSwitchGuard`) + #### 7.0.0-rc3 * The following previously deprecated classes have been removed: diff --git a/javacc-wrapper.xml b/javacc-wrapper.xml index c92827a482..601b91bb66 100644 --- a/javacc-wrapper.xml +++ b/javacc-wrapper.xml @@ -43,7 +43,7 @@ - + @@ -108,6 +108,10 @@ + + + +
@@ -128,7 +132,7 @@ - + @@ -189,6 +193,7 @@ + @@ -359,8 +364,7 @@ - + @@ -455,6 +459,15 @@ public final class ${token-constants-name} \{${line.separator}
+ + Option TOKEN_MANAGER_USES_PARSER is enabled + + + + + + + diff --git a/pmd-ant/src/main/java/net/sourceforge/pmd/ant/CPDTask.java b/pmd-ant/src/main/java/net/sourceforge/pmd/ant/CPDTask.java index 177f1311de..85abfdc0ad 100644 --- a/pmd-ant/src/main/java/net/sourceforge/pmd/ant/CPDTask.java +++ b/pmd-ant/src/main/java/net/sourceforge/pmd/ant/CPDTask.java @@ -40,20 +40,26 @@ import net.sourceforge.pmd.lang.LanguageRegistry; * *

Runs the CPD utility via ant. The ant task looks like this:

* - *
- * <project name="CPDProj" default="main" basedir=".">
- *   <taskdef name="cpd" classname="net.sourceforge.pmd.cpd.CPDTask" />
- *   <target name="main">
- *     <cpd encoding="UTF-16LE" language="java" ignoreIdentifiers="true"
- *          ignoreLiterals="true" ignoreAnnotations="true" minimumTokenCount="100"
- *          outputFile="c:\cpdrun.txt">
- *       <fileset dir="/path/to/my/src">
- *         <include name="*.java"/>
- *       </fileset>
- *     </cpd>
- *   </target>
- * </project>
- * 
+ *
{@code
+ *   
+ *     
+ *         
+ *             
+ *         
+ *     
+ *     
+ *
+ *     
+ *       
+ *         
+ *           
+ *         
+ *       
+ *     
+ *   
+ * }
* *

Required: minimumTokenCount, outputFile, and at least one file

*/ 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 cbdea6ac17..199cc2b16b 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.Method; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.nio.file.Files; @@ -220,11 +221,12 @@ public class Formatter { // fall-through } - // Maybe this is Java17? Then there will be + // Maybe this is Java17+? Then there will be // https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/io/Console.html#charset() // instead of the field "cs". try { - Charset charset = (Charset) MethodUtils.invokeMethod(console, "charset"); + Method charsetMethod = Console.class.getDeclaredMethod("charset"); + Charset charset = (Charset) charsetMethod.invoke(console); return charset.name(); } catch (IllegalArgumentException | ReflectiveOperationException ignored) { // fall-through diff --git a/pmd-ant/src/main/java/net/sourceforge/pmd/ant/PMDTask.java b/pmd-ant/src/main/java/net/sourceforge/pmd/ant/PMDTask.java index 578db83ca5..db10833ff7 100644 --- a/pmd-ant/src/main/java/net/sourceforge/pmd/ant/PMDTask.java +++ b/pmd-ant/src/main/java/net/sourceforge/pmd/ant/PMDTask.java @@ -24,6 +24,31 @@ import net.sourceforge.pmd.ant.internal.PMDTaskImpl; /** * PMD Ant task. Setters of this class are interpreted by Ant as properties * settable in the XML. This is therefore published API. + * + *

Runs PMD analysis via ant. The ant task looks like this:

+ * + *
{@code
+ *   
+ *     
+ *         
+ *             
+ *         
+ *     
+ *     
+ *
+ *     
+ *       
+ *         rulesets/java/quickstart.xml
+ *         config/my-ruleset.xml
+ *         
+ *             
+ *         
+ *       
+ *     
+ *   
+ * }
+ * + *

Required: rulesetfiles/ruleset, fileset

*/ public class PMDTask extends Task { diff --git a/pmd-apex-jorje/pom.xml b/pmd-apex-jorje/pom.xml index 08acecc562..df4c01214d 100644 --- a/pmd-apex-jorje/pom.xml +++ b/pmd-apex-jorje/pom.xml @@ -13,7 +13,7 @@ - 2021-10-08-631b8c + 2023-06-05-c27a5d @@ -48,7 +48,7 @@ cglib cglib - 3.3.0 + 3.3.0 com.google.code.findbugs @@ -58,7 +58,7 @@ com.google.code.gson gson - + com.google.errorprone @@ -68,7 +68,7 @@ com.google.guava guava - + com.google.j2objc @@ -94,17 +94,12 @@ animal-sniffer-annotations 1.14 - - org.openjdk.jol - jol-core - 0.4 - org.slf4j slf4j-api - + - diff --git a/pmd-apex-jorje/repo/README.md b/pmd-apex-jorje/repo/README.md index 098ab2eba7..8abe76cd2a 100644 --- a/pmd-apex-jorje/repo/README.md +++ b/pmd-apex-jorje/repo/README.md @@ -8,7 +8,7 @@ Apex Reference: -In order to download the jar file, minimize it and add a the jar files to the local repo, use the following script: +In order to download the jar file, minimize it and add the jar files to the local repo, use the following script: ./create-local-repo.sh diff --git a/pmd-apex-jorje/repo/apex/apex-jorje-lsp-minimized/2021-10-08-631b8c/apex-jorje-lsp-minimized-2021-10-08-631b8c.jar b/pmd-apex-jorje/repo/apex/apex-jorje-lsp-minimized/2021-10-08-631b8c/apex-jorje-lsp-minimized-2021-10-08-631b8c.jar deleted file mode 100644 index 7dbe44ed3a..0000000000 Binary files a/pmd-apex-jorje/repo/apex/apex-jorje-lsp-minimized/2021-10-08-631b8c/apex-jorje-lsp-minimized-2021-10-08-631b8c.jar and /dev/null differ diff --git a/pmd-apex-jorje/repo/apex/apex-jorje-lsp-minimized/2023-06-05-c27a5d/_remote.repositories b/pmd-apex-jorje/repo/apex/apex-jorje-lsp-minimized/2023-06-05-c27a5d/_remote.repositories new file mode 100644 index 0000000000..5019af613b --- /dev/null +++ b/pmd-apex-jorje/repo/apex/apex-jorje-lsp-minimized/2023-06-05-c27a5d/_remote.repositories @@ -0,0 +1,4 @@ +#NOTE: This is a Maven Resolver internal implementation file, its format can be changed without prior notice. +#Sat Jun 24 18:50:10 CEST 2023 +apex-jorje-lsp-minimized-2023-06-05-c27a5d.jar>= +apex-jorje-lsp-minimized-2023-06-05-c27a5d.pom>= diff --git a/pmd-apex-jorje/repo/apex/apex-jorje-lsp-minimized/2023-06-05-c27a5d/apex-jorje-lsp-minimized-2023-06-05-c27a5d.jar b/pmd-apex-jorje/repo/apex/apex-jorje-lsp-minimized/2023-06-05-c27a5d/apex-jorje-lsp-minimized-2023-06-05-c27a5d.jar new file mode 100644 index 0000000000..ff0cda8617 Binary files /dev/null and b/pmd-apex-jorje/repo/apex/apex-jorje-lsp-minimized/2023-06-05-c27a5d/apex-jorje-lsp-minimized-2023-06-05-c27a5d.jar differ diff --git a/pmd-apex-jorje/repo/apex/apex-jorje-lsp-minimized/2021-10-08-631b8c/apex-jorje-lsp-minimized-2021-10-08-631b8c.pom b/pmd-apex-jorje/repo/apex/apex-jorje-lsp-minimized/2023-06-05-c27a5d/apex-jorje-lsp-minimized-2023-06-05-c27a5d.pom similarity index 91% rename from pmd-apex-jorje/repo/apex/apex-jorje-lsp-minimized/2021-10-08-631b8c/apex-jorje-lsp-minimized-2021-10-08-631b8c.pom rename to pmd-apex-jorje/repo/apex/apex-jorje-lsp-minimized/2023-06-05-c27a5d/apex-jorje-lsp-minimized-2023-06-05-c27a5d.pom index 25388ebc7a..50f43125a0 100644 --- a/pmd-apex-jorje/repo/apex/apex-jorje-lsp-minimized/2021-10-08-631b8c/apex-jorje-lsp-minimized-2021-10-08-631b8c.pom +++ b/pmd-apex-jorje/repo/apex/apex-jorje-lsp-minimized/2023-06-05-c27a5d/apex-jorje-lsp-minimized-2023-06-05-c27a5d.pom @@ -4,6 +4,6 @@ 4.0.0 apex apex-jorje-lsp-minimized - 2021-10-08-631b8c + 2023-06-05-c27a5d POM was created from install:install-file diff --git a/pmd-apex-jorje/repo/apex/apex-jorje-lsp-minimized/maven-metadata-local.xml b/pmd-apex-jorje/repo/apex/apex-jorje-lsp-minimized/maven-metadata-local.xml index 979af0c533..f5e570899c 100644 --- a/pmd-apex-jorje/repo/apex/apex-jorje-lsp-minimized/maven-metadata-local.xml +++ b/pmd-apex-jorje/repo/apex/apex-jorje-lsp-minimized/maven-metadata-local.xml @@ -3,10 +3,10 @@ apex apex-jorje-lsp-minimized - 2021-10-08-631b8c + 2023-06-05-c27a5d - 2021-10-08-631b8c + 2023-06-05-c27a5d - 20211014081008 + 20230624165009 diff --git a/pmd-apex-jorje/repo/create-local-repo.sh b/pmd-apex-jorje/repo/create-local-repo.sh index a7e50374ec..6e0da0ec1b 100755 --- a/pmd-apex-jorje/repo/create-local-repo.sh +++ b/pmd-apex-jorje/repo/create-local-repo.sh @@ -31,19 +31,39 @@ function download() { } +# +# Unfortunately, jorje is provided as a blob, which seems to be a jar-with-dependencies +# kind of thing. We try to keep only the apex related classes and delete anything that has +# been added into the big apex-jorje-lsp-jar. The deleted classes will be added as dependencies again. +# +# We unfortunately need to keep some classes in com.google.common (guava), since jorje seems +# to have added classes there, which are not in the official guava packages. +# function minimize() { unzip -d temp ${FILENAME} pushd temp - find . -not -path "." \ - -and -not -path ".." \ - -and -not -path "./apex" \ + find . -type f \ -and -not -path "./apex/*" \ -and -not -path "./StandardApex*" \ -and -not -path "./messages*" \ - -and -not -path "./com" \ - -and -not -path "./com/google" \ - -and -not -path "./com/google/common*" \ + -and -not -path "./com/google/common/collect/ConcatenatedLists*" \ + -and -not -path "./com/google/common/collect/MoreLists*" \ + -and -not -path "./com/google/common/collect/MoreMaps*" \ + -and -not -path "./com/google/common/collect/MoreSets*" \ + -and -not -path "./com/google/common/collect/PairList*" \ + -and -not -path "./com/google/common/collect/SingleAppendList*" \ + -and -not -path "./com/google/common/collect/SinglePrependList*" \ + -and -not -path "./com/google/common/collect/WellBehavedMap*" \ + -and -not -path "./com/google/common/graph/ConfigurableMutableGraph*" \ + -and -not -path "./com/google/common/graph/ConfigurableMutableNetwork*" \ + -and -not -path "./com/google/common/graph/ConfigurableMutableValueGraph*" \ + -and -not -path "./com/google/common/graph/ConfigurableNetwork*" \ + -and -not -path "./com/google/common/graph/ConfigurableValueGraph*" \ + -and -not -path "./com/google/common/reflect/Element*" \ + -and -not -path "./com/google/common/util/concurrent/AbstractCheckedFuture*" \ -print0 | xargs -0 rm -rf + # delete empty directories + find . -depth -type d -empty -delete popd jar --create --file ${FILENAME_MINIMIZED} -C temp/ . rm -rf temp diff --git a/pmd-apex/pom.xml b/pmd-apex/pom.xml index 4904077185..ec1a0cedc0 100644 --- a/pmd-apex/pom.xml +++ b/pmd-apex/pom.xml @@ -66,6 +66,10 @@ commons-lang3 + + com.google.guava + guava + org.hamcrest diff --git a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ApexLanguageModule.java b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ApexLanguageModule.java index f2df5ad8ab..acb0bb19c0 100644 --- a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ApexLanguageModule.java +++ b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ApexLanguageModule.java @@ -25,7 +25,9 @@ public class ApexLanguageModule extends LanguageModuleBase implements PmdCapable .addVersion("54") .addVersion("55") .addVersion("56") - .addDefaultVersion("57")); + .addVersion("57") + .addVersion("58") + .addDefaultVersion("59")); } public static ApexLanguageModule getInstance() { diff --git a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ASTDmlDeleteStatement.java b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ASTDmlDeleteStatement.java index 8bdadaa995..47a2941b86 100644 --- a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ASTDmlDeleteStatement.java +++ b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ASTDmlDeleteStatement.java @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.apex.ast; import apex.jorje.semantic.ast.statement.DmlDeleteStatement; -public final class ASTDmlDeleteStatement extends AbstractApexNode { +public final class ASTDmlDeleteStatement extends AbstractDmlStatement { ASTDmlDeleteStatement(DmlDeleteStatement dmlDeleteStatement) { super(dmlDeleteStatement); diff --git a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ASTDmlInsertStatement.java b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ASTDmlInsertStatement.java index 97bdbc753e..e74f4bd616 100644 --- a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ASTDmlInsertStatement.java +++ b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ASTDmlInsertStatement.java @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.apex.ast; import apex.jorje.semantic.ast.statement.DmlInsertStatement; -public final class ASTDmlInsertStatement extends AbstractApexNode { +public final class ASTDmlInsertStatement extends AbstractDmlStatement { ASTDmlInsertStatement(DmlInsertStatement dmlInsertStatement) { super(dmlInsertStatement); diff --git a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ASTDmlMergeStatement.java b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ASTDmlMergeStatement.java index b2bcc98732..e5d2329dd4 100644 --- a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ASTDmlMergeStatement.java +++ b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ASTDmlMergeStatement.java @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.apex.ast; import apex.jorje.semantic.ast.statement.DmlMergeStatement; -public final class ASTDmlMergeStatement extends AbstractApexNode { +public final class ASTDmlMergeStatement extends AbstractDmlStatement { ASTDmlMergeStatement(DmlMergeStatement dmlMergeStatement) { super(dmlMergeStatement); diff --git a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ASTDmlUndeleteStatement.java b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ASTDmlUndeleteStatement.java index 33520cc4fd..5d4d6197e3 100644 --- a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ASTDmlUndeleteStatement.java +++ b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ASTDmlUndeleteStatement.java @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.apex.ast; import apex.jorje.semantic.ast.statement.DmlUndeleteStatement; -public final class ASTDmlUndeleteStatement extends AbstractApexNode { +public final class ASTDmlUndeleteStatement extends AbstractDmlStatement { ASTDmlUndeleteStatement(DmlUndeleteStatement dmlUndeleteStatement) { super(dmlUndeleteStatement); diff --git a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ASTDmlUpdateStatement.java b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ASTDmlUpdateStatement.java index 45ab8de03b..5c43530f19 100644 --- a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ASTDmlUpdateStatement.java +++ b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ASTDmlUpdateStatement.java @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.apex.ast; import apex.jorje.semantic.ast.statement.DmlUpdateStatement; -public final class ASTDmlUpdateStatement extends AbstractApexNode { +public final class ASTDmlUpdateStatement extends AbstractDmlStatement { ASTDmlUpdateStatement(DmlUpdateStatement dmlUpdateStatement) { super(dmlUpdateStatement); diff --git a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ASTDmlUpsertStatement.java b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ASTDmlUpsertStatement.java index b240fd7ea6..c4ff408a7b 100644 --- a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ASTDmlUpsertStatement.java +++ b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ASTDmlUpsertStatement.java @@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.apex.ast; import apex.jorje.semantic.ast.statement.DmlUpsertStatement; -public final class ASTDmlUpsertStatement extends AbstractApexNode { +public final class ASTDmlUpsertStatement extends AbstractDmlStatement { ASTDmlUpsertStatement(DmlUpsertStatement dmlUpsertStatement) { super(dmlUpsertStatement); diff --git a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/AbstractDmlStatement.java b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/AbstractDmlStatement.java new file mode 100644 index 0000000000..72825b4654 --- /dev/null +++ b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/AbstractDmlStatement.java @@ -0,0 +1,28 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +package net.sourceforge.pmd.lang.apex.ast; + +import java.util.Optional; + +import org.apache.commons.lang3.reflect.FieldUtils; + +import apex.jorje.semantic.ast.AstNode; +import apex.jorje.semantic.ast.expression.VariableExpression; + +public abstract class AbstractDmlStatement extends AbstractApexNode { + protected AbstractDmlStatement(T node) { + super(node); + } + + public Optional getRunAsMode() { + try { + Optional runAsMode = (Optional) FieldUtils.readField(node, "runAsModeVariable", true); + return runAsMode.map(v -> v.getIdentifier().getValue()); + } catch (IllegalArgumentException | ReflectiveOperationException e) { + // ignored + return Optional.empty(); + } + } +} diff --git a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/TestAccessEvaluator.java b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/TestAccessEvaluator.java index 77ddb50a66..b1cd8c34df 100644 --- a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/TestAccessEvaluator.java +++ b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/TestAccessEvaluator.java @@ -363,4 +363,9 @@ class TestAccessEvaluator implements AccessEvaluator { public boolean doesLightningWebComponentExist(String var1) { return false; } + + @Override + public boolean doesStaticResourceExist(String s) { + return false; + } } diff --git a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/design/UnusedMethodRule.java b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/design/UnusedMethodRule.java index 581e19600e..f76271c643 100644 --- a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/design/UnusedMethodRule.java +++ b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/design/UnusedMethodRule.java @@ -11,6 +11,9 @@ public class UnusedMethodRule extends AbstractApexRule { @Override public Object visit(ASTMethod node, Object data) { + if (node.isSynthetic()) { + return data; + } // Check if any 'Unused' Issues align with this method node.getRoot().getGlobalIssues().stream() diff --git a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/security/ApexCRUDViolationRule.java b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/security/ApexCRUDViolationRule.java index 5cc9345567..a4bc0a4e64 100644 --- a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/security/ApexCRUDViolationRule.java +++ b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/security/ApexCRUDViolationRule.java @@ -51,6 +51,7 @@ import net.sourceforge.pmd.lang.apex.ast.ASTSoqlExpression; import net.sourceforge.pmd.lang.apex.ast.ASTUserClass; import net.sourceforge.pmd.lang.apex.ast.ASTVariableDeclaration; import net.sourceforge.pmd.lang.apex.ast.ASTVariableExpression; +import net.sourceforge.pmd.lang.apex.ast.AbstractDmlStatement; import net.sourceforge.pmd.lang.apex.ast.ApexNode; import net.sourceforge.pmd.lang.apex.rule.AbstractApexRule; import net.sourceforge.pmd.lang.apex.rule.internal.Helper; @@ -261,32 +262,56 @@ public class ApexCRUDViolationRule extends AbstractApexRule { return false; } + private boolean hasRunAsMode(AbstractDmlStatement node) { + return node.getRunAsMode().isPresent(); + } + @Override public Object visit(ASTDmlInsertStatement node, Object data) { + if (hasRunAsMode(node)) { + return data; + } + checkForCRUD(node, data, IS_CREATEABLE); return data; } @Override public Object visit(ASTDmlDeleteStatement node, Object data) { + if (hasRunAsMode(node)) { + return data; + } + checkForCRUD(node, data, IS_DELETABLE); return data; } @Override public Object visit(ASTDmlUndeleteStatement node, Object data) { + if (hasRunAsMode(node)) { + return data; + } + checkForCRUD(node, data, IS_UNDELETABLE); return data; } @Override public Object visit(ASTDmlUpdateStatement node, Object data) { + if (hasRunAsMode(node)) { + return data; + } + checkForCRUD(node, data, IS_UPDATEABLE); return data; } @Override public Object visit(ASTDmlUpsertStatement node, Object data) { + if (hasRunAsMode(node)) { + return data; + } + checkForCRUD(node, data, IS_CREATEABLE); checkForCRUD(node, data, IS_UPDATEABLE); return data; @@ -294,6 +319,10 @@ public class ApexCRUDViolationRule extends AbstractApexRule { @Override public Object visit(ASTDmlMergeStatement node, Object data) { + if (hasRunAsMode(node)) { + return data; + } + checkForCRUD(node, data, IS_MERGEABLE); return data; } diff --git a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/security/ApexSOQLInjectionRule.java b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/security/ApexSOQLInjectionRule.java index df4d0fa59a..2309ed0423 100644 --- a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/security/ApexSOQLInjectionRule.java +++ b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/security/ApexSOQLInjectionRule.java @@ -4,6 +4,7 @@ package net.sourceforge.pmd.lang.apex.rule.security; +import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -11,6 +12,8 @@ import java.util.Locale; import java.util.Map; import java.util.Set; import java.util.regex.Pattern; +import java.util.stream.Collectors; +import java.util.stream.Stream; import net.sourceforge.pmd.lang.apex.ast.ASTAssignmentExpression; import net.sourceforge.pmd.lang.apex.ast.ASTBinaryExpression; @@ -35,12 +38,12 @@ import net.sourceforge.pmd.lang.apex.rule.internal.Helper; * */ public class ApexSOQLInjectionRule extends AbstractApexRule { - private static final String DOUBLE = "double"; - private static final String LONG = "long"; - private static final String DECIMAL = "decimal"; - private static final String BOOLEAN = "boolean"; - private static final String ID = "id"; - private static final String INTEGER = "integer"; + private static final Set SAFE_VARIABLE_TYPES = + Collections.unmodifiableSet(Stream.of( + "double", "long", "decimal", "boolean", "id", "integer", + "sobjecttype", "schema.sobjecttype", "sobjectfield", "schema.sobjectfield" + ).collect(Collectors.toSet())); + private static final String JOIN = "join"; private static final String ESCAPE_SINGLE_QUOTES = "escapeSingleQuotes"; private static final String STRING = "String"; @@ -108,23 +111,16 @@ public class ApexSOQLInjectionRule extends AbstractApexRule { return Helper.isMethodName(m, DATABASE, QUERY) || Helper.isMethodName(m, DATABASE, COUNT_QUERY); } + private boolean isSafeVariableType(String typeName) { + return SAFE_VARIABLE_TYPES.contains(typeName.toLowerCase(Locale.ROOT)); + } + private void findSafeVariablesInSignature(ASTMethod m) { for (ASTParameter p : m.findChildrenOfType(ASTParameter.class)) { - switch (p.getType().toLowerCase(Locale.ROOT)) { - case ID: - case INTEGER: - case BOOLEAN: - case DECIMAL: - case LONG: - case DOUBLE: + if (isSafeVariableType(p.getType())) { safeVariables.add(Helper.getFQVariableName(p)); - break; - default: - break; } - } - } private void findSanitizedVariables(ApexNode node) { @@ -159,17 +155,8 @@ public class ApexSOQLInjectionRule extends AbstractApexRule { } if (node instanceof ASTVariableDeclaration) { - switch (((ASTVariableDeclaration) node).getType().toLowerCase(Locale.ROOT)) { - case INTEGER: - case ID: - case BOOLEAN: - case DECIMAL: - case LONG: - case DOUBLE: + if (isSafeVariableType(((ASTVariableDeclaration) node).getType())) { safeVariables.add(Helper.getFQVariableName(left)); - break; - default: - break; } } } diff --git a/pmd-apex/src/main/resources/category/apex/bestpractices.xml b/pmd-apex/src/main/resources/category/apex/bestpractices.xml index 6763f71d9a..178f94e82e 100644 --- a/pmd-apex/src/main/resources/category/apex/bestpractices.xml +++ b/pmd-apex/src/main/resources/category/apex/bestpractices.xml @@ -1,4 +1,4 @@ - + + + + + + + + { - RuleSet ruleset = rulesetLoader().loadFromResource("rulesets/apex/quickstart.xml"); + RuleSet ruleset = rulesetLoader().loadFromResource(QUICKSTART_RULESET); assertNotNull(ruleset); }); assertTrue(log.isEmpty(), "No Logging expected"); } + @Test + void correctEncoding() throws Exception { + assertTrue(AbstractRuleSetFactoryTest.hasCorrectEncoding(QUICKSTART_RULESET)); + } + private RuleSetLoader rulesetLoader() { return new RuleSetLoader().enableCompatibility(false); } 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 08654073b9..8d899d0549 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 @@ -13,7 +13,7 @@ class LanguageVersionTest extends AbstractLanguageVersionTest { static Collection data() { return Arrays.asList( - TestDescriptor.defaultVersionIs(ApexLanguageModule.getInstance(), "57") + TestDescriptor.defaultVersionIs(ApexLanguageModule.getInstance(), "59") ); } } diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/design/UnusedMethodTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/design/UnusedMethodTest.java new file mode 100644 index 0000000000..cda9afc56b --- /dev/null +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/design/UnusedMethodTest.java @@ -0,0 +1,76 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +package net.sourceforge.pmd.lang.apex.rule.design; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.IOException; +import java.nio.file.Path; +import java.nio.file.Paths; + +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.Report; +import net.sourceforge.pmd.Rule; +import net.sourceforge.pmd.RuleSet; +import net.sourceforge.pmd.RuleSetLoader; +import net.sourceforge.pmd.RuleViolation; +import net.sourceforge.pmd.lang.Language; +import net.sourceforge.pmd.lang.LanguageVersion; +import net.sourceforge.pmd.lang.apex.ApexLanguageModule; +import net.sourceforge.pmd.lang.apex.ApexLanguageProperties; +import net.sourceforge.pmd.reporting.GlobalAnalysisListener; + +import com.nawforce.pkgforce.path.PathFactory; +import com.nawforce.pkgforce.path.PathLike; +import com.nawforce.runtime.platform.Environment; +import scala.Option; + +class UnusedMethodTest { + @TempDir + private Path tempDir; + + @Test + void findUnusedMethodsWithSfdxProject() throws Exception { + Path testProjectDir = Paths.get("src/test/resources/net/sourceforge/pmd/lang/apex/rule/design/UnusedMethod/project1"); + Report report = runRule(testProjectDir); + assertEquals(1, report.getViolations().size()); + assertViolation(report.getViolations().get(0), "Foo.cls", 10); // line 10 is method unusedMethod() + } + + private void assertViolation(RuleViolation violation, String fileName, int lineNumber) { + assertEquals(fileName, violation.getFileId().getFileName()); + assertEquals(lineNumber, violation.getBeginLine()); + } + + private Report runRule(Path testProjectDir) throws IOException { + Option pathLikeOption = Option.apply(PathFactory.apply(tempDir.toString())); + Option> cachDirOption = Option.apply(pathLikeOption); + Environment.setCacheDirOverride(cachDirOption); + + Language apexLanguage = ApexLanguageModule.getInstance(); + LanguageVersion languageVersion = apexLanguage.getDefaultVersion(); + PMDConfiguration configuration = new PMDConfiguration(); + configuration.setIgnoreIncrementalAnalysis(true); + configuration.setDefaultLanguageVersion(languageVersion); + configuration.setThreads(0); // don't use separate threads + configuration.prependAuxClasspath("."); + + configuration.getLanguageProperties(apexLanguage).setProperty(ApexLanguageProperties.MULTIFILE_DIRECTORY, testProjectDir.toString()); + + RuleSet parsedRset = new RuleSetLoader().warnDeprecated(false).loadFromResource("category/apex/design.xml"); + Rule rule = parsedRset.getRuleByName("UnusedMethod"); + + try (PmdAnalysis pmd = PmdAnalysis.create(configuration)) { + pmd.files().addDirectory(testProjectDir); + pmd.addRuleSet(RuleSet.forSingleRule(rule)); + pmd.addListener(GlobalAnalysisListener.exceptionThrower()); + return pmd.performAnalysisAndCollectReport(); + } + } +} diff --git a/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/SafeNavigationOperator.txt b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/SafeNavigationOperator.txt index d0dbc12ca6..549ab95e3e 100644 --- a/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/SafeNavigationOperator.txt +++ b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/SafeNavigationOperator.txt @@ -1,99 +1,99 @@ -+- ApexFile[@ApexVersion = 54.0, @DefiningType = "Foo", @Namespace = "", @RealLoc = true] - +- UserClass[@ApexVersion = 54.0, @DefiningType = "Foo", @Image = "Foo", @Namespace = "", @RealLoc = true, @SimpleName = "Foo", @SuperClassName = ""] - +- ModifierNode[@Abstract = false, @ApexVersion = 54.0, @DefiningType = "Foo", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 1, @Namespace = "", @Override = false, @Private = false, @Protected = false, @Public = true, @RealLoc = true, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] - +- Field[@ApexVersion = 54.0, @DefiningType = "Foo", @Image = "x", @Name = "x", @Namespace = "", @RealLoc = true, @Type = "Integer", @Value = null] - | +- ModifierNode[@Abstract = false, @ApexVersion = 54.0, @DefiningType = "Foo", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 0, @Namespace = "", @Override = false, @Private = false, @Protected = false, @Public = false, @RealLoc = true, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] - +- Field[@ApexVersion = 54.0, @DefiningType = "Foo", @Image = "profileUrl", @Name = "profileUrl", @Namespace = "", @RealLoc = true, @Type = "String", @Value = null] - | +- ModifierNode[@Abstract = false, @ApexVersion = 54.0, @DefiningType = "Foo", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 0, @Namespace = "", @Override = false, @Private = false, @Protected = false, @Public = false, @RealLoc = true, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] - +- FieldDeclarationStatements[@ApexVersion = 54.0, @DefiningType = "Foo", @Namespace = "", @RealLoc = true, @TypeName = "Integer"] - | +- ModifierNode[@Abstract = false, @ApexVersion = 54.0, @DefiningType = "Foo", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 0, @Namespace = "", @Override = false, @Private = false, @Protected = false, @Public = false, @RealLoc = false, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] - | +- FieldDeclaration[@ApexVersion = 54.0, @DefiningType = "Foo", @Image = "anIntegerField", @Name = "anIntegerField", @Namespace = "", @RealLoc = true] - | +- VariableExpression[@ApexVersion = 54.0, @DefiningType = "Foo", @Image = "anIntegerField", @Namespace = "", @RealLoc = true] - | | +- ReferenceExpression[@ApexVersion = 54.0, @Context = null, @DefiningType = "Foo", @Namespace = "", @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = true] - | | +- VariableExpression[@ApexVersion = 54.0, @DefiningType = "Foo", @Image = "anObject", @Namespace = "", @RealLoc = true] - | | +- EmptyReferenceExpression[@ApexVersion = 54.0, @DefiningType = null, @Namespace = null, @RealLoc = false] - | +- VariableExpression[@ApexVersion = 54.0, @DefiningType = "Foo", @Image = "x", @Namespace = "", @RealLoc = true] - | +- EmptyReferenceExpression[@ApexVersion = 54.0, @DefiningType = null, @Namespace = null, @RealLoc = false] - +- FieldDeclarationStatements[@ApexVersion = 54.0, @DefiningType = "Foo", @Namespace = "", @RealLoc = true, @TypeName = "String"] - | +- ModifierNode[@Abstract = false, @ApexVersion = 54.0, @DefiningType = "Foo", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 0, @Namespace = "", @Override = false, @Private = false, @Protected = false, @Public = false, @RealLoc = false, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] - | +- FieldDeclaration[@ApexVersion = 54.0, @DefiningType = "Foo", @Image = "profileUrl", @Name = "profileUrl", @Namespace = "", @RealLoc = true] - | +- MethodCallExpression[@ApexVersion = 54.0, @DefiningType = "Foo", @FullMethodName = "toExternalForm", @InputParametersSize = 0, @MethodName = "toExternalForm", @Namespace = "", @RealLoc = true] - | | +- ReferenceExpression[@ApexVersion = 54.0, @Context = null, @DefiningType = "Foo", @Namespace = "", @RealLoc = false, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = true] - | | +- MethodCallExpression[@ApexVersion = 54.0, @DefiningType = "Foo", @FullMethodName = "user.getProfileUrl", @InputParametersSize = 0, @MethodName = "getProfileUrl", @Namespace = "", @RealLoc = true] - | | +- ReferenceExpression[@ApexVersion = 54.0, @Context = null, @DefiningType = "Foo", @Image = "user", @Namespace = "", @RealLoc = true, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false] - | +- VariableExpression[@ApexVersion = 54.0, @DefiningType = "Foo", @Image = "profileUrl", @Namespace = "", @RealLoc = true] - | +- EmptyReferenceExpression[@ApexVersion = 54.0, @DefiningType = null, @Namespace = null, @RealLoc = false] - +- Method[@ApexVersion = 54.0, @Arity = 1, @CanonicalName = "bar1", @Constructor = false, @DefiningType = "Foo", @Image = "bar1", @Namespace = "", @RealLoc = true, @ReturnType = "void", @Synthetic = false] - | +- ModifierNode[@Abstract = false, @ApexVersion = 54.0, @DefiningType = "Foo", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 1, @Namespace = "", @Override = false, @Private = false, @Protected = false, @Public = true, @RealLoc = true, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] - | +- Parameter[@ApexVersion = 54.0, @DefiningType = "Foo", @Image = "a", @Namespace = "", @RealLoc = true, @Type = "Object"] - | | +- ModifierNode[@Abstract = false, @ApexVersion = 54.0, @DefiningType = "Foo", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 0, @Namespace = "", @Override = false, @Private = false, @Protected = false, @Public = false, @RealLoc = true, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] - | +- BlockStatement[@ApexVersion = 54.0, @CurlyBrace = true, @DefiningType = "Foo", @Namespace = "", @RealLoc = true] - | +- ExpressionStatement[@ApexVersion = 54.0, @DefiningType = "Foo", @Namespace = "", @RealLoc = true] - | | +- VariableExpression[@ApexVersion = 54.0, @DefiningType = "Foo", @Image = "b", @Namespace = "", @RealLoc = true] - | | +- ReferenceExpression[@ApexVersion = 54.0, @Context = null, @DefiningType = "Foo", @Namespace = "", @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = true] - | | +- VariableExpression[@ApexVersion = 54.0, @DefiningType = "Foo", @Image = "a", @Namespace = "", @RealLoc = true] - | | +- EmptyReferenceExpression[@ApexVersion = 54.0, @DefiningType = null, @Namespace = null, @RealLoc = false] - | +- ExpressionStatement[@ApexVersion = 54.0, @DefiningType = "Foo", @Namespace = "", @RealLoc = true] - | +- MethodCallExpression[@ApexVersion = 54.0, @DefiningType = "Foo", @FullMethodName = "c1", @InputParametersSize = 0, @MethodName = "c1", @Namespace = "", @RealLoc = true] - | +- ReferenceExpression[@ApexVersion = 54.0, @Context = null, @DefiningType = "Foo", @Namespace = "", @RealLoc = false, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = true] - | +- CastExpression[@ApexVersion = 54.0, @DefiningType = "Foo", @Namespace = "", @RealLoc = true] - | +- VariableExpression[@ApexVersion = 54.0, @DefiningType = "Foo", @Image = "b1", @Namespace = "", @RealLoc = true] - | +- ReferenceExpression[@ApexVersion = 54.0, @Context = null, @DefiningType = "Foo", @Namespace = "", @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = true] - | +- VariableExpression[@ApexVersion = 54.0, @DefiningType = "Foo", @Image = "a1", @Namespace = "", @RealLoc = true] - | +- EmptyReferenceExpression[@ApexVersion = 54.0, @DefiningType = null, @Namespace = null, @RealLoc = false] - +- Method[@ApexVersion = 54.0, @Arity = 2, @CanonicalName = "bar2", @Constructor = false, @DefiningType = "Foo", @Image = "bar2", @Namespace = "", @RealLoc = true, @ReturnType = "void", @Synthetic = false] - | +- ModifierNode[@Abstract = false, @ApexVersion = 54.0, @DefiningType = "Foo", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 1, @Namespace = "", @Override = false, @Private = false, @Protected = false, @Public = true, @RealLoc = true, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] - | +- Parameter[@ApexVersion = 54.0, @DefiningType = "Foo", @Image = "a", @Namespace = "", @RealLoc = true, @Type = "List"] - | | +- ModifierNode[@Abstract = false, @ApexVersion = 54.0, @DefiningType = "Foo", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 0, @Namespace = "", @Override = false, @Private = false, @Protected = false, @Public = false, @RealLoc = true, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] - | +- Parameter[@ApexVersion = 54.0, @DefiningType = "Foo", @Image = "x", @Namespace = "", @RealLoc = true, @Type = "int"] - | | +- ModifierNode[@Abstract = false, @ApexVersion = 54.0, @DefiningType = "Foo", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 0, @Namespace = "", @Override = false, @Private = false, @Protected = false, @Public = false, @RealLoc = true, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] - | +- BlockStatement[@ApexVersion = 54.0, @CurlyBrace = true, @DefiningType = "Foo", @Namespace = "", @RealLoc = true] - | +- ExpressionStatement[@ApexVersion = 54.0, @DefiningType = "Foo", @Namespace = "", @RealLoc = true] - | | +- VariableExpression[@ApexVersion = 54.0, @DefiningType = "Foo", @Image = "aField", @Namespace = "", @RealLoc = true] - | | +- ReferenceExpression[@ApexVersion = 54.0, @Context = null, @DefiningType = "Foo", @Namespace = "", @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = false] - | | +- MethodCallExpression[@ApexVersion = 54.0, @DefiningType = "Foo", @FullMethodName = "aMethod", @InputParametersSize = 0, @MethodName = "aMethod", @Namespace = "", @RealLoc = true] - | | +- ReferenceExpression[@ApexVersion = 54.0, @Context = null, @DefiningType = "Foo", @Namespace = "", @RealLoc = false, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = true] - | | +- ArrayLoadExpression[@ApexVersion = 54.0, @DefiningType = "Foo", @Namespace = "", @RealLoc = true] - | | +- VariableExpression[@ApexVersion = 54.0, @DefiningType = "Foo", @Image = "a", @Namespace = "", @RealLoc = true] - | | | +- EmptyReferenceExpression[@ApexVersion = 54.0, @DefiningType = null, @Namespace = null, @RealLoc = false] - | | +- VariableExpression[@ApexVersion = 54.0, @DefiningType = "Foo", @Image = "x", @Namespace = "", @RealLoc = true] - | | +- EmptyReferenceExpression[@ApexVersion = 54.0, @DefiningType = null, @Namespace = null, @RealLoc = false] - | +- ExpressionStatement[@ApexVersion = 54.0, @DefiningType = "Foo", @Namespace = "", @RealLoc = true] - | +- VariableExpression[@ApexVersion = 54.0, @DefiningType = "Foo", @Image = "aField", @Namespace = "", @RealLoc = true] - | +- ReferenceExpression[@ApexVersion = 54.0, @Context = null, @DefiningType = "Foo", @Namespace = "", @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = true] - | +- MethodCallExpression[@ApexVersion = 54.0, @DefiningType = "Foo", @FullMethodName = "aMethod", @InputParametersSize = 0, @MethodName = "aMethod", @Namespace = "", @RealLoc = true] - | +- ReferenceExpression[@ApexVersion = 54.0, @Context = null, @DefiningType = "Foo", @Namespace = "", @RealLoc = false, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false] - | +- ArrayLoadExpression[@ApexVersion = 54.0, @DefiningType = "Foo", @Namespace = "", @RealLoc = true] - | +- VariableExpression[@ApexVersion = 54.0, @DefiningType = "Foo", @Image = "a", @Namespace = "", @RealLoc = true] - | | +- EmptyReferenceExpression[@ApexVersion = 54.0, @DefiningType = null, @Namespace = null, @RealLoc = false] - | +- VariableExpression[@ApexVersion = 54.0, @DefiningType = "Foo", @Image = "x", @Namespace = "", @RealLoc = true] - | +- EmptyReferenceExpression[@ApexVersion = 54.0, @DefiningType = null, @Namespace = null, @RealLoc = false] - +- Method[@ApexVersion = 54.0, @Arity = 1, @CanonicalName = "getName", @Constructor = false, @DefiningType = "Foo", @Image = "getName", @Namespace = "", @RealLoc = true, @ReturnType = "String", @Synthetic = false] - | +- ModifierNode[@Abstract = false, @ApexVersion = 54.0, @DefiningType = "Foo", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 1, @Namespace = "", @Override = false, @Private = false, @Protected = false, @Public = true, @RealLoc = true, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] - | +- Parameter[@ApexVersion = 54.0, @DefiningType = "Foo", @Image = "accId", @Namespace = "", @RealLoc = true, @Type = "int"] - | | +- ModifierNode[@Abstract = false, @ApexVersion = 54.0, @DefiningType = "Foo", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 0, @Namespace = "", @Override = false, @Private = false, @Protected = false, @Public = false, @RealLoc = true, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] - | +- BlockStatement[@ApexVersion = 54.0, @CurlyBrace = true, @DefiningType = "Foo", @Namespace = "", @RealLoc = true] - | +- VariableDeclarationStatements[@ApexVersion = 54.0, @DefiningType = "Foo", @Namespace = "", @RealLoc = true] - | | +- ModifierNode[@Abstract = false, @ApexVersion = 54.0, @DefiningType = "Foo", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 0, @Namespace = "", @Override = false, @Private = false, @Protected = false, @Public = false, @RealLoc = false, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] - | | +- VariableDeclaration[@ApexVersion = 54.0, @DefiningType = "Foo", @Image = "s", @Namespace = "", @RealLoc = true, @Type = "String"] - | | +- VariableExpression[@ApexVersion = 54.0, @DefiningType = "Foo", @Image = "BillingCity", @Namespace = "", @RealLoc = true] - | | | +- ReferenceExpression[@ApexVersion = 54.0, @Context = null, @DefiningType = "Foo", @Namespace = "", @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = true] - | | | +- VariableExpression[@ApexVersion = 54.0, @DefiningType = "Foo", @Image = "Account", @Namespace = "", @RealLoc = true] - | | | +- ReferenceExpression[@ApexVersion = 54.0, @Context = null, @DefiningType = "Foo", @Image = "contact", @Namespace = "", @RealLoc = true, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = false] - | | +- VariableExpression[@ApexVersion = 54.0, @DefiningType = "Foo", @Image = "s", @Namespace = "", @RealLoc = true] - | | +- EmptyReferenceExpression[@ApexVersion = 54.0, @DefiningType = null, @Namespace = null, @RealLoc = false] - | +- ReturnStatement[@ApexVersion = 54.0, @DefiningType = "Foo", @Namespace = "", @RealLoc = true] - | +- VariableExpression[@ApexVersion = 54.0, @DefiningType = "Foo", @Image = "Name", @Namespace = "", @RealLoc = true] - | +- ReferenceExpression[@ApexVersion = 54.0, @Context = null, @DefiningType = "Foo", @Namespace = "", @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = true] - | +- SoqlExpression[@ApexVersion = 54.0, @CanonicalQuery = "SELECT Name FROM Account WHERE Id = :tmpVar1", @DefiningType = "Foo", @Namespace = "", @Query = "SELECT Name FROM Account WHERE Id = :accId", @RealLoc = true] - | +- BindExpressions[@ApexVersion = 54.0, @DefiningType = "Foo", @Namespace = "", @RealLoc = true] - | +- VariableExpression[@ApexVersion = 54.0, @DefiningType = "Foo", @Image = "accId", @Namespace = "", @RealLoc = true] - | +- EmptyReferenceExpression[@ApexVersion = 54.0, @DefiningType = null, @Namespace = null, @RealLoc = false] - +- Method[@ApexVersion = 54.0, @Arity = 0, @CanonicalName = "", @Constructor = false, @DefiningType = "Foo", @Image = "", @Namespace = "", @RealLoc = false, @ReturnType = "void", @Synthetic = true] - | +- ModifierNode[@Abstract = false, @ApexVersion = 54.0, @DefiningType = "Foo", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 8, @Namespace = "", @Override = false, @Private = false, @Protected = false, @Public = false, @RealLoc = true, @Static = true, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] - +- Method[@ApexVersion = 54.0, @Arity = 0, @CanonicalName = "clone", @Constructor = false, @DefiningType = "Foo", @Image = "clone", @Namespace = "", @RealLoc = false, @ReturnType = "Object", @Synthetic = true] - | +- ModifierNode[@Abstract = false, @ApexVersion = 54.0, @DefiningType = "Foo", @DeprecatedTestMethod = false, @Final = false, @Global = true, @InheritedSharing = false, @Modifiers = 0, @Namespace = "", @Override = false, @Private = false, @Protected = false, @Public = false, @RealLoc = false, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] - +- UserClassMethods[@ApexVersion = 54.0, @DefiningType = "Foo", @Namespace = "", @RealLoc = false] - | +- Method[@ApexVersion = 54.0, @Arity = 0, @CanonicalName = "", @Constructor = true, @DefiningType = "Foo", @Image = "", @Namespace = "", @RealLoc = false, @ReturnType = "void", @Synthetic = true] - | +- ModifierNode[@Abstract = false, @ApexVersion = 54.0, @DefiningType = "Foo", @DeprecatedTestMethod = false, @Final = false, @Global = true, @InheritedSharing = false, @Modifiers = 0, @Namespace = "", @Override = false, @Private = false, @Protected = false, @Public = false, @RealLoc = true, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] - +- BridgeMethodCreator[@ApexVersion = 54.0, @DefiningType = "Foo", @Namespace = "", @RealLoc = false] ++- ApexFile[@ApexVersion = 59.0, @DefiningType = "Foo", @Namespace = "", @RealLoc = true] + +- UserClass[@ApexVersion = 59.0, @DefiningType = "Foo", @Image = "Foo", @Namespace = "", @RealLoc = true, @SimpleName = "Foo", @SuperClassName = ""] + +- ModifierNode[@Abstract = false, @ApexVersion = 59.0, @DefiningType = "Foo", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 1, @Namespace = "", @Override = false, @Private = false, @Protected = false, @Public = true, @RealLoc = true, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] + +- Field[@ApexVersion = 59.0, @DefiningType = "Foo", @Image = "x", @Name = "x", @Namespace = "", @RealLoc = true, @Type = "Integer", @Value = null] + | +- ModifierNode[@Abstract = false, @ApexVersion = 59.0, @DefiningType = "Foo", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 0, @Namespace = "", @Override = false, @Private = false, @Protected = false, @Public = false, @RealLoc = true, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] + +- Field[@ApexVersion = 59.0, @DefiningType = "Foo", @Image = "profileUrl", @Name = "profileUrl", @Namespace = "", @RealLoc = true, @Type = "String", @Value = null] + | +- ModifierNode[@Abstract = false, @ApexVersion = 59.0, @DefiningType = "Foo", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 0, @Namespace = "", @Override = false, @Private = false, @Protected = false, @Public = false, @RealLoc = true, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] + +- FieldDeclarationStatements[@ApexVersion = 59.0, @DefiningType = "Foo", @Namespace = "", @RealLoc = true, @TypeName = "Integer"] + | +- ModifierNode[@Abstract = false, @ApexVersion = 59.0, @DefiningType = "Foo", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 0, @Namespace = "", @Override = false, @Private = false, @Protected = false, @Public = false, @RealLoc = false, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] + | +- FieldDeclaration[@ApexVersion = 59.0, @DefiningType = "Foo", @Image = "anIntegerField", @Name = "anIntegerField", @Namespace = "", @RealLoc = true] + | +- VariableExpression[@ApexVersion = 59.0, @DefiningType = "Foo", @Image = "anIntegerField", @Namespace = "", @RealLoc = true] + | | +- ReferenceExpression[@ApexVersion = 59.0, @Context = null, @DefiningType = "Foo", @Namespace = "", @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = true] + | | +- VariableExpression[@ApexVersion = 59.0, @DefiningType = "Foo", @Image = "anObject", @Namespace = "", @RealLoc = true] + | | +- EmptyReferenceExpression[@ApexVersion = 59.0, @DefiningType = null, @Namespace = null, @RealLoc = false] + | +- VariableExpression[@ApexVersion = 59.0, @DefiningType = "Foo", @Image = "x", @Namespace = "", @RealLoc = true] + | +- EmptyReferenceExpression[@ApexVersion = 59.0, @DefiningType = null, @Namespace = null, @RealLoc = false] + +- FieldDeclarationStatements[@ApexVersion = 59.0, @DefiningType = "Foo", @Namespace = "", @RealLoc = true, @TypeName = "String"] + | +- ModifierNode[@Abstract = false, @ApexVersion = 59.0, @DefiningType = "Foo", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 0, @Namespace = "", @Override = false, @Private = false, @Protected = false, @Public = false, @RealLoc = false, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] + | +- FieldDeclaration[@ApexVersion = 59.0, @DefiningType = "Foo", @Image = "profileUrl", @Name = "profileUrl", @Namespace = "", @RealLoc = true] + | +- MethodCallExpression[@ApexVersion = 59.0, @DefiningType = "Foo", @FullMethodName = "toExternalForm", @InputParametersSize = 0, @MethodName = "toExternalForm", @Namespace = "", @RealLoc = true] + | | +- ReferenceExpression[@ApexVersion = 59.0, @Context = null, @DefiningType = "Foo", @Namespace = "", @RealLoc = false, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = true] + | | +- MethodCallExpression[@ApexVersion = 59.0, @DefiningType = "Foo", @FullMethodName = "user.getProfileUrl", @InputParametersSize = 0, @MethodName = "getProfileUrl", @Namespace = "", @RealLoc = true] + | | +- ReferenceExpression[@ApexVersion = 59.0, @Context = null, @DefiningType = "Foo", @Image = "user", @Namespace = "", @RealLoc = true, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false] + | +- VariableExpression[@ApexVersion = 59.0, @DefiningType = "Foo", @Image = "profileUrl", @Namespace = "", @RealLoc = true] + | +- EmptyReferenceExpression[@ApexVersion = 59.0, @DefiningType = null, @Namespace = null, @RealLoc = false] + +- Method[@ApexVersion = 59.0, @Arity = 1, @CanonicalName = "bar1", @Constructor = false, @DefiningType = "Foo", @Image = "bar1", @Namespace = "", @RealLoc = true, @ReturnType = "void", @Synthetic = false] + | +- ModifierNode[@Abstract = false, @ApexVersion = 59.0, @DefiningType = "Foo", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 1, @Namespace = "", @Override = false, @Private = false, @Protected = false, @Public = true, @RealLoc = true, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] + | +- Parameter[@ApexVersion = 59.0, @DefiningType = "Foo", @Image = "a", @Namespace = "", @RealLoc = true, @Type = "Object"] + | | +- ModifierNode[@Abstract = false, @ApexVersion = 59.0, @DefiningType = "Foo", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 0, @Namespace = "", @Override = false, @Private = false, @Protected = false, @Public = false, @RealLoc = true, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] + | +- BlockStatement[@ApexVersion = 59.0, @CurlyBrace = true, @DefiningType = "Foo", @Namespace = "", @RealLoc = true] + | +- ExpressionStatement[@ApexVersion = 59.0, @DefiningType = "Foo", @Namespace = "", @RealLoc = true] + | | +- VariableExpression[@ApexVersion = 59.0, @DefiningType = "Foo", @Image = "b", @Namespace = "", @RealLoc = true] + | | +- ReferenceExpression[@ApexVersion = 59.0, @Context = null, @DefiningType = "Foo", @Namespace = "", @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = true] + | | +- VariableExpression[@ApexVersion = 59.0, @DefiningType = "Foo", @Image = "a", @Namespace = "", @RealLoc = true] + | | +- EmptyReferenceExpression[@ApexVersion = 59.0, @DefiningType = null, @Namespace = null, @RealLoc = false] + | +- ExpressionStatement[@ApexVersion = 59.0, @DefiningType = "Foo", @Namespace = "", @RealLoc = true] + | +- MethodCallExpression[@ApexVersion = 59.0, @DefiningType = "Foo", @FullMethodName = "c1", @InputParametersSize = 0, @MethodName = "c1", @Namespace = "", @RealLoc = true] + | +- ReferenceExpression[@ApexVersion = 59.0, @Context = null, @DefiningType = "Foo", @Namespace = "", @RealLoc = false, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = true] + | +- CastExpression[@ApexVersion = 59.0, @DefiningType = "Foo", @Namespace = "", @RealLoc = true] + | +- VariableExpression[@ApexVersion = 59.0, @DefiningType = "Foo", @Image = "b1", @Namespace = "", @RealLoc = true] + | +- ReferenceExpression[@ApexVersion = 59.0, @Context = null, @DefiningType = "Foo", @Namespace = "", @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = true] + | +- VariableExpression[@ApexVersion = 59.0, @DefiningType = "Foo", @Image = "a1", @Namespace = "", @RealLoc = true] + | +- EmptyReferenceExpression[@ApexVersion = 59.0, @DefiningType = null, @Namespace = null, @RealLoc = false] + +- Method[@ApexVersion = 59.0, @Arity = 2, @CanonicalName = "bar2", @Constructor = false, @DefiningType = "Foo", @Image = "bar2", @Namespace = "", @RealLoc = true, @ReturnType = "void", @Synthetic = false] + | +- ModifierNode[@Abstract = false, @ApexVersion = 59.0, @DefiningType = "Foo", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 1, @Namespace = "", @Override = false, @Private = false, @Protected = false, @Public = true, @RealLoc = true, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] + | +- Parameter[@ApexVersion = 59.0, @DefiningType = "Foo", @Image = "a", @Namespace = "", @RealLoc = true, @Type = "List"] + | | +- ModifierNode[@Abstract = false, @ApexVersion = 59.0, @DefiningType = "Foo", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 0, @Namespace = "", @Override = false, @Private = false, @Protected = false, @Public = false, @RealLoc = true, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] + | +- Parameter[@ApexVersion = 59.0, @DefiningType = "Foo", @Image = "x", @Namespace = "", @RealLoc = true, @Type = "int"] + | | +- ModifierNode[@Abstract = false, @ApexVersion = 59.0, @DefiningType = "Foo", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 0, @Namespace = "", @Override = false, @Private = false, @Protected = false, @Public = false, @RealLoc = true, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] + | +- BlockStatement[@ApexVersion = 59.0, @CurlyBrace = true, @DefiningType = "Foo", @Namespace = "", @RealLoc = true] + | +- ExpressionStatement[@ApexVersion = 59.0, @DefiningType = "Foo", @Namespace = "", @RealLoc = true] + | | +- VariableExpression[@ApexVersion = 59.0, @DefiningType = "Foo", @Image = "aField", @Namespace = "", @RealLoc = true] + | | +- ReferenceExpression[@ApexVersion = 59.0, @Context = null, @DefiningType = "Foo", @Namespace = "", @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = false] + | | +- MethodCallExpression[@ApexVersion = 59.0, @DefiningType = "Foo", @FullMethodName = "aMethod", @InputParametersSize = 0, @MethodName = "aMethod", @Namespace = "", @RealLoc = true] + | | +- ReferenceExpression[@ApexVersion = 59.0, @Context = null, @DefiningType = "Foo", @Namespace = "", @RealLoc = false, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = true] + | | +- ArrayLoadExpression[@ApexVersion = 59.0, @DefiningType = "Foo", @Namespace = "", @RealLoc = true] + | | +- VariableExpression[@ApexVersion = 59.0, @DefiningType = "Foo", @Image = "a", @Namespace = "", @RealLoc = true] + | | | +- EmptyReferenceExpression[@ApexVersion = 59.0, @DefiningType = null, @Namespace = null, @RealLoc = false] + | | +- VariableExpression[@ApexVersion = 59.0, @DefiningType = "Foo", @Image = "x", @Namespace = "", @RealLoc = true] + | | +- EmptyReferenceExpression[@ApexVersion = 59.0, @DefiningType = null, @Namespace = null, @RealLoc = false] + | +- ExpressionStatement[@ApexVersion = 59.0, @DefiningType = "Foo", @Namespace = "", @RealLoc = true] + | +- VariableExpression[@ApexVersion = 59.0, @DefiningType = "Foo", @Image = "aField", @Namespace = "", @RealLoc = true] + | +- ReferenceExpression[@ApexVersion = 59.0, @Context = null, @DefiningType = "Foo", @Namespace = "", @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = true] + | +- MethodCallExpression[@ApexVersion = 59.0, @DefiningType = "Foo", @FullMethodName = "aMethod", @InputParametersSize = 0, @MethodName = "aMethod", @Namespace = "", @RealLoc = true] + | +- ReferenceExpression[@ApexVersion = 59.0, @Context = null, @DefiningType = "Foo", @Namespace = "", @RealLoc = false, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false] + | +- ArrayLoadExpression[@ApexVersion = 59.0, @DefiningType = "Foo", @Namespace = "", @RealLoc = true] + | +- VariableExpression[@ApexVersion = 59.0, @DefiningType = "Foo", @Image = "a", @Namespace = "", @RealLoc = true] + | | +- EmptyReferenceExpression[@ApexVersion = 59.0, @DefiningType = null, @Namespace = null, @RealLoc = false] + | +- VariableExpression[@ApexVersion = 59.0, @DefiningType = "Foo", @Image = "x", @Namespace = "", @RealLoc = true] + | +- EmptyReferenceExpression[@ApexVersion = 59.0, @DefiningType = null, @Namespace = null, @RealLoc = false] + +- Method[@ApexVersion = 59.0, @Arity = 1, @CanonicalName = "getName", @Constructor = false, @DefiningType = "Foo", @Image = "getName", @Namespace = "", @RealLoc = true, @ReturnType = "String", @Synthetic = false] + | +- ModifierNode[@Abstract = false, @ApexVersion = 59.0, @DefiningType = "Foo", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 1, @Namespace = "", @Override = false, @Private = false, @Protected = false, @Public = true, @RealLoc = true, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] + | +- Parameter[@ApexVersion = 59.0, @DefiningType = "Foo", @Image = "accId", @Namespace = "", @RealLoc = true, @Type = "int"] + | | +- ModifierNode[@Abstract = false, @ApexVersion = 59.0, @DefiningType = "Foo", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 0, @Namespace = "", @Override = false, @Private = false, @Protected = false, @Public = false, @RealLoc = true, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] + | +- BlockStatement[@ApexVersion = 59.0, @CurlyBrace = true, @DefiningType = "Foo", @Namespace = "", @RealLoc = true] + | +- VariableDeclarationStatements[@ApexVersion = 59.0, @DefiningType = "Foo", @Namespace = "", @RealLoc = true] + | | +- ModifierNode[@Abstract = false, @ApexVersion = 59.0, @DefiningType = "Foo", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 0, @Namespace = "", @Override = false, @Private = false, @Protected = false, @Public = false, @RealLoc = false, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] + | | +- VariableDeclaration[@ApexVersion = 59.0, @DefiningType = "Foo", @Image = "s", @Namespace = "", @RealLoc = true, @Type = "String"] + | | +- VariableExpression[@ApexVersion = 59.0, @DefiningType = "Foo", @Image = "BillingCity", @Namespace = "", @RealLoc = true] + | | | +- ReferenceExpression[@ApexVersion = 59.0, @Context = null, @DefiningType = "Foo", @Namespace = "", @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = true] + | | | +- VariableExpression[@ApexVersion = 59.0, @DefiningType = "Foo", @Image = "Account", @Namespace = "", @RealLoc = true] + | | | +- ReferenceExpression[@ApexVersion = 59.0, @Context = null, @DefiningType = "Foo", @Image = "contact", @Namespace = "", @RealLoc = true, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = false] + | | +- VariableExpression[@ApexVersion = 59.0, @DefiningType = "Foo", @Image = "s", @Namespace = "", @RealLoc = true] + | | +- EmptyReferenceExpression[@ApexVersion = 59.0, @DefiningType = null, @Namespace = null, @RealLoc = false] + | +- ReturnStatement[@ApexVersion = 59.0, @DefiningType = "Foo", @Namespace = "", @RealLoc = true] + | +- VariableExpression[@ApexVersion = 59.0, @DefiningType = "Foo", @Image = "Name", @Namespace = "", @RealLoc = true] + | +- ReferenceExpression[@ApexVersion = 59.0, @Context = null, @DefiningType = "Foo", @Namespace = "", @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = true] + | +- SoqlExpression[@ApexVersion = 59.0, @CanonicalQuery = "SELECT Name FROM Account WHERE Id = :tmpVar1", @DefiningType = "Foo", @Namespace = "", @Query = "SELECT Name FROM Account WHERE Id = :accId", @RealLoc = true] + | +- BindExpressions[@ApexVersion = 59.0, @DefiningType = "Foo", @Namespace = "", @RealLoc = true] + | +- VariableExpression[@ApexVersion = 59.0, @DefiningType = "Foo", @Image = "accId", @Namespace = "", @RealLoc = true] + | +- EmptyReferenceExpression[@ApexVersion = 59.0, @DefiningType = null, @Namespace = null, @RealLoc = false] + +- Method[@ApexVersion = 59.0, @Arity = 0, @CanonicalName = "", @Constructor = false, @DefiningType = "Foo", @Image = "", @Namespace = "", @RealLoc = false, @ReturnType = "void", @Synthetic = true] + | +- ModifierNode[@Abstract = false, @ApexVersion = 59.0, @DefiningType = "Foo", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 8, @Namespace = "", @Override = false, @Private = false, @Protected = false, @Public = false, @RealLoc = true, @Static = true, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] + +- Method[@ApexVersion = 59.0, @Arity = 0, @CanonicalName = "clone", @Constructor = false, @DefiningType = "Foo", @Image = "clone", @Namespace = "", @RealLoc = false, @ReturnType = "Object", @Synthetic = true] + | +- ModifierNode[@Abstract = false, @ApexVersion = 59.0, @DefiningType = "Foo", @DeprecatedTestMethod = false, @Final = false, @Global = true, @InheritedSharing = false, @Modifiers = 0, @Namespace = "", @Override = false, @Private = false, @Protected = false, @Public = false, @RealLoc = false, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] + +- UserClassMethods[@ApexVersion = 59.0, @DefiningType = "Foo", @Namespace = "", @RealLoc = false] + | +- Method[@ApexVersion = 59.0, @Arity = 0, @CanonicalName = "", @Constructor = true, @DefiningType = "Foo", @Image = "", @Namespace = "", @RealLoc = false, @ReturnType = "void", @Synthetic = true] + | +- ModifierNode[@Abstract = false, @ApexVersion = 59.0, @DefiningType = "Foo", @DeprecatedTestMethod = false, @Final = false, @Global = true, @InheritedSharing = false, @Modifiers = 0, @Namespace = "", @Override = false, @Private = false, @Protected = false, @Public = false, @RealLoc = true, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] + +- BridgeMethodCreator[@ApexVersion = 59.0, @DefiningType = "Foo", @Namespace = "", @RealLoc = false] diff --git a/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/rule/design/UnusedMethod/project1/sfdx-project.json b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/rule/design/UnusedMethod/project1/sfdx-project.json new file mode 100644 index 0000000000..dba67ee8c1 --- /dev/null +++ b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/rule/design/UnusedMethod/project1/sfdx-project.json @@ -0,0 +1,9 @@ +{ + "packageDirectories": [ + { + "path": "src", + "default": true + } + ], + "namespace": "foo_ns" +} diff --git a/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/rule/design/UnusedMethod/project1/src/Foo.cls b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/rule/design/UnusedMethod/project1/src/Foo.cls new file mode 100644 index 0000000000..08bd87f565 --- /dev/null +++ b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/rule/design/UnusedMethod/project1/src/Foo.cls @@ -0,0 +1,18 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +public class Foo { + // this method is needed, otherwise the whole class is considered as unused, as it would contain + // then only one unused method. + private void other() {} + + public void unusedMethod() { + // ÀÀÀÀ // at least 4 umlauts are required in order to + // reproduce the ArrayIndexOutOfBoundsException (#4453) + // up to 7.0.0-rc3 with export PMD_JAVA_OPTS="-Dfile.encoding=ISO-8859-15" (e.g. platform encoding is not UTF-8) + other(); + // note: there should be no additional characters + // after this method, only the two closing brackets + } +} diff --git a/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/rule/security/xml/ApexCRUDViolation.xml b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/rule/security/xml/ApexCRUDViolation.xml index 12a11a5729..7d5ec7d018 100644 --- a/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/rule/security/xml/ApexCRUDViolation.xml +++ b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/rule/security/xml/ApexCRUDViolation.xml @@ -1740,7 +1740,7 @@ public class Foo { - Consider Database DML methods with AccessLevel parameter + Consider Database DML methods with AccessLevel parameter #4146 7 4,12,19,19,26,33,39 @@ -1799,11 +1799,10 @@ public class UserMode { ]]> - - - Consider "insert as" + + Consider "insert as" #4146 #3973 1 - 7 + 8 diff --git a/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/rule/security/xml/ApexSOQLInjection.xml b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/rule/security/xml/ApexSOQLInjection.xml index 966f46c48f..1b1055f776 100644 --- a/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/rule/security/xml/ApexSOQLInjection.xml +++ b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/rule/security/xml/ApexSOQLInjection.xml @@ -62,6 +62,62 @@ public class Foo { ]]> + + SObjectType and Field as parameters are safe to use in SOQL query string building #4646 + 0 + + + + + SObjectType and Field as variables are safe to use in SOQL query string building #4646 + 0 + + + + + Schema.SObjectType and Field as parameters are safe to use in SOQL query string building #4646 + 0 + + + + + Schema.SObjectType and Field as variables are safe to use in SOQL query string building #4646 + 0 + + + Safe SOQL + merged variable from a literal 0 diff --git a/pmd-cli/src/main/java/net/sourceforge/pmd/cli/commands/internal/CpdCommand.java b/pmd-cli/src/main/java/net/sourceforge/pmd/cli/commands/internal/CpdCommand.java index bea731babc..1b61689251 100644 --- a/pmd-cli/src/main/java/net/sourceforge/pmd/cli/commands/internal/CpdCommand.java +++ b/pmd-cli/src/main/java/net/sourceforge/pmd/cli/commands/internal/CpdCommand.java @@ -104,7 +104,9 @@ public class CpdCommand extends AbstractAnalysisPmdSubcommand } configuration.setFailOnViolation(failOnViolation); configuration.setInputFilePath(fileListPath); - configuration.setInputPathList(inputPaths); + if (inputPaths != null) { + configuration.setInputPathList(inputPaths); + } configuration.setIgnoreAnnotations(ignoreAnnotations); configuration.setIgnoreIdentifiers(ignoreIdentifiers); configuration.setIgnoreLiterals(ignoreLiterals); diff --git a/pmd-cli/src/test/java/net/sourceforge/pmd/cli/CpdCliTest.java b/pmd-cli/src/test/java/net/sourceforge/pmd/cli/CpdCliTest.java index e751ebf741..96101700be 100644 --- a/pmd-cli/src/test/java/net/sourceforge/pmd/cli/CpdCliTest.java +++ b/pmd-cli/src/test/java/net/sourceforge/pmd/cli/CpdCliTest.java @@ -12,6 +12,8 @@ import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.emptyString; import static org.hamcrest.Matchers.equalTo; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.Collection; @@ -37,8 +39,8 @@ class CpdCliTest extends BaseCliTest { private static final Map NUMBER_OF_TOKENS = ImmutableMap.of( SRC_PATH.resolve("dup1.java").toString(), 89, SRC_PATH.resolve("dup2.java").toString(), 89, - SRC_PATH.resolve("file_with_ISO-8859-1_encoding.java").toString(), 8, - SRC_PATH.resolve("file_with_utf8_bom.java").toString(), 9 + SRC_PATH.resolve("fileWith_ISO8859_1_Encoding.java").toString(), 5, + SRC_PATH.resolve("fileWith_UTF_8_BOM_Encoding.java").toString(), 5 ); @TempDir private Path tempDir; @@ -147,19 +149,17 @@ class CpdCliTest extends BaseCliTest { @Test void testNoDuplicatesResultRendering() throws Exception { - final Path srcDir = Paths.get(SRC_DIR).toAbsolutePath(); String expectedReport = "\n" + "\n" - + " \n" - + " \n" - + " \n" - + " \n" - + "\n"; + + " \n" + + " \n" + + "\n"; runCliSuccessfully("--minimum-tokens", "340", "--language", "java", "--dir", SRC_DIR, "--format", "xml") .verify(result -> result.checkStdOut(equalTo(expectedReport))); @@ -228,4 +228,17 @@ class CpdCliTest extends BaseCliTest { "\n\n" )); } + + @Test + void testFileListOnly() throws Exception { + Path fileList = tempDir.resolve("fileList.txt"); + StringBuilder fileListContent = new StringBuilder(); + fileListContent.append(SRC_PATH.resolve("dup1.java")).append(System.lineSeparator()); + fileListContent.append(SRC_PATH.resolve("dup2.java")).append(System.lineSeparator()); + Files.write(fileList, fileListContent.toString().getBytes(StandardCharsets.UTF_8)); + runCli(VIOLATIONS_FOUND, "--minimum-tokens", "5", "--file-list", fileList.toString()) + .verify(result -> result.checkStdOut(containsString( + "Found a 14 line (86 tokens) duplication in the following files:" + ))); + } } diff --git a/pmd-cli/src/test/resources/net/sourceforge/pmd/cli/cpd/files/file_with_ISO-8859-1_encoding.java b/pmd-cli/src/test/resources/net/sourceforge/pmd/cli/cpd/files/fileWith_ISO8859_1_Encoding.java similarity index 70% rename from pmd-cli/src/test/resources/net/sourceforge/pmd/cli/cpd/files/file_with_ISO-8859-1_encoding.java rename to pmd-cli/src/test/resources/net/sourceforge/pmd/cli/cpd/files/fileWith_ISO8859_1_Encoding.java index 1b77e3ef98..6cdcfe1b54 100644 --- a/pmd-cli/src/test/resources/net/sourceforge/pmd/cli/cpd/files/file_with_ISO-8859-1_encoding.java +++ b/pmd-cli/src/test/resources/net/sourceforge/pmd/cli/cpd/files/fileWith_ISO8859_1_Encoding.java @@ -3,6 +3,6 @@ * * δ (this is an a-umlaut U+00E4) */ -public class FileWith_ISO8859-1_Encoding { +public class fileWith_ISO8859_1_Encoding { } diff --git a/pmd-cli/src/test/resources/net/sourceforge/pmd/cli/cpd/files/file_with_utf8_bom.java b/pmd-cli/src/test/resources/net/sourceforge/pmd/cli/cpd/files/fileWith_UTF_8_BOM_Encoding.java similarity index 69% rename from pmd-cli/src/test/resources/net/sourceforge/pmd/cli/cpd/files/file_with_utf8_bom.java rename to pmd-cli/src/test/resources/net/sourceforge/pmd/cli/cpd/files/fileWith_UTF_8_BOM_Encoding.java index 30fd5d2b2b..dec2269f1f 100644 --- a/pmd-cli/src/test/resources/net/sourceforge/pmd/cli/cpd/files/file_with_utf8_bom.java +++ b/pmd-cli/src/test/resources/net/sourceforge/pmd/cli/cpd/files/fileWith_UTF_8_BOM_Encoding.java @@ -3,6 +3,6 @@ * * Γ€ (this is an a-umlaut U+00E4) */ -public class FileWith_UTF-8-BOM_Encoding { +public class FileWith_UTF_8_BOM_Encoding { } diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/LanguageProcessorRegistry.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/LanguageProcessorRegistry.java index 9303cc8706..19bc5a02ae 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/LanguageProcessorRegistry.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/LanguageProcessorRegistry.java @@ -117,6 +117,14 @@ public final class LanguageProcessorRegistry implements AutoCloseable { public static LanguageProcessorRegistry create(LanguageRegistry registry, Map languageProperties, MessageReporter messageReporter) { + return create(registry, languageProperties, messageReporter, System.getenv()); + } + + // overload for testing to allow mocking the system env vars. + static LanguageProcessorRegistry create(LanguageRegistry registry, + Map languageProperties, + MessageReporter messageReporter, + Map env) { Set processors = new HashSet<>(); for (Language language : registry) { if (!(language instanceof PmdCapableLanguage)) { @@ -130,7 +138,7 @@ public final class LanguageProcessorRegistry implements AutoCloseable { try { // - readLanguagePropertiesFromEnv(properties, messageReporter); + readLanguagePropertiesFromEnv(properties, messageReporter, env); processors.add(((PmdCapableLanguage) language).createProcessor(properties)); } catch (IllegalArgumentException e) { @@ -186,11 +194,11 @@ public final class LanguageProcessorRegistry implements AutoCloseable { } } - private static void readLanguagePropertiesFromEnv(LanguagePropertyBundle props, MessageReporter reporter) { + private static void readLanguagePropertiesFromEnv(LanguagePropertyBundle props, MessageReporter reporter, Map env) { for (PropertyDescriptor propertyDescriptor : props.getPropertyDescriptors()) { String envVarName = getEnvironmentVariableName(props.getLanguage(), propertyDescriptor); - String propertyValue = System.getenv(envVarName); + String propertyValue = env.get(envVarName); if (propertyValue != null) { if (props.isPropertyOverridden(propertyDescriptor)) { diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/impl/MultiThreadProcessor.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/impl/MultiThreadProcessor.java index 035accf05f..cd0e26dc37 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/impl/MultiThreadProcessor.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/impl/MultiThreadProcessor.java @@ -4,8 +4,12 @@ package net.sourceforge.pmd.lang.impl; +import java.util.LinkedList; +import java.util.List; +import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; +import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; import net.sourceforge.pmd.RuleSets; @@ -18,13 +22,15 @@ import net.sourceforge.pmd.util.log.MessageReporter; * @author Romain Pelisse <belaran@gmail.com> */ final class MultiThreadProcessor extends AbstractPMDProcessor { - private final ExecutorService executor; + private final List> futureList; + MultiThreadProcessor(final AnalysisTask task) { super(task); executor = Executors.newFixedThreadPool(task.getThreadCount(), new PmdThreadFactory()); + futureList = new LinkedList<>(); } @Override @@ -42,18 +48,30 @@ final class MultiThreadProcessor extends AbstractPMDProcessor { }); for (final TextFile textFile : task.getFiles()) { - executor.submit(new PmdRunnable(textFile, task) { + futureList.add(executor.submit(new PmdRunnable(textFile, task) { @Override protected RuleSets getRulesets() { return ruleSetCopy.get(); } - }); + })); } } @Override public void close() { try { + try { + for (Future task : futureList) { + task.get(); + } + } catch (ExecutionException e) { + task.getMessageReporter().error("Unknown error occurred while executing a PmdRunnable: {0}", + e.getCause().toString(), e.getCause()); + if (e.getCause() instanceof Error) { + throw (Error) e.getCause(); + } + } + executor.shutdown(); while (!executor.awaitTermination(10, TimeUnit.HOURS)) { // still waiting diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/util/StringUtil.java b/pmd-core/src/main/java/net/sourceforge/pmd/util/StringUtil.java index 0a4bd90b49..60ec003e57 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/util/StringUtil.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/util/StringUtil.java @@ -510,7 +510,7 @@ public final class StringUtil { @Override String joinWords(List words) { - return words.stream().map(s -> s.toLowerCase(Locale.ROOT)).collect(Collectors.joining("_")); + return words.stream().map(s -> s.toUpperCase(Locale.ROOT)).collect(Collectors.joining("_")); } }, /** camelCase. */ diff --git a/pmd-core/src/main/resources/rulesets/internal/all-ecmascript.xml b/pmd-core/src/main/resources/rulesets/internal/all-ecmascript.xml index e208b7cbb1..b65de902b2 100644 --- a/pmd-core/src/main/resources/rulesets/internal/all-ecmascript.xml +++ b/pmd-core/src/main/resources/rulesets/internal/all-ecmascript.xml @@ -1,4 +1,4 @@ - + + .*/net/sourceforge/pmd/lang/java/ast/InfiniteLoopInLookahead.java - - .*/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/DealingWithNull.java - .*/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/ExhaustiveSwitch.java - diff --git a/pmd-core/src/main/resources/rulesets/releases/33.xml b/pmd-core/src/main/resources/rulesets/releases/33.xml index 895e7820d9..c0072fe498 100644 --- a/pmd-core/src/main/resources/rulesets/releases/33.xml +++ b/pmd-core/src/main/resources/rulesets/releases/33.xml @@ -1,4 +1,4 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -20,5 +21,6 @@ This ruleset contains links to rules that are new in PMD v7.0.0 + diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/lang/LanguageProcessorRegistryTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/lang/LanguageProcessorRegistryTest.java new file mode 100644 index 0000000000..eb500bbfc6 --- /dev/null +++ b/pmd-core/src/test/java/net/sourceforge/pmd/lang/LanguageProcessorRegistryTest.java @@ -0,0 +1,51 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +package net.sourceforge.pmd.lang; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.util.HashMap; +import java.util.Map; + +import org.junit.jupiter.api.Test; + +import net.sourceforge.pmd.properties.PropertyDescriptor; +import net.sourceforge.pmd.properties.PropertyFactory; +import net.sourceforge.pmd.util.log.MessageReporter; + +class LanguageProcessorRegistryTest { + @Test + void loadEnvironmentVariables() throws Exception { + Map env = new HashMap<>(); + env.put("PMD_DUMMY_ROOT_DIRECTORY", "theValue"); + + Language dummyLanguage = DummyLanguageModule.getInstance().getDefaultVersion().getLanguage(); + LanguageRegistry languageRegistry = LanguageRegistry.singleton(dummyLanguage); + + Map languageProperties = new HashMap<>(); + DummyLanguagePropertyBundle bundle = new DummyLanguagePropertyBundle(dummyLanguage); + languageProperties.put(dummyLanguage, bundle); + + try (LanguageProcessorRegistry ignored = LanguageProcessorRegistry.create(languageRegistry, languageProperties, MessageReporter.quiet(), env)) { + assertEquals("theValue", bundle.getRootDirectory()); + } + } + + private static class DummyLanguagePropertyBundle extends LanguagePropertyBundle { + private static final PropertyDescriptor ROOT_DIRECTORY = PropertyFactory.stringProperty("rootDirectory") + .desc("Test") + .defaultValue("") + .build(); + + DummyLanguagePropertyBundle(Language language) { + super(language); + definePropertyDescriptor(ROOT_DIRECTORY); + } + + public String getRootDirectory() { + return getProperty(ROOT_DIRECTORY); + } + } +} diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/lang/impl/AbstractPMDProcessorTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/lang/impl/AbstractPMDProcessorTest.java index a95f36e3da..ca52a03e65 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/lang/impl/AbstractPMDProcessorTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/lang/impl/AbstractPMDProcessorTest.java @@ -4,24 +4,136 @@ package net.sourceforge.pmd.lang.impl; +import static net.sourceforge.pmd.util.CollectionUtil.listOf; +import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertSame; +import java.util.concurrent.atomic.AtomicInteger; + import org.junit.jupiter.api.Test; +import org.mockito.Mockito; +import net.sourceforge.pmd.PMDConfiguration; +import net.sourceforge.pmd.PmdAnalysis; +import net.sourceforge.pmd.Report; +import net.sourceforge.pmd.RuleContext; +import net.sourceforge.pmd.RuleSet; +import net.sourceforge.pmd.RuleViolation; +import net.sourceforge.pmd.lang.DummyLanguageModule; import net.sourceforge.pmd.lang.LanguageProcessor; +import net.sourceforge.pmd.lang.LanguageVersion; +import net.sourceforge.pmd.lang.ast.Node; +import net.sourceforge.pmd.lang.document.FileId; +import net.sourceforge.pmd.lang.document.TextFile; +import net.sourceforge.pmd.lang.rule.AbstractRule; +import net.sourceforge.pmd.reporting.FileAnalysisListener; +import net.sourceforge.pmd.reporting.GlobalAnalysisListener; +import net.sourceforge.pmd.util.log.MessageReporter; + +abstract class AbstractPMDProcessorTest { + protected SimpleReportListener reportListener; + + protected MessageReporter reporter; + + protected abstract int getThreads(); + + protected abstract Class getExpectedImplementation(); -class AbstractPMDProcessorTest { @Test - void shouldUseMonoThreadProcessorForZeroOnly() { - AbstractPMDProcessor processor = AbstractPMDProcessor.newFileProcessor(createTask(0)); - assertSame(MonoThreadProcessor.class, processor.getClass()); - - processor = AbstractPMDProcessor.newFileProcessor(createTask(1)); - assertSame(MultiThreadProcessor.class, processor.getClass()); + void shouldUseCorrectProcessorImpl() { + try (AbstractPMDProcessor processor = AbstractPMDProcessor.newFileProcessor(createTask(getThreads()))) { + assertSame(getExpectedImplementation(), processor.getClass()); + } } private LanguageProcessor.AnalysisTask createTask(int threads) { - LanguageProcessor.AnalysisTask task = new LanguageProcessor.AnalysisTask(null, null, null, threads, null, null, null); - return task; + return new LanguageProcessor.AnalysisTask(null, null, null, threads, null, null, null); + } + + @Test + void exceptionsShouldBeLogged() { + try (PmdAnalysis pmd = createPmdAnalysis()) { + pmd.addRuleSet(RuleSet.forSingleRule(new RuleThatThrowsException())); + pmd.performAnalysis(); + } + + assertEquals(2, reportListener.files.get()); + assertEquals(2, reportListener.errors.get()); + // exceptions are reported as processing errors + Mockito.verifyNoInteractions(reporter); + } + + protected PmdAnalysis createPmdAnalysis() { + PMDConfiguration configuration = new PMDConfiguration(); + configuration.setThreads(getThreads()); + configuration.setIgnoreIncrementalAnalysis(true); + reporter = Mockito.spy(configuration.getReporter()); + configuration.setReporter(reporter); + + PmdAnalysis pmd = PmdAnalysis.create(configuration); + LanguageVersion lv = DummyLanguageModule.getInstance().getDefaultVersion(); + pmd.files().addFile(TextFile.forCharSeq("abc", FileId.fromPathLikeString("file1-violation.dummy"), lv)); + pmd.files().addFile(TextFile.forCharSeq("DEF", FileId.fromPathLikeString("file2-foo.dummy"), lv)); + + reportListener = new SimpleReportListener(); + GlobalAnalysisListener listener = GlobalAnalysisListener.tee(listOf( + new Report.GlobalReportBuilderListener(), + reportListener + )); + + + pmd.addListener(listener); + return pmd; + } + + protected static class RuleThatThrowsException extends AbstractRule { + RuleThatThrowsException() { + setLanguage(DummyLanguageModule.getInstance().getDefaultVersion().getLanguage()); + } + + @Override + public void apply(Node target, RuleContext ctx) { + throw new RuntimeException("test exception"); + } + } + + protected static class RuleThatThrowsError extends AbstractRule { + RuleThatThrowsError() { + setLanguage(DummyLanguageModule.getInstance().getDefaultVersion().getLanguage()); + } + + @Override + public void apply(Node target, RuleContext ctx) { + throw new Error("test error"); + } + } + + protected static class SimpleReportListener implements GlobalAnalysisListener { + + public AtomicInteger violations = new AtomicInteger(0); + public AtomicInteger files = new AtomicInteger(0); + public AtomicInteger errors = new AtomicInteger(0); + + @Override + public FileAnalysisListener startFileAnalysis(TextFile file) { + files.incrementAndGet(); + + return new FileAnalysisListener() { + @Override + public void onRuleViolation(RuleViolation violation) { + violations.incrementAndGet(); + } + + @Override + public void onError(Report.ProcessingError error) { + errors.incrementAndGet(); + } + }; + } + + @Override + public void close() throws Exception { + + } } } diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/lang/impl/MonoThreadProcessorTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/lang/impl/MonoThreadProcessorTest.java new file mode 100644 index 0000000000..755003142b --- /dev/null +++ b/pmd-core/src/test/java/net/sourceforge/pmd/lang/impl/MonoThreadProcessorTest.java @@ -0,0 +1,43 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +package net.sourceforge.pmd.lang.impl; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import org.junit.jupiter.api.Test; +import org.mockito.Mockito; + +import net.sourceforge.pmd.PmdAnalysis; +import net.sourceforge.pmd.RuleSet; + +class MonoThreadProcessorTest extends AbstractPMDProcessorTest { + + @Override + protected int getThreads() { + return 0; + } + + @Override + protected Class getExpectedImplementation() { + return MonoThreadProcessor.class; + } + + @Test + void errorsShouldBeThrown() { + try (PmdAnalysis pmd = createPmdAnalysis()) { + pmd.addRuleSet(RuleSet.forSingleRule(new RuleThatThrowsError())); + Error exception = assertThrows(Error.class, pmd::performAnalysis); + assertEquals("test error", exception.getMessage()); + } + + // in mono thread, files are processed one after another. + // in case of error, we abort at the first error, so in this test case + // we abort at the first file, so only 1 file is processed. + assertEquals(1, reportListener.files.get()); + // in mono thread, the error just falls through, we don't additionally catch and log it. + Mockito.verifyNoInteractions(reporter); + } +} diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/lang/impl/MultiThreadProcessorTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/lang/impl/MultiThreadProcessorTest.java index f32b330b0a..12e381fac1 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/lang/impl/MultiThreadProcessorTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/lang/impl/MultiThreadProcessorTest.java @@ -4,51 +4,61 @@ package net.sourceforge.pmd.lang.impl; -import static net.sourceforge.pmd.util.CollectionUtil.listOf; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.concurrent.atomic.AtomicInteger; import org.junit.jupiter.api.Test; +import org.mockito.Mockito; -import net.sourceforge.pmd.PMDConfiguration; import net.sourceforge.pmd.PmdAnalysis; -import net.sourceforge.pmd.Report.GlobalReportBuilderListener; import net.sourceforge.pmd.RuleContext; -import net.sourceforge.pmd.RuleViolation; -import net.sourceforge.pmd.lang.DummyLanguageModule; -import net.sourceforge.pmd.lang.LanguageVersion; +import net.sourceforge.pmd.RuleSet; import net.sourceforge.pmd.lang.ast.Node; -import net.sourceforge.pmd.lang.document.FileId; -import net.sourceforge.pmd.lang.document.TextFile; import net.sourceforge.pmd.lang.rule.AbstractRule; -import net.sourceforge.pmd.reporting.FileAnalysisListener; -import net.sourceforge.pmd.reporting.GlobalAnalysisListener; -class MultiThreadProcessorTest { +class MultiThreadProcessorTest extends AbstractPMDProcessorTest { - private SimpleReportListener reportListener; + @Override + protected int getThreads() { + return 2; + } - PmdAnalysis setupForTest(final String ruleset) { - PMDConfiguration configuration = new PMDConfiguration(); - configuration.setThreads(2); - configuration.setIgnoreIncrementalAnalysis(true); - PmdAnalysis pmd = PmdAnalysis.create(configuration); - LanguageVersion lv = DummyLanguageModule.getInstance().getDefaultVersion(); - pmd.files().addFile(TextFile.forCharSeq("abc", FileId.fromPathLikeString("file1-violation.dummy"), lv)); - pmd.files().addFile(TextFile.forCharSeq("DEF", FileId.fromPathLikeString("file2-foo.dummy"), lv)); + @Override + protected Class getExpectedImplementation() { + return MultiThreadProcessor.class; + } - reportListener = new SimpleReportListener(); - GlobalAnalysisListener listener = GlobalAnalysisListener.tee(listOf( - new GlobalReportBuilderListener(), - reportListener - )); - - pmd.addListener(listener); + private PmdAnalysis createPmdAnalysis(final String ruleset) { + PmdAnalysis pmd = createPmdAnalysis(); pmd.addRuleSet(pmd.newRuleSetLoader().loadFromResource(ruleset)); return pmd; } + @Test + void errorsShouldBeThrown() { + // in multithreading mode, the errors are detected when closing PmdAnalysis + Error error = assertThrows(Error.class, () -> { + try (PmdAnalysis pmd = createPmdAnalysis()) { + pmd.addRuleSet(RuleSet.forSingleRule(new RuleThatThrowsError())); + pmd.performAnalysis(); + } + }); + assertEquals("test error", error.getMessage()); + + // in multithreading mode, all files are started but eventually fail + // depending on how many tasks have been started before getting the first results + // we might have started only one file analysis or more. But we rethrow + // the error on the first. + assertTrue(reportListener.files.get() >= 1); + // we report the first error + Mockito.verify(reporter).error(Mockito.eq("Unknown error occurred while executing a PmdRunnable: {0}"), + Mockito.eq("java.lang.Error: test error"), + Mockito.any(Error.class)); + } + // TODO: Dysfunctional rules are pruned upstream of the processor. // // @Test @@ -71,7 +81,7 @@ class MultiThreadProcessorTest { @Test void testRulesThreadSafety() throws Exception { - try (PmdAnalysis pmd = setupForTest("rulesets/MultiThreadProcessorTest/basic.xml")) { + try (PmdAnalysis pmd = createPmdAnalysis("rulesets/MultiThreadProcessorTest/basic.xml")) { pmd.performAnalysis(); } @@ -130,23 +140,4 @@ class MultiThreadProcessorTest { } } - private static class SimpleReportListener implements GlobalAnalysisListener { - - public AtomicInteger violations = new AtomicInteger(0); - - @Override - public FileAnalysisListener startFileAnalysis(TextFile file) { - return new FileAnalysisListener() { - @Override - public void onRuleViolation(RuleViolation violation) { - violations.incrementAndGet(); - } - }; - } - - @Override - public void close() throws Exception { - - } - } } diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/util/StringUtilTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/util/StringUtilTest.java index a39eda5269..634607ba85 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/util/StringUtilTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/util/StringUtilTest.java @@ -8,9 +8,14 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertEquals; +import java.util.stream.Stream; + import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; import net.sourceforge.pmd.lang.document.Chars; +import net.sourceforge.pmd.util.StringUtil.CaseConvention; class StringUtilTest { @@ -91,4 +96,102 @@ class StringUtilTest { assertEquals("abc", StringUtil.substringAfterLast("abc", '.')); } + @Test + void caseConventionCamelCaseToScreamingSnake() { + assertEquals("rootDirectory", CaseConvention.SCREAMING_SNAKE_CASE.convertTo(CaseConvention.CAMEL_CASE, "ROOT_DIRECTORY")); + assertEquals("ROOT_DIRECTORY", CaseConvention.CAMEL_CASE.convertTo(CaseConvention.SCREAMING_SNAKE_CASE, "rootDirectory")); + } + + @ParameterizedTest + @MethodSource + void caseConventionConvertTo(CaseConventionConversionTestData data) { + assertEquals(data.expected, data.from.convertTo(data.to, data.source)); + } + + private static Stream caseConventionConvertTo() { + return Stream.of( + new CaseConventionConversionTestData( + CaseConvention.CAMEL_CASE, + CaseConvention.SCREAMING_SNAKE_CASE, + "camelCase", + "CAMEL_CASE"), + new CaseConventionConversionTestData( + CaseConvention.CAMEL_CASE, + CaseConvention.PASCAL_CASE, + "camelCase", + "CamelCase"), + new CaseConventionConversionTestData( + CaseConvention.CAMEL_CASE, + CaseConvention.SPACE_SEPARATED, + "camelCase", + "camel case"), + + new CaseConventionConversionTestData( + CaseConvention.SCREAMING_SNAKE_CASE, + CaseConvention.CAMEL_CASE, + "SCREAMING_SNAKE_CASE", + "screamingSnakeCase"), + new CaseConventionConversionTestData( + CaseConvention.SCREAMING_SNAKE_CASE, + CaseConvention.PASCAL_CASE, + "SCREAMING_SNAKE_CASE", + "ScreamingSnakeCase"), + new CaseConventionConversionTestData( + CaseConvention.SCREAMING_SNAKE_CASE, + CaseConvention.SPACE_SEPARATED, + "SCREAMING_SNAKE_CASE", + "screaming snake case"), + + new CaseConventionConversionTestData( + CaseConvention.PASCAL_CASE, + CaseConvention.CAMEL_CASE, + "PascalCase", + "pascalCase"), + new CaseConventionConversionTestData( + CaseConvention.PASCAL_CASE, + CaseConvention.SCREAMING_SNAKE_CASE, + "PascalCase", + "PASCAL_CASE"), + new CaseConventionConversionTestData( + CaseConvention.PASCAL_CASE, + CaseConvention.SPACE_SEPARATED, + "PascalCase", + "pascal case"), + + new CaseConventionConversionTestData( + CaseConvention.SPACE_SEPARATED, + CaseConvention.CAMEL_CASE, + "space separated", + "spaceSeparated"), + new CaseConventionConversionTestData( + CaseConvention.SPACE_SEPARATED, + CaseConvention.SCREAMING_SNAKE_CASE, + "space separated", + "SPACE_SEPARATED"), + new CaseConventionConversionTestData( + CaseConvention.SPACE_SEPARATED, + CaseConvention.PASCAL_CASE, + "space separated", + "SpaceSeparated") + ); + } + + private static class CaseConventionConversionTestData { + CaseConvention from; + CaseConvention to; + String source; + String expected; + + CaseConventionConversionTestData(CaseConvention from, CaseConvention to, String source, String expected) { + this.from = from; + this.to = to; + this.source = source; + this.expected = expected; + } + + @Override + public String toString() { + return source + "(" + from.name() + "->" + to.name() + ")=" + expected; + } + } } diff --git a/pmd-dist/pom.xml b/pmd-dist/pom.xml index 9e824be8a3..4a657699bf 100644 --- a/pmd-dist/pom.xml +++ b/pmd-dist/pom.xml @@ -168,13 +168,6 @@ commons-lang3 - - - com.beust - jcommander - 1.48 - - org.junit.jupiter junit-jupiter @@ -256,5 +249,36 @@ + + jdk21-compat-it + + + java21.home + + + + + + org.apache.maven.plugins + maven-failsafe-plugin + + + jdk21-compat-it + + integration-test + verify + + + + ${java21.home} + ${java21.home}/bin:${env.PATH} + + + + + + + + diff --git a/pmd-dist/src/main/resources/scripts/pmd b/pmd-dist/src/main/resources/scripts/pmd index 926238f9da..73476fdab9 100755 --- a/pmd-dist/src/main/resources/scripts/pmd +++ b/pmd-dist/src/main/resources/scripts/pmd @@ -52,7 +52,7 @@ set_lib_dir() { if [ -L "$0" ]; then local script_real_loc=$(readlink "$0") else - local script_real_loc=$0 + local script_real_loc=${BASH_SOURCE[0]:-${(%):-%x}} fi local script_dir=$(dirname "${script_real_loc}") @@ -74,7 +74,7 @@ set_conf_dir() { if [ -L $0 ]; then local script_real_loc=$(readlink "$0") else - local script_real_loc=$0 + local script_real_loc=${BASH_SOURCE[0]:-${(%):-%x}} fi local script_dir=$(dirname "${script_real_loc}") diff --git a/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java b/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java index 2a146dce04..86aec7be9b 100644 --- a/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java +++ b/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java @@ -39,7 +39,8 @@ class BinaryDistributionIT extends AbstractBinaryDistributionTest { private static final List SUPPORTED_LANGUAGES_PMD = listOf( "apex-52", "apex-53", "apex-54", "apex-55", - "apex-56", "apex-57", "ecmascript-3", "ecmascript-5", + "apex-56", "apex-57", "apex-58", "apex-59", + "ecmascript-3", "ecmascript-5", "ecmascript-6", "ecmascript-7", "ecmascript-8", "ecmascript-9", "ecmascript-ES2015", "ecmascript-ES2016", "ecmascript-ES2017", @@ -48,7 +49,8 @@ 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-19-preview", "java-20", "java-20-preview", + "java-20", "java-20-preview", + "java-21", "java-21-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", @@ -59,7 +61,8 @@ class BinaryDistributionIT extends AbstractBinaryDistributionTest { "swift-4.2", "swift-5.0", "swift-5.1", "swift-5.2", "swift-5.3", "swift-5.4", "swift-5.5", "swift-5.6", "swift-5.7", "vf-52", "vf-53", "vf-54", "vf-55", "vf-56", - "vf-57", "vm-2.0", "vm-2.1", "vm-2.2", "vm-2.3", "wsdl-1.1", + "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" ); diff --git a/pmd-doc/pom.xml b/pmd-doc/pom.xml index 8c3f7c1dff..76fd0f7817 100644 --- a/pmd-doc/pom.xml +++ b/pmd-doc/pom.xml @@ -74,8 +74,9 @@ net.sourceforge.pmd - pmd-dist + pmd-languages-deps ${project.version} + pom runtime diff --git a/pmd-html/src/main/resources/category/html/bestpractices.xml b/pmd-html/src/main/resources/category/html/bestpractices.xml index 19c07662e9..775e366565 100644 --- a/pmd-html/src/main/resources/category/html/bestpractices.xml +++ b/pmd-html/src/main/resources/category/html/bestpractices.xml @@ -1,4 +1,4 @@ - + + + + + + + + JEP 430: String Templates (Preview) + */ + private Deque tokenContexts = new ArrayDeque(); + TokenContext determineTokenContext() { + if (tokenContexts.isEmpty()) { + return TokenContext.BLOCK; + } + return tokenContexts.peek(); + } } PARSER_END(JavaParserImpl) TOKEN_MGR_DECLS : { protected List comments = new ArrayList(); + + enum TokenContext { STRING_TEMPLATE, TEXT_BLOCK_TEMPLATE, BLOCK; } + + private static final java.util.regex.Pattern TEXT_BLOCK_TEMPLATE_END_PATTERN = + java.util.regex.Pattern.compile("^}[^\"]*\"\"\""); + private static final java.util.regex.Pattern STRING_TEMPLATE_MID_OR_END_PATTERN = + java.util.regex.Pattern.compile("^}(?:[^\"\\\\\n\r]|\\\\(?:[ntbrfs\\\\'\"]|[0-7][0-7]?|[0-3][0-7][0-7]))*(\\{|\")"); + + private TokenContext determineContext() { + return parser.determineTokenContext(); + } + + private net.sourceforge.pmd.lang.ast.impl.javacc.JavaccToken rereadTokenAs(int kind, int length) { + input_stream.backup(lengthOfMatch); + try { + for (int i = 0; i < length; i++) { + input_stream.readChar(); + } + } catch (java.io.EOFException eofException) { + throw new IllegalStateException(eofException); + } + jjmatchedKind = kind; + return jjFillToken(); + } + + private net.sourceforge.pmd.lang.ast.impl.javacc.JavaccToken handleBlock() { + net.sourceforge.pmd.lang.ast.impl.javacc.JavaccToken matchedToken = rereadTokenAs(JavaTokenKinds.RBRACE, 1); + if (!"}".equals(input_stream.getTokenImage())) { + throw new IllegalStateException("Expected '}'"); + } + return matchedToken; + } } /* WHITE SPACE */ @@ -748,7 +806,8 @@ TOKEN : | < #EXPONENT_TAIL: (["+","-"])? > | < CHARACTER_LITERAL: "'" ( ~["'", "\\","\n","\r"] | ) "'" > -| < STRING_LITERAL: "\"" ( ~["\"","\\","\n","\r"] | )* "\"" > +| < STRING_LITERAL: "\"" ()* "\"" > +| < #STRING_CHARACTER: ~["\"","\\","\n","\r"] | > | < #STRING_ESCAPE: "\\" ( ["n","t","b","r","f","s","\\","'","\""] @@ -757,9 +816,12 @@ TOKEN : | ["0"-"3"] ["0"-"7"] ["0"-"7"] ) > +| < #TEXT_BLOCK_CHARACTER: ~["\\"] | | ("\\")? > } /* TEXT BLOCKS */ +// note: Text Blocks need an own lexical state, so that we can reliably determine +// the end of the text block (""") which is 3 characters long. MORE : { < "\"\"\"" ()* > : IN_TEXT_BLOCK_LITERAL @@ -774,7 +836,7 @@ TOKEN : MORE : { - < ~["\\"] | | ("\\")? > + < > } /* IDENTIFIERS */ @@ -976,6 +1038,87 @@ TOKEN : | < GT: ">" > } +/* FRAGMENTS */ + +// Note: The fragments introduce ambiguity with other token productions, especially the separator token "}" (RBRACE). +// 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) + +TOKEN : +{ + < STRING_TEMPLATE_BEGIN: "\"" "\\{" > +| < STRING_TEMPLATE_MID: "}" "\\{" > +{ + { + TokenContext ctx = determineContext(); + switch (ctx) { + case TEXT_BLOCK_TEMPLATE: + jjmatchedKind = TEXT_BLOCK_TEMPLATE_MID; + matchedToken = jjFillToken(); + break; + case BLOCK: + matchedToken = handleBlock(); + break; + } + } +} +| < STRING_TEMPLATE_END: "}" "\"" > +{ + { + TokenContext ctx = determineContext(); + if (ctx == TokenContext.BLOCK) { + matchedToken = handleBlock(); + } + } +} +| < #STRING_FRAGMENT: ()* > + +| < TEXT_BLOCK_TEMPLATE_BEGIN: "\"\"\"" ()* "\\{" > +| < TEXT_BLOCK_TEMPLATE_MID: "}" "\\{" > +{ + { + TokenContext ctx = determineContext(); + switch (ctx) { + case STRING_TEMPLATE: { + java.util.regex.Matcher m = STRING_TEMPLATE_MID_OR_END_PATTERN.matcher(matchedToken.getImage()); + if (m.find()) { + int kind = STRING_TEMPLATE_END; + if ("\\{".equals(m.group(1))) { + kind = STRING_TEMPLATE_MID; + } + matchedToken = rereadTokenAs(kind, m.end()); + } + break; + } + case TEXT_BLOCK_TEMPLATE: { + // Note: TEXT_BLOCK_FRAGMENT is not really correct and might match """ as part of TEXT_BLOCK_TEMPLATE_MID + // instead of TEXT_BLOCK_TEMPLATE_END. In case this happens, this is corrected here. + java.util.regex.Matcher m = TEXT_BLOCK_TEMPLATE_END_PATTERN.matcher(matchedToken.getImage()); + if (m.find()) { + matchedToken = rereadTokenAs(TEXT_BLOCK_TEMPLATE_END, m.end()); + } + break; + } + case BLOCK: + matchedToken = handleBlock(); + break; + } + } + } +| < TEXT_BLOCK_TEMPLATE_END: "}" "\"\"\"" > +{ + { + TokenContext ctx = determineContext(); + if (ctx == TokenContext.BLOCK) { + matchedToken = handleBlock(); + } + } +} +| < #TEXT_BLOCK_FRAGMENT: ()* > +} + /***************************************** * THE JAVA LANGUAGE GRAMMAR STARTS HERE * *****************************************/ @@ -989,11 +1132,23 @@ ASTCompilationUnit CompilationUnit() : { [ LOOKAHEAD( ( Annotation() )* "package" ) PackageDeclaration() ( EmptyDeclaration() )* ] ( ImportDeclaration() ( EmptyDeclaration() )* )* + + // ModularCompilationUnit: // the module decl lookahead needs to be before the type declaration branch, // looking for annotations + "open" | "module" will fail faster if it's *not* // a module (most common case) [ LOOKAHEAD(ModuleDeclLahead()) ModuleDeclaration() ( EmptyDeclaration() )* ] + + // OrdinaryCompilationUnit: -> TopLevelClassOrInterfaceDeclaration ( TypeDeclaration() ( EmptyDeclaration() )* )* + + // UnnamedClassCompilationUnit: + [ + ( LOOKAHEAD(3) ClassMemberDeclarationNoMethod() )* + ModifierList() MethodDeclaration() + ( ClassOrInterfaceBodyDeclaration() )* + ] + { jjtThis.setComments(token_source.comments); @@ -1001,6 +1156,20 @@ ASTCompilationUnit CompilationUnit() : } } +// see ClassOrInterfaceBodyDeclaration() +void ClassMemberDeclarationNoMethod() #void: +{} +{ + ModifierList() + ( LOOKAHEAD(3) ClassOrInterfaceDeclaration() + | LOOKAHEAD({isKeyword("enum")}) EnumDeclaration() + | LOOKAHEAD({isKeyword("record")}) RecordDeclaration() + | LOOKAHEAD( [ TypeParameters() ] "(" ) ConstructorDeclaration() + | LOOKAHEAD( Type() (AnnotationList() "[" "]")* ( "," | "=" | ";" ) ) FieldDeclaration() + | LOOKAHEAD(2) AnnotationTypeDeclaration() + ) +} + private void ModuleDeclLahead() #void: {} { @@ -1118,11 +1287,11 @@ void EnumDeclaration(): void EnumBody(): {} { - "{" + "{" { tokenContexts.push(TokenContext.BLOCK); } [ EnumConstant() ( LOOKAHEAD(2) "," EnumConstant() )* ] [ "," { jjtThis.setTrailingComma(); } ] [ ";" { jjtThis.setSeparatorSemi(); } ( ClassOrInterfaceBodyDeclaration() )* ] - "}" + "}" { tokenContexts.pop(); } } void EnumConstant(): @@ -1165,9 +1334,9 @@ void RecordComponent(): void RecordBody(): {} { - "{" + "{" { tokenContexts.push(TokenContext.BLOCK); } ( RecordBodyDeclaration() )* - "}" + "}" { tokenContexts.pop(); } } void RecordBodyDeclaration() #void : @@ -1207,7 +1376,9 @@ void TypeParameter(): void ClassOrInterfaceBody(): {} { - "{" ( ClassOrInterfaceBodyDeclaration() )* "}" + "{" { tokenContexts.push(TokenContext.BLOCK); } + ( ClassOrInterfaceBodyDeclaration() )* + "}" { tokenContexts.pop(); } } void ClassOrInterfaceBodyDeclaration() #void: @@ -1268,7 +1439,9 @@ void VariableInitializer() #void: void ArrayInitializer() : {} { - "{" [ VariableInitializer() ( LOOKAHEAD(2) "," VariableInitializer() )* ] [ "," ] "}" + "{" { tokenContexts.push(TokenContext.BLOCK); } + [ VariableInitializer() ( LOOKAHEAD(2) "," VariableInitializer() )* ] [ "," ] + "}" { tokenContexts.pop(); } } void MethodDeclaration() : @@ -1333,10 +1506,10 @@ void ConstructorDeclaration() : private void ConstructorBlock() #Block: {} { - "{" + "{" { tokenContexts.push(TokenContext.BLOCK); } [ LOOKAHEAD(ExplicitConstructorInvocation()) ExplicitConstructorInvocation() ] ( BlockStatement() )* - "}" + "}" { tokenContexts.pop(); } } void ExplicitConstructorInvocation() : @@ -1721,6 +1894,8 @@ void Pattern() #void: | 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: {} { @@ -1739,16 +1914,29 @@ void RecordPattern(): (Annotation())* ReferenceType() RecordStructurePattern() } -void RecordStructurePattern() #ComponentPatternList: +void RecordStructurePattern() #void: {} { - "(" [ RecordComponentPatternList() ] ")" + "(" [ ComponentPatternList() ] ")" } -void RecordComponentPatternList() #void: +void ComponentPatternList() #PatternList : {} { - Pattern() ( "," Pattern() )* + ComponentPattern() ( "," ComponentPattern() )* +} + +void ComponentPattern() #void: +{} +{ + LOOKAHEAD({isKeyword("_")}) UnnamedPattern() + | Pattern() +} + +void UnnamedPattern(): +{} +{ + softKeyword("_") } void InstanceOfExpression() #void: @@ -2023,6 +2211,7 @@ void PrimaryStep2() #void: // "super" alone is not a valid expression ("." MemberSelector() | MethodReference()) | MemberSelector() + | {forceExprContext();} TemplateArgument() #TemplateExpression(2) ) // catches the case where the ambig name is the start of an array type | LOOKAHEAD("@" | "[" "]") {forceTypeContext();} Dims() #ArrayType(2) (MethodReference() | "." "class" #ClassLiteral(1)) @@ -2127,6 +2316,53 @@ boolean LambdaParameterType() #void : | FormalParamType() { return false; } } +void TemplateArgument() #void : +{} +{ + Template() + | StringLiteral() +} + +void Template() : +{} +{ + StringTemplate() + | TextBlockTemplate() + +} + +void StringTemplate() #void : +{} +{ + { tokenContexts.push(TokenContext.STRING_TEMPLATE); } + + { setLastTokenImage(jjtThis); } #TemplateFragment + EmbeddedExpression() + ( { setLastTokenImage(jjtThis); } #TemplateFragment EmbeddedExpression() )* + { setLastTokenImage(jjtThis); } #TemplateFragment + + { tokenContexts.pop(); } +} + +void TextBlockTemplate() #void : +{} +{ + { tokenContexts.push(TokenContext.TEXT_BLOCK_TEMPLATE); } + + { setLastTokenImage(jjtThis); } #TemplateFragment + EmbeddedExpression() + ( { setLastTokenImage(jjtThis); } #TemplateFragment EmbeddedExpression() )* + { setLastTokenImage(jjtThis); } #TemplateFragment + + { tokenContexts.pop(); } +} + +void EmbeddedExpression() #void : +{} +{ + [ Expression() ] +} + void Literal() #void : {} { @@ -2284,7 +2520,9 @@ void LabeledStatement() : void Block() : {} { - "{" ( BlockStatement() )* "}" + "{" { tokenContexts.push(TokenContext.BLOCK); } + ( BlockStatement() )* + "}" { tokenContexts.pop(); } } void BlockStatement() #void: @@ -2415,12 +2653,12 @@ void SwitchStatement(): void SwitchBlock() #void: {} { - "{" + "{" { tokenContexts.push(TokenContext.BLOCK); } ( LOOKAHEAD(SwitchLabel() ":") (SwitchFallthroughBranch())+ | (SwitchArrowBranch())* ) - "}" + "}" { tokenContexts.pop(); } } void SwitchArrowBranch(): @@ -2453,22 +2691,26 @@ void SwitchLabel() : void CaseLabelElement(ASTSwitchLabel label) #void: {} { - "default" {label.setDefault();} // only valid in java-19-preview + "null" #NullLiteral [ "," "default" {label.setDefault();} ] | - "null" #NullLiteral - [ - // this lookahead is only required to allow parsing java-19-preview code - // since java-20-preview, combining null is only allowed with default - LOOKAHEAD(2) - "," "default" {label.setDefault();} - ] - | - LOOKAHEAD(Pattern()) Pattern() [ LOOKAHEAD({isKeyword("when")}) Guard() ] + LOOKAHEAD(Pattern()) CasePattern() [ LOOKAHEAD({isKeyword("when")}) Guard() ] | + CaseConstant() +} + +void CaseConstant() #void: +{} +{ ConditionalExpression() } -void Guard() #SwitchGuard: +void CasePattern() #void: +{} +{ + Pattern() +} + +void Guard() : {} { softKeyword("when") @@ -2525,6 +2767,7 @@ 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() } @@ -2712,7 +2955,9 @@ void MemberValue() #void: void MemberValueArrayInitializer(): {} { - "{" (MemberValue() ( LOOKAHEAD(2) "," MemberValue() )*)? [ "," ] "}" + "{" { tokenContexts.push(TokenContext.BLOCK); } + (MemberValue() ( LOOKAHEAD(2) "," MemberValue() )*)? [ "," ] + "}" { tokenContexts.pop(); } } /* @@ -2737,7 +2982,9 @@ void AnnotationTypeDeclaration(): void AnnotationTypeBody(): {} { - "{" ( AnnotationTypeMemberDeclaration() )* "}" + "{" { tokenContexts.push(TokenContext.BLOCK); } + ( AnnotationTypeMemberDeclaration() )* + "}" { tokenContexts.pop(); } } void AnnotationTypeMemberDeclaration() #void: @@ -2782,7 +3029,9 @@ void ModuleDeclaration(): [LOOKAHEAD({isKeyword("open")}) {jjtThis.setOpen(true);}] LOOKAHEAD({isKeyword("module")}) ModuleName() - "{" (ModuleDirective())* "}" + "{" { tokenContexts.push(TokenContext.BLOCK); } + (ModuleDirective())* + "}" { tokenContexts.pop(); } } void ModuleDirective() #void: 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 2e4ef59029..928773dc75 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 @@ -41,9 +41,10 @@ public class JavaLanguageModule extends LanguageModuleBase implements PmdCapable .addVersion("17") .addVersion("18") .addVersion("19") - .addVersion("19-preview") - .addDefaultVersion("20") // 20 is the default - .addVersion("20-preview")); + .addVersion("20") + .addVersion("20-preview") + .addDefaultVersion("21") // 21 is the default + .addVersion("21-preview")); } public static JavaLanguageModule getInstance() { diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTCompilationUnit.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTCompilationUnit.java index 0dc06782a4..33fcb2e24b 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTCompilationUnit.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTCompilationUnit.java @@ -9,6 +9,7 @@ import java.util.List; import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; +import net.sourceforge.pmd.annotation.Experimental; import net.sourceforge.pmd.lang.ast.AstInfo; import net.sourceforge.pmd.lang.ast.NodeStream; import net.sourceforge.pmd.lang.ast.RootNode; @@ -16,6 +17,7 @@ import net.sourceforge.pmd.lang.ast.impl.GenericNode; import net.sourceforge.pmd.lang.java.symbols.table.JSymbolTable; import net.sourceforge.pmd.lang.java.types.TypeSystem; import net.sourceforge.pmd.lang.java.types.ast.LazyTypeResolver; +import net.sourceforge.pmd.lang.rule.xpath.NoAttribute; /** @@ -23,7 +25,8 @@ import net.sourceforge.pmd.lang.java.types.ast.LazyTypeResolver; * *
  *
- * CompilationUnit ::= RegularCompilationUnit
+ * CompilationUnit ::= OrdinaryCompilationUnit
+ *                   | UnnamedClassCompilationUnit
  *                   | ModularCompilationUnit
  *
  * RegularCompilationUnit ::=
@@ -31,11 +34,20 @@ import net.sourceforge.pmd.lang.java.types.ast.LazyTypeResolver;
  *   {@linkplain ASTImportDeclaration ImportDeclaration}*
  *   {@linkplain ASTAnyTypeDeclaration TypeDeclaration}*
  *
+ * UnnamedClassCompilationUnit ::=
+ *   {@linkplain ASTImportDeclaration ImportDeclaration}*
+ *   {@linkplain ASTFieldDeclaration FieldDeclaration}*
+ *   {@linkplain ASTMethodDeclaration MethodDeclaration}
+ *   {@linkplain ASTBodyDeclaration BodyDeclaration}*
+ *
  * ModularCompilationUnit ::=
  *   {@linkplain ASTImportDeclaration ImportDeclaration}*
  *   {@linkplain ASTModuleDeclaration ModuleDeclaration}
  *
  * 
+ * + * @see JEP 445: Unnamed Classes and Instance Main Methods (Preview) (Java 21) + * @see #isUnnamedClass() */ public final class ASTCompilationUnit extends AbstractJavaNode implements JavaNode, GenericNode, RootNode { @@ -126,4 +138,9 @@ public final class ASTCompilationUnit extends AbstractJavaNode implements JavaNo return lazyTypeResolver; } + @Experimental + @NoAttribute + public boolean isUnnamedClass() { + return children(ASTMethodDeclaration.class).nonEmpty(); + } } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTSwitchGuard.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTGuard.java similarity index 53% rename from pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTSwitchGuard.java rename to pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTGuard.java index 995a7ea3e9..848fff414e 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTSwitchGuard.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTGuard.java @@ -4,25 +4,22 @@ package net.sourceforge.pmd.lang.java.ast; -import net.sourceforge.pmd.annotation.Experimental; - /** * A guard for refining a switch case in {@link ASTSwitchLabel}s. - * This is a Java 19 Preview and Java 20 Preview language feature. + * This is a Java 21 language feature. * *
  *
- * SwitchLabel := "case" {@linkplain ASTPattern Pattern} SwitchGuard?
- * SwitchGuard ::= "when" {@linkplain ASTExpression Expression}
+ * SwitchLabel := "case" {@linkplain ASTPattern Pattern} Guard?
+ * Guard ::= "when" {@linkplain ASTExpression Expression}
  *
  * 
* - * @see JEP 433: Pattern Matching for switch (Fourth Preview) + * @see JEP 441: Pattern Matching for switch */ -@Experimental -public final class ASTSwitchGuard extends AbstractJavaNode { +public final class ASTGuard extends AbstractJavaNode { - ASTSwitchGuard(int id) { + ASTGuard(int id) { super(id); } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTMethodDeclaration.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTMethodDeclaration.java index 3a83204420..e5c8be4514 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTMethodDeclaration.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTMethodDeclaration.java @@ -166,6 +166,20 @@ public final class ASTMethodDeclaration extends AbstractMethodOrConstructorDecla && "main".equals(this.getName()) && this.isVoid() && this.getArity() == 1 - && TypeTestUtil.isExactlyA(String[].class, this.getFormalParameters().get(0)); + && TypeTestUtil.isExactlyA(String[].class, this.getFormalParameters().get(0)) + || isMainMethodUnnamedClass(); + } + + /** + * With JEP 445 (Java 21 Preview) the main method does not need to be static anymore and + * does not need to be public or have a formal parameter. + */ + private boolean isMainMethodUnnamedClass() { + return this.getRoot().isUnnamedClass() + && "main".equals(this.getName()) + && !this.hasModifiers(JModifier.PRIVATE) + && this.isVoid() + && (this.getArity() == 0 + || this.getArity() == 1 && TypeTestUtil.isExactlyA(String[].class, this.getFormalParameters().get(0))); } } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTModifierList.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTModifierList.java index 5868070c64..d7b2d0ae92 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTModifierList.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTModifierList.java @@ -206,7 +206,8 @@ public final class ASTModifierList extends AbstractJavaNode { @Override public Void visit(ASTFieldDeclaration node, Set effective) { - if (node.getEnclosingType().isInterface()) { + ASTAnyTypeDeclaration enclosingType = node.getEnclosingType(); + if (enclosingType != null && enclosingType.isInterface()) { effective.add(PUBLIC); effective.add(STATIC); effective.add(FINAL); @@ -266,8 +267,8 @@ public final class ASTModifierList extends AbstractJavaNode { @Override public Void visit(ASTMethodDeclaration node, Set effective) { - - if (node.getEnclosingType().isInterface()) { + ASTAnyTypeDeclaration enclosingType = node.getEnclosingType(); + if (enclosingType != null && enclosingType.isInterface()) { Set declared = node.getModifiers().explicitModifiers; 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 144c2c1e90..e80ed54084 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTPattern.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTPattern.java @@ -7,9 +7,11 @@ package net.sourceforge.pmd.lang.java.ast; import net.sourceforge.pmd.annotation.Experimental; /** - * A pattern (for pattern matching constructs like {@link ASTInfixExpression InstanceOfExpression} + * A pattern for pattern matching constructs like {@link ASTInfixExpression InstanceOfExpression} * or within a {@link ASTSwitchLabel}). This is a JDK 16 feature. * + * The {@link ASTRecordPattern} is a JDK 21 feature. + * *

This interface is implemented by all forms of patterns. * *

@@ -18,16 +20,19 @@ import net.sourceforge.pmd.annotation.Experimental;
  *
  * 
* - * @see JEP 394: Pattern Matching for instanceof + * @see JEP 394: Pattern Matching for instanceof (Java 16) * @see JEP 405: Record Patterns (Preview) (Java 19) * @see JEP 432: Record Patterns (Second Preview) (Java 20) + * @see JEP 440: Record Patterns (Java 21) */ public interface ASTPattern extends JavaNode { /** * Returns the number of parenthesis levels around this pattern. * If this method returns 0, then no parentheses are present. + * @deprecated Parenthesized patterns are only possible with Java 20 Preview and are removed with Java 21. */ @Experimental + @Deprecated int getParenthesisDepth(); } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTComponentPatternList.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTPatternList.java similarity index 53% rename from pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTComponentPatternList.java rename to pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTPatternList.java index 344eb511a4..74b14b2514 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTComponentPatternList.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTPatternList.java @@ -5,23 +5,20 @@ package net.sourceforge.pmd.lang.java.ast; -import net.sourceforge.pmd.annotation.Experimental; - /** * Contains a potentially empty list of nested Patterns for {@linkplain ASTRecordPattern RecordPattern} - * (Java 19 Preview and Java 20 Preview). + * (Java 21). * *
  *
- * ComponentPatternList ::= "(" {@linkplain ASTPattern Pattern} ( "," {@linkplain ASTPattern pattern} ) ")"
+ * PatternList ::= "(" {@linkplain ASTPattern Pattern} ( "," {@linkplain ASTPattern pattern} ) ")"
  *
  * 
* - * @see JEP 432: Record Patterns (Second Preview) + * @see JEP 440: Record Patterns */ -@Experimental -public final class ASTComponentPatternList extends ASTList { - ASTComponentPatternList(int id) { +public final class ASTPatternList extends ASTList { + ASTPatternList(int id) { super(id, ASTPattern.class); } 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 0b54f6706f..62f783eada 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 @@ -4,22 +4,23 @@ package net.sourceforge.pmd.lang.java.ast; + import net.sourceforge.pmd.annotation.Experimental; /** - * A record pattern (Java 19 Preview and Java 20 Preview). + * A record pattern, a Java 21 language feature. * *
  *
- * RecordPattern ::= {@linkplain ASTReferenceType ReferenceType} {@linkplain ASTComponentPatternList ComponentPatternList}
+ * RecordPattern ::= {@linkplain ASTReferenceType ReferenceType} {@linkplain ASTPatternList PatternList}
  *
  * 
* * @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) */ -@Experimental public final class ASTRecordPattern extends AbstractJavaNode implements ASTPattern { private int parenDepth; diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTSwitchLabel.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTSwitchLabel.java index 1fdf6a135c..8391284ec8 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTSwitchLabel.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTSwitchLabel.java @@ -23,9 +23,9 @@ import net.sourceforge.pmd.lang.ast.NodeStream; * * * - *

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

+ *

Note: case null and the case patterns are a Java 21 language feature

* - * @see JEP 433: Pattern Matching for switch (Fourth Preview) + * @see JEP 441: Pattern Matching for switch * @see JEP 432: Record Patterns (Second Preview) */ public final class ASTSwitchLabel extends AbstractJavaNode implements Iterable { 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 new file mode 100644 index 0000000000..15c2c72a85 --- /dev/null +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTemplate.java @@ -0,0 +1,30 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +package net.sourceforge.pmd.lang.java.ast; + +import net.sourceforge.pmd.annotation.Experimental; + +/** + * This is a Java 21 Preview feature. + * + *
+ *
+ * Template ::= ({@link ASTTemplateFragment TemplateFragment} {@link ASTExpression Expression}?)* {@link ASTTemplateFragment TemplateFragment}
+ *
+ * 
+ * + * @see JEP 430: String Templates (Preview) + */ +@Experimental +public final class ASTTemplate extends AbstractJavaNode { + ASTTemplate(int i) { + super(i); + } + + @Override + protected R acceptVisitor(JavaVisitor visitor, P data) { + return visitor.visit(this, data); + } +} 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 new file mode 100644 index 0000000000..76a91b8e0b --- /dev/null +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTemplateExpression.java @@ -0,0 +1,50 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +package net.sourceforge.pmd.lang.java.ast; + +import net.sourceforge.pmd.annotation.Experimental; +import net.sourceforge.pmd.lang.java.ast.ASTAssignableExpr.ASTNamedReferenceExpr; + +/** + * This is a Java 21 Preview feature. + * + *
+ *
+ * TemplateExpression ::= ({@link ASTVariableAccess VariableAccess} | {@link ASTFieldAccess FieldAccess})
+ *                        ({@link ASTTemplate Template} | {@link ASTStringLiteral StringLiteral})
+ *
+ * 
+ * + * @see JEP 430: String Templates (Preview) + */ +@Experimental +public final class ASTTemplateExpression extends AbstractJavaExpr { + ASTTemplateExpression(int i) { + super(i); + } + + @Override + protected R acceptVisitor(JavaVisitor visitor, P data) { + return visitor.visit(this, data); + } + + public ASTExpression getTemplateProcessor() { + return (ASTExpression) getChild(0); + } + + public JavaNode getTemplateArgument() { + return getChild(1); + } + + public boolean isStringTemplate() { + String name; + if (getTemplateProcessor() instanceof ASTNamedReferenceExpr) { + name = ((ASTNamedReferenceExpr) getTemplateProcessor()).getName(); + } else { + name = getTemplateProcessor().getFirstToken().getImage(); + } + return "STR".equals(name); + } +} 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 new file mode 100644 index 0000000000..8bb1c40b87 --- /dev/null +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTemplateFragment.java @@ -0,0 +1,31 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +package net.sourceforge.pmd.lang.java.ast; + +import net.sourceforge.pmd.annotation.Experimental; + +/** + * This is a Java 21 Preview feature. + * + *
+ *
+ * TemplateFragment ::= StringTemplateBegin|StringTemplateMid|StringTemplateEnd
+ *                      |TextBlockTemplateBegin|TextBlockTemplateMid|TextBlockTemplateEnd
+ *
+ * 
+ * + * @see JEP 430: String Templates (Preview) + */ +@Experimental +public final class ASTTemplateFragment extends AbstractJavaNode { + ASTTemplateFragment(int i) { + super(i); + } + + @Override + protected R acceptVisitor(JavaVisitor visitor, P data) { + return visitor.visit(this, data); + } +} 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 new file mode 100644 index 0000000000..641e932458 --- /dev/null +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTUnnamedPattern.java @@ -0,0 +1,37 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +package net.sourceforge.pmd.lang.java.ast; + + +import net.sourceforge.pmd.annotation.Experimental; + +/** + * An unnamed pattern, a Java 21 Preview language feature. + * + *
+ *
+ * UnnamedPattern ::= "_"
+ *
+ * 
+ * + * @see JEP 443: Unnamed patterns and variables (Preview) (Java 21) +*/ +@Experimental +public final class ASTUnnamedPattern extends AbstractJavaNode implements ASTPattern { + + ASTUnnamedPattern(int id) { + super(id); + } + + @Override + 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 9dd6df7cd3..5ed897d23a 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 @@ -48,6 +48,10 @@ 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 diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/JavaComment.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/JavaComment.java index d88681e3ab..d2655ae5e0 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/JavaComment.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/JavaComment.java @@ -132,16 +132,27 @@ public class JavaComment implements Reportable { return line.subSequence(subseqFrom, line.length()).trim(); } - private static Stream getSpecialCommentsIn(JjtreeNode node) { + private static Stream getSpecialTokensIn(JjtreeNode node) { return GenericToken.streamRange(node.getFirstToken(), node.getLastToken()) .flatMap(it -> IteratorUtil.toStream(GenericToken.previousSpecials(it).iterator())); } public static Stream getLeadingComments(JavaNode node) { + Stream specialTokens; + if (node instanceof AccessNode) { node = ((AccessNode) node).getModifiers(); + specialTokens = getSpecialTokensIn(node); + + // if this was a non-implicit empty modifier node, we should also consider comments immediately after + if (!node.getFirstToken().isImplicit()) { + specialTokens = Stream.concat(specialTokens, getSpecialTokensIn(node.getNextSibling())); + } + } else { + specialTokens = getSpecialTokensIn(node); } - return getSpecialCommentsIn(node).filter(JavaComment::isComment) + + return specialTokens.filter(JavaComment::isComment) .map(JavaComment::toComment); } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/SyntacticJavaTokenizerFactory.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/SyntacticJavaTokenizerFactory.java new file mode 100644 index 0000000000..f97231e2ca --- /dev/null +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/SyntacticJavaTokenizerFactory.java @@ -0,0 +1,58 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +package net.sourceforge.pmd.lang.java.ast; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import net.sourceforge.pmd.lang.LanguageVersion; +import net.sourceforge.pmd.lang.TokenManager; +import net.sourceforge.pmd.lang.ast.impl.javacc.CharStream; +import net.sourceforge.pmd.lang.ast.impl.javacc.JavaccToken; +import net.sourceforge.pmd.lang.java.JavaLanguageModule; +import net.sourceforge.pmd.lang.java.internal.JavaLanguageProperties; + +/** + * Creates a tokenizer, that uses the syntactic grammar to provide context + * for the tokenizer when reducing the input characters to tokens. + *

This is required with JEP 430: String Templates

. + * + * @see JEP 430: String Templates (Preview) + */ +public final class SyntacticJavaTokenizerFactory { + private SyntacticJavaTokenizerFactory() { + // factory class + } + + public static TokenManager createTokenizer(CharStream cs) { + final List tokenList = new ArrayList<>(); + JavaParserImplTokenManager tokenManager = new JavaParserImplTokenManager(null, cs) { + @Override + public JavaccToken getNextToken() { + JavaccToken token = super.getNextToken(); + tokenList.add(token); + return token; + } + }; + + LanguageVersion latestVersion = JavaLanguageModule.getInstance().getLatestVersion(); + JavaParserImpl parser = new JavaParserImpl(tokenManager); + tokenManager.parser = parser; + parser.setJdkVersion(JavaLanguageProperties.getInternalJdkVersion(latestVersion)); + parser.setPreview(JavaLanguageProperties.isPreviewEnabled(latestVersion)); + + ASTCompilationUnit compilationUnit = parser.CompilationUnit(); + assert compilationUnit != null; + + return new TokenManager() { + Iterator iterator = tokenList.iterator(); + @Override + public JavaccToken getNextToken() { + return iterator.next(); + } + }; + } +} diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/internal/JavaAstUtils.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/internal/JavaAstUtils.java index 5ec7cdc9cc..d9e0502f5e 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/internal/JavaAstUtils.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/internal/JavaAstUtils.java @@ -151,6 +151,10 @@ public final class JavaAstUtils { } public static boolean hasField(ASTAnyTypeDeclaration node, String name) { + if (node == null) { + return false; + } + for (JFieldSymbol f : node.getSymbol().getDeclaredFields()) { String fname = f.getSimpleName(); if (fname.startsWith("m_") || fname.startsWith("_")) { @@ -445,7 +449,7 @@ public final class JavaAstUtils { } public static boolean hasAnyAnnotation(Annotatable node, Collection qualifiedNames) { - return qualifiedNames.stream().anyMatch(node::isAnnotationPresent); + return node != null && qualifiedNames.stream().anyMatch(node::isAnnotationPresent); } /** @@ -586,8 +590,10 @@ public final class JavaAstUtils { if (usage instanceof ASTVariableAccess) { return !Modifier.isStatic(((JFieldSymbol) symbol).getModifiers()); } else if (usage instanceof ASTFieldAccess) { - return Objects.equals(((JFieldSymbol) symbol).getEnclosingClass(), - usage.getEnclosingType().getSymbol()); + if (usage.getEnclosingType() != null) { + return Objects.equals(((JFieldSymbol) symbol).getEnclosingClass(), + usage.getEnclosingType().getSymbol()); + } } return false; } 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 ae7a7e3b52..5dffb20b01 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 @@ -17,10 +17,12 @@ import net.sourceforge.pmd.lang.java.ast.ASTAnyTypeDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTAssertStatement; 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.ASTEnumDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTForeachStatement; import net.sourceforge.pmd.lang.java.ast.ASTFormalParameter; +import net.sourceforge.pmd.lang.java.ast.ASTGuard; import net.sourceforge.pmd.lang.java.ast.ASTImportDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTIntersectionType; import net.sourceforge.pmd.lang.java.ast.ASTLambdaExpression; @@ -37,13 +39,14 @@ import net.sourceforge.pmd.lang.java.ast.ASTResource; import net.sourceforge.pmd.lang.java.ast.ASTStringLiteral; import net.sourceforge.pmd.lang.java.ast.ASTSwitchArrowBranch; import net.sourceforge.pmd.lang.java.ast.ASTSwitchExpression; -import net.sourceforge.pmd.lang.java.ast.ASTSwitchGuard; import net.sourceforge.pmd.lang.java.ast.ASTSwitchLabel; +import net.sourceforge.pmd.lang.java.ast.ASTTemplateExpression; import net.sourceforge.pmd.lang.java.ast.ASTTryStatement; import net.sourceforge.pmd.lang.java.ast.ASTType; import net.sourceforge.pmd.lang.java.ast.ASTTypeArguments; import net.sourceforge.pmd.lang.java.ast.ASTTypeParameters; import net.sourceforge.pmd.lang.java.ast.ASTTypePattern; +import net.sourceforge.pmd.lang.java.ast.ASTUnnamedPattern; import net.sourceforge.pmd.lang.java.ast.ASTVariableDeclaratorId; import net.sourceforge.pmd.lang.java.ast.ASTYieldStatement; import net.sourceforge.pmd.lang.java.ast.JModifier; @@ -84,7 +87,7 @@ public class LanguageLevelChecker { public void check(JavaNode node) { T accumulator = reportingStrategy.createAccumulator(); - node.descendants(JavaNode.class).crossFindBoundaries().forEach(n -> n.acceptVisitor(visitor, accumulator)); + node.descendantsOrSelf().crossFindBoundaries().filterIs(JavaNode.class).forEach(n -> n.acceptVisitor(visitor, accumulator)); reportingStrategy.done(accumulator); } @@ -124,8 +127,9 @@ public class LanguageLevelChecker { * @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, false), + PATTERNS_IN_SWITCH_STATEMENTS(17, 20, true), /** * Part of pattern matching for switch @@ -134,30 +138,53 @@ public class LanguageLevelChecker { * @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, false), + 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, false), + 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) */ - DECONSTRUCTION_PATTERNS(19, 20, false), + RECORD_PATTERNS(19, 20, true), /** - * Record deconstruction patterns in for-each loops + * 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) + */ + STRING_TEMPLATES(21, 21, false), + + /** + * Unnamed patterns and variables. + * @see JEP 443: Unnamed patterns and variables (Preview) (Java 21) + */ + UNNAMED_PATTERNS_AND_VARIABLES(21, 21, false), + + /** + * Unnamed Classes and Instance Main Methods + * @see JEP 445: Unnamed Classes and Instance Main Methods (Preview) (Java 21) + */ + UNNAMED_CLASSES(21, 21, false), + ; // SUPPRESS CHECKSTYLE enum trailing semi is awesome @@ -389,6 +416,14 @@ public class LanguageLevelChecker { return null; } + @Override + public Void visit(ASTCompilationUnit node, T data) { + if (node.isUnnamedClass()) { + check(node, PreviewFeature.UNNAMED_CLASSES, data); + } + return null; + } + @Override public Void visit(ASTStringLiteral node, T data) { if (node.isStringLiteral() && SPACE_ESCAPE_PATTERN.matcher(node.getImage()).find()) { @@ -520,7 +555,7 @@ public class LanguageLevelChecker { check(node, RegularLanguageFeature.DEFAULT_METHODS, data); } - if (node.isPrivate() && node.getEnclosingType().isInterface()) { + if (node.isPrivate() && node.getEnclosingType() != null && node.getEnclosingType().isInterface()) { check(node, RegularLanguageFeature.PRIVATE_METHODS_IN_INTERFACES, data); } @@ -542,12 +577,12 @@ public class LanguageLevelChecker { @Override public Void visit(ASTRecordPattern node, T data) { - check(node, PreviewFeature.DECONSTRUCTION_PATTERNS, data); + check(node, PreviewFeature.RECORD_PATTERNS, data); return null; } @Override - public Void visit(ASTSwitchGuard node, T data) { + public Void visit(ASTGuard node, T data) { check(node, PreviewFeature.CASE_REFINEMENT, data); return null; } @@ -620,6 +655,18 @@ public class LanguageLevelChecker { return null; } + @Override + public Void visit(ASTTemplateExpression node, T data) { + check(node, PreviewFeature.STRING_TEMPLATES, data); + return null; + } + + @Override + public Void visit(ASTUnnamedPattern node, T data) { + check(node, PreviewFeature.UNNAMED_PATTERNS_AND_VARIABLES, data); + return null; + } + @Override public Void visitTypeDecl(ASTAnyTypeDeclaration node, T data) { if (node.getModifiers().hasAnyExplicitly(JModifier.SEALED, JModifier.NON_SEALED)) { @@ -649,7 +696,11 @@ public class LanguageLevelChecker { } else if ("assert".equals(simpleName)) { check(node, Keywords.ASSERT_AS_AN_IDENTIFIER, acc); } else if ("_".equals(simpleName)) { - check(node, Keywords.UNDERSCORE_AS_AN_IDENTIFIER, acc); + if (LanguageLevelChecker.this.preview) { + check(node, PreviewFeature.UNNAMED_PATTERNS_AND_VARIABLES, acc); + } else { + check(node, Keywords.UNDERSCORE_AS_AN_IDENTIFIER, acc); + } } } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/cpd/JavaTokenizer.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/cpd/JavaTokenizer.java index b3fcf82ae1..8331feff13 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/cpd/JavaTokenizer.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/cpd/JavaTokenizer.java @@ -18,6 +18,7 @@ import net.sourceforge.pmd.lang.ast.impl.javacc.JavaccToken; import net.sourceforge.pmd.lang.document.TextDocument; import net.sourceforge.pmd.lang.java.ast.InternalApiBridge; import net.sourceforge.pmd.lang.java.ast.JavaTokenKinds; +import net.sourceforge.pmd.lang.java.ast.SyntacticJavaTokenizerFactory; import net.sourceforge.pmd.lang.java.internal.JavaLanguageProperties; public class JavaTokenizer extends JavaCCTokenizer { @@ -40,7 +41,7 @@ public class JavaTokenizer extends JavaCCTokenizer { @Override protected TokenManager makeLexerImpl(TextDocument doc) { - return JavaTokenKinds.newTokenManager(CharStream.create(doc, InternalApiBridge.javaTokenDoc())); + return SyntacticJavaTokenizerFactory.createTokenizer(CharStream.create(doc, InternalApiBridge.javaTokenDoc())); } @Override diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/CommentDefaultAccessModifierRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/CommentDefaultAccessModifierRule.java index 02e93d625c..5d5892bc43 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/CommentDefaultAccessModifierRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/CommentDefaultAccessModifierRule.java @@ -150,7 +150,9 @@ public class CommentDefaultAccessModifierRule extends AbstractJavaRulechainRule return isMissingComment(decl) && isNotIgnored(decl) - && !(decl instanceof ASTFieldDeclaration && enclosing.isAnnotationPresent("lombok.Value")); + && !(decl instanceof ASTFieldDeclaration + && enclosing != null + && enclosing.isAnnotationPresent("lombok.Value")); } private boolean isMissingComment(AccessNode decl) { diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/CouplingBetweenObjectsRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/CouplingBetweenObjectsRule.java index 8bd9c128c6..11cf94a367 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/CouplingBetweenObjectsRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/CouplingBetweenObjectsRule.java @@ -127,7 +127,7 @@ public class CouplingBetweenObjectsRule extends AbstractJavaRule { * @return boolean true if variableType is not what we care about */ private boolean ignoreType(ASTType typeNode, JTypeMirror t) { - if (typeNode.getEnclosingType().getSymbol().equals(t.getSymbol())) { + if (typeNode.getEnclosingType() != null && typeNode.getEnclosingType().getSymbol().equals(t.getSymbol())) { return true; } JTypeDeclSymbol symbol = t.getSymbol(); diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/internal/JavaRuleUtil.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/internal/JavaRuleUtil.java index 0513eb29ca..fa857ce1a4 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/internal/JavaRuleUtil.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/internal/JavaRuleUtil.java @@ -202,7 +202,9 @@ public final class JavaRuleUtil { public static boolean isExplicitUnusedVarName(String name) { return name.startsWith("ignored") || name.startsWith("unused") - || "_".equals(name); // before java 9 it's ok + // before java 9 it's ok, after that, "_" is a reserved keyword + // with Java 21 Preview (JEP 443), "_" means explicitly unused + || "_".equals(name); } /** diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/internal/TestFrameworksUtil.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/internal/TestFrameworksUtil.java index f3a35f4361..54ae9202f6 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/internal/TestFrameworksUtil.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/internal/TestFrameworksUtil.java @@ -138,7 +138,8 @@ public final class TestFrameworksUtil { * True if this is a {@code TestCase} class for Junit 3. */ public static boolean isJUnit3Class(ASTAnyTypeDeclaration node) { - return node.isRegularClass() + return node != null + && node.isRegularClass() && !node.isNested() && !node.isAbstract() && TypeTestUtil.isA(JUNIT3_CLASS_NAME, node); diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/internal/EmptyClassSymbol.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/internal/EmptyClassSymbol.java new file mode 100644 index 0000000000..4901b3a755 --- /dev/null +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/internal/EmptyClassSymbol.java @@ -0,0 +1,135 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +package net.sourceforge.pmd.lang.java.symbols.internal; + +import java.util.Collections; +import java.util.List; +import java.util.function.Supplier; + +import org.checkerframework.checker.nullness.qual.Nullable; + +import net.sourceforge.pmd.lang.java.symbols.JClassSymbol; +import net.sourceforge.pmd.lang.java.symbols.JConstructorSymbol; +import net.sourceforge.pmd.lang.java.symbols.JExecutableSymbol; +import net.sourceforge.pmd.lang.java.symbols.JFieldSymbol; +import net.sourceforge.pmd.lang.java.symbols.JMethodSymbol; +import net.sourceforge.pmd.lang.java.symbols.JTypeDeclSymbol; +import net.sourceforge.pmd.lang.java.types.JClassType; +import net.sourceforge.pmd.lang.java.types.JTypeVar; +import net.sourceforge.pmd.lang.java.types.Substitution; +import net.sourceforge.pmd.lang.java.types.TypeSystem; + +public abstract class EmptyClassSymbol implements JClassSymbol { + private final Supplier typeSystemSupplier; + + public EmptyClassSymbol(Supplier typeSystemSupplier) { + this.typeSystemSupplier = typeSystemSupplier; + } + + @Override + public @Nullable JClassSymbol getEnclosingClass() { + return null; + } + + @Override + public @Nullable JExecutableSymbol getEnclosingMethod() { + return null; + } + + @Override + public @Nullable String getCanonicalName() { + return null; + } + + @Override + public List getDeclaredClasses() { + return Collections.emptyList(); + } + + @Override + public List getDeclaredMethods() { + return Collections.emptyList(); + } + + @Override + public List getConstructors() { + return Collections.emptyList(); + } + + @Override + public List getDeclaredFields() { + return Collections.emptyList(); + } + + @Override + public List getSuperInterfaceTypes(Substitution substitution) { + return Collections.emptyList(); + } + + @Override + public @Nullable JClassType getSuperclassType(Substitution substitution) { + return null; + } + + @Override + public @Nullable JClassSymbol getSuperclass() { + return null; + } + + @Override + public List getSuperInterfaces() { + return Collections.emptyList(); + } + + @Override + public @Nullable JTypeDeclSymbol getArrayComponent() { + return null; + } + + @Override + public boolean isArray() { + return false; + } + + @Override + public boolean isPrimitive() { + return false; + } + + @Override + public boolean isEnum() { + return false; + } + + @Override + public boolean isRecord() { + return false; + } + + @Override + public boolean isAnnotation() { + return false; + } + + @Override + public boolean isLocalClass() { + return false; + } + + @Override + public boolean isAnonymousClass() { + return false; + } + + @Override + public TypeSystem getTypeSystem() { + return typeSystemSupplier.get(); + } + + @Override + public List getTypeParameters() { + return Collections.emptyList(); + } +} diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/internal/ast/AstSymFactory.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/internal/ast/AstSymFactory.java index 5a4288a5ed..d04865bd63 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/internal/ast/AstSymFactory.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/internal/ast/AstSymFactory.java @@ -6,9 +6,11 @@ package net.sourceforge.pmd.lang.java.symbols.internal.ast; import static net.sourceforge.pmd.util.CollectionUtil.listOf; +import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import net.sourceforge.pmd.lang.java.ast.ASTAnyTypeDeclaration; +import net.sourceforge.pmd.lang.java.ast.ASTCompilationUnit; import net.sourceforge.pmd.lang.java.ast.ASTVariableDeclaratorId; import net.sourceforge.pmd.lang.java.internal.JavaAstProcessor; import net.sourceforge.pmd.lang.java.symbols.JClassSymbol; @@ -76,7 +78,7 @@ final class AstSymFactory { return new AstClassSym(klass, this, enclosing); } - - - + JClassSymbol setClassSymbol(@NonNull ASTCompilationUnit compilationUnit) { + return new AstUnnamedClassSym(compilationUnit, this); + } } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/internal/ast/AstSymbolMakerVisitor.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/internal/ast/AstSymbolMakerVisitor.java index 96355c2a72..71b7144f5c 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/internal/ast/AstSymbolMakerVisitor.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/internal/ast/AstSymbolMakerVisitor.java @@ -78,6 +78,17 @@ final class AstSymbolMakerVisitor extends JavaVisitorBase { || node.getParent() instanceof ASTFormalParameter); } + @Override + public Void visit(ASTCompilationUnit node, AstSymFactory data) { + if (node.isUnnamedClass()) { + JClassSymbol sym = data.setClassSymbol(node); + enclosingSymbols.push(sym); + visitChildren(node, data); + enclosingSymbols.pop(); + return null; + } + return super.visit(node, data); + } @Override public Void visitTypeDecl(ASTAnyTypeDeclaration node, AstSymFactory data) { diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/internal/ast/AstUnnamedClassSym.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/internal/ast/AstUnnamedClassSym.java new file mode 100644 index 0000000000..e3add67460 --- /dev/null +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/internal/ast/AstUnnamedClassSym.java @@ -0,0 +1,76 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +package net.sourceforge.pmd.lang.java.symbols.internal.ast; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.EnumSet; +import java.util.List; + +import org.checkerframework.checker.nullness.qual.NonNull; + +import net.sourceforge.pmd.lang.java.ast.ASTCompilationUnit; +import net.sourceforge.pmd.lang.java.ast.ASTFieldDeclaration; +import net.sourceforge.pmd.lang.java.ast.ASTMethodDeclaration; +import net.sourceforge.pmd.lang.java.ast.ASTVariableDeclaratorId; +import net.sourceforge.pmd.lang.java.ast.JModifier; +import net.sourceforge.pmd.lang.java.symbols.JClassSymbol; +import net.sourceforge.pmd.lang.java.symbols.JFieldSymbol; +import net.sourceforge.pmd.lang.java.symbols.JMethodSymbol; +import net.sourceforge.pmd.lang.java.symbols.internal.EmptyClassSymbol; + +class AstUnnamedClassSym extends EmptyClassSymbol implements JClassSymbol { + private final List declaredMethods; + private final List declaredFields; + + AstUnnamedClassSym(ASTCompilationUnit node, AstSymFactory factory) { + super(node::getTypeSystem); + + final List myMethods = new ArrayList<>(); + final List myFields = new ArrayList<>(); + + node.children(ASTMethodDeclaration.class).forEach(dnode -> { + myMethods.add(new AstMethodSym((ASTMethodDeclaration) dnode, factory, this)); + }); + node.children(ASTFieldDeclaration.class).forEach(dnode -> { + for (ASTVariableDeclaratorId varId : dnode.getVarIds()) { + myFields.add(new AstFieldSym(varId, factory, this)); + } + }); + + this.declaredMethods = Collections.unmodifiableList(myMethods); + this.declaredFields = Collections.unmodifiableList(myFields); + } + + @Override + public int getModifiers() { + return JModifier.toReflect(EnumSet.of(JModifier.FINAL)); + } + + @Override + public @NonNull String getPackageName() { + return ""; + } + + @Override + public @NonNull String getBinaryName() { + return "UnnamedClass"; + } + + @Override + public List getDeclaredMethods() { + return declaredMethods; + } + + @Override + public List getDeclaredFields() { + return declaredFields; + } + + @Override + public @NonNull String getSimpleName() { + return ""; + } +} diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/table/internal/SymbolTableResolver.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/table/internal/SymbolTableResolver.java index 1233f48b0b..b1843f018a 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/table/internal/SymbolTableResolver.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/table/internal/SymbolTableResolver.java @@ -698,6 +698,9 @@ public final class SymbolTableResolver { } private JClassType enclosing() { + if (enclosingType.isEmpty()) { + return null; + } return enclosingType.getFirst().getTypeMirror(); } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/BasePrimitiveSymbol.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/BasePrimitiveSymbol.java index c312857033..dd2647ec6e 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/BasePrimitiveSymbol.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/BasePrimitiveSymbol.java @@ -6,28 +6,20 @@ package net.sourceforge.pmd.lang.java.types; import java.lang.reflect.Modifier; -import java.util.Collections; -import java.util.List; import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import net.sourceforge.pmd.lang.java.symbols.JClassSymbol; -import net.sourceforge.pmd.lang.java.symbols.JConstructorSymbol; -import net.sourceforge.pmd.lang.java.symbols.JExecutableSymbol; -import net.sourceforge.pmd.lang.java.symbols.JFieldSymbol; -import net.sourceforge.pmd.lang.java.symbols.JMethodSymbol; -import net.sourceforge.pmd.lang.java.symbols.JTypeDeclSymbol; +import net.sourceforge.pmd.lang.java.symbols.internal.EmptyClassSymbol; import net.sourceforge.pmd.lang.java.symbols.internal.SymbolEquality; import net.sourceforge.pmd.lang.java.symbols.internal.SymbolToStrings; import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind; -abstract class BasePrimitiveSymbol implements JClassSymbol { - - private final TypeSystem ts; +abstract class BasePrimitiveSymbol extends EmptyClassSymbol implements JClassSymbol { BasePrimitiveSymbol(TypeSystem ts) { - this.ts = ts; + super(() -> ts); } static final class VoidSymbol extends BasePrimitiveSymbol { @@ -86,112 +78,16 @@ abstract class BasePrimitiveSymbol implements JClassSymbol { return PRIMITIVE_PACKAGE; } - @Override - public @Nullable JExecutableSymbol getEnclosingMethod() { - return null; - } - - @Override - public List getDeclaredClasses() { - return Collections.emptyList(); - } - - @Override - public List getDeclaredMethods() { - return Collections.emptyList(); - } - - @Override - public List getConstructors() { - return Collections.emptyList(); - } - - @Override - public List getDeclaredFields() { - return Collections.emptyList(); - } - - @Override - public List getSuperInterfaceTypes(Substitution substitution) { - return Collections.emptyList(); - } - - @Override - public @Nullable JClassType getSuperclassType(Substitution substitution) { - return null; - } - - @Override - public @Nullable JClassSymbol getSuperclass() { - return null; - } - - @Override - public List getSuperInterfaces() { - return Collections.emptyList(); - } - - @Override - public @Nullable JTypeDeclSymbol getArrayComponent() { - return null; - } - - @Override - public boolean isArray() { - return false; - } - @Override public boolean isPrimitive() { return true; } - @Override - public boolean isEnum() { - return false; - } - - @Override - public boolean isRecord() { - return false; - } - - @Override - public boolean isAnnotation() { - return false; - } - - @Override - public boolean isLocalClass() { - return false; - } - - @Override - public boolean isAnonymousClass() { - return false; - } - - @Override - public TypeSystem getTypeSystem() { - return ts; - } - - @Override - public List getTypeParameters() { - return Collections.emptyList(); - } - @Override public int getModifiers() { return Modifier.PUBLIC | Modifier.ABSTRACT | Modifier.FINAL; } - @Override - public @Nullable JClassSymbol getEnclosingClass() { - return null; - } - - @Override public int hashCode() { return SymbolEquality.CLASS.hash(this); diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/ast/LazyTypeResolver.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/ast/LazyTypeResolver.java index a892f1edc9..6cac2c479b 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/ast/LazyTypeResolver.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/ast/LazyTypeResolver.java @@ -51,6 +51,7 @@ import net.sourceforge.pmd.lang.java.ast.ASTSuperExpression; import net.sourceforge.pmd.lang.java.ast.ASTSwitchExpression; import net.sourceforge.pmd.lang.java.ast.ASTSwitchLabel; import net.sourceforge.pmd.lang.java.ast.ASTSwitchLike; +import net.sourceforge.pmd.lang.java.ast.ASTTemplateExpression; import net.sourceforge.pmd.lang.java.ast.ASTThisExpression; import net.sourceforge.pmd.lang.java.ast.ASTType; import net.sourceforge.pmd.lang.java.ast.ASTTypeParameter; @@ -422,6 +423,15 @@ public final class LazyTypeResolver extends JavaVisitorBase implements Invoca if (lhs == null) { // already filters accessibility return myNode.getSymbolTable().methods().resolve(getName()); + } else if (myNode.getEnclosingType() == null) { + return Collections.emptyList(); } else { JTypeMirror lhsType; if (lhs instanceof ASTConstructorCall) { diff --git a/pmd-java/src/main/resources/category/java/bestpractices.xml b/pmd-java/src/main/resources/category/java/bestpractices.xml index 6c788a7cec..7843f7d1fa 100644 --- a/pmd-java/src/main/resources/category/java/bestpractices.xml +++ b/pmd-java/src/main/resources/category/java/bestpractices.xml @@ -1,4 +1,4 @@ - + +
+ + +Java 10 introduced the `var` keyword. This reduces the amount of code written because java can infer the type +from the initializer of the variable declaration. + +This is essentially a trade-off: On the one hand, it can make code more readable by eliminating redundant +information. On the other hand, it can make code less readable by eliding useful information. There is no +blanket rule for when `var` should be used or shouldn't. + +It may make sense to use `var` when the type is inherently clear upon reading the statement +(ie: assignment to either a literal value or a constructor call). Those use cases +can be enabled through properties. + +Notice that lambda parameters are allowed, as they are already inferred by default (the `var` keyword +is completely optional). + +See also [Local Variable Type Inference Style Guidelines](https://openjdk.org/projects/amber/guides/lvti-style-guide). + + 3 + + + + + + + + + + + + + + + + + + + --> + 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 7133197e18..47f1619085 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,6 +4,9 @@ package net.sourceforge.pmd.lang.java; +import static net.sourceforge.pmd.AbstractLanguageVersionTest.TestDescriptor.defaultVersionIs; +import static net.sourceforge.pmd.AbstractLanguageVersionTest.TestDescriptor.versionDoesNotExist; + import java.util.Arrays; import java.util.Collection; @@ -30,11 +33,20 @@ class LanguageVersionTest extends AbstractLanguageVersionTest { new TestDescriptor(java, "14"), new TestDescriptor(java, "15"), new TestDescriptor(java, "16"), - new TestDescriptor(java, "16-preview"), new TestDescriptor(java, "17"), - new TestDescriptor(java, "17-preview"), + 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"), - // this one won't be found: case sensitive! - new TestDescriptor("JAVA", "JAVA", "1.7", null)); + defaultVersionIs(java, "21"), + + // this one won't be found: case-sensitive! + versionDoesNotExist("JAVA", "JAVA", "1.7"), + // not supported anymore + versionDoesNotExist(java, "19-preview") + ); } } 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 e7182c7382..2b7ffdc9fd 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,20 +9,27 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import org.junit.jupiter.api.Test; +import net.sourceforge.pmd.AbstractRuleSetFactoryTest; import net.sourceforge.pmd.RuleSet; import net.sourceforge.pmd.RuleSetLoader; import com.github.stefanbirkner.systemlambda.SystemLambda; class QuickstartRulesetTest { + private static final String QUICKSTART_RULESET = "rulesets/java/quickstart.xml"; @Test void noDeprecations() throws Exception { RuleSetLoader ruleSetLoader = new RuleSetLoader().enableCompatibility(false); String errorOutput = SystemLambda.tapSystemErr(() -> { - RuleSet quickstart = ruleSetLoader.loadFromResource("rulesets/java/quickstart.xml"); + RuleSet quickstart = ruleSetLoader.loadFromResource(QUICKSTART_RULESET); assertFalse(quickstart.getRules().isEmpty()); }); assertTrue(errorOutput.isEmpty()); } + + @Test + void correctEncoding() throws Exception { + assertTrue(AbstractRuleSetFactoryTest.hasCorrectEncoding(QUICKSTART_RULESET)); + } } 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 01b3169070..1af75cb987 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/AllJavaAstTreeDumpTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/AllJavaAstTreeDumpTest.java @@ -14,8 +14,9 @@ import org.junit.platform.suite.api.Suite; Java15TreeDumpTest.class, Java16TreeDumpTest.class, Java17TreeDumpTest.class, - Java19PreviewTreeDumpTest.class, - Java20PreviewTreeDumpTest.class + Java20PreviewTreeDumpTest.class, + Java21TreeDumpTest.class, + Java21PreviewTreeDumpTest.class }) class AllJavaAstTreeDumpTest { diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java19PreviewTreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java19PreviewTreeDumpTest.java deleted file mode 100644 index 0f7efbc8af..0000000000 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java19PreviewTreeDumpTest.java +++ /dev/null @@ -1,100 +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.ast.test.BaseTreeDumpTest; -import net.sourceforge.pmd.lang.ast.test.RelevantAttributePrinter; -import net.sourceforge.pmd.lang.java.JavaParsingHelper; - -class Java19PreviewTreeDumpTest extends BaseTreeDumpTest { - private final JavaParsingHelper java19p = - JavaParsingHelper.DEFAULT.withDefaultVersion("19-preview") - .withResourceContext(Java19PreviewTreeDumpTest.class, "jdkversiontests/java19p/"); - private final JavaParsingHelper java19 = java19p.withDefaultVersion("19"); - - Java19PreviewTreeDumpTest() { - super(new RelevantAttributePrinter(), ".java"); - } - - @Override - public BaseParsingHelper getParser() { - return java19p; - } - - @Test - void dealingWithNullBeforeJava19Preview() { - ParseException thrown = assertThrows(ParseException.class, () -> java19.parseResource("DealingWithNull.java")); - assertTrue(thrown.getMessage().contains("Null in switch cases is a preview feature of JDK 19, you should select your language version accordingly"), - "Unexpected message: " + thrown.getMessage()); - } - - @Test - void dealingWithNull() { - doTest("DealingWithNull"); - } - - @Test - void enhancedTypeCheckingSwitch() { - doTest("EnhancedTypeCheckingSwitch"); - } - - @Test - void exhaustiveSwitch() { - doTest("ExhaustiveSwitch"); - } - - @Test - void guardedAndParenthesizedPatternsBeforeJava19Preview() { - ParseException thrown = assertThrows(ParseException.class, () -> java19.parseResource("GuardedAndParenthesizedPatterns.java")); - assertTrue(thrown.getMessage().contains("Patterns in switch statements is a preview feature of JDK 19, you should select your language version accordingly"), - "Unexpected message: " + thrown.getMessage()); - } - - @Test - void guardedAndParenthesizedPatterns() { - doTest("GuardedAndParenthesizedPatterns"); - } - - @Test - void patternsInSwitchLabelsBeforeJava19Preview() { - ParseException thrown = assertThrows(ParseException.class, () -> java19.parseResource("PatternsInSwitchLabels.java")); - assertTrue(thrown.getMessage().contains("Patterns in switch statements is a preview feature of JDK 19, you should select your language version accordingly"), - "Unexpected message: " + thrown.getMessage()); - } - - @Test - void patternsInSwitchLabels() { - doTest("PatternsInSwitchLabels"); - } - - @Test - void refiningPatternsInSwitch() { - doTest("RefiningPatternsInSwitch"); - } - - @Test - void scopeOfPatternVariableDeclarations() { - doTest("ScopeOfPatternVariableDeclarations"); - } - - @Test - void recordPatterns() { - doTest("RecordPatterns"); - } - - @Test - void recordPatternsBeforeJava19Preview() { - ParseException thrown = assertThrows(ParseException.class, () -> java19.parseResource("RecordPatterns.java")); - assertTrue(thrown.getMessage().contains("Deconstruction patterns is a preview feature of JDK 19, you should select your language version accordingly"), - "Unexpected message: " + thrown.getMessage()); - } -} diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java20PreviewTreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java20PreviewTreeDumpTest.java index e82215bf6b..211fd24ccf 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java20PreviewTreeDumpTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java20PreviewTreeDumpTest.java @@ -94,7 +94,7 @@ class Java20PreviewTreeDumpTest extends BaseTreeDumpTest { @Test void recordPatternsBeforeJava20Preview() { ParseException thrown = assertThrows(ParseException.class, () -> java20.parseResource("RecordPatterns.java")); - assertTrue(thrown.getMessage().contains("Deconstruction patterns is a preview feature of JDK 20, you should select your language version accordingly"), + assertTrue(thrown.getMessage().contains("Record patterns is a preview feature of JDK 20, you should select your language version accordingly"), "Unexpected message: " + thrown.getMessage()); } diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java21PreviewTreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java21PreviewTreeDumpTest.java new file mode 100644 index 0000000000..fa649d66b1 --- /dev/null +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java21PreviewTreeDumpTest.java @@ -0,0 +1,109 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +package net.sourceforge.pmd.lang.java.ast; + +import static org.hamcrest.CoreMatchers.containsString; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.junit.jupiter.api.Test; + +import net.sourceforge.pmd.lang.ast.ParseException; +import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; +import net.sourceforge.pmd.lang.ast.test.BaseTreeDumpTest; +import net.sourceforge.pmd.lang.ast.test.RelevantAttributePrinter; +import net.sourceforge.pmd.lang.java.JavaParsingHelper; +import net.sourceforge.pmd.lang.java.symbols.JClassSymbol; +import net.sourceforge.pmd.lang.java.types.JTypeMirror; + +class Java21PreviewTreeDumpTest extends BaseTreeDumpTest { + private final JavaParsingHelper java21p = + JavaParsingHelper.DEFAULT.withDefaultVersion("21-preview") + .withResourceContext(Java21PreviewTreeDumpTest.class, "jdkversiontests/java21p/"); + private final JavaParsingHelper java21 = java21p.withDefaultVersion("21"); + + Java21PreviewTreeDumpTest() { + super(new RelevantAttributePrinter(), ".java"); + } + + @Override + public BaseParsingHelper getParser() { + return java21p; + } + + @Test + void templateProcessors() { + doTest("Jep430_StringTemplates"); + } + + @Test + void templateProcessorsBeforeJava21Preview() { + ParseException thrown = assertThrows(ParseException.class, () -> java21.parseResource("Jep430_StringTemplates.java")); + assertTrue(thrown.getMessage().contains("String templates is a preview feature of JDK 21, you should select your language version accordingly")); + } + + @Test + void templateExpressionType() { + ASTCompilationUnit unit = java21p.parse("class Foo {{ int i = 1; String s = STR.\"i = \\{i}\"; }}"); + ASTTemplateExpression templateExpression = unit.descendants(ASTTemplateExpression.class).first(); + JTypeMirror typeMirror = templateExpression.getTypeMirror(); + assertEquals("java.lang.String", ((JClassSymbol) typeMirror.getSymbol()).getCanonicalName()); + } + + @Test + void unnamedPatternsAndVariables() { + doTest("Jep443_UnnamedPatternsAndVariables"); + } + + @Test + void 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")); + } + + @Test + void unnamedClasses1() { + doTest("Jep445_UnnamedClasses1"); + ASTCompilationUnit compilationUnit = java21p.parseResource("Jep445_UnnamedClasses1.java"); + assertTrue(compilationUnit.isUnnamedClass()); + ASTMethodCall methodCall = compilationUnit.descendants(ASTMethodCall.class).first(); + assertNotNull(methodCall.getTypeMirror()); + } + + @Test + void unnamedClasses2() { + doTest("Jep445_UnnamedClasses2"); + } + + @Test + void unnamedClasses3() { + doTest("Jep445_UnnamedClasses3"); + } + + @Test + void unnamedClassesBeforeJava21Preview() { + ParseException thrown = assertThrows(ParseException.class, () -> java21.parseResource("Jep445_UnnamedClasses1.java")); + assertThat(thrown.getMessage(), containsString("Unnamed classes is a preview feature of JDK 21, you should select your language version accordingly")); + } + + @Test + void testOrdinaryCompilationUnit() { + ASTCompilationUnit compilationUnit = java21.parse("public class Foo { public static void main(String[] args) {}}"); + assertFalse(compilationUnit.isUnnamedClass()); + } + + @Test + void testModularCompilationUnit() { + ASTCompilationUnit compilationUnit = java21.parse("module foo {}"); + assertFalse(compilationUnit.isUnnamedClass()); + } +} 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 new file mode 100644 index 0000000000..0dbcaf725a --- /dev/null +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java21TreeDumpTest.java @@ -0,0 +1,130 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +package net.sourceforge.pmd.lang.java.ast; + +import static org.hamcrest.CoreMatchers.containsString; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import org.junit.jupiter.api.Test; + +import net.sourceforge.pmd.lang.ast.ParseException; +import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; +import net.sourceforge.pmd.lang.ast.test.BaseTreeDumpTest; +import net.sourceforge.pmd.lang.ast.test.RelevantAttributePrinter; +import net.sourceforge.pmd.lang.java.JavaParsingHelper; + +class Java21TreeDumpTest extends BaseTreeDumpTest { + private final JavaParsingHelper java21 = + JavaParsingHelper.DEFAULT.withDefaultVersion("21") + .withResourceContext(Java21TreeDumpTest.class, "jdkversiontests/java21/"); + private final JavaParsingHelper java20 = java21.withDefaultVersion("20"); + + Java21TreeDumpTest() { + super(new RelevantAttributePrinter(), ".java"); + } + + @Override + public BaseParsingHelper getParser() { + return java21; + } + + @Test + void patternMatchingForSwitch() { + doTest("Jep441_PatternMatchingForSwitch"); + } + + @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")); + } + + @Test + void dealingWithNull() { + doTest("DealingWithNull"); + } + + @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")); + } + + + @Test + void enhancedTypeCheckingSwitch() { + doTest("EnhancedTypeCheckingSwitch"); + } + + @Test + void exhaustiveSwitch() { + doTest("ExhaustiveSwitch"); + } + + @Test + void guardedPatterns() { + doTest("GuardedPatterns"); + } + + @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")); + } + + @Test + void patternsInSwitchLabels() { + doTest("PatternsInSwitchLabels"); + } + + @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")); + } + + @Test + void refiningPatternsInSwitch() { + doTest("RefiningPatternsInSwitch"); + } + + @Test + void scopeOfPatternVariableDeclarations() { + doTest("ScopeOfPatternVariableDeclarations"); + } + + @Test + void recordPatternsJep() { + doTest("Jep440_RecordPatterns"); + } + + @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")); + } + + @Test + void recordPatterns() { + doTest("RecordPatterns"); + } + + @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")); + } + + @Test + void recordPatternsExhaustiveSwitch() { + doTest("RecordPatternsExhaustiveSwitch"); + } + + @Test + void canParseAnnotationValueInitializers() { + doTest("AnnotationValueInitializers"); + } +} diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/cpd/JavaTokenizerTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/cpd/JavaTokenizerTest.java index 64ae233621..67e211f13c 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/cpd/JavaTokenizerTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/cpd/JavaTokenizerTest.java @@ -4,6 +4,7 @@ package net.sourceforge.pmd.lang.java.cpd; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import net.sourceforge.pmd.cpd.CpdLanguageProperties; @@ -11,67 +12,95 @@ import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest; import net.sourceforge.pmd.cpd.test.LanguagePropertyConfig; import net.sourceforge.pmd.lang.java.JavaLanguageModule; +// TODO - enable tests class JavaTokenizerTest extends CpdTextComparisonTest { JavaTokenizerTest() { super(JavaLanguageModule.getInstance(), ".java"); } + @Test + void testSimpleClass() { + doTest("SimpleClass"); + } + + @Test + void testStringTemplateReduction() { + doTest("StringTemplateReduction"); + } + + @Test + void testStringTemplateReduction2() { + doTest("StringTemplateReduction2"); + } + + @Disabled("Needs to be enabled after java-grammar changes are finalized") @Test void testCommentsIgnored() { doTest("simpleClassWithComments"); } + @Disabled("Needs to be enabled after java-grammar changes are finalized") @Test void testDiscardedElements() { doTest("discardedElements", "_ignore_annots", ignoreAnnotations()); } + @Disabled("Needs to be enabled after java-grammar changes are finalized") @Test void testDiscardedElementsExceptAnnots() { doTest("discardedElements", "_no_ignore_annots"); } + @Disabled("Needs to be enabled after java-grammar changes are finalized") @Test void testIgnoreBetweenSpecialComments() { doTest("specialComments"); } + @Disabled("Needs to be enabled after java-grammar changes are finalized") @Test void testIgnoreBetweenSpecialAnnotation() { doTest("ignoreSpecialAnnotations"); } + @Disabled("Needs to be enabled after java-grammar changes are finalized") @Test void testIgnoreBetweenSpecialAnnotationAndIgnoreAnnotations() { doTest("ignoreSpecialAnnotations", "_ignore_annots", ignoreAnnotations()); } + @Disabled("Needs to be enabled after java-grammar changes are finalized") @Test void testIgnoreIdentifiersDontAffectConstructors() { doTest("ignoreIdentsPreservesCtor", "", ignoreIdents()); } + @Disabled("Needs to be enabled after java-grammar changes are finalized") @Test void testIgnoreIdentifiersHandlesEnums() { doTest("ignoreIdentsPreservesEnum", "", ignoreIdents()); } + @Disabled("Needs to be enabled after java-grammar changes are finalized") @Test void testIgnoreIdentifiersWithClassKeyword() { doTest("ignoreIdentsPreservesClassLiteral", "", ignoreIdents()); } + @Disabled("Needs to be enabled after java-grammar changes are finalized") @Test void testIgnoreLiterals() { doTest("ignoreLiterals", "", ignoreLiterals()); } + @Disabled("Needs to be enabled after java-grammar changes are finalized") @Test void testNoIgnoreLiterals() { doTest("ignoreLiterals", "_noignore"); } + @Disabled("Needs to be enabled after java-grammar changes are finalized") @Test void testTabWidth() { doTest("tabWidth"); 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 new file mode 100644 index 0000000000..e535efd39c --- /dev/null +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UseExplicitTypesTest.java @@ -0,0 +1,11 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +package net.sourceforge.pmd.lang.java.rule.codestyle; + +import net.sourceforge.pmd.testframework.PmdRuleTst; + +class UseExplicitTypesTest extends PmdRuleTst { + // no additional unit tests +} 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 84685e03e2..f7d106b431 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 @@ -32,8 +32,9 @@ enum class JavaVersion : Comparable { J16, J17, J18, - J19, J19__PREVIEW, - J20, J20__PREVIEW; + J19, + J20, J20__PREVIEW, + J21, J21__PREVIEW; /** Name suitable for use with e.g. [JavaParsingHelper.parse] */ val pmdName: String = name.removePrefix("J").replaceFirst("__", "-").replace('_', '.').lowercase() diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/EnhancedTypeCheckingSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/EnhancedTypeCheckingSwitch.txt deleted file mode 100644 index c4629ea16e..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/EnhancedTypeCheckingSwitch.txt +++ /dev/null @@ -1,143 +0,0 @@ -+- CompilationUnit[@PackageName = ""] - +- ClassOrInterfaceDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "EnhancedTypeCheckingSwitch", @CanonicalName = "EnhancedTypeCheckingSwitch", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Image = "EnhancedTypeCheckingSwitch", @Interface = false, @Local = false, @Native = false, @Nested = false, @PackageName = "", @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "EnhancedTypeCheckingSwitch", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = true, @SyntacticallyStatic = false, @TopLevel = true, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] - | +- ModifierList[] - | +- ClassOrInterfaceBody[@Empty = false, @Size = 2] - | +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "typeTester", @MainMethod = false, @MethodName = "typeTester", @Name = "typeTester", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] - | | +- ModifierList[] - | | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] - | | +- FormalParameters[@Empty = false, @Size = 1] - | | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] - | | | +- ModifierList[] - | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] - | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "o", @Visibility = Visibility.V_LOCAL, @Volatile = false] - | | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- SwitchArrowBranch[@Default = false] - | | | +- SwitchLabel[@Default = false] - | | | | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] - | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] - | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "null", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"null\"", @IntLiteral = false, @Length = 4, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] - | | +- SwitchArrowBranch[@Default = false] - | | | +- SwitchLabel[@Default = false] - | | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | | | | +- ModifierList[] - | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] - | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] - | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] - | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "String", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"String\"", @IntLiteral = false, @Length = 6, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] - | | +- SwitchArrowBranch[@Default = false] - | | | +- SwitchLabel[@Default = false] - | | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | | | | +- ModifierList[] - | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Color", @TypeImage = "Color"] - | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "c", @Visibility = Visibility.V_LOCAL, @Volatile = false] - | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] - | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Color with ", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Color with \"", @IntLiteral = false, @Length = 11, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] - | | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "length", @Name = "length", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "values", @MethodName = "values", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "c"] - | | | | +- ArgumentList[@Empty = true, @Size = 0] - | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = " values", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\" values\"", @IntLiteral = false, @Length = 7, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] - | | +- SwitchArrowBranch[@Default = false] - | | | +- SwitchLabel[@Default = false] - | | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | | | | +- ModifierList[] - | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Point", @TypeImage = "Point"] - | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "p", @LambdaParameter = false, @LocalVariable = false, @Name = "p", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "p", @Visibility = Visibility.V_LOCAL, @Volatile = false] - | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] - | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Record class: ", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Record class: \"", @IntLiteral = false, @Length = 14, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] - | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "toString", @MethodName = "toString", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "p", @Name = "p", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "p"] - | | | +- ArgumentList[@Empty = true, @Size = 0] - | | +- SwitchArrowBranch[@Default = false] - | | | +- SwitchLabel[@Default = false] - | | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | | | | +- ModifierList[] - | | | | +- ArrayType[@ArrayDepth = 1, @ArrayType = true, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "int[]"] - | | | | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] - | | | | | +- ArrayDimensions[@Empty = false, @Size = 1] - | | | | | +- ArrayTypeDim[@Varargs = false] - | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "ia", @LambdaParameter = false, @LocalVariable = false, @Name = "ia", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "ia", @Visibility = Visibility.V_LOCAL, @Volatile = false] - | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] - | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Array of ints of length", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Array of ints of length\"", @IntLiteral = false, @Length = 23, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] - | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "length", @Name = "length", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "ia", @Name = "ia", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "ia"] - | | +- SwitchArrowBranch[@Default = true] - | | +- SwitchLabel[@Default = true] - | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Something else", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Something else\"", @IntLiteral = false, @Length = 14, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] - | +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "main", @MainMethod = true, @MethodName = "main", @Name = "main", @Native = false, @Overridden = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = true, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true, @Volatile = false] - | +- ModifierList[] - | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] - | | +- ModifierList[] - | | +- ArrayType[@ArrayDepth = 1, @ArrayType = true, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "String[]"] - | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] - | | | +- ArrayDimensions[@Empty = false, @Size = 1] - | | | +- ArrayTypeDim[@Varargs = false] - | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "args", @LambdaParameter = false, @LocalVariable = false, @Name = "args", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "args", @Visibility = Visibility.V_LOCAL, @Volatile = false] - | +- Block[@Empty = false, @Size = 2, @containsComment = false] - | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] - | | +- ModifierList[] - | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] - | | +- VariableDeclarator[@Initializer = true, @Name = "o"] - | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "o", @LambdaParameter = false, @LocalVariable = true, @Name = "o", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "o", @Visibility = Visibility.V_LOCAL, @Volatile = false] - | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "test", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"test\"", @IntLiteral = false, @Length = 4, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] - | +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "typeTester", @MethodName = "typeTester", @ParenthesisDepth = 0, @Parenthesized = false] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Point", @CanonicalName = "Point", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Image = "Point", @Interface = false, @Local = false, @Native = false, @Nested = false, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Point", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = true, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | +- ModifierList[] - | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] - | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] - | | | +- ModifierList[] - | | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] - | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "i", @Visibility = Visibility.V_PRIVATE, @Volatile = false] - | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] - | | +- ModifierList[] - | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] - | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "j", @LambdaParameter = false, @LocalVariable = false, @Name = "j", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "j", @Visibility = Visibility.V_PRIVATE, @Volatile = false] - | +- RecordBody[@Empty = true, @Size = 0] - +- EnumDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Color", @CanonicalName = "Color", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = true, @Final = true, @Image = "Color", @Interface = false, @Local = false, @Native = false, @Nested = false, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Color", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = true, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - +- ModifierList[] - +- EnumBody[@Empty = false, @SeparatorSemi = true, @Size = 3, @TrailingComma = false] - +- EnumConstant[@Abstract = false, @AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = true, @Image = "RED", @MethodName = "new", @Name = "RED", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] - | +- ModifierList[] - | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "RED", @LambdaParameter = false, @LocalVariable = false, @Name = "RED", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = true, @VariableName = "RED", @Visibility = Visibility.V_PUBLIC, @Volatile = false] - +- EnumConstant[@Abstract = false, @AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = true, @Image = "GREEN", @MethodName = "new", @Name = "GREEN", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] - | +- ModifierList[] - | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "GREEN", @LambdaParameter = false, @LocalVariable = false, @Name = "GREEN", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = true, @VariableName = "GREEN", @Visibility = Visibility.V_PUBLIC, @Volatile = false] - +- EnumConstant[@Abstract = false, @AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = true, @Image = "BLUE", @MethodName = "new", @Name = "BLUE", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] - +- ModifierList[] - +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "BLUE", @LambdaParameter = false, @LocalVariable = false, @Name = "BLUE", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = true, @VariableName = "BLUE", @Visibility = Visibility.V_PUBLIC, @Volatile = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/GuardedAndParenthesizedPatterns.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/GuardedAndParenthesizedPatterns.txt index 1af8bec44d..4cc8d4c987 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/GuardedAndParenthesizedPatterns.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/GuardedAndParenthesizedPatterns.txt @@ -19,7 +19,7 @@ | | | | +- ModifierList[] | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] - | | | +- SwitchGuard[] + | | | +- Guard[] | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "s"] @@ -49,7 +49,7 @@ | | | | +- ModifierList[] | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Integer", @TypeImage = "Integer"] | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "i", @Visibility = Visibility.V_LOCAL, @Volatile = false] - | | | +- SwitchGuard[] + | | | +- Guard[] | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "intValue", @MethodName = "intValue", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "i"] @@ -67,7 +67,7 @@ | | | | +- ModifierList[] | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Long", @TypeImage = "Long"] | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "l", @LambdaParameter = false, @LocalVariable = false, @Name = "l", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "l", @Visibility = Visibility.V_LOCAL, @Volatile = false] - | | | +- SwitchGuard[] + | | | +- Guard[] | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "longValue", @MethodName = "longValue", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "l", @Name = "l", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "l"] @@ -153,7 +153,7 @@ | | | | +- ModifierList[] | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] - | | | +- SwitchGuard[] + | | | +- Guard[] | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.EQ, @ParenthesisDepth = 1, @Parenthesized = true] | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "s"] @@ -183,7 +183,7 @@ | | | | +- ModifierList[] | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Integer", @TypeImage = "Integer"] | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "i", @Visibility = Visibility.V_LOCAL, @Volatile = false] - | | | +- SwitchGuard[] + | | | +- Guard[] | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "intValue", @MethodName = "intValue", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "i"] @@ -201,7 +201,7 @@ | | | | +- ModifierList[] | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Long", @TypeImage = "Long"] | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "l", @LambdaParameter = false, @LocalVariable = false, @Name = "l", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "l", @Visibility = Visibility.V_LOCAL, @Volatile = false] - | | | +- SwitchGuard[] + | | | +- Guard[] | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.EQ, @ParenthesisDepth = 2, @Parenthesized = true] | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "longValue", @MethodName = "longValue", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "l", @Name = "l", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "l"] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatterns.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatterns.txt index 038308fdb6..f94cd9ac87 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatterns.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatterns.txt @@ -108,7 +108,7 @@ | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] | | +- RecordPattern[@ParenthesisDepth = 0] | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Point", @TypeImage = "Point"] - | | +- ComponentPatternList[@Empty = false, @Size = 2] + | | +- PatternList[@Empty = false, @Size = 2] | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] | | | +- ModifierList[] | | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] @@ -142,7 +142,7 @@ | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] | | +- RecordPattern[@ParenthesisDepth = 0] | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Rectangle", @TypeImage = "Rectangle"] - | | +- ComponentPatternList[@Empty = false, @Size = 2] + | | +- PatternList[@Empty = false, @Size = 2] | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] | | | +- ModifierList[] | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "ColoredPoint", @TypeImage = "ColoredPoint"] @@ -176,10 +176,10 @@ | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] | | +- RecordPattern[@ParenthesisDepth = 0] | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Rectangle", @TypeImage = "Rectangle"] - | | +- ComponentPatternList[@Empty = false, @Size = 2] + | | +- PatternList[@Empty = false, @Size = 2] | | +- RecordPattern[@ParenthesisDepth = 0] | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "ColoredPoint", @TypeImage = "ColoredPoint"] - | | | +- ComponentPatternList[@Empty = false, @Size = 2] + | | | +- PatternList[@Empty = false, @Size = 2] | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] | | | | +- ModifierList[] | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Point", @TypeImage = "Point"] @@ -272,13 +272,13 @@ | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] | | +- RecordPattern[@ParenthesisDepth = 0] | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Rectangle", @TypeImage = "Rectangle"] - | | +- ComponentPatternList[@Empty = false, @Size = 2] + | | +- PatternList[@Empty = false, @Size = 2] | | +- RecordPattern[@ParenthesisDepth = 0] | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "ColoredPoint", @TypeImage = "ColoredPoint"] - | | | +- ComponentPatternList[@Empty = false, @Size = 2] + | | | +- PatternList[@Empty = false, @Size = 2] | | | +- RecordPattern[@ParenthesisDepth = 0] | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Point", @TypeImage = "Point"] - | | | | +- ComponentPatternList[@Empty = false, @Size = 2] + | | | | +- PatternList[@Empty = false, @Size = 2] | | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] | | | | | +- ModifierList[] | | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "var", @TypeImage = "var"] @@ -338,7 +338,7 @@ | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] | | +- RecordPattern[@ParenthesisDepth = 0] | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Pair", @TypeImage = "Pair"] - | | +- ComponentPatternList[@Empty = false, @Size = 2] + | | +- PatternList[@Empty = false, @Size = 2] | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] | | | +- ModifierList[] | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] @@ -396,7 +396,7 @@ | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] - | | +- ComponentPatternList[@Empty = false, @Size = 1] + | | +- PatternList[@Empty = false, @Size = 1] | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] | | +- ModifierList[] | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] @@ -430,7 +430,7 @@ | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] - | | +- ComponentPatternList[@Empty = false, @Size = 1] + | | +- PatternList[@Empty = false, @Size = 1] | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] | | +- ModifierList[] | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "var", @TypeImage = "var"] @@ -462,7 +462,7 @@ | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] | | +- RecordPattern[@ParenthesisDepth = 0] | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] - | | +- ComponentPatternList[@Empty = false, @Size = 1] + | | +- PatternList[@Empty = false, @Size = 1] | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] | | +- ModifierList[] | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "var", @TypeImage = "var"] @@ -500,10 +500,10 @@ | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] - | | +- ComponentPatternList[@Empty = false, @Size = 1] + | | +- PatternList[@Empty = false, @Size = 1] | | +- RecordPattern[@ParenthesisDepth = 0] | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] - | | +- ComponentPatternList[@Empty = false, @Size = 1] + | | +- PatternList[@Empty = false, @Size = 1] | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] | | +- ModifierList[] | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "var", @TypeImage = "var"] @@ -537,10 +537,10 @@ | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] | +- RecordPattern[@ParenthesisDepth = 0] | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] - | +- ComponentPatternList[@Empty = false, @Size = 1] + | +- PatternList[@Empty = false, @Size = 1] | +- RecordPattern[@ParenthesisDepth = 0] | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] - | +- ComponentPatternList[@Empty = false, @Size = 1] + | +- PatternList[@Empty = false, @Size = 1] | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] | +- ModifierList[] | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "var", @TypeImage = "var"] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsExhaustiveSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsExhaustiveSwitch.txt index 7e3ac507f4..c123520496 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsExhaustiveSwitch.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsExhaustiveSwitch.txt @@ -69,7 +69,7 @@ | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Pair", @TypeImage = "Pair"] | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "A", @TypeImage = "A"] - | | | +- ComponentPatternList[@Empty = false, @Size = 2] + | | | +- PatternList[@Empty = false, @Size = 2] | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] | | | | +- ModifierList[] | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "A", @TypeImage = "A"] @@ -90,7 +90,7 @@ | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Pair", @TypeImage = "Pair"] | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "A", @TypeImage = "A"] - | | | +- ComponentPatternList[@Empty = false, @Size = 2] + | | | +- PatternList[@Empty = false, @Size = 2] | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] | | | | +- ModifierList[] | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "B", @TypeImage = "B"] @@ -111,7 +111,7 @@ | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Pair", @TypeImage = "Pair"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "A", @TypeImage = "A"] - | | +- ComponentPatternList[@Empty = false, @Size = 2] + | | +- PatternList[@Empty = false, @Size = 2] | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] | | | +- ModifierList[] | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "A", @TypeImage = "A"] @@ -134,7 +134,7 @@ | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Pair", @TypeImage = "Pair"] | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "I", @TypeImage = "I"] - | | | +- ComponentPatternList[@Empty = false, @Size = 2] + | | | +- PatternList[@Empty = false, @Size = 2] | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] | | | | +- ModifierList[] | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "I", @TypeImage = "I"] @@ -155,7 +155,7 @@ | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Pair", @TypeImage = "Pair"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "I", @TypeImage = "I"] - | | +- ComponentPatternList[@Empty = false, @Size = 2] + | | +- PatternList[@Empty = false, @Size = 2] | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] | | | +- ModifierList[] | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "I", @TypeImage = "I"] @@ -178,7 +178,7 @@ | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Pair", @TypeImage = "Pair"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "I", @TypeImage = "I"] - | | +- ComponentPatternList[@Empty = false, @Size = 2] + | | +- PatternList[@Empty = false, @Size = 2] | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] | | | +- ModifierList[] | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "C", @TypeImage = "C"] @@ -199,7 +199,7 @@ | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Pair", @TypeImage = "Pair"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "I", @TypeImage = "I"] - | | +- ComponentPatternList[@Empty = false, @Size = 2] + | | +- PatternList[@Empty = false, @Size = 2] | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] | | | +- ModifierList[] | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "D", @TypeImage = "D"] @@ -220,7 +220,7 @@ | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Pair", @TypeImage = "Pair"] | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "I", @TypeImage = "I"] - | +- ComponentPatternList[@Empty = false, @Size = 2] + | +- PatternList[@Empty = false, @Size = 2] | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] | | +- ModifierList[] | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "D", @TypeImage = "D"] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsInEnhancedFor.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsInEnhancedFor.txt index 411c416005..2401ccef33 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsInEnhancedFor.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsInEnhancedFor.txt @@ -65,7 +65,7 @@ | +- ForeachStatement[] | +- RecordPattern[@ParenthesisDepth = 0] | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Point", @TypeImage = "Point"] - | | +- ComponentPatternList[@Empty = false, @Size = 2] + | | +- PatternList[@Empty = false, @Size = 2] | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] | | | +- ModifierList[] | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "var", @TypeImage = "var"] @@ -106,10 +106,10 @@ | +- ForeachStatement[] | +- RecordPattern[@ParenthesisDepth = 0] | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Rectangle", @TypeImage = "Rectangle"] - | | +- ComponentPatternList[@Empty = false, @Size = 2] + | | +- PatternList[@Empty = false, @Size = 2] | | +- RecordPattern[@ParenthesisDepth = 0] | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "ColoredPoint", @TypeImage = "ColoredPoint"] - | | | +- ComponentPatternList[@Empty = false, @Size = 2] + | | | +- PatternList[@Empty = false, @Size = 2] | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] | | | | +- ModifierList[] | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Point", @TypeImage = "Point"] @@ -176,7 +176,7 @@ | +- ForeachStatement[] | +- RecordPattern[@ParenthesisDepth = 0] | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Pair", @TypeImage = "Pair"] - | | +- ComponentPatternList[@Empty = false, @Size = 2] + | | +- PatternList[@Empty = false, @Size = 2] | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] | | | +- ModifierList[] | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "var", @TypeImage = "var"] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RefiningPatternsInSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RefiningPatternsInSwitch.txt index bda1bf2671..33e6549fb1 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RefiningPatternsInSwitch.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RefiningPatternsInSwitch.txt @@ -107,7 +107,7 @@ | | | | +- ModifierList[] | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Triangle", @TypeImage = "Triangle"] | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "t", @LambdaParameter = false, @LocalVariable = false, @Name = "t", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "t", @Visibility = Visibility.V_LOCAL, @Volatile = false] - | | | +- SwitchGuard[] + | | | +- Guard[] | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "calculateArea", @MethodName = "calculateArea", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "t", @Name = "t", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "t"] @@ -149,7 +149,7 @@ | | | | +- ModifierList[] | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Triangle", @TypeImage = "Triangle"] | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "t", @LambdaParameter = false, @LocalVariable = false, @Name = "t", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "t", @Visibility = Visibility.V_LOCAL, @Volatile = false] - | | | +- SwitchGuard[] + | | | +- Guard[] | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "calculateArea", @MethodName = "calculateArea", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "t", @Name = "t", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "t"] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ScopeOfPatternVariableDeclarations.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ScopeOfPatternVariableDeclarations.txt index 2599595e42..24cebff346 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ScopeOfPatternVariableDeclarations.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ScopeOfPatternVariableDeclarations.txt @@ -19,7 +19,7 @@ | | | | +- ModifierList[] | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Character", @TypeImage = "Character"] | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "c", @Visibility = Visibility.V_LOCAL, @Volatile = false] - | | | +- SwitchGuard[] + | | | +- Guard[] | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "charValue", @MethodName = "charValue", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "c"] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/AnnotationValueInitializers.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/AnnotationValueInitializers.java new file mode 100644 index 0000000000..11bf9cc322 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/AnnotationValueInitializers.java @@ -0,0 +1,13 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +/* + * Tests parsing after supporting String Templates. "}" is ambiguous. + */ + +@MyAnnotation(a = { "a" }, b = "b") // "}" might be recognized as STRING_TEMPLATE_END, but it is not +class AnnotationValueInitializers { } + +@MyAnnotation(a = { "a" }, b = "#b") // "}" might be recognized as STRING_TEMPLATE_END, but it is not +class AnnotationValueInitializers2 { } diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/AnnotationValueInitializers.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/AnnotationValueInitializers.txt new file mode 100644 index 0000000000..93deaccbde --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/AnnotationValueInitializers.txt @@ -0,0 +1,23 @@ ++- CompilationUnit[@PackageName = ""] + +- ClassOrInterfaceDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "AnnotationValueInitializers", @CanonicalName = "AnnotationValueInitializers", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Image = "AnnotationValueInitializers", @Interface = false, @Local = false, @Native = false, @Nested = false, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "AnnotationValueInitializers", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = true, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | | +- Annotation[@AnnotationName = "MyAnnotation", @SimpleName = "MyAnnotation"] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "MyAnnotation", @TypeImage = "MyAnnotation"] + | | +- AnnotationMemberList[@Empty = false, @Size = 2] + | | +- MemberValuePair[@Image = "a", @Name = "a", @Shorthand = false] + | | | +- MemberValueArrayInitializer[] + | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "a", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"a\"", @IntLiteral = false, @Length = 1, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- MemberValuePair[@Image = "b", @Name = "b", @Shorthand = false] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "b", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"b\"", @IntLiteral = false, @Length = 1, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- ClassOrInterfaceBody[@Empty = true, @Size = 0] + +- ClassOrInterfaceDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "AnnotationValueInitializers2", @CanonicalName = "AnnotationValueInitializers2", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Image = "AnnotationValueInitializers2", @Interface = false, @Local = false, @Native = false, @Nested = false, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "AnnotationValueInitializers2", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = true, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + +- ModifierList[] + | +- Annotation[@AnnotationName = "MyAnnotation", @SimpleName = "MyAnnotation"] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "MyAnnotation", @TypeImage = "MyAnnotation"] + | +- AnnotationMemberList[@Empty = false, @Size = 2] + | +- MemberValuePair[@Image = "a", @Name = "a", @Shorthand = false] + | | +- MemberValueArrayInitializer[] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "a", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"a\"", @IntLiteral = false, @Length = 1, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- MemberValuePair[@Image = "b", @Name = "b", @Shorthand = false] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "#b", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"#b\"", @IntLiteral = false, @Length = 2, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- ClassOrInterfaceBody[@Empty = true, @Size = 0] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/DealingWithNull.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/DealingWithNull.java similarity index 65% rename from pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/DealingWithNull.java rename to pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/DealingWithNull.java index 990fcc2522..e9b2a10cc1 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/DealingWithNull.java +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/DealingWithNull.java @@ -3,34 +3,33 @@ */ /** - * @see JEP 427: Pattern Matching for switch (Third Preview) + * @see JEP 441: Pattern Matching for switch */ public class DealingWithNull { static void testFooBar(String s) { switch (s) { case null -> System.out.println("Oops"); - case "Foo", "Bar" -> System.out.println("Great"); + case "Foo", "Bar" -> System.out.println("Great"); // CaseConstant default -> System.out.println("Ok"); } } static void testStringOrNull(Object o) { switch (o) { - case null, String s -> System.out.println("String: " + s); - case default -> System.out.print("default case"); + case String s -> System.out.println("String: " + s); // CasePattern + case null -> System.out.println("null"); + default -> System.out.println("default case"); } } - static void test(Object o) { + static void testStringOrDefaultNull(Object o) { switch (o) { - case null -> System.out.println("null!"); - case String s -> System.out.println("String"); - default -> System.out.println("Something else"); + case String s -> System.out.println("String: " + s); + case null, default -> System.out.println("null or default case"); } } - static void test2(Object o) { switch (o) { case null -> throw new NullPointerException(); @@ -43,8 +42,11 @@ public class DealingWithNull { static void test3(Object o) { switch(o) { - case null: case String s: - System.out.println("String, including null"); + case null: + System.out.println("null"); + break; // note: fall-through to a CasePattern is not allowed, as the pattern variable is not initialized + case String s: + System.out.println("String"); break; default: System.out.println("default case"); @@ -52,7 +54,8 @@ public class DealingWithNull { } switch(o) { - case null, String s -> System.out.println("String, including null"); + case null -> System.out.println("null"); + case String s -> System.out.println("String"); default -> System.out.println("default case"); } @@ -68,7 +71,7 @@ public class DealingWithNull { } public static void main(String[] args) { - test("test"); + testStringOrDefaultNull("test"); test2(2); try { test2(null); diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/DealingWithNull.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/DealingWithNull.txt similarity index 92% rename from pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/DealingWithNull.txt rename to pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/DealingWithNull.txt index d2302bcfa7..73a1ad57d3 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/DealingWithNull.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/DealingWithNull.txt @@ -53,7 +53,48 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "String: ", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"String: \"", @IntLiteral = false, @Length = 8, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] | | | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "null", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"null\"", @IntLiteral = false, @Length = 4, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = true] + | +- SwitchLabel[@Default = true] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "default case", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"default case\"", @IntLiteral = false, @Length = 12, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "testStringOrDefaultNull", @MainMethod = false, @MethodName = "testStringOrDefaultNull", @Name = "testStringOrDefaultNull", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "o", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] | | | +- ModifierList[] | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] @@ -68,52 +109,13 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = true] | +- SwitchLabel[@Default = true] - | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "print", @MethodName = "print", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "default case", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"default case\"", @IntLiteral = false, @Length = 12, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "test", @MainMethod = false, @MethodName = "test", @Name = "test", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] - | +- ModifierList[] - | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] - | | +- ModifierList[] - | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] - | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "o", @Visibility = Visibility.V_LOCAL, @Volatile = false] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] - | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "null!", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"null!\"", @IntLiteral = false, @Length = 5, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | | | +- ModifierList[] - | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] - | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] - | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "String", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"String\"", @IntLiteral = false, @Length = 6, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] - | +- SwitchArrowBranch[@Default = true] - | +- SwitchLabel[@Default = true] + | | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] | +- ArgumentList[@Empty = false, @Size = 1] - | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Something else", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Something else\"", @IntLiteral = false, @Length = 14, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "null or default case", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"null or default case\"", @IntLiteral = false, @Length = 20, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "test2", @MainMethod = false, @MethodName = "test2", @Name = "test2", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] | +- ModifierList[] | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] @@ -179,7 +181,15 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] | | +- SwitchFallthroughBranch[@Default = false] | | | +- SwitchLabel[@Default = false] - | | | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + | | | | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + | | | +- ExpressionStatement[] + | | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | | | +- ArgumentList[@Empty = false, @Size = 1] + | | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "null", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"null\"", @IntLiteral = false, @Length = 4, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | | +- BreakStatement[@Label = null] | | +- SwitchFallthroughBranch[@Default = false] | | | +- SwitchLabel[@Default = false] | | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] @@ -192,7 +202,7 @@ | | | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] | | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] | | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "String, including null", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"String, including null\"", @IntLiteral = false, @Length = 22, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "String", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"String\"", @IntLiteral = false, @Length = 6, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] | | | +- BreakStatement[@Label = null] | | +- SwitchFallthroughBranch[@Default = true] | | +- SwitchLabel[@Default = true] @@ -209,6 +219,14 @@ | | +- SwitchArrowBranch[@Default = false] | | | +- SwitchLabel[@Default = false] | | | | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | | +- ArgumentList[@Empty = false, @Size = 1] + | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "null", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"null\"", @IntLiteral = false, @Length = 4, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- SwitchArrowBranch[@Default = false] + | | | +- SwitchLabel[@Default = false] | | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] | | | | +- ModifierList[] | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] @@ -218,7 +236,7 @@ | | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "String, including null", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"String, including null\"", @IntLiteral = false, @Length = 22, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "String", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"String\"", @IntLiteral = false, @Length = 6, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] | | +- SwitchArrowBranch[@Default = true] | | +- SwitchLabel[@Default = true] | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -265,7 +283,7 @@ | +- VariableDeclaratorId[@Abstract = false, @ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "args", @LambdaParameter = false, @LocalVariable = false, @Name = "args", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "args", @Visibility = Visibility.V_LOCAL, @Volatile = false] +- Block[@Empty = false, @Size = 12, @containsComment = false] +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "test", @MethodName = "test", @ParenthesisDepth = 0, @Parenthesized = false] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "testStringOrDefaultNull", @MethodName = "testStringOrDefaultNull", @ParenthesisDepth = 0, @Parenthesized = false] | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "test", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"test\"", @IntLiteral = false, @Length = 4, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] +- ExpressionStatement[] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/EnhancedTypeCheckingSwitch.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/EnhancedTypeCheckingSwitch.java similarity index 52% rename from pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/EnhancedTypeCheckingSwitch.java rename to pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/EnhancedTypeCheckingSwitch.java index ad8fe31898..63964021e3 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/EnhancedTypeCheckingSwitch.java +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/EnhancedTypeCheckingSwitch.java @@ -3,16 +3,20 @@ */ /** - * @see JEP 427: Pattern Matching for switch (Third Preview) + * @see JEP 441: Pattern Matching for switch */ public class EnhancedTypeCheckingSwitch { + // As of Java 21 + // Selector expression typing + record Point(int i, int j) {} + enum Color { RED, GREEN, BLUE; } - static void typeTester(Object o) { - switch (o) { + static void typeTester(Object obj) { + switch (obj) { 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 Color c -> System.out.println("Color: " + c.toString()); 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"); @@ -22,8 +26,15 @@ public class EnhancedTypeCheckingSwitch { public static void main(String[] args) { Object o = "test"; typeTester(o); + typeTester(Color.BLUE); + + o = new int[] {1, 2, 3, 4}; + typeTester(o); + + o = new Point(7, 8); + typeTester(o); + + o = new Object(); + typeTester(o); } } - -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/java21/EnhancedTypeCheckingSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/EnhancedTypeCheckingSwitch.txt new file mode 100644 index 0000000000..c8ac8b73a2 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/EnhancedTypeCheckingSwitch.txt @@ -0,0 +1,185 @@ ++- CompilationUnit[@PackageName = ""] + +- ClassOrInterfaceDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "EnhancedTypeCheckingSwitch", @CanonicalName = "EnhancedTypeCheckingSwitch", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Image = "EnhancedTypeCheckingSwitch", @Interface = false, @Local = false, @Native = false, @Nested = false, @PackageName = "", @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "EnhancedTypeCheckingSwitch", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = true, @SyntacticallyStatic = false, @TopLevel = true, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] + +- ModifierList[] + +- ClassOrInterfaceBody[@Empty = false, @Size = 4] + +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "EnhancedTypeCheckingSwitch$Point", @CanonicalName = "EnhancedTypeCheckingSwitch.Point", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Image = "Point", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Point", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | | +- ModifierList[] + | | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "i", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- ModifierList[] + | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "j", @LambdaParameter = false, @LocalVariable = false, @Name = "j", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "j", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | +- RecordBody[@Empty = true, @Size = 0] + +- EnumDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "EnhancedTypeCheckingSwitch$Color", @CanonicalName = "EnhancedTypeCheckingSwitch.Color", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = true, @Final = true, @Image = "Color", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Color", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- EnumBody[@Empty = false, @SeparatorSemi = true, @Size = 3, @TrailingComma = false] + | +- EnumConstant[@Abstract = false, @AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = true, @Image = "RED", @MethodName = "new", @Name = "RED", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] + | | +- ModifierList[] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "RED", @LambdaParameter = false, @LocalVariable = false, @Name = "RED", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = true, @VariableName = "RED", @Visibility = Visibility.V_PUBLIC, @Volatile = false] + | +- EnumConstant[@Abstract = false, @AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = true, @Image = "GREEN", @MethodName = "new", @Name = "GREEN", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] + | | +- ModifierList[] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "GREEN", @LambdaParameter = false, @LocalVariable = false, @Name = "GREEN", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = true, @VariableName = "GREEN", @Visibility = Visibility.V_PUBLIC, @Volatile = false] + | +- EnumConstant[@Abstract = false, @AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = true, @Image = "BLUE", @MethodName = "new", @Name = "BLUE", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] + | +- ModifierList[] + | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "BLUE", @LambdaParameter = false, @LocalVariable = false, @Name = "BLUE", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = true, @VariableName = "BLUE", @Visibility = Visibility.V_PUBLIC, @Volatile = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "typeTester", @MainMethod = false, @MethodName = "typeTester", @Name = "typeTester", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "obj", @LambdaParameter = false, @LocalVariable = false, @Name = "obj", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "obj", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "null", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"null\"", @IntLiteral = false, @Length = 4, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "String", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"String\"", @IntLiteral = false, @Length = 6, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Color", @TypeImage = "Color"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "c", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Color: ", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Color: \"", @IntLiteral = false, @Length = 7, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "toString", @MethodName = "toString", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "c"] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Point", @TypeImage = "Point"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "p", @LambdaParameter = false, @LocalVariable = false, @Name = "p", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "p", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Record class: ", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Record class: \"", @IntLiteral = false, @Length = 14, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "toString", @MethodName = "toString", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "p", @Name = "p", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "p"] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ArrayType[@ArrayDepth = 1, @ArrayType = true, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "int[]"] + | | | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | | | +- ArrayDimensions[@Empty = false, @Size = 1] + | | | | +- ArrayTypeDim[@Varargs = false] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "ia", @LambdaParameter = false, @LocalVariable = false, @Name = "ia", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "ia", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Array of ints of length", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Array of ints of length\"", @IntLiteral = false, @Length = 23, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "length", @Name = "length", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "ia", @Name = "ia", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "ia"] + | +- SwitchArrowBranch[@Default = true] + | +- SwitchLabel[@Default = true] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Something else", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Something else\"", @IntLiteral = false, @Length = 14, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "main", @MainMethod = true, @MethodName = "main", @Name = "main", @Native = false, @Overridden = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = true, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true, @Volatile = false] + +- ModifierList[] + +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + +- FormalParameters[@Empty = false, @Size = 1] + | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- ModifierList[] + | +- ArrayType[@ArrayDepth = 1, @ArrayType = true, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "String[]"] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- ArrayDimensions[@Empty = false, @Size = 1] + | | +- ArrayTypeDim[@Varargs = false] + | +- VariableDeclaratorId[@Abstract = false, @ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "args", @LambdaParameter = false, @LocalVariable = false, @Name = "args", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "args", @Visibility = Visibility.V_LOCAL, @Volatile = false] + +- Block[@Empty = false, @Size = 9, @containsComment = false] + +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- ModifierList[] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] + | +- VariableDeclarator[@Initializer = true, @Name = "o"] + | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "o", @LambdaParameter = false, @LocalVariable = true, @Name = "o", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "o", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "test", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"test\"", @IntLiteral = false, @Length = 4, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "typeTester", @MethodName = "typeTester", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "typeTester", @MethodName = "typeTester", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "BLUE", @Name = "BLUE", @ParenthesisDepth = 0, @Parenthesized = false] + | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Color", @TypeImage = "Color"] + +- ExpressionStatement[] + | +- AssignmentExpression[@CompileTimeConstant = false, @Compound = false, @Expression = true, @Operator = AssignmentOp.ASSIGN, @ParenthesisDepth = 0, @Parenthesized = false] + | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArrayAllocation[@ArrayDepth = 1, @CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArrayType[@ArrayDepth = 1, @ArrayType = true, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "int[]"] + | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | +- ArrayDimensions[@Empty = false, @Size = 1] + | | +- ArrayTypeDim[@Varargs = false] + | +- ArrayInitializer[@CompileTimeConstant = false, @Expression = true, @Length = 4, @ParenthesisDepth = 0, @Parenthesized = false] + | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] + | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3] + | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "4", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 4.0, @ValueAsFloat = 4.0, @ValueAsInt = 4, @ValueAsLong = 4] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "typeTester", @MethodName = "typeTester", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] + +- ExpressionStatement[] + | +- AssignmentExpression[@CompileTimeConstant = false, @Compound = false, @Expression = true, @Operator = AssignmentOp.ASSIGN, @ParenthesisDepth = 0, @Parenthesized = false] + | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @Expression = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Point", @TypeImage = "Point"] + | +- ArgumentList[@Empty = false, @Size = 2] + | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "7", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 7.0, @ValueAsFloat = 7.0, @ValueAsInt = 7, @ValueAsLong = 7] + | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "8", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 8.0, @ValueAsFloat = 8.0, @ValueAsInt = 8, @ValueAsLong = 8] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "typeTester", @MethodName = "typeTester", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] + +- ExpressionStatement[] + | +- AssignmentExpression[@CompileTimeConstant = false, @Compound = false, @Expression = true, @Operator = AssignmentOp.ASSIGN, @ParenthesisDepth = 0, @Parenthesized = false] + | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @Expression = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] + | +- ArgumentList[@Empty = true, @Size = 0] + +- ExpressionStatement[] + +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "typeTester", @MethodName = "typeTester", @ParenthesisDepth = 0, @Parenthesized = false] + +- ArgumentList[@Empty = false, @Size = 1] + +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/ExhaustiveSwitch.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ExhaustiveSwitch.java similarity index 84% rename from pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/ExhaustiveSwitch.java rename to pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ExhaustiveSwitch.java index 44b5bb9fa7..436c1bfbaa 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/ExhaustiveSwitch.java +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ExhaustiveSwitch.java @@ -3,26 +3,20 @@ */ /** - * @see JEP 427: Pattern Matching for switch (Third Preview) + * @see JEP 441: Pattern Matching for switch */ public class ExhaustiveSwitch { - static int coverage(Object o) { - return switch (o) { + // As of Java 21 + // Type coverage + static int coverage(Object obj) { + return switch (obj) { case String s -> s.length(); case Integer i -> i; default -> 0; }; } - static int coverageDefaultCase(Object o) { - return switch (o) { - case String s -> s.length(); - case Integer i -> i; - case default -> 0; - }; - } - static void coverageStatement(Object o) { switch (o) { case String s: @@ -35,11 +29,13 @@ public class ExhaustiveSwitch { break; } } - + + // As of Java 21 + // Exhaustiveness and sealed classes 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 + record C(int i) implements S {} // Implicitly final static int testSealedExhaustive(S s) { return switch (s) { @@ -62,6 +58,9 @@ public class ExhaustiveSwitch { break; }; } + + // As of Java 21 + // Exhaustiveness and sealed classes sealed interface I permits E, F {} final static class E implements I {} final static class F implements I {} @@ -92,4 +91,4 @@ public class ExhaustiveSwitch { System.out.println("F:" + testGenericSealedExhaustive(new F())); } -} \ No newline at end of file +} diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/ExhaustiveSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ExhaustiveSwitch.txt similarity index 90% rename from pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/ExhaustiveSwitch.txt rename to pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ExhaustiveSwitch.txt index 7eadf564b2..9040cfa4d5 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/ExhaustiveSwitch.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ExhaustiveSwitch.txt @@ -1,7 +1,7 @@ +- CompilationUnit[@PackageName = ""] +- ClassOrInterfaceDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ExhaustiveSwitch", @CanonicalName = "ExhaustiveSwitch", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Image = "ExhaustiveSwitch", @Interface = false, @Local = false, @Native = false, @Nested = false, @PackageName = "", @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "ExhaustiveSwitch", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = true, @SyntacticallyStatic = false, @TopLevel = true, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] +- ModifierList[] - +- ClassOrInterfaceBody[@Empty = false, @Size = 14] + +- ClassOrInterfaceBody[@Empty = false, @Size = 13] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "coverage", @MainMethod = false, @MethodName = "coverage", @Name = "coverage", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false, @Volatile = false] | +- ModifierList[] | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] @@ -9,42 +9,11 @@ | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] | | +- ModifierList[] | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] - | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "o", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "obj", @LambdaParameter = false, @LocalVariable = false, @Name = "obj", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "obj", @Visibility = Visibility.V_LOCAL, @Volatile = false] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ReturnStatement[] | +- SwitchExpression[@CompileTimeConstant = false, @DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @Expression = true, @FallthroughSwitch = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | | | +- ModifierList[] - | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] - | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] - | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "s"] - | | +- ArgumentList[@Empty = true, @Size = 0] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | | | +- ModifierList[] - | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Integer", @TypeImage = "Integer"] - | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "i", @Visibility = Visibility.V_LOCAL, @Volatile = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] - | +- SwitchArrowBranch[@Default = true] - | +- SwitchLabel[@Default = true] - | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "coverageDefaultCase", @MainMethod = false, @MethodName = "coverageDefaultCase", @Name = "coverageDefaultCase", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false, @Volatile = false] - | +- ModifierList[] - | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] - | | +- ModifierList[] - | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] - | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "o", @Visibility = Visibility.V_LOCAL, @Volatile = false] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- ReturnStatement[] - | +- SwitchExpression[@CompileTimeConstant = false, @DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @Expression = true, @FallthroughSwitch = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/GuardedAndParenthesizedPatterns.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/GuardedPatterns.java similarity index 55% rename from pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/GuardedAndParenthesizedPatterns.java rename to pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/GuardedPatterns.java index 2dd7da3f70..ba0832da4b 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/GuardedAndParenthesizedPatterns.java +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/GuardedPatterns.java @@ -3,28 +3,26 @@ */ /** - * @see JEP 427: Pattern Matching for switch (Third Preview) + * @see JEP 441: Pattern Matching for switch */ -public class GuardedAndParenthesizedPatterns { +public class GuardedPatterns { 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"); + 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"); + default -> System.out.println("default case"); } } - // verify that "when" can still be used as an identifier + // verify that "when" can still be used as an identifier -> formal parameter void testIdentifierWhen(String when) { System.out.println(when); } - // verify that "when" can still be used as an identifier + // verify that "when" can still be used as an identifier -> local variable void testIdentifierWhen() { int when = 1; System.out.println(when); @@ -35,13 +33,11 @@ public class GuardedAndParenthesizedPatterns { static void testWithNull(Object o) { switch (o) { - case String s when (s.length() == 1) -> System.out.println("single char string"); - case String s -> System.out.println("string"); - case (Integer i) when i.intValue() == 1 -> System.out.println("integer 1"); - case ((Long l)) when ((l.longValue() == 1L)) -> System.out.println("long 1 with parens"); - case (((Double d))) -> System.out.println("double with parens"); - case null -> System.out.println("null!"); - default -> System.out.println("default case"); + case 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 null -> System.out.println("null!"); + default -> System.out.println("default case"); } } @@ -64,6 +60,14 @@ public class GuardedAndParenthesizedPatterns { } } + static void testScopeOfPatternVariableDeclarations(Object obj) { + if ((obj instanceof String s) && s.length() > 3) { + System.out.println(s); + } else { + System.out.println("Not a string"); + } + } + public static void main(String[] args) { test("a"); test("fooo"); @@ -76,5 +80,7 @@ public class GuardedAndParenthesizedPatterns { e.printStackTrace(); } testWithNull(null); + testScopeOfPatternVariableDeclarations("a"); + testScopeOfPatternVariableDeclarations("long enough"); } } diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/GuardedAndParenthesizedPatterns.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/GuardedPatterns.txt similarity index 81% rename from pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/GuardedAndParenthesizedPatterns.txt rename to pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/GuardedPatterns.txt index 3607a3ec21..e6548dec35 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/GuardedAndParenthesizedPatterns.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/GuardedPatterns.txt @@ -1,7 +1,7 @@ +- CompilationUnit[@PackageName = ""] - +- ClassOrInterfaceDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "GuardedAndParenthesizedPatterns", @CanonicalName = "GuardedAndParenthesizedPatterns", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Image = "GuardedAndParenthesizedPatterns", @Interface = false, @Local = false, @Native = false, @Nested = false, @PackageName = "", @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "GuardedAndParenthesizedPatterns", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = true, @SyntacticallyStatic = false, @TopLevel = true, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] + +- ClassOrInterfaceDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "GuardedPatterns", @CanonicalName = "GuardedPatterns", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Image = "GuardedPatterns", @Interface = false, @Local = false, @Native = false, @Nested = false, @PackageName = "", @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "GuardedPatterns", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = true, @SyntacticallyStatic = false, @TopLevel = true, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] +- ModifierList[] - +- ClassOrInterfaceBody[@Empty = false, @Size = 7] + +- ClassOrInterfaceBody[@Empty = false, @Size = 8] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "test", @MainMethod = false, @MethodName = "test", @Name = "test", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] | +- ModifierList[] | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] @@ -19,7 +19,7 @@ | | | | +- ModifierList[] | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] - | | | +- SwitchGuard[] + | | | +- Guard[] | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "s"] @@ -49,7 +49,7 @@ | | | | +- ModifierList[] | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Integer", @TypeImage = "Integer"] | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "i", @Visibility = Visibility.V_LOCAL, @Volatile = false] - | | | +- SwitchGuard[] + | | | +- Guard[] | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "intValue", @MethodName = "intValue", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "i"] @@ -61,36 +61,6 @@ | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "integer 1", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"integer 1\"", @IntLiteral = false, @Length = 9, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 1, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | | | | +- ModifierList[] - | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Long", @TypeImage = "Long"] - | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "l", @LambdaParameter = false, @LocalVariable = false, @Name = "l", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "l", @Visibility = Visibility.V_LOCAL, @Volatile = false] - | | | +- SwitchGuard[] - | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "longValue", @MethodName = "longValue", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "l", @Name = "l", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "l"] - | | | | +- ArgumentList[@Empty = true, @Size = 0] - | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "1L", @IntLiteral = false, @Integral = true, @LongLiteral = true, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] - | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "long 1 with parens", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"long 1 with parens\"", @IntLiteral = false, @Length = 18, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 3, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | | | +- ModifierList[] - | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Double", @TypeImage = "Double"] - | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "d", @LambdaParameter = false, @LocalVariable = false, @Name = "d", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "d", @Visibility = Visibility.V_LOCAL, @Volatile = false] - | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "double with parens", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"double with parens\"", @IntLiteral = false, @Length = 18, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] | +- SwitchArrowBranch[@Default = true] | +- SwitchLabel[@Default = true] | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -133,7 +103,7 @@ | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "when", @Name = "when", @ParenthesisDepth = 0, @Parenthesized = false] - +- ClassOrInterfaceDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "GuardedAndParenthesizedPatterns$when", @CanonicalName = "GuardedAndParenthesizedPatterns.when", @EffectiveVisibility = Visibility.V_PRIVATE, @Enum = false, @Final = false, @Image = "when", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "when", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + +- ClassOrInterfaceDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "GuardedPatterns$when", @CanonicalName = "GuardedPatterns.when", @EffectiveVisibility = Visibility.V_PRIVATE, @Enum = false, @Final = false, @Image = "when", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "when", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] | +- ModifierList[] | +- ClassOrInterfaceBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "testWithNull", @MainMethod = false, @MethodName = "testWithNull", @Name = "testWithNull", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] @@ -153,7 +123,7 @@ | | | | +- ModifierList[] | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] - | | | +- SwitchGuard[] + | | | +- Guard[] | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.EQ, @ParenthesisDepth = 1, @Parenthesized = true] | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "s"] @@ -179,11 +149,11 @@ | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "string", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"string\"", @IntLiteral = false, @Length = 6, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 1, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] | | | | +- ModifierList[] | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Integer", @TypeImage = "Integer"] | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "i", @Visibility = Visibility.V_LOCAL, @Volatile = false] - | | | +- SwitchGuard[] + | | | +- Guard[] | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "intValue", @MethodName = "intValue", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "i"] @@ -197,36 +167,6 @@ | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "integer 1", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"integer 1\"", @IntLiteral = false, @Length = 9, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 2, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | | | | +- ModifierList[] - | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Long", @TypeImage = "Long"] - | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "l", @LambdaParameter = false, @LocalVariable = false, @Name = "l", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "l", @Visibility = Visibility.V_LOCAL, @Volatile = false] - | | | +- SwitchGuard[] - | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.EQ, @ParenthesisDepth = 2, @Parenthesized = true] - | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "longValue", @MethodName = "longValue", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "l", @Name = "l", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "l"] - | | | | +- ArgumentList[@Empty = true, @Size = 0] - | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "1L", @IntLiteral = false, @Integral = true, @LongLiteral = true, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] - | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "long 1 with parens", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"long 1 with parens\"", @IntLiteral = false, @Length = 18, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 3, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | | | +- ModifierList[] - | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Double", @TypeImage = "Double"] - | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "d", @LambdaParameter = false, @LocalVariable = false, @Name = "d", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "d", @Visibility = Visibility.V_LOCAL, @Volatile = false] - | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] - | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "double with parens", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"double with parens\"", @IntLiteral = false, @Length = 18, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] - | +- SwitchArrowBranch[@Default = false] - | | +- SwitchLabel[@Default = false] | | | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] @@ -321,6 +261,45 @@ | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "A string containing at least four characters", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"A string containing at least four characters\"", @IntLiteral = false, @Length = 44, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "testScopeOfPatternVariableDeclarations", @MainMethod = false, @MethodName = "testScopeOfPatternVariableDeclarations", @Name = "testScopeOfPatternVariableDeclarations", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "obj", @LambdaParameter = false, @LocalVariable = false, @Name = "obj", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "obj", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- IfStatement[@Else = true] + | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.CONDITIONAL_AND, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 1, @Parenthesized = true] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ArgumentList[@Empty = true, @Size = 0] + | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | +- ExpressionStatement[] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Not a string", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Not a string\"", @IntLiteral = false, @Length = 12, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "main", @MainMethod = true, @MethodName = "main", @Name = "main", @Native = false, @Overridden = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = true, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true, @Volatile = false] +- ModifierList[] +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] @@ -332,7 +311,7 @@ | | +- ArrayDimensions[@Empty = false, @Size = 1] | | +- ArrayTypeDim[@Varargs = false] | +- VariableDeclaratorId[@Abstract = false, @ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "args", @LambdaParameter = false, @LocalVariable = false, @Name = "args", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "args", @Visibility = Visibility.V_LOCAL, @Volatile = false] - +- Block[@Empty = false, @Size = 7, @containsComment = false] + +- Block[@Empty = false, @Size = 9, @containsComment = false] +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "test", @MethodName = "test", @ParenthesisDepth = 0, @Parenthesized = false] | +- ArgumentList[@Empty = false, @Size = 1] @@ -370,6 +349,14 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "e", @Name = "e", @ParenthesisDepth = 0, @Parenthesized = false] | +- ArgumentList[@Empty = true, @Size = 0] +- ExpressionStatement[] - +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "testWithNull", @MethodName = "testWithNull", @ParenthesisDepth = 0, @Parenthesized = false] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "testWithNull", @MethodName = "testWithNull", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "testScopeOfPatternVariableDeclarations", @MethodName = "testScopeOfPatternVariableDeclarations", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "a", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"a\"", @IntLiteral = false, @Length = 1, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- ExpressionStatement[] + +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "testScopeOfPatternVariableDeclarations", @MethodName = "testScopeOfPatternVariableDeclarations", @ParenthesisDepth = 0, @Parenthesized = false] +- ArgumentList[@Empty = false, @Size = 1] - +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "long enough", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"long enough\"", @IntLiteral = false, @Length = 11, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep440_RecordPatterns.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep440_RecordPatterns.java new file mode 100644 index 0000000000..f936ebf1f4 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep440_RecordPatterns.java @@ -0,0 +1,75 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +/** + * @see JEP 440: Record Patterns + */ +class Jep440_RecordPatterns { + + record Point(int x, int y) {} + // As of Java 21 + static void printSum(Object obj) { + if (obj instanceof Point(int x, int y)) { + System.out.println(x+y); + } + } + + enum Color { RED, GREEN, BLUE } + record ColoredPoint(Point p, Color c) {} + record Rectangle(ColoredPoint upperLeft, ColoredPoint lowerRight) {} + // As of Java 21 + static void printColorOfUpperLeftPoint(Rectangle r) { + if (r instanceof Rectangle(ColoredPoint(Point p, Color c), + ColoredPoint lr)) { + System.out.println(c); + } + } + + // As of Java 21 + static 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); + } + } + + // As of Java 21 + record Pair(Object x, Object y) {} + + static void patternsCanFailToMatch() { + 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"); + } + } + + // As of Java 21 + record MyPair(S fst, T snd){}; + + static void recordInference(MyPair pair){ + switch (pair) { + case MyPair(var f, var s) -> + // Inferred record pattern MyPair(var f, var s) + System.out.println("matched"); + } + } + + // As of Java 21 + record Box(T t) {} + + static void test1(Box> bbs) { + if (bbs instanceof Box>(Box(var s))) { + System.out.println("String " + s); + } + } + // As of Java 21 + static void test2(Box> bbs) { + if (bbs 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/java19p/RecordPatterns.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep440_RecordPatterns.txt similarity index 67% rename from pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/RecordPatterns.txt rename to pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep440_RecordPatterns.txt index 1ab585c5de..5ff806e1f5 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/RecordPatterns.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep440_RecordPatterns.txt @@ -1,8 +1,8 @@ +- CompilationUnit[@PackageName = ""] - +- ClassOrInterfaceDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns", @CanonicalName = "RecordPatterns", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Image = "RecordPatterns", @Interface = false, @Local = false, @Native = false, @Nested = false, @PackageName = "", @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "RecordPatterns", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = true, @SyntacticallyStatic = false, @TopLevel = true, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] + +- ClassOrInterfaceDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep440_RecordPatterns", @CanonicalName = "Jep440_RecordPatterns", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Image = "Jep440_RecordPatterns", @Interface = false, @Local = false, @Native = false, @Nested = false, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Jep440_RecordPatterns", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = true, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] +- ModifierList[] - +- ClassOrInterfaceBody[@Empty = false, @Size = 12] - +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns$Point", @CanonicalName = "RecordPatterns.Point", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Image = "Point", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Point", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + +- ClassOrInterfaceBody[@Empty = false, @Size = 15] + +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep440_RecordPatterns$Point", @CanonicalName = "Jep440_RecordPatterns.Point", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Image = "Point", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Point", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] | +- ModifierList[] | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] @@ -14,101 +14,22 @@ | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "y", @LambdaParameter = false, @LocalVariable = false, @Name = "y", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "y", @Visibility = Visibility.V_PRIVATE, @Volatile = false] | +- RecordBody[@Empty = true, @Size = 0] - +- EnumDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns$Color", @CanonicalName = "RecordPatterns.Color", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = true, @Final = true, @Image = "Color", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Color", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | +- ModifierList[] - | +- EnumBody[@Empty = false, @SeparatorSemi = false, @Size = 3, @TrailingComma = false] - | +- EnumConstant[@Abstract = false, @AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = true, @Image = "RED", @MethodName = "new", @Name = "RED", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] - | | +- ModifierList[] - | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "RED", @LambdaParameter = false, @LocalVariable = false, @Name = "RED", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = true, @VariableName = "RED", @Visibility = Visibility.V_PUBLIC, @Volatile = false] - | +- EnumConstant[@Abstract = false, @AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = true, @Image = "GREEN", @MethodName = "new", @Name = "GREEN", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] - | | +- ModifierList[] - | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "GREEN", @LambdaParameter = false, @LocalVariable = false, @Name = "GREEN", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = true, @VariableName = "GREEN", @Visibility = Visibility.V_PUBLIC, @Volatile = false] - | +- EnumConstant[@Abstract = false, @AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = true, @Image = "BLUE", @MethodName = "new", @Name = "BLUE", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] - | +- ModifierList[] - | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "BLUE", @LambdaParameter = false, @LocalVariable = false, @Name = "BLUE", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = true, @VariableName = "BLUE", @Visibility = Visibility.V_PUBLIC, @Volatile = false] - +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns$ColoredPoint", @CanonicalName = "RecordPatterns.ColoredPoint", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Image = "ColoredPoint", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "ColoredPoint", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | +- ModifierList[] - | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] - | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] - | | | +- ModifierList[] - | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Point", @TypeImage = "Point"] - | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "p", @LambdaParameter = false, @LocalVariable = false, @Name = "p", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "p", @Visibility = Visibility.V_PRIVATE, @Volatile = false] - | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] - | | +- ModifierList[] - | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Color", @TypeImage = "Color"] - | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "c", @Visibility = Visibility.V_PRIVATE, @Volatile = false] - | +- RecordBody[@Empty = true, @Size = 0] - +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns$Rectangle", @CanonicalName = "RecordPatterns.Rectangle", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Image = "Rectangle", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Rectangle", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | +- ModifierList[] - | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] - | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] - | | | +- ModifierList[] - | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "ColoredPoint", @TypeImage = "ColoredPoint"] - | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "upperLeft", @LambdaParameter = false, @LocalVariable = false, @Name = "upperLeft", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "upperLeft", @Visibility = Visibility.V_PRIVATE, @Volatile = false] - | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] - | | +- ModifierList[] - | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "ColoredPoint", @TypeImage = "ColoredPoint"] - | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "lowerRight", @LambdaParameter = false, @LocalVariable = false, @Name = "lowerRight", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "lowerRight", @Visibility = Visibility.V_PRIVATE, @Volatile = false] - | +- RecordBody[@Empty = true, @Size = 0] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "printSum1", @MainMethod = false, @MethodName = "printSum1", @Name = "printSum1", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "printSum", @MainMethod = false, @MethodName = "printSum", @Name = "printSum", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] | +- ModifierList[] | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] | | +- ModifierList[] | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] - | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "o", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "obj", @LambdaParameter = false, @LocalVariable = false, @Name = "obj", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "obj", @Visibility = Visibility.V_LOCAL, @Volatile = false] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- IfStatement[@Else = false] | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | | +- ModifierList[] - | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Point", @TypeImage = "Point"] - | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "p", @LambdaParameter = false, @LocalVariable = false, @Name = "p", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "p", @Visibility = Visibility.V_LOCAL, @Volatile = false] - | +- Block[@Empty = false, @Size = 3, @containsComment = false] - | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] - | | +- ModifierList[] - | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] - | | +- VariableDeclarator[@Initializer = true, @Name = "x"] - | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "x", @LambdaParameter = false, @LocalVariable = true, @Name = "x", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "x", @Visibility = Visibility.V_LOCAL, @Volatile = false] - | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "x", @MethodName = "x", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "p", @Name = "p", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ArgumentList[@Empty = true, @Size = 0] - | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] - | | +- ModifierList[] - | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] - | | +- VariableDeclarator[@Initializer = true, @Name = "y"] - | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "y", @LambdaParameter = false, @LocalVariable = true, @Name = "y", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "y", @Visibility = Visibility.V_LOCAL, @Volatile = false] - | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "y", @MethodName = "y", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "p", @Name = "p", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ArgumentList[@Empty = true, @Size = 0] - | +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "y", @Name = "y", @ParenthesisDepth = 0, @Parenthesized = false] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "printSum2", @MainMethod = false, @MethodName = "printSum2", @Name = "printSum2", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] - | +- ModifierList[] - | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] - | | +- ModifierList[] - | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] - | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "o", @Visibility = Visibility.V_LOCAL, @Volatile = false] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- IfStatement[@Else = false] - | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] | | +- RecordPattern[@ParenthesisDepth = 0] | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Point", @TypeImage = "Point"] - | | +- ComponentPatternList[@Empty = false, @Size = 2] + | | +- PatternList[@Empty = false, @Size = 2] | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] | | | +- ModifierList[] | | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] @@ -127,7 +48,43 @@ | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "y", @Name = "y", @ParenthesisDepth = 0, @Parenthesized = false] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "printUpperLeftColoredPoint", @MainMethod = false, @MethodName = "printUpperLeftColoredPoint", @Name = "printUpperLeftColoredPoint", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + +- EnumDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep440_RecordPatterns$Color", @CanonicalName = "Jep440_RecordPatterns.Color", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = true, @Final = true, @Image = "Color", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Color", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- EnumBody[@Empty = false, @SeparatorSemi = false, @Size = 3, @TrailingComma = false] + | +- EnumConstant[@Abstract = false, @AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = true, @Image = "RED", @MethodName = "new", @Name = "RED", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] + | | +- ModifierList[] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "RED", @LambdaParameter = false, @LocalVariable = false, @Name = "RED", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = true, @VariableName = "RED", @Visibility = Visibility.V_PUBLIC, @Volatile = false] + | +- EnumConstant[@Abstract = false, @AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = true, @Image = "GREEN", @MethodName = "new", @Name = "GREEN", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] + | | +- ModifierList[] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "GREEN", @LambdaParameter = false, @LocalVariable = false, @Name = "GREEN", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = true, @VariableName = "GREEN", @Visibility = Visibility.V_PUBLIC, @Volatile = false] + | +- EnumConstant[@Abstract = false, @AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = true, @Image = "BLUE", @MethodName = "new", @Name = "BLUE", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] + | +- ModifierList[] + | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "BLUE", @LambdaParameter = false, @LocalVariable = false, @Name = "BLUE", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = true, @VariableName = "BLUE", @Visibility = Visibility.V_PUBLIC, @Volatile = false] + +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep440_RecordPatterns$ColoredPoint", @CanonicalName = "Jep440_RecordPatterns.ColoredPoint", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Image = "ColoredPoint", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "ColoredPoint", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Point", @TypeImage = "Point"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "p", @LambdaParameter = false, @LocalVariable = false, @Name = "p", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "p", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Color", @TypeImage = "Color"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "c", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | +- RecordBody[@Empty = true, @Size = 0] + +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep440_RecordPatterns$Rectangle", @CanonicalName = "Jep440_RecordPatterns.Rectangle", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Image = "Rectangle", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Rectangle", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "ColoredPoint", @TypeImage = "ColoredPoint"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "upperLeft", @LambdaParameter = false, @LocalVariable = false, @Name = "upperLeft", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "upperLeft", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "ColoredPoint", @TypeImage = "ColoredPoint"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "lowerRight", @LambdaParameter = false, @LocalVariable = false, @Name = "lowerRight", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "lowerRight", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | +- RecordBody[@Empty = true, @Size = 0] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "printColorOfUpperLeftPoint", @MainMethod = false, @MethodName = "printColorOfUpperLeftPoint", @Name = "printColorOfUpperLeftPoint", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] | +- ModifierList[] | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] | +- FormalParameters[@Empty = false, @Size = 1] @@ -142,44 +99,10 @@ | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] | | +- RecordPattern[@ParenthesisDepth = 0] | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Rectangle", @TypeImage = "Rectangle"] - | | +- ComponentPatternList[@Empty = false, @Size = 2] - | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | | | +- ModifierList[] - | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "ColoredPoint", @TypeImage = "ColoredPoint"] - | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "ul", @LambdaParameter = false, @LocalVariable = false, @Name = "ul", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "ul", @Visibility = Visibility.V_LOCAL, @Volatile = false] - | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | | +- ModifierList[] - | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "ColoredPoint", @TypeImage = "ColoredPoint"] - | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "lr", @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "lr", @Visibility = Visibility.V_LOCAL, @Volatile = false] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] - | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] - | +- ArgumentList[@Empty = false, @Size = 1] - | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "c", @MethodName = "c", @ParenthesisDepth = 0, @Parenthesized = false] - | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "ul", @Name = "ul", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "ul"] - | +- ArgumentList[@Empty = true, @Size = 0] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "printColorOfUpperLeftPoint", @MainMethod = false, @MethodName = "printColorOfUpperLeftPoint", @Name = "printColorOfUpperLeftPoint", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] - | +- ModifierList[] - | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] - | +- FormalParameters[@Empty = false, @Size = 1] - | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] - | | +- ModifierList[] - | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Rectangle", @TypeImage = "Rectangle"] - | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "r", @LambdaParameter = false, @LocalVariable = false, @Name = "r", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "r", @Visibility = Visibility.V_LOCAL, @Volatile = false] - | +- Block[@Empty = false, @Size = 1, @containsComment = false] - | +- IfStatement[@Else = false] - | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Rectangle", @TypeImage = "Rectangle"] - | | +- ComponentPatternList[@Empty = false, @Size = 2] + | | +- PatternList[@Empty = false, @Size = 2] | | +- RecordPattern[@ParenthesisDepth = 0] | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "ColoredPoint", @TypeImage = "ColoredPoint"] - | | | +- ComponentPatternList[@Empty = false, @Size = 2] + | | | +- PatternList[@Empty = false, @Size = 2] | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] | | | | +- ModifierList[] | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Point", @TypeImage = "Point"] @@ -200,7 +123,7 @@ | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "printXCoordOfUpperLeftPointWithPatterns", @MainMethod = false, @MethodName = "printXCoordOfUpperLeftPointWithPatterns", @Name = "printXCoordOfUpperLeftPointWithPatterns", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "printXCoordOfUpperLeftPointWithPatterns", @MainMethod = false, @MethodName = "printXCoordOfUpperLeftPointWithPatterns", @Name = "printXCoordOfUpperLeftPointWithPatterns", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] | +- ModifierList[] | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] | +- FormalParameters[@Empty = false, @Size = 1] @@ -215,13 +138,13 @@ | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] | | +- RecordPattern[@ParenthesisDepth = 0] | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Rectangle", @TypeImage = "Rectangle"] - | | +- ComponentPatternList[@Empty = false, @Size = 2] + | | +- PatternList[@Empty = false, @Size = 2] | | +- RecordPattern[@ParenthesisDepth = 0] | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "ColoredPoint", @TypeImage = "ColoredPoint"] - | | | +- ComponentPatternList[@Empty = false, @Size = 2] + | | | +- PatternList[@Empty = false, @Size = 2] | | | +- RecordPattern[@ParenthesisDepth = 0] | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Point", @TypeImage = "Point"] - | | | | +- ComponentPatternList[@Empty = false, @Size = 2] + | | | | +- PatternList[@Empty = false, @Size = 2] | | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] | | | | | +- ModifierList[] | | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "var", @TypeImage = "var"] @@ -248,7 +171,118 @@ | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Upper-left corner: ", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Upper-left corner: \"", @IntLiteral = false, @Length = 19, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] - +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns$Box", @CanonicalName = "RecordPatterns.Box", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Image = "Box", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Box", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep440_RecordPatterns$Pair", @CanonicalName = "Jep440_RecordPatterns.Pair", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Image = "Pair", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Pair", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "x", @LambdaParameter = false, @LocalVariable = false, @Name = "x", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "x", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "y", @LambdaParameter = false, @LocalVariable = false, @Name = "y", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "y", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | +- RecordBody[@Empty = true, @Size = 0] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "patternsCanFailToMatch", @MainMethod = false, @MethodName = "patternsCanFailToMatch", @Name = "patternsCanFailToMatch", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = true, @Size = 0] + | +- Block[@Empty = false, @Size = 2, @containsComment = false] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Pair", @TypeImage = "Pair"] + | | +- VariableDeclarator[@Initializer = true, @Name = "p"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "p", @LambdaParameter = false, @LocalVariable = true, @Name = "p", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "p", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @Expression = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Pair", @TypeImage = "Pair"] + | | +- ArgumentList[@Empty = false, @Size = 2] + | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "42", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42] + | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "42", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42] + | +- IfStatement[@Else = true] + | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "p", @Name = "p", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Pair", @TypeImage = "Pair"] + | | +- PatternList[@Empty = false, @Size = 2] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "t", @LambdaParameter = false, @LocalVariable = false, @Name = "t", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "t", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | +- ExpressionStatement[] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = ", ", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\", \"", @IntLiteral = false, @Length = 2, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "t", @Name = "t", @ParenthesisDepth = 0, @Parenthesized = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Not a pair of strings", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Not a pair of strings\"", @IntLiteral = false, @Length = 21, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep440_RecordPatterns$MyPair", @CanonicalName = "Jep440_RecordPatterns.MyPair", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Image = "MyPair", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "MyPair", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- TypeParameters[@Empty = false, @Size = 2] + | | +- TypeParameter[@Image = "S", @Name = "S", @TypeBound = false] + | | +- TypeParameter[@Image = "T", @Name = "T", @TypeBound = false] + | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "S", @TypeImage = "S"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "fst", @LambdaParameter = false, @LocalVariable = false, @Name = "fst", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "fst", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "T", @TypeImage = "T"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "snd", @LambdaParameter = false, @LocalVariable = false, @Name = "snd", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "snd", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | +- RecordBody[@Empty = true, @Size = 0] + +- EmptyDeclaration[] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "recordInference", @MainMethod = false, @MethodName = "recordInference", @Name = "recordInference", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "MyPair", @TypeImage = "MyPair"] + | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 2] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Integer", @TypeImage = "Integer"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "pair", @LambdaParameter = false, @LocalVariable = false, @Name = "pair", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "pair", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "pair", @Name = "pair", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchArrowBranch[@Default = false] + | +- SwitchLabel[@Default = false] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "MyPair", @TypeImage = "MyPair"] + | | +- PatternList[@Empty = false, @Size = 2] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "var", @TypeImage = "var"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "f", @LambdaParameter = false, @LocalVariable = false, @Name = "f", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "f", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "var", @TypeImage = "var"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "matched", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"matched\"", @IntLiteral = false, @Length = 7, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep440_RecordPatterns$Box", @CanonicalName = "Jep440_RecordPatterns.Box", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Image = "Box", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Box", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] | +- ModifierList[] | +- TypeParameters[@Empty = false, @Size = 1] | | +- TypeParameter[@Image = "T", @Name = "T", @TypeBound = false] @@ -258,30 +292,37 @@ | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "T", @TypeImage = "T"] | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "t", @LambdaParameter = false, @LocalVariable = false, @Name = "t", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "t", @Visibility = Visibility.V_PRIVATE, @Volatile = false] | +- RecordBody[@Empty = true, @Size = 0] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "test1", @MainMethod = false, @MethodName = "test1", @Name = "test1", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "test1", @MainMethod = false, @MethodName = "test1", @Name = "test1", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] | +- ModifierList[] | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] | | +- ModifierList[] - | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box>"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] - | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "bo", @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "bo", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] + | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "bbs", @LambdaParameter = false, @LocalVariable = false, @Name = "bbs", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "bbs", @Visibility = Visibility.V_LOCAL, @Volatile = false] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- IfStatement[@Else = false] | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "bo", @Name = "bo", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "bbs", @Name = "bbs", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] | | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box>"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] - | | +- ComponentPatternList[@Empty = false, @Size = 1] - | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | | +- ModifierList[] - | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] - | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] + | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- PatternList[@Empty = false, @Size = 1] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] + | | +- PatternList[@Empty = false, @Size = 1] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "var", @TypeImage = "var"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -292,30 +333,33 @@ | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "String ", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"String \"", @IntLiteral = false, @Length = 7, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "test2", @MainMethod = false, @MethodName = "test2", @Name = "test2", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "test2", @MainMethod = false, @MethodName = "test2", @Name = "test2", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] +- ModifierList[] +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] +- FormalParameters[@Empty = false, @Size = 1] | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] | +- ModifierList[] - | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box>"] | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] - | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "bo", @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "bo", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] + | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "bbs", @LambdaParameter = false, @LocalVariable = false, @Name = "bbs", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "bbs", @Visibility = Visibility.V_LOCAL, @Volatile = false] +- Block[@Empty = false, @Size = 1, @containsComment = false] +- IfStatement[@Else = false] +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] - | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "bo", @Name = "bo", @ParenthesisDepth = 0, @Parenthesized = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "bbs", @Name = "bbs", @ParenthesisDepth = 0, @Parenthesized = false] | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] | +- RecordPattern[@ParenthesisDepth = 0] - | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] - | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] - | +- ComponentPatternList[@Empty = false, @Size = 1] - | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | +- ModifierList[] - | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "var", @TypeImage = "var"] - | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] + | +- PatternList[@Empty = false, @Size = 1] + | +- RecordPattern[@ParenthesisDepth = 0] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] + | +- PatternList[@Empty = false, @Size = 1] + | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "var", @TypeImage = "var"] + | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] +- Block[@Empty = false, @Size = 1, @containsComment = false] +- ExpressionStatement[] +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep441_PatternMatchingForSwitch.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep441_PatternMatchingForSwitch.java new file mode 100644 index 0000000000..fe50edda5c --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep441_PatternMatchingForSwitch.java @@ -0,0 +1,146 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +/** + * @see JEP 441: Pattern Matching for switch + */ +class Jep441_PatternMatchingForSwitch { + + // As of Java 21 + static String formatterPatternSwitch(Object obj) { + return switch (obj) { + 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 -> obj.toString(); + }; + } + + // As of Java 21 + // switch with case null + static void testFooBarNew(String s) { + switch (s) { + case null -> System.out.println("Oops"); + case "Foo", "Bar" -> System.out.println("Great"); + default -> System.out.println("Ok"); + } + } + + // As of Java 21 + // switch with guarded case labels + static void testStringNew(String response) { + switch (response) { + case null -> { } + case String s + when s.equalsIgnoreCase("YES") -> { + System.out.println("You got it"); + } + case String s + when s.equalsIgnoreCase("NO") -> { + System.out.println("Shame"); + } + case String s -> { + System.out.println("Sorry?"); + } + } + } + + // As of Java 21 + static void testStringEnhanced(String response) { + switch (response) { + case null -> { } + case "y", "Y" -> { + System.out.println("You got it"); + } + case "n", "N" -> { + System.out.println("Shame"); + } + case String s + when s.equalsIgnoreCase("YES") -> { + System.out.println("You got it"); + } + case String s + when s.equalsIgnoreCase("NO") -> { + System.out.println("Shame"); + } + case String s -> { + System.out.println("Sorry?"); + } + } + } + + // As of Java 21 + sealed interface CardClassification permits Suit, Tarot {} + public enum Suit implements CardClassification { CLUBS, DIAMONDS, HEARTS, SPADES } + final class Tarot implements CardClassification {} + + static void exhaustiveSwitchWithoutEnumSupport(CardClassification c) { + switch (c) { + case Suit s when s == Suit.CLUBS -> { + System.out.println("It's clubs"); + } + case Suit s when s == Suit.DIAMONDS -> { + System.out.println("It's diamonds"); + } + case Suit s when s == Suit.HEARTS -> { + System.out.println("It's hearts"); + } + case Suit s -> { + System.out.println("It's spades"); + } + case Tarot t -> { + System.out.println("It's a tarot"); + } + } + } + + // As of Java 21 + static void exhaustiveSwitchWithBetterEnumSupport(CardClassification c) { + switch (c) { + case Suit.CLUBS -> { + System.out.println("It's clubs"); + } + case Suit.DIAMONDS -> { + System.out.println("It's diamonds"); + } + case Suit.HEARTS -> { + System.out.println("It's hearts"); + } + case Suit.SPADES -> { + System.out.println("It's spades"); + } + case Tarot t -> { + System.out.println("It's a tarot"); + } + } + } + + // As of Java 21 + // Improved enum constant case labels + sealed interface Currency permits Coin {} + enum Coin implements Currency { HEADS, TAILS } + + static void goodEnumSwitch1(Currency c) { + switch (c) { + case Coin.HEADS -> { // Qualified name of enum constant as a label + System.out.println("Heads"); + } + case Coin.TAILS -> { + System.out.println("Tails"); + } + } + } + + static void goodEnumSwitch2(Coin c) { + switch (c) { + case HEADS -> { + System.out.println("Heads"); + } + case Coin.TAILS -> { // Unnecessary qualification but allowed + System.out.println("Tails"); + } + } + } +} 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 new file mode 100644 index 0000000000..8a825c5f46 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep441_PatternMatchingForSwitch.txt @@ -0,0 +1,557 @@ ++- CompilationUnit[@PackageName = ""] + +- ClassOrInterfaceDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep441_PatternMatchingForSwitch", @CanonicalName = "Jep441_PatternMatchingForSwitch", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Image = "Jep441_PatternMatchingForSwitch", @Interface = false, @Local = false, @Native = false, @Nested = false, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Jep441_PatternMatchingForSwitch", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = true, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + +- ModifierList[] + +- ClassOrInterfaceBody[@Empty = false, @Size = 13] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "formatterPatternSwitch", @MainMethod = false, @MethodName = "formatterPatternSwitch", @Name = "formatterPatternSwitch", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false, @Volatile = false] + | +- ModifierList[] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "obj", @LambdaParameter = false, @LocalVariable = false, @Name = "obj", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "obj", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ReturnStatement[] + | +- SwitchExpression[@CompileTimeConstant = false, @DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @Expression = true, @FallthroughSwitch = false, @ParenthesisDepth = 0, @Parenthesized = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Integer", @TypeImage = "Integer"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "i", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- ArgumentList[@Empty = false, @Size = 2] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "int %d", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"int %d\"", @IntLiteral = false, @Length = 6, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Long", @TypeImage = "Long"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "l", @LambdaParameter = false, @LocalVariable = false, @Name = "l", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "l", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- ArgumentList[@Empty = false, @Size = 2] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "long %d", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"long %d\"", @IntLiteral = false, @Length = 7, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "l", @Name = "l", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Double", @TypeImage = "Double"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "d", @LambdaParameter = false, @LocalVariable = false, @Name = "d", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "d", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- ArgumentList[@Empty = false, @Size = 2] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "double %f", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"double %f\"", @IntLiteral = false, @Length = 9, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "d", @Name = "d", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- ArgumentList[@Empty = false, @Size = 2] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "String %s", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"String %s\"", @IntLiteral = false, @Length = 9, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchArrowBranch[@Default = true] + | +- SwitchLabel[@Default = true] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "toString", @MethodName = "toString", @ParenthesisDepth = 0, @Parenthesized = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = true, @Size = 0] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "testFooBarNew", @MainMethod = false, @MethodName = "testFooBarNew", @Name = "testFooBarNew", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Oops", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Oops\"", @IntLiteral = false, @Length = 4, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Foo", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Foo\"", @IntLiteral = false, @Length = 3, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Bar", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Bar\"", @IntLiteral = false, @Length = 3, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Great", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Great\"", @IntLiteral = false, @Length = 5, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = true] + | +- SwitchLabel[@Default = true] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Ok", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Ok\"", @IntLiteral = false, @Length = 2, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "testStringNew", @MainMethod = false, @MethodName = "testStringNew", @Name = "testStringNew", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "response", @LambdaParameter = false, @LocalVariable = false, @Name = "response", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "response", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "response", @Name = "response", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + | | +- Block[@Empty = true, @Size = 0, @containsComment = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- Guard[] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "equalsIgnoreCase", @MethodName = "equalsIgnoreCase", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "s"] + | | | +- ArgumentList[@Empty = false, @Size = 1] + | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "YES", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"YES\"", @IntLiteral = false, @Length = 3, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | +- ExpressionStatement[] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "You got it", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"You got it\"", @IntLiteral = false, @Length = 10, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- Guard[] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "equalsIgnoreCase", @MethodName = "equalsIgnoreCase", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "s"] + | | | +- ArgumentList[@Empty = false, @Size = 1] + | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "NO", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"NO\"", @IntLiteral = false, @Length = 2, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | +- ExpressionStatement[] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Shame", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Shame\"", @IntLiteral = false, @Length = 5, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = false] + | +- SwitchLabel[@Default = false] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Sorry?", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Sorry?\"", @IntLiteral = false, @Length = 6, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "testStringEnhanced", @MainMethod = false, @MethodName = "testStringEnhanced", @Name = "testStringEnhanced", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "response", @LambdaParameter = false, @LocalVariable = false, @Name = "response", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "response", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "response", @Name = "response", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + | | +- Block[@Empty = true, @Size = 0, @containsComment = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "y", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"y\"", @IntLiteral = false, @Length = 1, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Y", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Y\"", @IntLiteral = false, @Length = 1, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | +- ExpressionStatement[] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "You got it", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"You got it\"", @IntLiteral = false, @Length = 10, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "n", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"n\"", @IntLiteral = false, @Length = 1, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "N", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"N\"", @IntLiteral = false, @Length = 1, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | +- ExpressionStatement[] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Shame", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Shame\"", @IntLiteral = false, @Length = 5, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- Guard[] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "equalsIgnoreCase", @MethodName = "equalsIgnoreCase", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "s"] + | | | +- ArgumentList[@Empty = false, @Size = 1] + | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "YES", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"YES\"", @IntLiteral = false, @Length = 3, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | +- ExpressionStatement[] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "You got it", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"You got it\"", @IntLiteral = false, @Length = 10, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- Guard[] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "equalsIgnoreCase", @MethodName = "equalsIgnoreCase", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "s"] + | | | +- ArgumentList[@Empty = false, @Size = 1] + | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "NO", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"NO\"", @IntLiteral = false, @Length = 2, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | +- ExpressionStatement[] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Shame", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Shame\"", @IntLiteral = false, @Length = 5, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = false] + | +- SwitchLabel[@Default = false] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Sorry?", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Sorry?\"", @IntLiteral = false, @Length = 6, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- ClassOrInterfaceDeclaration[@Abstract = true, @Annotation = false, @Anonymous = false, @BinaryName = "Jep441_PatternMatchingForSwitch$CardClassification", @CanonicalName = "Jep441_PatternMatchingForSwitch.CardClassification", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Image = "CardClassification", @Interface = true, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = false, @RegularClass = false, @RegularInterface = true, @SimpleName = "CardClassification", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- PermitsList[@Empty = false, @Size = 2] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Suit", @TypeImage = "Suit"] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Tarot", @TypeImage = "Tarot"] + | +- ClassOrInterfaceBody[@Empty = true, @Size = 0] + +- EnumDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep441_PatternMatchingForSwitch$Suit", @CanonicalName = "Jep441_PatternMatchingForSwitch.Suit", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = true, @Final = true, @Image = "Suit", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Suit", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = true, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] + | +- ModifierList[] + | +- ImplementsList[@Empty = false, @Size = 1] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "CardClassification", @TypeImage = "CardClassification"] + | +- EnumBody[@Empty = false, @SeparatorSemi = false, @Size = 4, @TrailingComma = false] + | +- EnumConstant[@Abstract = false, @AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = true, @Image = "CLUBS", @MethodName = "new", @Name = "CLUBS", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] + | | +- ModifierList[] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "CLUBS", @LambdaParameter = false, @LocalVariable = false, @Name = "CLUBS", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = true, @VariableName = "CLUBS", @Visibility = Visibility.V_PUBLIC, @Volatile = false] + | +- EnumConstant[@Abstract = false, @AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = true, @Image = "DIAMONDS", @MethodName = "new", @Name = "DIAMONDS", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] + | | +- ModifierList[] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "DIAMONDS", @LambdaParameter = false, @LocalVariable = false, @Name = "DIAMONDS", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = true, @VariableName = "DIAMONDS", @Visibility = Visibility.V_PUBLIC, @Volatile = false] + | +- EnumConstant[@Abstract = false, @AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = true, @Image = "HEARTS", @MethodName = "new", @Name = "HEARTS", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] + | | +- ModifierList[] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "HEARTS", @LambdaParameter = false, @LocalVariable = false, @Name = "HEARTS", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = true, @VariableName = "HEARTS", @Visibility = Visibility.V_PUBLIC, @Volatile = false] + | +- EnumConstant[@Abstract = false, @AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = true, @Image = "SPADES", @MethodName = "new", @Name = "SPADES", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] + | +- ModifierList[] + | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "SPADES", @LambdaParameter = false, @LocalVariable = false, @Name = "SPADES", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = true, @VariableName = "SPADES", @Visibility = Visibility.V_PUBLIC, @Volatile = false] + +- ClassOrInterfaceDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep441_PatternMatchingForSwitch$Tarot", @CanonicalName = "Jep441_PatternMatchingForSwitch.Tarot", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Image = "Tarot", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Tarot", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = true, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- ImplementsList[@Empty = false, @Size = 1] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "CardClassification", @TypeImage = "CardClassification"] + | +- ClassOrInterfaceBody[@Empty = true, @Size = 0] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "exhaustiveSwitchWithoutEnumSupport", @MainMethod = false, @MethodName = "exhaustiveSwitchWithoutEnumSupport", @Name = "exhaustiveSwitchWithoutEnumSupport", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "CardClassification", @TypeImage = "CardClassification"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "c", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Suit", @TypeImage = "Suit"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- Guard[] + | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "CLUBS", @Name = "CLUBS", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Suit", @TypeImage = "Suit"] + | | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | +- ExpressionStatement[] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "It\'s clubs", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"It\'s clubs\"", @IntLiteral = false, @Length = 10, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Suit", @TypeImage = "Suit"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- Guard[] + | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "DIAMONDS", @Name = "DIAMONDS", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Suit", @TypeImage = "Suit"] + | | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | +- ExpressionStatement[] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "It\'s diamonds", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"It\'s diamonds\"", @IntLiteral = false, @Length = 13, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Suit", @TypeImage = "Suit"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- Guard[] + | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "HEARTS", @Name = "HEARTS", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Suit", @TypeImage = "Suit"] + | | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | +- ExpressionStatement[] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "It\'s hearts", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"It\'s hearts\"", @IntLiteral = false, @Length = 11, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Suit", @TypeImage = "Suit"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | +- ExpressionStatement[] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "It\'s spades", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"It\'s spades\"", @IntLiteral = false, @Length = 11, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = false] + | +- SwitchLabel[@Default = false] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Tarot", @TypeImage = "Tarot"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "t", @LambdaParameter = false, @LocalVariable = false, @Name = "t", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "t", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "It\'s a tarot", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"It\'s a tarot\"", @IntLiteral = false, @Length = 12, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "exhaustiveSwitchWithBetterEnumSupport", @MainMethod = false, @MethodName = "exhaustiveSwitchWithBetterEnumSupport", @Name = "exhaustiveSwitchWithBetterEnumSupport", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "CardClassification", @TypeImage = "CardClassification"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "c", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "CLUBS", @Name = "CLUBS", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Suit", @TypeImage = "Suit"] + | | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | +- ExpressionStatement[] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "It\'s clubs", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"It\'s clubs\"", @IntLiteral = false, @Length = 10, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "DIAMONDS", @Name = "DIAMONDS", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Suit", @TypeImage = "Suit"] + | | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | +- ExpressionStatement[] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "It\'s diamonds", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"It\'s diamonds\"", @IntLiteral = false, @Length = 13, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "HEARTS", @Name = "HEARTS", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Suit", @TypeImage = "Suit"] + | | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | +- ExpressionStatement[] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "It\'s hearts", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"It\'s hearts\"", @IntLiteral = false, @Length = 11, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "SPADES", @Name = "SPADES", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Suit", @TypeImage = "Suit"] + | | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | +- ExpressionStatement[] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "It\'s spades", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"It\'s spades\"", @IntLiteral = false, @Length = 11, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = false] + | +- SwitchLabel[@Default = false] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Tarot", @TypeImage = "Tarot"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "t", @LambdaParameter = false, @LocalVariable = false, @Name = "t", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "t", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "It\'s a tarot", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"It\'s a tarot\"", @IntLiteral = false, @Length = 12, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- ClassOrInterfaceDeclaration[@Abstract = true, @Annotation = false, @Anonymous = false, @BinaryName = "Jep441_PatternMatchingForSwitch$Currency", @CanonicalName = "Jep441_PatternMatchingForSwitch.Currency", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Image = "Currency", @Interface = true, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = false, @RegularClass = false, @RegularInterface = true, @SimpleName = "Currency", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- PermitsList[@Empty = false, @Size = 1] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Coin", @TypeImage = "Coin"] + | +- ClassOrInterfaceBody[@Empty = true, @Size = 0] + +- EnumDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep441_PatternMatchingForSwitch$Coin", @CanonicalName = "Jep441_PatternMatchingForSwitch.Coin", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = true, @Final = true, @Image = "Coin", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Coin", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- ImplementsList[@Empty = false, @Size = 1] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Currency", @TypeImage = "Currency"] + | +- EnumBody[@Empty = false, @SeparatorSemi = false, @Size = 2, @TrailingComma = false] + | +- EnumConstant[@Abstract = false, @AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = true, @Image = "HEADS", @MethodName = "new", @Name = "HEADS", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] + | | +- ModifierList[] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "HEADS", @LambdaParameter = false, @LocalVariable = false, @Name = "HEADS", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = true, @VariableName = "HEADS", @Visibility = Visibility.V_PUBLIC, @Volatile = false] + | +- EnumConstant[@Abstract = false, @AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = true, @Image = "TAILS", @MethodName = "new", @Name = "TAILS", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] + | +- ModifierList[] + | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "TAILS", @LambdaParameter = false, @LocalVariable = false, @Name = "TAILS", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = true, @VariableName = "TAILS", @Visibility = Visibility.V_PUBLIC, @Volatile = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "goodEnumSwitch1", @MainMethod = false, @MethodName = "goodEnumSwitch1", @Name = "goodEnumSwitch1", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Currency", @TypeImage = "Currency"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "c", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "HEADS", @Name = "HEADS", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Coin", @TypeImage = "Coin"] + | | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | +- ExpressionStatement[] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Heads", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Heads\"", @IntLiteral = false, @Length = 5, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = false] + | +- SwitchLabel[@Default = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "TAILS", @Name = "TAILS", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Coin", @TypeImage = "Coin"] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Tails", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Tails\"", @IntLiteral = false, @Length = 5, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "goodEnumSwitch2", @MainMethod = false, @MethodName = "goodEnumSwitch2", @Name = "goodEnumSwitch2", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + +- ModifierList[] + +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + +- FormalParameters[@Empty = false, @Size = 1] + | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- ModifierList[] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Coin", @TypeImage = "Coin"] + | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "c", @Visibility = Visibility.V_LOCAL, @Volatile = false] + +- Block[@Empty = false, @Size = 1, @containsComment = false] + +- SwitchStatement[@DefaultCase = false, @EnumSwitch = true, @ExhaustiveEnumSwitch = true, @FallthroughSwitch = false] + +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false] + +- SwitchArrowBranch[@Default = false] + | +- SwitchLabel[@Default = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "HEADS", @Name = "HEADS", @ParenthesisDepth = 0, @Parenthesized = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Heads", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Heads\"", @IntLiteral = false, @Length = 5, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- SwitchArrowBranch[@Default = false] + +- SwitchLabel[@Default = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "TAILS", @Name = "TAILS", @ParenthesisDepth = 0, @Parenthesized = false] + | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Coin", @TypeImage = "Coin"] + +- Block[@Empty = false, @Size = 1, @containsComment = false] + +- ExpressionStatement[] + +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + +- ArgumentList[@Empty = false, @Size = 1] + +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Tails", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Tails\"", @IntLiteral = false, @Length = 5, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/PatternsInSwitchLabels.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/PatternsInSwitchLabels.java similarity index 84% rename from pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/PatternsInSwitchLabels.java rename to pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/PatternsInSwitchLabels.java index a3ed038cb2..99c6b2a7ac 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/PatternsInSwitchLabels.java +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/PatternsInSwitchLabels.java @@ -3,7 +3,7 @@ */ /** - * @see JEP 427: Pattern Matching for switch (Third Preview) + * @see JEP 441: Pattern Matching for switch */ public class PatternsInSwitchLabels { diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/PatternsInSwitchLabels.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/PatternsInSwitchLabels.txt similarity index 100% rename from pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/PatternsInSwitchLabels.txt rename to pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/PatternsInSwitchLabels.txt diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/RecordPatterns.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatterns.java similarity index 58% rename from pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/RecordPatterns.java rename to pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatterns.java index 4a28b35b50..bf944eace8 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/RecordPatterns.java +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatterns.java @@ -3,7 +3,7 @@ */ /** - * @see JEP 405: Record Patterns (Preview) + * @see JEP 440: Record Patterns */ public class RecordPatterns { @@ -41,6 +41,12 @@ public class RecordPatterns { } } + Rectangle createRectangle(int x1, int y1, Color c1, int x2, int y2, Color c2) { + Rectangle r = new Rectangle(new ColoredPoint(new Point(x1, y1), c1), + new ColoredPoint(new Point(x2, y2), c2)); + return r; + } + // fully nested record pattern, also using "var" void printXCoordOfUpperLeftPointWithPatterns(Rectangle r) { if (r instanceof Rectangle(ColoredPoint(Point(var x, var y), var c), @@ -49,16 +55,46 @@ public class RecordPatterns { } } + record Pair(Object x, Object y) {} + void nestedPatternsCanFailToMatch() { + Pair p = new Pair(42, 42); + if (p instanceof Pair(String s, String t)) { + System.out.println(s + ", " + t); + } else { + System.out.println("Not a pair of strings"); + } + } + // record patterns with generic types record Box(T t) {} - void test1(Box bo) { + void test1a(Box bo) { if (bo instanceof Box(String s)) { System.out.println("String " + s); } } - void test2(Box bo) { + void test1(Box bo) { if (bo instanceof Box(var s)) { System.out.println("String " + s); } } -} \ No newline at end of file + + // type argument is inferred + void test2(Box bo) { + if (bo instanceof Box(var s)) { // Inferred to be Box(var s) + System.out.println("String " + s); + } + } + + // nested record patterns + void test3(Box> bo) { + if (bo instanceof Box>(Box(var s))) { + System.out.println("String " + s); + } + } + + void test4(Box> bo) { + if (bo instanceof Box(Box(var s))) { + System.out.println("String " + s); + } + } +} diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatterns.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatterns.txt new file mode 100644 index 0000000000..f94cd9ac87 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatterns.txt @@ -0,0 +1,557 @@ ++- CompilationUnit[@PackageName = ""] + +- ClassOrInterfaceDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns", @CanonicalName = "RecordPatterns", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Image = "RecordPatterns", @Interface = false, @Local = false, @Native = false, @Nested = false, @PackageName = "", @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "RecordPatterns", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = true, @SyntacticallyStatic = false, @TopLevel = true, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] + +- ModifierList[] + +- ClassOrInterfaceBody[@Empty = false, @Size = 18] + +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns$Point", @CanonicalName = "RecordPatterns.Point", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Image = "Point", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Point", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | | +- ModifierList[] + | | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "x", @LambdaParameter = false, @LocalVariable = false, @Name = "x", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "x", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- ModifierList[] + | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "y", @LambdaParameter = false, @LocalVariable = false, @Name = "y", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "y", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | +- RecordBody[@Empty = true, @Size = 0] + +- EnumDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns$Color", @CanonicalName = "RecordPatterns.Color", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = true, @Final = true, @Image = "Color", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Color", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- EnumBody[@Empty = false, @SeparatorSemi = false, @Size = 3, @TrailingComma = false] + | +- EnumConstant[@Abstract = false, @AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = true, @Image = "RED", @MethodName = "new", @Name = "RED", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] + | | +- ModifierList[] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "RED", @LambdaParameter = false, @LocalVariable = false, @Name = "RED", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = true, @VariableName = "RED", @Visibility = Visibility.V_PUBLIC, @Volatile = false] + | +- EnumConstant[@Abstract = false, @AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = true, @Image = "GREEN", @MethodName = "new", @Name = "GREEN", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] + | | +- ModifierList[] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "GREEN", @LambdaParameter = false, @LocalVariable = false, @Name = "GREEN", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = true, @VariableName = "GREEN", @Visibility = Visibility.V_PUBLIC, @Volatile = false] + | +- EnumConstant[@Abstract = false, @AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = true, @Image = "BLUE", @MethodName = "new", @Name = "BLUE", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] + | +- ModifierList[] + | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "BLUE", @LambdaParameter = false, @LocalVariable = false, @Name = "BLUE", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = true, @VariableName = "BLUE", @Visibility = Visibility.V_PUBLIC, @Volatile = false] + +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns$ColoredPoint", @CanonicalName = "RecordPatterns.ColoredPoint", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Image = "ColoredPoint", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "ColoredPoint", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Point", @TypeImage = "Point"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "p", @LambdaParameter = false, @LocalVariable = false, @Name = "p", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "p", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Color", @TypeImage = "Color"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "c", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | +- RecordBody[@Empty = true, @Size = 0] + +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns$Rectangle", @CanonicalName = "RecordPatterns.Rectangle", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Image = "Rectangle", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Rectangle", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "ColoredPoint", @TypeImage = "ColoredPoint"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "upperLeft", @LambdaParameter = false, @LocalVariable = false, @Name = "upperLeft", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "upperLeft", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "ColoredPoint", @TypeImage = "ColoredPoint"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "lowerRight", @LambdaParameter = false, @LocalVariable = false, @Name = "lowerRight", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "lowerRight", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | +- RecordBody[@Empty = true, @Size = 0] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "printSum1", @MainMethod = false, @MethodName = "printSum1", @Name = "printSum1", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "o", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- IfStatement[@Else = false] + | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Point", @TypeImage = "Point"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "p", @LambdaParameter = false, @LocalVariable = false, @Name = "p", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "p", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 3, @containsComment = false] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | +- VariableDeclarator[@Initializer = true, @Name = "x"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "x", @LambdaParameter = false, @LocalVariable = true, @Name = "x", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "x", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "x", @MethodName = "x", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "p", @Name = "p", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | +- VariableDeclarator[@Initializer = true, @Name = "y"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "y", @LambdaParameter = false, @LocalVariable = true, @Name = "y", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "y", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "y", @MethodName = "y", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "p", @Name = "p", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "y", @Name = "y", @ParenthesisDepth = 0, @Parenthesized = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "printSum2", @MainMethod = false, @MethodName = "printSum2", @Name = "printSum2", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "o", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- IfStatement[@Else = false] + | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Point", @TypeImage = "Point"] + | | +- PatternList[@Empty = false, @Size = 2] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "x", @LambdaParameter = false, @LocalVariable = false, @Name = "x", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "x", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | +- ModifierList[] + | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "y", @LambdaParameter = false, @LocalVariable = false, @Name = "y", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "y", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "y", @Name = "y", @ParenthesisDepth = 0, @Parenthesized = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "printUpperLeftColoredPoint", @MainMethod = false, @MethodName = "printUpperLeftColoredPoint", @Name = "printUpperLeftColoredPoint", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Rectangle", @TypeImage = "Rectangle"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "r", @LambdaParameter = false, @LocalVariable = false, @Name = "r", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "r", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- IfStatement[@Else = false] + | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Rectangle", @TypeImage = "Rectangle"] + | | +- PatternList[@Empty = false, @Size = 2] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "ColoredPoint", @TypeImage = "ColoredPoint"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "ul", @LambdaParameter = false, @LocalVariable = false, @Name = "ul", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "ul", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "ColoredPoint", @TypeImage = "ColoredPoint"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "lr", @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "lr", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "c", @MethodName = "c", @ParenthesisDepth = 0, @Parenthesized = false] + | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "ul", @Name = "ul", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "ul"] + | +- ArgumentList[@Empty = true, @Size = 0] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "printColorOfUpperLeftPoint", @MainMethod = false, @MethodName = "printColorOfUpperLeftPoint", @Name = "printColorOfUpperLeftPoint", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Rectangle", @TypeImage = "Rectangle"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "r", @LambdaParameter = false, @LocalVariable = false, @Name = "r", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "r", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- IfStatement[@Else = false] + | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Rectangle", @TypeImage = "Rectangle"] + | | +- PatternList[@Empty = false, @Size = 2] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "ColoredPoint", @TypeImage = "ColoredPoint"] + | | | +- PatternList[@Empty = false, @Size = 2] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Point", @TypeImage = "Point"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "p", @LambdaParameter = false, @LocalVariable = false, @Name = "p", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "p", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Color", @TypeImage = "Color"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "c", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "ColoredPoint", @TypeImage = "ColoredPoint"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "lr", @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "lr", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false] + +- MethodDeclaration[@Abstract = false, @Arity = 6, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "createRectangle", @MainMethod = false, @MethodName = "createRectangle", @Name = "createRectangle", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false, @Volatile = false] + | +- ModifierList[] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Rectangle", @TypeImage = "Rectangle"] + | +- FormalParameters[@Empty = false, @Size = 6] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- ModifierList[] + | | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "x1", @LambdaParameter = false, @LocalVariable = false, @Name = "x1", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "x1", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- ModifierList[] + | | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "y1", @LambdaParameter = false, @LocalVariable = false, @Name = "y1", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "y1", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Color", @TypeImage = "Color"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "c1", @LambdaParameter = false, @LocalVariable = false, @Name = "c1", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "c1", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- ModifierList[] + | | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "x2", @LambdaParameter = false, @LocalVariable = false, @Name = "x2", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "x2", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- ModifierList[] + | | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "y2", @LambdaParameter = false, @LocalVariable = false, @Name = "y2", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "y2", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Color", @TypeImage = "Color"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "c2", @LambdaParameter = false, @LocalVariable = false, @Name = "c2", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "c2", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 2, @containsComment = false] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Rectangle", @TypeImage = "Rectangle"] + | | +- VariableDeclarator[@Initializer = true, @Name = "r"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "r", @LambdaParameter = false, @LocalVariable = true, @Name = "r", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "r", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @Expression = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Rectangle", @TypeImage = "Rectangle"] + | | +- ArgumentList[@Empty = false, @Size = 2] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @Expression = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "ColoredPoint", @TypeImage = "ColoredPoint"] + | | | +- ArgumentList[@Empty = false, @Size = 2] + | | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @Expression = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Point", @TypeImage = "Point"] + | | | | +- ArgumentList[@Empty = false, @Size = 2] + | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "x1", @Name = "x1", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "y1", @Name = "y1", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "c1", @Name = "c1", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @Expression = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "ColoredPoint", @TypeImage = "ColoredPoint"] + | | +- ArgumentList[@Empty = false, @Size = 2] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @Expression = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Point", @TypeImage = "Point"] + | | | +- ArgumentList[@Empty = false, @Size = 2] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "x2", @Name = "x2", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "y2", @Name = "y2", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "c2", @Name = "c2", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ReturnStatement[] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "printXCoordOfUpperLeftPointWithPatterns", @MainMethod = false, @MethodName = "printXCoordOfUpperLeftPointWithPatterns", @Name = "printXCoordOfUpperLeftPointWithPatterns", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Rectangle", @TypeImage = "Rectangle"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "r", @LambdaParameter = false, @LocalVariable = false, @Name = "r", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "r", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- IfStatement[@Else = false] + | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Rectangle", @TypeImage = "Rectangle"] + | | +- PatternList[@Empty = false, @Size = 2] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "ColoredPoint", @TypeImage = "ColoredPoint"] + | | | +- PatternList[@Empty = false, @Size = 2] + | | | +- RecordPattern[@ParenthesisDepth = 0] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Point", @TypeImage = "Point"] + | | | | +- PatternList[@Empty = false, @Size = 2] + | | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | | +- ModifierList[] + | | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "var", @TypeImage = "var"] + | | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "x", @LambdaParameter = false, @LocalVariable = false, @Name = "x", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "x", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "var", @TypeImage = "var"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "y", @LambdaParameter = false, @LocalVariable = false, @Name = "y", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "y", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "var", @TypeImage = "var"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "c", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "var", @TypeImage = "var"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "lr", @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "lr", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Upper-left corner: ", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Upper-left corner: \"", @IntLiteral = false, @Length = 19, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] + +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns$Pair", @CanonicalName = "RecordPatterns.Pair", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Image = "Pair", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Pair", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "x", @LambdaParameter = false, @LocalVariable = false, @Name = "x", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "x", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "y", @LambdaParameter = false, @LocalVariable = false, @Name = "y", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "y", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | +- RecordBody[@Empty = true, @Size = 0] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "nestedPatternsCanFailToMatch", @MainMethod = false, @MethodName = "nestedPatternsCanFailToMatch", @Name = "nestedPatternsCanFailToMatch", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = true, @Size = 0] + | +- Block[@Empty = false, @Size = 2, @containsComment = false] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Pair", @TypeImage = "Pair"] + | | +- VariableDeclarator[@Initializer = true, @Name = "p"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "p", @LambdaParameter = false, @LocalVariable = true, @Name = "p", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "p", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @Expression = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Pair", @TypeImage = "Pair"] + | | +- ArgumentList[@Empty = false, @Size = 2] + | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "42", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42] + | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "42", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42] + | +- IfStatement[@Else = true] + | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "p", @Name = "p", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Pair", @TypeImage = "Pair"] + | | +- PatternList[@Empty = false, @Size = 2] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "t", @LambdaParameter = false, @LocalVariable = false, @Name = "t", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "t", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | +- ExpressionStatement[] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = ", ", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\", \"", @IntLiteral = false, @Length = 2, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "t", @Name = "t", @ParenthesisDepth = 0, @Parenthesized = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Not a pair of strings", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Not a pair of strings\"", @IntLiteral = false, @Length = 21, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns$Box", @CanonicalName = "RecordPatterns.Box", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Image = "Box", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Box", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- TypeParameters[@Empty = false, @Size = 1] + | | +- TypeParameter[@Image = "T", @Name = "T", @TypeBound = false] + | +- RecordComponentList[@Empty = false, @Size = 1, @Varargs = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "T", @TypeImage = "T"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "t", @LambdaParameter = false, @LocalVariable = false, @Name = "t", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "t", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | +- RecordBody[@Empty = true, @Size = 0] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "test1a", @MainMethod = false, @MethodName = "test1a", @Name = "test1a", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] + | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "bo", @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "bo", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- IfStatement[@Else = false] + | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "bo", @Name = "bo", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] + | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] + | | +- PatternList[@Empty = false, @Size = 1] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "String ", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"String \"", @IntLiteral = false, @Length = 7, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "test1", @MainMethod = false, @MethodName = "test1", @Name = "test1", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] + | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "bo", @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "bo", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- IfStatement[@Else = false] + | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "bo", @Name = "bo", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] + | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- PatternList[@Empty = false, @Size = 1] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "var", @TypeImage = "var"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "String ", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"String \"", @IntLiteral = false, @Length = 7, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "test2", @MainMethod = false, @MethodName = "test2", @Name = "test2", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] + | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "bo", @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "bo", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- IfStatement[@Else = false] + | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "bo", @Name = "bo", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] + | | +- PatternList[@Empty = false, @Size = 1] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "var", @TypeImage = "var"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "String ", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"String \"", @IntLiteral = false, @Length = 7, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "test3", @MainMethod = false, @MethodName = "test3", @Name = "test3", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box>"] + | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] + | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "bo", @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "bo", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- IfStatement[@Else = false] + | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "bo", @Name = "bo", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box>"] + | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] + | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- PatternList[@Empty = false, @Size = 1] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] + | | +- PatternList[@Empty = false, @Size = 1] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "var", @TypeImage = "var"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "String ", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"String \"", @IntLiteral = false, @Length = 7, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "test4", @MainMethod = false, @MethodName = "test4", @Name = "test4", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + +- ModifierList[] + +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + +- FormalParameters[@Empty = false, @Size = 1] + | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- ModifierList[] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box>"] + | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] + | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "bo", @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "bo", @Visibility = Visibility.V_LOCAL, @Volatile = false] + +- Block[@Empty = false, @Size = 1, @containsComment = false] + +- IfStatement[@Else = false] + +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "bo", @Name = "bo", @ParenthesisDepth = 0, @Parenthesized = false] + | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | +- RecordPattern[@ParenthesisDepth = 0] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] + | +- PatternList[@Empty = false, @Size = 1] + | +- RecordPattern[@ParenthesisDepth = 0] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] + | +- PatternList[@Empty = false, @Size = 1] + | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "var", @TypeImage = "var"] + | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + +- Block[@Empty = false, @Size = 1, @containsComment = false] + +- ExpressionStatement[] + +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + +- ArgumentList[@Empty = false, @Size = 1] + +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "String ", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"String \"", @IntLiteral = false, @Length = 7, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatternsExhaustiveSwitch.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatternsExhaustiveSwitch.java new file mode 100644 index 0000000000..6bd95d2279 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatternsExhaustiveSwitch.java @@ -0,0 +1,37 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +/** + * @see JEP 440: Record Patterns + */ +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/java21/RecordPatternsExhaustiveSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatternsExhaustiveSwitch.txt new file mode 100644 index 0000000000..c123520496 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatternsExhaustiveSwitch.txt @@ -0,0 +1,237 @@ ++- CompilationUnit[@PackageName = ""] + +- ClassOrInterfaceDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch", @CanonicalName = "RecordPatternsExhaustiveSwitch", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Image = "RecordPatternsExhaustiveSwitch", @Interface = false, @Local = false, @Native = false, @Nested = false, @PackageName = "", @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "RecordPatternsExhaustiveSwitch", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = true, @SyntacticallyStatic = false, @TopLevel = true, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] + +- ModifierList[] + +- ClassOrInterfaceBody[@Empty = false, @Size = 7] + +- ClassOrInterfaceDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch$A", @CanonicalName = "RecordPatternsExhaustiveSwitch.A", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Image = "A", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "A", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- ClassOrInterfaceBody[@Empty = true, @Size = 0] + +- ClassOrInterfaceDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch$B", @CanonicalName = "RecordPatternsExhaustiveSwitch.B", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Image = "B", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "B", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- ExtendsList[@Empty = false, @Size = 1] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "A", @TypeImage = "A"] + | +- ClassOrInterfaceBody[@Empty = true, @Size = 0] + +- ClassOrInterfaceDeclaration[@Abstract = true, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch$I", @CanonicalName = "RecordPatternsExhaustiveSwitch.I", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Image = "I", @Interface = true, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = false, @RegularClass = false, @RegularInterface = true, @SimpleName = "I", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- PermitsList[@Empty = false, @Size = 2] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "C", @TypeImage = "C"] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "D", @TypeImage = "D"] + | +- ClassOrInterfaceBody[@Empty = true, @Size = 0] + +- ClassOrInterfaceDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch$C", @CanonicalName = "RecordPatternsExhaustiveSwitch.C", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Image = "C", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "C", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = true, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- ImplementsList[@Empty = false, @Size = 1] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "I", @TypeImage = "I"] + | +- ClassOrInterfaceBody[@Empty = true, @Size = 0] + +- ClassOrInterfaceDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch$D", @CanonicalName = "RecordPatternsExhaustiveSwitch.D", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Image = "D", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "D", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = true, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- ImplementsList[@Empty = false, @Size = 1] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "I", @TypeImage = "I"] + | +- ClassOrInterfaceBody[@Empty = true, @Size = 0] + +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch$Pair", @CanonicalName = "RecordPatternsExhaustiveSwitch.Pair", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Image = "Pair", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Pair", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- TypeParameters[@Empty = false, @Size = 1] + | | +- TypeParameter[@Image = "T", @Name = "T", @TypeBound = false] + | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "T", @TypeImage = "T"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "x", @LambdaParameter = false, @LocalVariable = false, @Name = "x", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "x", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "T", @TypeImage = "T"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "y", @LambdaParameter = false, @LocalVariable = false, @Name = "y", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "y", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | +- RecordBody[@Empty = true, @Size = 0] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "test", @MainMethod = false, @MethodName = "test", @Name = "test", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + +- ModifierList[] + +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + +- FormalParameters[@Empty = true, @Size = 0] + +- Block[@Empty = false, @Size = 5, @containsComment = false] + +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- ModifierList[] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Pair", @TypeImage = "Pair"] + | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "A", @TypeImage = "A"] + | +- VariableDeclarator[@Initializer = true, @Name = "p1"] + | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "p1", @LambdaParameter = false, @LocalVariable = true, @Name = "p1", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "p1", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- ModifierList[] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Pair", @TypeImage = "Pair"] + | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "I", @TypeImage = "I"] + | +- VariableDeclarator[@Initializer = true, @Name = "p2"] + | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "p2", @LambdaParameter = false, @LocalVariable = true, @Name = "p2", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "p2", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "p1", @Name = "p1", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- RecordPattern[@ParenthesisDepth = 0] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Pair", @TypeImage = "Pair"] + | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "A", @TypeImage = "A"] + | | | +- PatternList[@Empty = false, @Size = 2] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "A", @TypeImage = "A"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "a", @LambdaParameter = false, @LocalVariable = false, @Name = "a", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "a", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "B", @TypeImage = "B"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "b", @LambdaParameter = false, @LocalVariable = false, @Name = "b", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "b", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "a", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"a\"", @IntLiteral = false, @Length = 1, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- RecordPattern[@ParenthesisDepth = 0] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Pair", @TypeImage = "Pair"] + | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "A", @TypeImage = "A"] + | | | +- PatternList[@Empty = false, @Size = 2] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "B", @TypeImage = "B"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "b", @LambdaParameter = false, @LocalVariable = false, @Name = "b", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "b", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "A", @TypeImage = "A"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "a", @LambdaParameter = false, @LocalVariable = false, @Name = "a", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "a", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "a", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"a\"", @IntLiteral = false, @Length = 1, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = false] + | +- SwitchLabel[@Default = false] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Pair", @TypeImage = "Pair"] + | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "A", @TypeImage = "A"] + | | +- PatternList[@Empty = false, @Size = 2] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "A", @TypeImage = "A"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "a1", @LambdaParameter = false, @LocalVariable = false, @Name = "a1", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "a1", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "A", @TypeImage = "A"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "a2", @LambdaParameter = false, @LocalVariable = false, @Name = "a2", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "a2", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "exhaustive now", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"exhaustive now\"", @IntLiteral = false, @Length = 14, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "p2", @Name = "p2", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- RecordPattern[@ParenthesisDepth = 0] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Pair", @TypeImage = "Pair"] + | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "I", @TypeImage = "I"] + | | | +- PatternList[@Empty = false, @Size = 2] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "I", @TypeImage = "I"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "i", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "C", @TypeImage = "C"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "c", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "a", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"a\"", @IntLiteral = false, @Length = 1, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = false] + | +- SwitchLabel[@Default = false] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Pair", @TypeImage = "Pair"] + | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "I", @TypeImage = "I"] + | | +- PatternList[@Empty = false, @Size = 2] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "I", @TypeImage = "I"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "i", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "D", @TypeImage = "D"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "d", @LambdaParameter = false, @LocalVariable = false, @Name = "d", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "d", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "a", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"a\"", @IntLiteral = false, @Length = 1, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "p2", @Name = "p2", @ParenthesisDepth = 0, @Parenthesized = false] + +- SwitchArrowBranch[@Default = false] + | +- SwitchLabel[@Default = false] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Pair", @TypeImage = "Pair"] + | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "I", @TypeImage = "I"] + | | +- PatternList[@Empty = false, @Size = 2] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "C", @TypeImage = "C"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "c", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "I", @TypeImage = "I"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "i", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "a", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"a\"", @IntLiteral = false, @Length = 1, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- SwitchArrowBranch[@Default = false] + | +- SwitchLabel[@Default = false] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Pair", @TypeImage = "Pair"] + | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "I", @TypeImage = "I"] + | | +- PatternList[@Empty = false, @Size = 2] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "D", @TypeImage = "D"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "d", @LambdaParameter = false, @LocalVariable = false, @Name = "d", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "d", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "C", @TypeImage = "C"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "c", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "a", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"a\"", @IntLiteral = false, @Length = 1, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- SwitchArrowBranch[@Default = false] + +- SwitchLabel[@Default = false] + | +- RecordPattern[@ParenthesisDepth = 0] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Pair", @TypeImage = "Pair"] + | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "I", @TypeImage = "I"] + | +- PatternList[@Empty = false, @Size = 2] + | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "D", @TypeImage = "D"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "d1", @LambdaParameter = false, @LocalVariable = false, @Name = "d1", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "d1", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "D", @TypeImage = "D"] + | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "d2", @LambdaParameter = false, @LocalVariable = false, @Name = "d2", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "d2", @Visibility = Visibility.V_LOCAL, @Volatile = false] + +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + +- ArgumentList[@Empty = false, @Size = 1] + +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "a", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"a\"", @IntLiteral = false, @Length = 1, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/RefiningPatternsInSwitch.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RefiningPatternsInSwitch.java similarity index 84% rename from pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/RefiningPatternsInSwitch.java rename to pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RefiningPatternsInSwitch.java index 7cbd63a4b6..9e2241b7e8 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/RefiningPatternsInSwitch.java +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RefiningPatternsInSwitch.java @@ -3,7 +3,7 @@ */ /** - * @see JEP 427: Pattern Matching for switch (Third Preview) + * @see JEP 441: Pattern Matching for switch */ public class RefiningPatternsInSwitch { @@ -33,7 +33,10 @@ public class RefiningPatternsInSwitch { static void testTriangleRefined(Shape s) { switch (s) { - case Triangle t when t.calculateArea() > 100 -> + case null -> + { break; } + case Triangle t + when t.calculateArea() > 100 -> System.out.println("Large triangle"); default -> System.out.println("A shape, possibly a small triangle"); @@ -42,7 +45,10 @@ public class RefiningPatternsInSwitch { static void testTriangleRefined2(Shape s) { switch (s) { - case Triangle t when t.calculateArea() > 100 -> + case null -> + { break; } + case Triangle t + when t.calculateArea() > 100 -> System.out.println("Large triangle"); case Triangle t -> System.out.println("Small triangle"); diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/RefiningPatternsInSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RefiningPatternsInSwitch.txt similarity index 97% rename from pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/RefiningPatternsInSwitch.txt rename to pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RefiningPatternsInSwitch.txt index 35991e0927..33e6549fb1 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/RefiningPatternsInSwitch.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RefiningPatternsInSwitch.txt @@ -98,11 +98,16 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] + | | | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + | | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | +- BreakStatement[@Label = null] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] | | | | +- ModifierList[] | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Triangle", @TypeImage = "Triangle"] | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "t", @LambdaParameter = false, @LocalVariable = false, @Name = "t", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "t", @Visibility = Visibility.V_LOCAL, @Volatile = false] - | | | +- SwitchGuard[] + | | | +- Guard[] | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "calculateArea", @MethodName = "calculateArea", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "t", @Name = "t", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "t"] @@ -135,11 +140,16 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] + | | | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + | | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | +- BreakStatement[@Label = null] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] | | | | +- ModifierList[] | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Triangle", @TypeImage = "Triangle"] | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "t", @LambdaParameter = false, @LocalVariable = false, @Name = "t", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "t", @Visibility = Visibility.V_LOCAL, @Volatile = false] - | | | +- SwitchGuard[] + | | | +- Guard[] | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "calculateArea", @MethodName = "calculateArea", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "t", @Name = "t", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "t"] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/ScopeOfPatternVariableDeclarations.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ScopeOfPatternVariableDeclarations.java similarity index 61% rename from pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/ScopeOfPatternVariableDeclarations.java rename to pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ScopeOfPatternVariableDeclarations.java index 471f1b1074..b9d277b914 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/ScopeOfPatternVariableDeclarations.java +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ScopeOfPatternVariableDeclarations.java @@ -3,12 +3,22 @@ */ /** - * @see JEP 427: Pattern Matching for switch (Third Preview) + * @see JEP 441: Pattern Matching for switch */ public class ScopeOfPatternVariableDeclarations { + static void testSwitchBlock(Object obj) { + switch (obj) { + case Character c + when c.charValue() == 7: + System.out.println("Ding!"); + break; + default: + break; + } + } - static void test(Object o) { + static void testSwitchRule(Object o) { switch (o) { case Character c -> { if (c.charValue() == 7) { @@ -36,13 +46,19 @@ public class ScopeOfPatternVariableDeclarations { } System.out.println("character"); default: - System.out.println(); + System.out.println("fall-through"); } } public static void main(String[] args) { - test('A'); + testSwitchBlock('\u0007'); + testSwitchRule('A'); + try { + testSwitchRule(42); // throws + } catch (IllegalStateException e) { + System.out.println(e); + } test2('\t'); } } diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/ScopeOfPatternVariableDeclarations.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ScopeOfPatternVariableDeclarations.txt similarity index 69% rename from pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/ScopeOfPatternVariableDeclarations.txt rename to pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ScopeOfPatternVariableDeclarations.txt index af2582f69d..24cebff346 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/ScopeOfPatternVariableDeclarations.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ScopeOfPatternVariableDeclarations.txt @@ -1,8 +1,42 @@ +- CompilationUnit[@PackageName = ""] +- ClassOrInterfaceDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ScopeOfPatternVariableDeclarations", @CanonicalName = "ScopeOfPatternVariableDeclarations", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Image = "ScopeOfPatternVariableDeclarations", @Interface = false, @Local = false, @Native = false, @Nested = false, @PackageName = "", @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "ScopeOfPatternVariableDeclarations", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = true, @SyntacticallyStatic = false, @TopLevel = true, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] +- ModifierList[] - +- ClassOrInterfaceBody[@Empty = false, @Size = 3] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "test", @MainMethod = false, @MethodName = "test", @Name = "test", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + +- ClassOrInterfaceBody[@Empty = false, @Size = 4] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "testSwitchBlock", @MainMethod = false, @MethodName = "testSwitchBlock", @Name = "testSwitchBlock", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "obj", @LambdaParameter = false, @LocalVariable = false, @Name = "obj", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "obj", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchFallthroughBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Character", @TypeImage = "Character"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "c", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- Guard[] + | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "charValue", @MethodName = "charValue", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "c"] + | | | | +- ArgumentList[@Empty = true, @Size = 0] + | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "7", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 7.0, @ValueAsFloat = 7.0, @ValueAsInt = 7, @ValueAsLong = 7] + | | +- ExpressionStatement[] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | | +- ArgumentList[@Empty = false, @Size = 1] + | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Ding!", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Ding!\"", @IntLiteral = false, @Length = 5, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- BreakStatement[@Label = null] + | +- SwitchFallthroughBranch[@Default = true] + | +- SwitchLabel[@Default = true] + | +- BreakStatement[@Label = null] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "testSwitchRule", @MainMethod = false, @MethodName = "testSwitchRule", @Name = "testSwitchRule", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] | +- ModifierList[] | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] | +- FormalParameters[@Empty = false, @Size = 1] @@ -119,7 +153,8 @@ | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] - | +- ArgumentList[@Empty = true, @Size = 0] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "fall-through", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"fall-through\"", @IntLiteral = false, @Length = 12, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "main", @MainMethod = true, @MethodName = "main", @Name = "main", @Native = false, @Overridden = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = true, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true, @Volatile = false] +- ModifierList[] +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] @@ -131,11 +166,34 @@ | | +- ArrayDimensions[@Empty = false, @Size = 1] | | +- ArrayTypeDim[@Varargs = false] | +- VariableDeclaratorId[@Abstract = false, @ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "args", @LambdaParameter = false, @LocalVariable = false, @Name = "args", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "args", @Visibility = Visibility.V_LOCAL, @Volatile = false] - +- Block[@Empty = false, @Size = 2, @containsComment = false] + +- Block[@Empty = false, @Size = 4, @containsComment = false] +- ExpressionStatement[] - | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "test", @MethodName = "test", @ParenthesisDepth = 0, @Parenthesized = false] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "testSwitchBlock", @MethodName = "testSwitchBlock", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- CharLiteral[@BooleanLiteral = false, @CharLiteral = true, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "\'\u0007\'", @IntLiteral = false, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "testSwitchRule", @MethodName = "testSwitchRule", @ParenthesisDepth = 0, @Parenthesized = false] | +- ArgumentList[@Empty = false, @Size = 1] | +- CharLiteral[@BooleanLiteral = false, @CharLiteral = true, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "\'A\'", @IntLiteral = false, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + +- TryStatement[@TryWithResources = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = true] + | | +- ExpressionStatement[] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "testSwitchRule", @MethodName = "testSwitchRule", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "42", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42] + | +- CatchClause[] + | +- CatchParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Multicatch = false, @Name = "e", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "IllegalStateException", @TypeImage = "IllegalStateException"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "e", @LambdaParameter = false, @LocalVariable = false, @Name = "e", @Native = false, @PackagePrivate = true, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "e", @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "e", @Name = "e", @ParenthesisDepth = 0, @Parenthesized = false] +- ExpressionStatement[] +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "test2", @MethodName = "test2", @ParenthesisDepth = 0, @Parenthesized = false] +- ArgumentList[@Empty = false, @Size = 1] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep430_StringTemplates.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep430_StringTemplates.java new file mode 100644 index 0000000000..c5d269cfa8 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep430_StringTemplates.java @@ -0,0 +1,193 @@ +/* + * 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) + */ +class Jep430_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/java21p/Jep430_StringTemplates.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep430_StringTemplates.txt new file mode 100644 index 0000000000..e349f20f80 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep430_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] + +- ClassOrInterfaceDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep430_StringTemplates", @CanonicalName = "Jep430_StringTemplates", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Image = "Jep430_StringTemplates", @Interface = false, @Local = false, @Native = false, @Nested = false, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Jep430_StringTemplates", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = true, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + +- ModifierList[] + +- ClassOrInterfaceBody[@Empty = false, @Size = 9] + +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep430_StringTemplates$Request", @CanonicalName = "Jep430_StringTemplates.Request", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Image = "Request", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Request", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- RecordComponentList[@Empty = false, @Size = 3, @Varargs = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "date", @LambdaParameter = false, @LocalVariable = false, @Name = "date", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "date", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "time", @LambdaParameter = false, @LocalVariable = false, @Name = "time", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "time", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "ipAddress", @LambdaParameter = false, @LocalVariable = false, @Name = "ipAddress", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "ipAddress", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | +- RecordBody[@Empty = true, @Size = 0] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "STRTemplateProcessor", @MainMethod = false, @MethodName = "STRTemplateProcessor", @Name = "STRTemplateProcessor", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = true, @Size = 0] + | +- Block[@Empty = false, @Size = 19, @containsComment = false] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- VariableDeclarator[@Initializer = true, @Name = "firstName"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "firstName", @LambdaParameter = false, @LocalVariable = true, @Name = "firstName", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "firstName", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Bill", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Bill\"", @IntLiteral = false, @Length = 4, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- VariableDeclarator[@Initializer = true, @Name = "lastName"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "lastName", @LambdaParameter = false, @LocalVariable = true, @Name = "lastName", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "lastName", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Duck", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Duck\"", @IntLiteral = false, @Length = 4, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- VariableDeclarator[@Initializer = true, @Name = "fullName"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "fullName", @LambdaParameter = false, @LocalVariable = true, @Name = "fullName", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "fullName", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- TemplateExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- Template[] + | | +- TemplateFragment[@Image = "\"\\{"] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "firstName", @Name = "firstName", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TemplateFragment[@Image = "} \\{"] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "lastName", @Name = "lastName", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TemplateFragment[@Image = "}\""] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- VariableDeclarator[@Initializer = true, @Name = "sortName"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "sortName", @LambdaParameter = false, @LocalVariable = true, @Name = "sortName", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "sortName", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- TemplateExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- Template[] + | | +- TemplateFragment[@Image = "\"\\{"] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "lastName", @Name = "lastName", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TemplateFragment[@Image = "}, \\{"] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "firstName", @Name = "firstName", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TemplateFragment[@Image = "}\""] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | +- VariableDeclarator[@Initializer = true, @Name = "x"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "x", @LambdaParameter = false, @LocalVariable = true, @Name = "x", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "x", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "10", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 10.0, @ValueAsFloat = 10.0, @ValueAsInt = 10, @ValueAsLong = 10] + | | +- VariableDeclarator[@Initializer = true, @Name = "y"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "y", @LambdaParameter = false, @LocalVariable = true, @Name = "y", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "y", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "20", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 20.0, @ValueAsFloat = 20.0, @ValueAsInt = 20, @ValueAsLong = 20] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- VariableDeclarator[@Initializer = true, @Name = "s1"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s1", @LambdaParameter = false, @LocalVariable = true, @Name = "s1", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s1", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- TemplateExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- Template[] + | | +- TemplateFragment[@Image = "\"\\{"] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TemplateFragment[@Image = "} + \\{"] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "y", @Name = "y", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TemplateFragment[@Image = "} = \\{"] + | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "y", @Name = "y", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TemplateFragment[@Image = "}\""] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- VariableDeclarator[@Initializer = true, @Name = "s2"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s2", @LambdaParameter = false, @LocalVariable = true, @Name = "s2", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s2", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- TemplateExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- Template[] + | | +- TemplateFragment[@Image = "\"You have a \\{"] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "getOfferType", @MethodName = "getOfferType", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ArgumentList[@Empty = true, @Size = 0] + | | +- TemplateFragment[@Image = "} waiting for you!\""] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Request", @TypeImage = "Request"] + | | +- VariableDeclarator[@Initializer = true, @Name = "req"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "req", @LambdaParameter = false, @LocalVariable = true, @Name = "req", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "req", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @Expression = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Request", @TypeImage = "Request"] + | | +- ArgumentList[@Empty = false, @Size = 3] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "2022-03-25", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"2022-03-25\"", @IntLiteral = false, @Length = 10, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "15:34", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"15:34\"", @IntLiteral = false, @Length = 5, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "8.8.8.8", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"8.8.8.8\"", @IntLiteral = false, @Length = 7, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- VariableDeclarator[@Initializer = true, @Name = "t"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "t", @LambdaParameter = false, @LocalVariable = true, @Name = "t", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "t", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- TemplateExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- Template[] + | | +- TemplateFragment[@Image = "\"Access at \\{"] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "date", @Name = "date", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "req", @Name = "req", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TemplateFragment[@Image = "} \\{"] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "time", @Name = "time", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "req", @Name = "req", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TemplateFragment[@Image = "} from \\{"] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "ipAddress", @Name = "ipAddress", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "req", @Name = "req", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TemplateFragment[@Image = "}\""] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- VariableDeclarator[@Initializer = true, @Name = "filePath"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "filePath", @LambdaParameter = false, @LocalVariable = true, @Name = "filePath", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "filePath", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "tmp.dat", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"tmp.dat\"", @IntLiteral = false, @Length = 7, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "File", @TypeImage = "File"] + | | +- VariableDeclarator[@Initializer = true, @Name = "file"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "file", @LambdaParameter = false, @LocalVariable = true, @Name = "file", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "file", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @Expression = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "File", @TypeImage = "File"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "filePath", @Name = "filePath", @ParenthesisDepth = 0, @Parenthesized = false] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- VariableDeclarator[@Initializer = true, @Name = "old"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "old", @LambdaParameter = false, @LocalVariable = true, @Name = "old", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "old", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "The file ", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"The file \"", @IntLiteral = false, @Length = 9, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "filePath", @Name = "filePath", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = " ", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\" \"", @IntLiteral = false, @Length = 1, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | | +- ConditionalExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 1, @Parenthesized = true] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "exists", @MethodName = "exists", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "file", @Name = "file", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ArgumentList[@Empty = true, @Size = 0] + | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "does", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"does\"", @IntLiteral = false, @Length = 4, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "does not", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"does not\"", @IntLiteral = false, @Length = 8, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = " exist", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\" exist\"", @IntLiteral = false, @Length = 6, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- VariableDeclarator[@Initializer = true, @Name = "msg"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "msg", @LambdaParameter = false, @LocalVariable = true, @Name = "msg", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "msg", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- TemplateExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- Template[] + | | +- TemplateFragment[@Image = "\"The file \\{"] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "filePath", @Name = "filePath", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TemplateFragment[@Image = "} \\{"] + | | +- ConditionalExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "exists", @MethodName = "exists", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "file", @Name = "file", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ArgumentList[@Empty = true, @Size = 0] + | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "does", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"does\"", @IntLiteral = false, @Length = 4, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "does not", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"does not\"", @IntLiteral = false, @Length = 8, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- TemplateFragment[@Image = "} exist\""] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- VariableDeclarator[@Initializer = true, @Name = "time"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "time", @LambdaParameter = false, @LocalVariable = true, @Name = "time", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "time", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- TemplateExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- Template[] + | | +- TemplateFragment[@Image = "\"The time is \\{"] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "ofPattern", @MethodName = "ofPattern", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "DateTimeFormatter", @TypeImage = "DateTimeFormatter"] + | | | | +- ArgumentList[@Empty = false, @Size = 1] + | | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "HH:mm:ss", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"HH:mm:ss\"", @IntLiteral = false, @Length = 8, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | | +- ArgumentList[@Empty = false, @Size = 1] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "now", @MethodName = "now", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "LocalTime", @TypeImage = "LocalTime"] + | | | +- ArgumentList[@Empty = true, @Size = 0] + | | +- TemplateFragment[@Image = "} right now\""] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | +- VariableDeclarator[@Initializer = true, @Name = "index"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "index", @LambdaParameter = false, @LocalVariable = true, @Name = "index", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "index", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- VariableDeclarator[@Initializer = true, @Name = "data"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "data", @LambdaParameter = false, @LocalVariable = true, @Name = "data", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "data", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- TemplateExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- Template[] + | | +- TemplateFragment[@Image = "\"\\{"] + | | +- UnaryExpression[@CompileTimeConstant = false, @Expression = true, @Operator = UnaryOp.POST_INCREMENT, @ParenthesisDepth = 0, @Parenthesized = false, @Prefix = false] + | | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Expression = true, @Image = "index", @Name = "index", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TemplateFragment[@Image = "}, \\{"] + | | +- UnaryExpression[@CompileTimeConstant = false, @Expression = true, @Operator = UnaryOp.POST_INCREMENT, @ParenthesisDepth = 0, @Parenthesized = false, @Prefix = false] + | | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Expression = true, @Image = "index", @Name = "index", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TemplateFragment[@Image = "}, \\{"] + | | +- UnaryExpression[@CompileTimeConstant = false, @Expression = true, @Operator = UnaryOp.POST_INCREMENT, @ParenthesisDepth = 0, @Parenthesized = false, @Prefix = false] + | | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Expression = true, @Image = "index", @Name = "index", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TemplateFragment[@Image = "}, \\{"] + | | +- UnaryExpression[@CompileTimeConstant = false, @Expression = true, @Operator = UnaryOp.POST_INCREMENT, @ParenthesisDepth = 0, @Parenthesized = false, @Prefix = false] + | | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Expression = true, @Image = "index", @Name = "index", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TemplateFragment[@Image = "}\""] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ArrayType[@ArrayDepth = 1, @ArrayType = true, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "String[]"] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | +- ArrayDimensions[@Empty = false, @Size = 1] + | | | +- ArrayTypeDim[@Varargs = false] + | | +- VariableDeclarator[@Initializer = true, @Name = "fruit"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "fruit", @LambdaParameter = false, @LocalVariable = true, @Name = "fruit", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "fruit", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ArrayInitializer[@CompileTimeConstant = false, @Expression = true, @Length = 3, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "apples", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"apples\"", @IntLiteral = false, @Length = 6, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "oranges", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"oranges\"", @IntLiteral = false, @Length = 7, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "peaches", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"peaches\"", @IntLiteral = false, @Length = 7, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- VariableDeclarator[@Initializer = true, @Name = "s3"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s3", @LambdaParameter = false, @LocalVariable = true, @Name = "s3", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s3", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- TemplateExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- Template[] + | | +- TemplateFragment[@Image = "\"\\{"] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "fruit", @Name = "fruit", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + | | +- TemplateFragment[@Image = "}, \\{"] + | | +- TemplateExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- Template[] + | | | +- TemplateFragment[@Image = "\"\\{"] + | | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "fruit", @Name = "fruit", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + | | | +- TemplateFragment[@Image = "}, \\{"] + | | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "fruit", @Name = "fruit", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] + | | | +- TemplateFragment[@Image = "}\""] + | | +- TemplateFragment[@Image = "}\""] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- ModifierList[] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | +- VariableDeclarator[@Initializer = true, @Name = "s4"] + | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s4", @LambdaParameter = false, @LocalVariable = true, @Name = "s4", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s4", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- TemplateExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] + | +- Template[] + | +- TemplateFragment[@Image = "\"\\{"] + | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "fruit", @Name = "fruit", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + | +- TemplateFragment[@Image = "}, \\{"] + | +- TemplateExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- Template[] + | | +- TemplateFragment[@Image = "\"\\{"] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "fruit", @Name = "fruit", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + | | +- TemplateFragment[@Image = "}, \\{"] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "fruit", @Name = "fruit", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] + | | +- TemplateFragment[@Image = "}\""] + | +- TemplateFragment[@Image = "}\""] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "getOfferType", @MainMethod = false, @MethodName = "getOfferType", @Name = "getOfferType", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false, @Volatile = false] + | +- ModifierList[] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | +- FormalParameters[@Empty = true, @Size = 0] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ReturnStatement[] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "_getOfferType_", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"_getOfferType_\"", @IntLiteral = false, @Length = 14, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "multilineTemplateExpressions", @MainMethod = false, @MethodName = "multilineTemplateExpressions", @Name = "multilineTemplateExpressions", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = true, @Size = 0] + | +- Block[@Empty = false, @Size = 7, @containsComment = false] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- VariableDeclarator[@Initializer = true, @Name = "title"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "title", @LambdaParameter = false, @LocalVariable = true, @Name = "title", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "title", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "My Web Page", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"My Web Page\"", @IntLiteral = false, @Length = 11, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- VariableDeclarator[@Initializer = true, @Name = "text"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "text", @LambdaParameter = false, @LocalVariable = true, @Name = "text", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "text", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Hello, world", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Hello, world\"", @IntLiteral = false, @Length = 12, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- VariableDeclarator[@Initializer = true, @Name = "html"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "html", @LambdaParameter = false, @LocalVariable = true, @Name = "html", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "html", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- TemplateExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- Template[] + | | +- TemplateFragment[@Image = "\"\"\"\n \n \n \\{"] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "title", @Name = "title", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TemplateFragment[@Image = "}\n \n \n

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

\n \n \n \"\"\""] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- VariableDeclarator[@Initializer = true, @Name = "name"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "name", @LambdaParameter = false, @LocalVariable = true, @Name = "name", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "name", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Joan Smith", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Joan Smith\"", @IntLiteral = false, @Length = 10, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- VariableDeclarator[@Initializer = true, @Name = "phone"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "phone", @LambdaParameter = false, @LocalVariable = true, @Name = "phone", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "phone", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "555-123-4567", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"555-123-4567\"", @IntLiteral = false, @Length = 12, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- VariableDeclarator[@Initializer = true, @Name = "address"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "address", @LambdaParameter = false, @LocalVariable = true, @Name = "address", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "address", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "1 Maple Drive, Anytown", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"1 Maple Drive, Anytown\"", @IntLiteral = false, @Length = 22, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- ModifierList[] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | +- VariableDeclarator[@Initializer = true, @Name = "json"] + | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "json", @LambdaParameter = false, @LocalVariable = true, @Name = "json", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "json", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- TemplateExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] + | +- Template[] + | +- TemplateFragment[@Image = "\"\"\"\n {\n \"name\": \"\\{"] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false] + | +- TemplateFragment[@Image = "}\",\n \"phone\": \"\\{"] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "phone", @Name = "phone", @ParenthesisDepth = 0, @Parenthesized = false] + | +- TemplateFragment[@Image = "}\",\n \"address\": \"\\{"] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @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 \\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + | +- TemplateFragment[@Image = "} \\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "width", @Name = "width", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + | +- TemplateFragment[@Image = "} \\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "height", @Name = "height", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + | +- TemplateFragment[@Image = "} \\{"] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- TemplateFragment[@Image = "}\n \\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + | +- TemplateFragment[@Image = "} \\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "width", @Name = "width", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + | +- TemplateFragment[@Image = "} \\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "height", @Name = "height", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + | +- TemplateFragment[@Image = "} \\{"] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- TemplateFragment[@Image = "}\n \\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] + | +- TemplateFragment[@Image = "} \\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "width", @Name = "width", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] + | +- TemplateFragment[@Image = "} \\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "height", @Name = "height", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] + | +- TemplateFragment[@Image = "} \\{"] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- TemplateFragment[@Image = "}\n Total \\{"] + | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + | | | | +- ArgumentList[@Empty = true, @Size = 0] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + | | | +- ArgumentList[@Empty = true, @Size = 0] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- TemplateFragment[@Image = "}\n \"\"\""] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "FMTTemplateProcessor", @MainMethod = false, @MethodName = "FMTTemplateProcessor", @Name = "FMTTemplateProcessor", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = true, @Size = 0] + | +- Block[@Empty = false, @Size = 4, @containsComment = false] + | +- LocalClassStatement[] + | | +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep430_StringTemplates$1Rectangle", @CanonicalName = null, @EffectiveVisibility = Visibility.V_LOCAL, @Enum = false, @Final = true, @Image = "Rectangle", @Interface = false, @Local = true, @Native = false, @Nested = false, @PackageName = "", @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Rectangle", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- RecordComponentList[@Empty = false, @Size = 3, @Varargs = false] + | | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "name", @LambdaParameter = false, @LocalVariable = false, @Name = "name", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "name", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.DOUBLE, @PrimitiveType = true, @TypeImage = "double"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "width", @LambdaParameter = false, @LocalVariable = false, @Name = "width", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "width", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | | +- ModifierList[] + | | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.DOUBLE, @PrimitiveType = true, @TypeImage = "double"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "height", @LambdaParameter = false, @LocalVariable = false, @Name = "height", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "height", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- RecordBody[@Empty = false, @Size = 1] + | | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Image = "area", @MainMethod = false, @MethodName = "area", @Name = "area", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false, @Volatile = false] + | | +- ModifierList[] + | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.DOUBLE, @PrimitiveType = true, @TypeImage = "double"] + | | +- FormalParameters[@Empty = true, @Size = 0] + | | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | +- ReturnStatement[] + | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.MUL, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "width", @Name = "width", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "height", @Name = "height", @ParenthesisDepth = 0, @Parenthesized = false] + | +- EmptyStatement[] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ArrayType[@ArrayDepth = 1, @ArrayType = true, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "Rectangle[]"] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Rectangle", @TypeImage = "Rectangle"] + | | | +- ArrayDimensions[@Empty = false, @Size = 1] + | | | +- ArrayTypeDim[@Varargs = false] + | | +- VariableDeclarator[@Initializer = true, @Name = "zone"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "zone", @LambdaParameter = false, @LocalVariable = true, @Name = "zone", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "zone", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ArrayAllocation[@ArrayDepth = 1, @CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayType[@ArrayDepth = 1, @ArrayType = true, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "Rectangle[]"] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Rectangle", @TypeImage = "Rectangle"] + | | | +- ArrayDimensions[@Empty = false, @Size = 1] + | | | +- ArrayTypeDim[@Varargs = false] + | | +- ArrayInitializer[@CompileTimeConstant = false, @Expression = true, @Length = 3, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @Expression = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Rectangle", @TypeImage = "Rectangle"] + | | | +- ArgumentList[@Empty = false, @Size = 3] + | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Alfa", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Alfa\"", @IntLiteral = false, @Length = 4, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = true, @Expression = true, @FloatLiteral = false, @Image = "17.8", @IntLiteral = false, @Integral = false, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 17.8, @ValueAsFloat = 17.8, @ValueAsInt = 17, @ValueAsLong = 17] + | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = true, @Expression = true, @FloatLiteral = false, @Image = "31.4", @IntLiteral = false, @Integral = false, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 31.4, @ValueAsFloat = 31.4, @ValueAsInt = 31, @ValueAsLong = 31] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @Expression = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Rectangle", @TypeImage = "Rectangle"] + | | | +- ArgumentList[@Empty = false, @Size = 3] + | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Bravo", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Bravo\"", @IntLiteral = false, @Length = 5, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = true, @Expression = true, @FloatLiteral = false, @Image = "9.6", @IntLiteral = false, @Integral = false, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 9.6, @ValueAsFloat = 9.6, @ValueAsInt = 9, @ValueAsLong = 9] + | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = true, @Expression = true, @FloatLiteral = false, @Image = "12.4", @IntLiteral = false, @Integral = false, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 12.4, @ValueAsFloat = 12.4, @ValueAsInt = 12, @ValueAsLong = 12] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @Expression = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Rectangle", @TypeImage = "Rectangle"] + | | +- ArgumentList[@Empty = false, @Size = 3] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Charlie", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Charlie\"", @IntLiteral = false, @Length = 7, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = true, @Expression = true, @FloatLiteral = false, @Image = "7.1", @IntLiteral = false, @Integral = false, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 7.1, @ValueAsFloat = 7.1, @ValueAsInt = 7, @ValueAsLong = 7] + | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = true, @Expression = true, @FloatLiteral = false, @Image = "11.23", @IntLiteral = false, @Integral = false, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 11.23, @ValueAsFloat = 11.23, @ValueAsInt = 11, @ValueAsLong = 11] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- ModifierList[] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | +- VariableDeclarator[@Initializer = true, @Name = "table"] + | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "table", @LambdaParameter = false, @LocalVariable = true, @Name = "table", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "table", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- TemplateExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "FMT", @Name = "FMT", @ParenthesisDepth = 0, @Parenthesized = false] + | +- Template[] + | +- TemplateFragment[@Image = "\"\"\"\n Description Width Height Area\n %-12s\\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + | +- TemplateFragment[@Image = "} %7.2f\\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "width", @Name = "width", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + | +- TemplateFragment[@Image = "} %7.2f\\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "height", @Name = "height", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + | +- TemplateFragment[@Image = "} %7.2f\\{"] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- TemplateFragment[@Image = "}\n %-12s\\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + | +- TemplateFragment[@Image = "} %7.2f\\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "width", @Name = "width", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + | +- TemplateFragment[@Image = "} %7.2f\\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "height", @Name = "height", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + | +- TemplateFragment[@Image = "} %7.2f\\{"] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- TemplateFragment[@Image = "}\n %-12s\\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] + | +- TemplateFragment[@Image = "} %7.2f\\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "width", @Name = "width", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] + | +- TemplateFragment[@Image = "} %7.2f\\{"] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "height", @Name = "height", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] + | +- TemplateFragment[@Image = "} %7.2f\\{"] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- TemplateFragment[@Image = "}\n \\{"] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "repeat", @MethodName = "repeat", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = " ", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\" \"", @IntLiteral = false, @Length = 1, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "28", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 28.0, @ValueAsFloat = 28.0, @ValueAsInt = 28, @ValueAsLong = 28] + | +- TemplateFragment[@Image = "} Total %7.2f\\{"] + | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + | | | | +- ArgumentList[@Empty = true, @Size = 0] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + | | | +- ArgumentList[@Empty = true, @Size = 0] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- TemplateFragment[@Image = "}\n \"\"\""] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "ensuringSafety", @MainMethod = false, @MethodName = "ensuringSafety", @Name = "ensuringSafety", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = true, @Size = 0] + | +- Block[@Empty = false, @Size = 3, @containsComment = false] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- VariableDeclarator[@Initializer = true, @Name = "name"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "name", @LambdaParameter = false, @LocalVariable = true, @Name = "name", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "name", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Joan", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Joan\"", @IntLiteral = false, @Length = 4, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "StringTemplate", @TypeImage = "StringTemplate"] + | | +- VariableDeclarator[@Initializer = true, @Name = "st"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "st", @LambdaParameter = false, @LocalVariable = true, @Name = "st", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "st", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- TemplateExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "RAW", @Name = "RAW", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- Template[] + | | +- TemplateFragment[@Image = "\"My name is \\{"] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TemplateFragment[@Image = "}\""] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- ModifierList[] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | +- VariableDeclarator[@Initializer = true, @Name = "info"] + | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "info", @LambdaParameter = false, @LocalVariable = true, @Name = "info", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "info", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "process", @MethodName = "process", @ParenthesisDepth = 0, @Parenthesized = false] + | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "STR"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "st", @Name = "st", @ParenthesisDepth = 0, @Parenthesized = false] + +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep430_StringTemplates$User", @CanonicalName = "Jep430_StringTemplates.User", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Image = "User", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "User", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "firstName", @LambdaParameter = false, @LocalVariable = false, @Name = "firstName", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "firstName", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- ModifierList[] + | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "accountNumber", @LambdaParameter = false, @LocalVariable = false, @Name = "accountNumber", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "accountNumber", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | +- RecordBody[@Empty = true, @Size = 0] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "literalsInsideTemplateExpressions", @MainMethod = false, @MethodName = "literalsInsideTemplateExpressions", @Name = "literalsInsideTemplateExpressions", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = true, @Size = 0] + | +- Block[@Empty = false, @Size = 3, @containsComment = false] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- VariableDeclarator[@Initializer = true, @Name = "s1"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s1", @LambdaParameter = false, @LocalVariable = true, @Name = "s1", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s1", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- TemplateExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Welcome to your account", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Welcome to your account\"", @IntLiteral = false, @Length = 23, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "User", @TypeImage = "User"] + | | +- VariableDeclarator[@Initializer = true, @Name = "user"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "user", @LambdaParameter = false, @LocalVariable = true, @Name = "user", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "user", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @Expression = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "User", @TypeImage = "User"] + | | +- ArgumentList[@Empty = false, @Size = 2] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Lisa", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Lisa\"", @IntLiteral = false, @Length = 4, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "12345", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 12345.0, @ValueAsFloat = 12345.0, @ValueAsInt = 12345, @ValueAsLong = 12345] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- ModifierList[] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | +- VariableDeclarator[@Initializer = true, @Name = "s2"] + | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s2", @LambdaParameter = false, @LocalVariable = true, @Name = "s2", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s2", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- TemplateExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] + | +- Template[] + | +- TemplateFragment[@Image = "\"Welcome, \\{"] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "firstName", @MethodName = "firstName", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "user", @Name = "user", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- TemplateFragment[@Image = "}, to your account \\{"] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "accountNumber", @MethodName = "accountNumber", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "user", @Name = "user", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- TemplateFragment[@Image = "}\""] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "emptyEmbeddedExpression", @MainMethod = false, @MethodName = "emptyEmbeddedExpression", @Name = "emptyEmbeddedExpression", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + +- ModifierList[] + +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + +- FormalParameters[@Empty = true, @Size = 0] + +- Block[@Empty = false, @Size = 1, @containsComment = false] + +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + +- ModifierList[] + +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + +- VariableDeclarator[@Initializer = true, @Name = "s1"] + +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s1", @LambdaParameter = false, @LocalVariable = true, @Name = "s1", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s1", @Visibility = Visibility.V_LOCAL, @Volatile = false] + +- TemplateExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] + +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] + +- Template[] + +- TemplateFragment[@Image = "\"Test \\{"] + +- TemplateFragment[@Image = "}\""] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep443_UnnamedPatternsAndVariables.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep443_UnnamedPatternsAndVariables.java new file mode 100644 index 0000000000..dc2e9f4c7a --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep443_UnnamedPatternsAndVariables.java @@ -0,0 +1,123 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + + +import java.util.ArrayDeque; +import java.util.List; +import java.util.Queue; +import java.util.stream.Collectors; + +/** + * @see JEP 443: Unnamed Patterns and Variables (Preview) + */ +class Jep443_UnamedPatternsAndVariables { + record Point(int x, int y) { } + enum Color { RED, GREEN, BLUE } + record ColoredPoint(Point p, Color c) { } + + void unnamedPatterns1() { + ColoredPoint r = new ColoredPoint(new Point(3,4), Color.GREEN); + + if (r instanceof ColoredPoint(Point p, Color _)) { + System.out.println(p.x() + " " + p.y()); + } + + if (r instanceof ColoredPoint(Point(int x, int y), _)) { + System.out.println(x + " " + y); + } + } + + sealed abstract class Ball permits RedBall, BlueBall, GreenBall { } + final class RedBall extends Ball { } + final class BlueBall extends Ball { } + final class GreenBall extends Ball { } + + record Box(T content) { } + + void unnamedPatterns2() { + Box b = new Box<>(new RedBall()); + switch (b) { + case Box(RedBall _) -> processBox(b); + case Box(BlueBall _) -> processBox(b); + case Box(GreenBall _) -> stopProcessing(); + } + + switch (b) { + case Box(RedBall _), Box(BlueBall _) -> processBox(b); + case Box(GreenBall _) -> stopProcessing(); + case Box(_) -> pickAnotherBox(); + } + + int x = 42; + switch (b) { + // multiple patterns guarded by one guard + case Box(RedBall _), Box(BlueBall _) when x == 42 -> processBox(b); + case Box(_) -> pickAnotherBox(); + } + } + + private void processBox(Box b) {} + private void stopProcessing() {} + private void pickAnotherBox() {} + + class Order {} + private static final int LIMIT = 10; + private int sideEffect() { + return 0; + } + + void unnamedVariables(List orders) { + int total = 0; + for (Order _ : orders) { + if (total < LIMIT) { + total++; + } + } + System.out.println("total: " + total); + + for (int i = 0, _ = sideEffect(); i < 10; i++) { + System.out.println(i); + } + + Queue q = new ArrayDeque<>(); // x1, y1, z1, x2, y2, z2 .. + while (q.size() >= 3) { + int x = q.remove(); + int y = q.remove(); + int _ = q.remove(); // z is unused + Point p = new Point(x, y); + } + while (q.size() >= 3) { + var x = q.remove(); + var _ = q.remove(); + var _ = q.remove(); + Point p = new Point(x, 0); + } + } + + static class ScopedContext implements AutoCloseable { + @Override + public void close() { } + public static ScopedContext acquire() { + return new ScopedContext(); + } + } + + void unusedVariables2() { + try (var _ = ScopedContext.acquire()) { + //... acquiredContext not used ... + } + + String s = "123"; + try { + int i = Integer.parseInt(s); + System.out.println(i); + } catch (NumberFormatException _) { + System.out.println("Bad number: " + s); + } catch (Exception _) { + System.out.println("error..."); + } + + List.of("a", "b").stream().collect(Collectors.toMap(String::toUpperCase, _ -> "NO_DATA")); + } +} diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep443_UnnamedPatternsAndVariables.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep443_UnnamedPatternsAndVariables.txt new file mode 100644 index 0000000000..e3e7d607ba --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep443_UnnamedPatternsAndVariables.txt @@ -0,0 +1,608 @@ ++- CompilationUnit[@PackageName = ""] + +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.util.ArrayDeque", @ImportedSimpleName = "ArrayDeque", @PackageName = "java.util", @Static = false] + +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.util.List", @ImportedSimpleName = "List", @PackageName = "java.util", @Static = false] + +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.util.Queue", @ImportedSimpleName = "Queue", @PackageName = "java.util", @Static = false] + +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.util.stream.Collectors", @ImportedSimpleName = "Collectors", @PackageName = "java.util.stream", @Static = false] + +- ClassOrInterfaceDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep443_UnamedPatternsAndVariables", @CanonicalName = "Jep443_UnamedPatternsAndVariables", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Image = "Jep443_UnamedPatternsAndVariables", @Interface = false, @Local = false, @Native = false, @Nested = false, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Jep443_UnamedPatternsAndVariables", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = true, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + +- ModifierList[] + +- ClassOrInterfaceBody[@Empty = false, @Size = 19] + +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep443_UnamedPatternsAndVariables$Point", @CanonicalName = "Jep443_UnamedPatternsAndVariables.Point", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Image = "Point", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Point", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | | +- ModifierList[] + | | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "x", @LambdaParameter = false, @LocalVariable = false, @Name = "x", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "x", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- ModifierList[] + | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "y", @LambdaParameter = false, @LocalVariable = false, @Name = "y", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "y", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | +- RecordBody[@Empty = true, @Size = 0] + +- EnumDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep443_UnamedPatternsAndVariables$Color", @CanonicalName = "Jep443_UnamedPatternsAndVariables.Color", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = true, @Final = true, @Image = "Color", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Color", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- EnumBody[@Empty = false, @SeparatorSemi = false, @Size = 3, @TrailingComma = false] + | +- EnumConstant[@Abstract = false, @AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = true, @Image = "RED", @MethodName = "new", @Name = "RED", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] + | | +- ModifierList[] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "RED", @LambdaParameter = false, @LocalVariable = false, @Name = "RED", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = true, @VariableName = "RED", @Visibility = Visibility.V_PUBLIC, @Volatile = false] + | +- EnumConstant[@Abstract = false, @AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = true, @Image = "GREEN", @MethodName = "new", @Name = "GREEN", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] + | | +- ModifierList[] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "GREEN", @LambdaParameter = false, @LocalVariable = false, @Name = "GREEN", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = true, @VariableName = "GREEN", @Visibility = Visibility.V_PUBLIC, @Volatile = false] + | +- EnumConstant[@Abstract = false, @AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = true, @Image = "BLUE", @MethodName = "new", @Name = "BLUE", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] + | +- ModifierList[] + | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "BLUE", @LambdaParameter = false, @LocalVariable = false, @Name = "BLUE", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = true, @VariableName = "BLUE", @Visibility = Visibility.V_PUBLIC, @Volatile = false] + +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep443_UnamedPatternsAndVariables$ColoredPoint", @CanonicalName = "Jep443_UnamedPatternsAndVariables.ColoredPoint", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Image = "ColoredPoint", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "ColoredPoint", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Point", @TypeImage = "Point"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "p", @LambdaParameter = false, @LocalVariable = false, @Name = "p", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "p", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Color", @TypeImage = "Color"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "c", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | +- RecordBody[@Empty = true, @Size = 0] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "unnamedPatterns1", @MainMethod = false, @MethodName = "unnamedPatterns1", @Name = "unnamedPatterns1", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = true, @Size = 0] + | +- Block[@Empty = false, @Size = 3, @containsComment = false] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "ColoredPoint", @TypeImage = "ColoredPoint"] + | | +- VariableDeclarator[@Initializer = true, @Name = "r"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "r", @LambdaParameter = false, @LocalVariable = true, @Name = "r", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "r", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @Expression = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "ColoredPoint", @TypeImage = "ColoredPoint"] + | | +- ArgumentList[@Empty = false, @Size = 2] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @Expression = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Point", @TypeImage = "Point"] + | | | +- ArgumentList[@Empty = false, @Size = 2] + | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3] + | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "4", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 4.0, @ValueAsFloat = 4.0, @ValueAsInt = 4, @ValueAsLong = 4] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "GREEN", @Name = "GREEN", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Color", @TypeImage = "Color"] + | +- IfStatement[@Else = false] + | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- RecordPattern[@ParenthesisDepth = 0] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "ColoredPoint", @TypeImage = "ColoredPoint"] + | | | +- PatternList[@Empty = false, @Size = 2] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Point", @TypeImage = "Point"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "p", @LambdaParameter = false, @LocalVariable = false, @Name = "p", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "p", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Color", @TypeImage = "Color"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "_", @LambdaParameter = false, @LocalVariable = false, @Name = "_", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "_", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | +- ExpressionStatement[] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "x", @MethodName = "x", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "p", @Name = "p", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "p"] + | | | | +- ArgumentList[@Empty = true, @Size = 0] + | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = " ", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\" \"", @IntLiteral = false, @Length = 1, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "y", @MethodName = "y", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "p", @Name = "p", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "p"] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- IfStatement[@Else = false] + | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "ColoredPoint", @TypeImage = "ColoredPoint"] + | | +- PatternList[@Empty = false, @Size = 2] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Point", @TypeImage = "Point"] + | | | +- PatternList[@Empty = false, @Size = 2] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "x", @LambdaParameter = false, @LocalVariable = false, @Name = "x", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "x", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "y", @LambdaParameter = false, @LocalVariable = false, @Name = "y", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "y", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- UnnamedPattern[@ParenthesisDepth = 0] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = " ", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\" \"", @IntLiteral = false, @Length = 1, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "y", @Name = "y", @ParenthesisDepth = 0, @Parenthesized = false] + +- ClassOrInterfaceDeclaration[@Abstract = true, @Annotation = false, @Anonymous = false, @BinaryName = "Jep443_UnamedPatternsAndVariables$Ball", @CanonicalName = "Jep443_UnamedPatternsAndVariables.Ball", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Image = "Ball", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Ball", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = true, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- PermitsList[@Empty = false, @Size = 3] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "RedBall", @TypeImage = "RedBall"] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "BlueBall", @TypeImage = "BlueBall"] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "GreenBall", @TypeImage = "GreenBall"] + | +- ClassOrInterfaceBody[@Empty = true, @Size = 0] + +- ClassOrInterfaceDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep443_UnamedPatternsAndVariables$RedBall", @CanonicalName = "Jep443_UnamedPatternsAndVariables.RedBall", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Image = "RedBall", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "RedBall", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = true, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- ExtendsList[@Empty = false, @Size = 1] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Ball", @TypeImage = "Ball"] + | +- ClassOrInterfaceBody[@Empty = true, @Size = 0] + +- ClassOrInterfaceDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep443_UnamedPatternsAndVariables$BlueBall", @CanonicalName = "Jep443_UnamedPatternsAndVariables.BlueBall", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Image = "BlueBall", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "BlueBall", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = true, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- ExtendsList[@Empty = false, @Size = 1] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Ball", @TypeImage = "Ball"] + | +- ClassOrInterfaceBody[@Empty = true, @Size = 0] + +- ClassOrInterfaceDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep443_UnamedPatternsAndVariables$GreenBall", @CanonicalName = "Jep443_UnamedPatternsAndVariables.GreenBall", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Image = "GreenBall", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "GreenBall", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = true, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- ExtendsList[@Empty = false, @Size = 1] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Ball", @TypeImage = "Ball"] + | +- ClassOrInterfaceBody[@Empty = true, @Size = 0] + +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep443_UnamedPatternsAndVariables$Box", @CanonicalName = "Jep443_UnamedPatternsAndVariables.Box", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Image = "Box", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Box", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- TypeParameters[@Empty = false, @Size = 1] + | | +- TypeParameter[@Image = "T", @Name = "T", @TypeBound = true] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Ball", @TypeImage = "Ball"] + | +- RecordComponentList[@Empty = false, @Size = 1, @Varargs = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "T", @TypeImage = "T"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "content", @LambdaParameter = false, @LocalVariable = false, @Name = "content", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "content", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | +- RecordBody[@Empty = true, @Size = 0] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "unnamedPatterns2", @MainMethod = false, @MethodName = "unnamedPatterns2", @Name = "unnamedPatterns2", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = true, @Size = 0] + | +- Block[@Empty = false, @Size = 5, @containsComment = false] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] + | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | | +- WildcardType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @LowerBound = false, @PrimitiveType = false, @TypeImage = "? extends Ball", @UpperBound = true] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Ball", @TypeImage = "Ball"] + | | +- VariableDeclarator[@Initializer = true, @Name = "b"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "b", @LambdaParameter = false, @LocalVariable = true, @Name = "b", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "b", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = true, @Expression = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box<>"] + | | | +- TypeArguments[@Diamond = true, @Empty = true, @Size = 0] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @Expression = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "RedBall", @TypeImage = "RedBall"] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- SwitchArrowBranch[@Default = false] + | | | +- SwitchLabel[@Default = false] + | | | | +- RecordPattern[@ParenthesisDepth = 0] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] + | | | | +- PatternList[@Empty = false, @Size = 1] + | | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "RedBall", @TypeImage = "RedBall"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "_", @LambdaParameter = false, @LocalVariable = false, @Name = "_", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "_", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "processBox", @MethodName = "processBox", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ArgumentList[@Empty = false, @Size = 1] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- SwitchArrowBranch[@Default = false] + | | | +- SwitchLabel[@Default = false] + | | | | +- RecordPattern[@ParenthesisDepth = 0] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] + | | | | +- PatternList[@Empty = false, @Size = 1] + | | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "BlueBall", @TypeImage = "BlueBall"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "_", @LambdaParameter = false, @LocalVariable = false, @Name = "_", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "_", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "processBox", @MethodName = "processBox", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ArgumentList[@Empty = false, @Size = 1] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- RecordPattern[@ParenthesisDepth = 0] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] + | | | +- PatternList[@Empty = false, @Size = 1] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "GreenBall", @TypeImage = "GreenBall"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "_", @LambdaParameter = false, @LocalVariable = false, @Name = "_", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "_", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @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, @Expression = true, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- SwitchArrowBranch[@Default = false] + | | | +- SwitchLabel[@Default = false] + | | | | +- RecordPattern[@ParenthesisDepth = 0] + | | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] + | | | | | +- PatternList[@Empty = false, @Size = 1] + | | | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | | +- ModifierList[] + | | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "RedBall", @TypeImage = "RedBall"] + | | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "_", @LambdaParameter = false, @LocalVariable = false, @Name = "_", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "_", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | | +- RecordPattern[@ParenthesisDepth = 0] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] + | | | | +- PatternList[@Empty = false, @Size = 1] + | | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "BlueBall", @TypeImage = "BlueBall"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "_", @LambdaParameter = false, @LocalVariable = false, @Name = "_", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "_", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "processBox", @MethodName = "processBox", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ArgumentList[@Empty = false, @Size = 1] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- SwitchArrowBranch[@Default = false] + | | | +- SwitchLabel[@Default = false] + | | | | +- RecordPattern[@ParenthesisDepth = 0] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] + | | | | +- PatternList[@Empty = false, @Size = 1] + | | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "GreenBall", @TypeImage = "GreenBall"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "_", @LambdaParameter = false, @LocalVariable = false, @Name = "_", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "_", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "stopProcessing", @MethodName = "stopProcessing", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ArgumentList[@Empty = true, @Size = 0] + | | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- RecordPattern[@ParenthesisDepth = 0] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] + | | | +- PatternList[@Empty = false, @Size = 1] + | | | +- UnnamedPattern[@ParenthesisDepth = 0] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "pickAnotherBox", @MethodName = "pickAnotherBox", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | +- VariableDeclarator[@Initializer = true, @Name = "x"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "x", @LambdaParameter = false, @LocalVariable = true, @Name = "x", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "x", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "42", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42] + | +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- RecordPattern[@ParenthesisDepth = 0] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] + | | | | +- PatternList[@Empty = false, @Size = 1] + | | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "RedBall", @TypeImage = "RedBall"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "_", @LambdaParameter = false, @LocalVariable = false, @Name = "_", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "_", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- RecordPattern[@ParenthesisDepth = 0] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] + | | | | +- PatternList[@Empty = false, @Size = 1] + | | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "BlueBall", @TypeImage = "BlueBall"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "_", @LambdaParameter = false, @LocalVariable = false, @Name = "_", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "_", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- Guard[] + | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "42", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "processBox", @MethodName = "processBox", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchArrowBranch[@Default = false] + | +- SwitchLabel[@Default = false] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] + | | +- PatternList[@Empty = false, @Size = 1] + | | +- UnnamedPattern[@ParenthesisDepth = 0] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "pickAnotherBox", @MethodName = "pickAnotherBox", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = true, @Size = 0] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Image = "processBox", @MainMethod = false, @MethodName = "processBox", @Name = "processBox", @Native = false, @Overridden = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] + | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | | +- WildcardType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @LowerBound = false, @PrimitiveType = false, @TypeImage = "? extends Ball", @UpperBound = true] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Ball", @TypeImage = "Ball"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "b", @LambdaParameter = false, @LocalVariable = false, @Name = "b", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "b", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = true, @Size = 0, @containsComment = false] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Image = "stopProcessing", @MainMethod = false, @MethodName = "stopProcessing", @Name = "stopProcessing", @Native = false, @Overridden = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = true, @Size = 0] + | +- Block[@Empty = true, @Size = 0, @containsComment = false] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Image = "pickAnotherBox", @MainMethod = false, @MethodName = "pickAnotherBox", @Name = "pickAnotherBox", @Native = false, @Overridden = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = true, @Size = 0] + | +- Block[@Empty = true, @Size = 0, @containsComment = false] + +- ClassOrInterfaceDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep443_UnamedPatternsAndVariables$Order", @CanonicalName = "Jep443_UnamedPatternsAndVariables.Order", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Image = "Order", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Order", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- ClassOrInterfaceBody[@Empty = true, @Size = 0] + +- FieldDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = true, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @VariableName = "LIMIT", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | +- ModifierList[] + | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | +- VariableDeclarator[@Initializer = true, @Name = "LIMIT"] + | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "LIMIT", @LambdaParameter = false, @LocalVariable = false, @Name = "LIMIT", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = true, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @TypeInferred = false, @VariableName = "LIMIT", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "10", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 10.0, @ValueAsFloat = 10.0, @ValueAsInt = 10, @ValueAsLong = 10] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Image = "sideEffect", @MainMethod = false, @MethodName = "sideEffect", @Name = "sideEffect", @Native = false, @Overridden = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = false, @Volatile = false] + | +- ModifierList[] + | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | +- FormalParameters[@Empty = true, @Size = 0] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ReturnStatement[] + | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "unnamedVariables", @MainMethod = false, @MethodName = "unnamedVariables", @Name = "unnamedVariables", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "List", @TypeImage = "List"] + | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Order", @TypeImage = "Order"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "orders", @LambdaParameter = false, @LocalVariable = false, @Name = "orders", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "orders", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 7, @containsComment = false] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | +- VariableDeclarator[@Initializer = true, @Name = "total"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "total", @LambdaParameter = false, @LocalVariable = true, @Name = "total", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "total", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + | +- ForeachStatement[] + | | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Order", @TypeImage = "Order"] + | | | +- VariableDeclarator[@Initializer = false, @Name = "_"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = true, @FormalParameter = false, @Image = "_", @LambdaParameter = false, @LocalVariable = false, @Name = "_", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "_", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "orders", @Name = "orders", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | +- IfStatement[@Else = false] + | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.LT, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "total", @Name = "total", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = true, @Expression = true, @Image = "LIMIT", @Name = "LIMIT", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | +- ExpressionStatement[] + | | +- UnaryExpression[@CompileTimeConstant = false, @Expression = true, @Operator = UnaryOp.POST_INCREMENT, @ParenthesisDepth = 0, @Parenthesized = false, @Prefix = false] + | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Expression = true, @Image = "total", @Name = "total", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ExpressionStatement[] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "total: ", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"total: \"", @IntLiteral = false, @Length = 7, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "total", @Name = "total", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ForStatement[] + | | +- ForInit[] + | | | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- ModifierList[] + | | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | | +- VariableDeclarator[@Initializer = true, @Name = "i"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = true, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = true, @Name = "i", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "i", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + | | | +- VariableDeclarator[@Initializer = true, @Name = "_"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = true, @ForeachVariable = false, @FormalParameter = false, @Image = "_", @LambdaParameter = false, @LocalVariable = true, @Name = "_", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "_", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "sideEffect", @MethodName = "sideEffect", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ArgumentList[@Empty = true, @Size = 0] + | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.LT, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "10", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 10.0, @ValueAsFloat = 10.0, @ValueAsInt = 10, @ValueAsLong = 10] + | | +- ForUpdate[] + | | | +- StatementExpressionList[@Empty = false, @Size = 1] + | | | +- UnaryExpression[@CompileTimeConstant = false, @Expression = true, @Operator = UnaryOp.POST_INCREMENT, @ParenthesisDepth = 0, @Parenthesized = false, @Prefix = false] + | | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Expression = true, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | +- ExpressionStatement[] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Queue", @TypeImage = "Queue"] + | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Integer", @TypeImage = "Integer"] + | | +- VariableDeclarator[@Initializer = true, @Name = "q"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "q", @LambdaParameter = false, @LocalVariable = true, @Name = "q", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "q", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = true, @Expression = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "ArrayDeque", @TypeImage = "ArrayDeque<>"] + | | | +- TypeArguments[@Diamond = true, @Empty = true, @Size = 0] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- WhileStatement[] + | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.GE, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "size", @MethodName = "size", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ArgumentList[@Empty = true, @Size = 0] + | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3] + | | +- Block[@Empty = false, @Size = 4, @containsComment = false] + | | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- ModifierList[] + | | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | | +- VariableDeclarator[@Initializer = true, @Name = "x"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "x", @LambdaParameter = false, @LocalVariable = true, @Name = "x", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "x", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "remove", @MethodName = "remove", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ArgumentList[@Empty = true, @Size = 0] + | | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- ModifierList[] + | | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | | +- VariableDeclarator[@Initializer = true, @Name = "y"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "y", @LambdaParameter = false, @LocalVariable = true, @Name = "y", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "y", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "remove", @MethodName = "remove", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ArgumentList[@Empty = true, @Size = 0] + | | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- ModifierList[] + | | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | | +- VariableDeclarator[@Initializer = true, @Name = "_"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "_", @LambdaParameter = false, @LocalVariable = true, @Name = "_", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "_", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "remove", @MethodName = "remove", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ArgumentList[@Empty = true, @Size = 0] + | | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Point", @TypeImage = "Point"] + | | +- VariableDeclarator[@Initializer = true, @Name = "p"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "p", @LambdaParameter = false, @LocalVariable = true, @Name = "p", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "p", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @Expression = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Point", @TypeImage = "Point"] + | | +- ArgumentList[@Empty = false, @Size = 2] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "y", @Name = "y", @ParenthesisDepth = 0, @Parenthesized = false] + | +- WhileStatement[] + | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.GE, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "size", @MethodName = "size", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ArgumentList[@Empty = true, @Size = 0] + | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3] + | +- Block[@Empty = false, @Size = 4, @containsComment = false] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- VariableDeclarator[@Initializer = true, @Name = "x"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "x", @LambdaParameter = false, @LocalVariable = true, @Name = "x", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = true, @VariableName = "x", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "remove", @MethodName = "remove", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- VariableDeclarator[@Initializer = true, @Name = "_"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "_", @LambdaParameter = false, @LocalVariable = true, @Name = "_", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = true, @VariableName = "_", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "remove", @MethodName = "remove", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- VariableDeclarator[@Initializer = true, @Name = "_"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "_", @LambdaParameter = false, @LocalVariable = true, @Name = "_", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = true, @VariableName = "_", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "remove", @MethodName = "remove", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- ModifierList[] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Point", @TypeImage = "Point"] + | +- VariableDeclarator[@Initializer = true, @Name = "p"] + | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "p", @LambdaParameter = false, @LocalVariable = true, @Name = "p", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "p", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @Expression = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Point", @TypeImage = "Point"] + | +- ArgumentList[@Empty = false, @Size = 2] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] + | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] + +- ClassOrInterfaceDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep443_UnamedPatternsAndVariables$ScopedContext", @CanonicalName = "Jep443_UnamedPatternsAndVariables.ScopedContext", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Image = "ScopedContext", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "ScopedContext", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- ImplementsList[@Empty = false, @Size = 1] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "AutoCloseable", @TypeImage = "AutoCloseable"] + | +- ClassOrInterfaceBody[@Empty = false, @Size = 2] + | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "close", @MainMethod = false, @MethodName = "close", @Name = "close", @Native = false, @Overridden = true, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = true, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true, @Volatile = false] + | | +- ModifierList[] + | | | +- Annotation[@AnnotationName = "Override", @SimpleName = "Override"] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Override", @TypeImage = "Override"] + | | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | | +- FormalParameters[@Empty = true, @Size = 0] + | | +- Block[@Empty = true, @Size = 0, @containsComment = false] + | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "acquire", @MainMethod = false, @MethodName = "acquire", @Name = "acquire", @Native = false, @Overridden = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = true, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false, @Volatile = false] + | +- ModifierList[] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "ScopedContext", @TypeImage = "ScopedContext"] + | +- FormalParameters[@Empty = true, @Size = 0] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ReturnStatement[] + | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @Expression = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "ScopedContext", @TypeImage = "ScopedContext"] + | +- ArgumentList[@Empty = true, @Size = 0] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "unusedVariables2", @MainMethod = false, @MethodName = "unusedVariables2", @Name = "unusedVariables2", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + +- ModifierList[] + +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + +- FormalParameters[@Empty = true, @Size = 0] + +- Block[@Empty = false, @Size = 4, @containsComment = false] + +- TryStatement[@TryWithResources = true] + | +- ResourceList[@Empty = false, @Size = 1, @TrailingSemiColon = false] + | | +- Resource[@ConciseResource = false, @StableName = "_"] + | | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = true, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- VariableDeclarator[@Initializer = true, @Name = "_"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "_", @LambdaParameter = false, @LocalVariable = true, @Name = "_", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = true, @VariableName = "_", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "acquire", @MethodName = "acquire", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "ScopedContext", @TypeImage = "ScopedContext"] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- Block[@Empty = true, @Size = 0, @containsComment = true] + +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- ModifierList[] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | +- VariableDeclarator[@Initializer = true, @Name = "s"] + | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = true, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "123", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"123\"", @IntLiteral = false, @Length = 3, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- TryStatement[@TryWithResources = false] + | +- Block[@Empty = false, @Size = 2, @containsComment = false] + | | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- ModifierList[] + | | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | | +- VariableDeclarator[@Initializer = true, @Name = "i"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = true, @Name = "i", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "i", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "parseInt", @MethodName = "parseInt", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Integer", @TypeImage = "Integer"] + | | | +- ArgumentList[@Empty = false, @Size = 1] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ExpressionStatement[] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] + | +- CatchClause[] + | | +- CatchParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Multicatch = false, @Name = "_", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "NumberFormatException", @TypeImage = "NumberFormatException"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "_", @LambdaParameter = false, @LocalVariable = false, @Name = "_", @Native = false, @PackagePrivate = true, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "_", @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | +- ExpressionStatement[] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Bad number: ", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Bad number: \"", @IntLiteral = false, @Length = 12, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] + | +- CatchClause[] + | +- CatchParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Multicatch = false, @Name = "_", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Exception", @TypeImage = "Exception"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "_", @LambdaParameter = false, @LocalVariable = false, @Name = "_", @Native = false, @PackagePrivate = true, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "_", @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "error...", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"error...\"", @IntLiteral = false, @Length = 8, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- ExpressionStatement[] + +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "collect", @MethodName = "collect", @ParenthesisDepth = 0, @Parenthesized = false] + +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "stream", @MethodName = "stream", @ParenthesisDepth = 0, @Parenthesized = false] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "of", @MethodName = "of", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "List", @TypeImage = "List"] + | | +- ArgumentList[@Empty = false, @Size = 2] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "a", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"a\"", @IntLiteral = false, @Length = 1, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "b", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"b\"", @IntLiteral = false, @Length = 1, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- ArgumentList[@Empty = true, @Size = 0] + +- ArgumentList[@Empty = false, @Size = 1] + +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "toMap", @MethodName = "toMap", @ParenthesisDepth = 0, @Parenthesized = false] + +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Collectors", @TypeImage = "Collectors"] + +- ArgumentList[@Empty = false, @Size = 2] + +- MethodReference[@CompileTimeConstant = false, @ConstructorReference = false, @Expression = true, @MethodName = "toUpperCase", @ParenthesisDepth = 0, @Parenthesized = false] + | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @Expression = true, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] + +- LambdaParameterList[@Empty = false, @Size = 1] + | +- LambdaParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "_", @LambdaParameter = true, @LocalVariable = false, @Name = "_", @Native = false, @PackagePrivate = true, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = true, @VariableName = "_", @Visibility = Visibility.V_PACKAGE, @Volatile = false] + +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "NO_DATA", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"NO_DATA\"", @IntLiteral = false, @Length = 7, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep443_UnnamedPatternsAndVariables2.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep443_UnnamedPatternsAndVariables2.java new file mode 100644 index 0000000000..7d690d41e5 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep443_UnnamedPatternsAndVariables2.java @@ -0,0 +1,26 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + + +import java.util.ArrayDeque; +import java.util.List; +import java.util.Queue; +import java.util.stream.Collectors; + +/** + * @see JEP 443: Unnamed Patterns and Variables (Preview) + */ +class Jep443_UnamedPatternsAndVariables2 { + record Point(int x, int y) { } + enum Color { RED, GREEN, BLUE } + record ColoredPoint(Point p, Color c) { } + + void unnamedPatterns1() { + ColoredPoint r = new ColoredPoint(new Point(3,4), Color.GREEN); + + if (r instanceof ColoredPoint(Point(int x, int y), _)) { + System.out.println(x + " " + y); + } + } +} diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep445_UnnamedClasses1.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep445_UnnamedClasses1.java new file mode 100644 index 0000000000..5a8891fd2f --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep445_UnnamedClasses1.java @@ -0,0 +1,13 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + + + +/** + * @see JEP 445: Unnamed Classes and Instance Main Methods (Preview) + */ + +void main() { + System.out.println("Hello World"); +} diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep445_UnnamedClasses1.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep445_UnnamedClasses1.txt new file mode 100644 index 0000000000..da108dd22a --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep445_UnnamedClasses1.txt @@ -0,0 +1,13 @@ ++- CompilationUnit[@PackageName = ""] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "main", @MainMethod = true, @MethodName = "main", @Name = "main", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + +- ModifierList[] + +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + +- FormalParameters[@Empty = true, @Size = 0] + +- Block[@Empty = false, @Size = 1, @containsComment = false] + +- ExpressionStatement[] + +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + +- ArgumentList[@Empty = false, @Size = 1] + +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Hello World", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Hello World\"", @IntLiteral = false, @Length = 11, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep445_UnnamedClasses2.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep445_UnnamedClasses2.java new file mode 100644 index 0000000000..49d30a40e1 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep445_UnnamedClasses2.java @@ -0,0 +1,15 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + + + +/** + * @see JEP 445: Unnamed Classes and Instance Main Methods (Preview) + */ + +String greeting() { return "Hello, World!"; } + +void main() { + System.out.println(greeting()); +} diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep445_UnnamedClasses2.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep445_UnnamedClasses2.txt new file mode 100644 index 0000000000..8c36735d06 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep445_UnnamedClasses2.txt @@ -0,0 +1,21 @@ ++- CompilationUnit[@PackageName = ""] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "greeting", @MainMethod = false, @MethodName = "greeting", @Name = "greeting", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false, @Volatile = false] + | +- ModifierList[] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | +- FormalParameters[@Empty = true, @Size = 0] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ReturnStatement[] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Hello, World!", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Hello, World!\"", @IntLiteral = false, @Length = 13, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "main", @MainMethod = true, @MethodName = "main", @Name = "main", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + +- ModifierList[] + +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + +- FormalParameters[@Empty = true, @Size = 0] + +- Block[@Empty = false, @Size = 1, @containsComment = false] + +- ExpressionStatement[] + +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + +- ArgumentList[@Empty = false, @Size = 1] + +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "greeting", @MethodName = "greeting", @ParenthesisDepth = 0, @Parenthesized = false] + +- ArgumentList[@Empty = true, @Size = 0] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep445_UnnamedClasses3.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep445_UnnamedClasses3.java new file mode 100644 index 0000000000..9c4fcae3f7 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep445_UnnamedClasses3.java @@ -0,0 +1,15 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + + + +/** + * @see JEP 445: Unnamed Classes and Instance Main Methods (Preview) + */ + +String greeting = "Hello, World!"; + +void main() { + System.out.println(greeting); +} diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep445_UnnamedClasses3.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep445_UnnamedClasses3.txt new file mode 100644 index 0000000000..be9ebbb6e2 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep445_UnnamedClasses3.txt @@ -0,0 +1,19 @@ ++- CompilationUnit[@PackageName = ""] + +- FieldDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @VariableName = "greeting", @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | +- VariableDeclarator[@Initializer = true, @Name = "greeting"] + | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "greeting", @LambdaParameter = false, @LocalVariable = false, @Name = "greeting", @Native = false, @PackagePrivate = true, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "greeting", @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Hello, World!", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Hello, World!\"", @IntLiteral = false, @Length = 13, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "main", @MainMethod = true, @MethodName = "main", @Name = "main", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + +- ModifierList[] + +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + +- FormalParameters[@Empty = true, @Size = 0] + +- Block[@Empty = false, @Size = 1, @containsComment = false] + +- ExpressionStatement[] + +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + +- ArgumentList[@Empty = false, @Size = 1] + +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "greeting", @Name = "greeting", @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/cpd/testdata/SimpleClass.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/cpd/testdata/SimpleClass.java new file mode 100644 index 0000000000..a0fa77af5c --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/cpd/testdata/SimpleClass.java @@ -0,0 +1,8 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +public class SimpleClass { + private int field; + private void method() {} +} diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/cpd/testdata/SimpleClass.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/cpd/testdata/SimpleClass.txt new file mode 100644 index 0000000000..6cde72e28e --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/cpd/testdata/SimpleClass.txt @@ -0,0 +1,21 @@ + [Image] or [Truncated image[ Bcol Ecol +L5 + [public] 1 7 + [class] 8 13 + [SimpleClass] 14 25 + [{] 26 27 +L6 + [private] 5 12 + [int] 13 16 + [field] 17 22 +L7 + [private] 5 12 + [void] 13 17 + [method] 18 24 + [(] 24 25 + [)] 25 26 + [{] 27 28 + [}] 28 29 +L8 + [}] 1 2 +EOF diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/cpd/testdata/StringTemplateReduction.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/cpd/testdata/StringTemplateReduction.java new file mode 100644 index 0000000000..c50907e03b --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/cpd/testdata/StringTemplateReduction.java @@ -0,0 +1,21 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +/** + * This is part of Java 21 Preview: String Templates. + * When tokenizing and reducing the input characters to the tokens, a "}" is ambiguous + * and can only be decided when taking the syntactic structure of the code into account. + * Otherwise a "}" might be recognized as the start of a STRING_TEMPLATE_END token. + * + * @see JEP 430: String Templates (Preview) + */ +class StringTemplateReduction { + boolean isRuleName(Object o) { + if (o != null) { + return true; + } else if (o.equals("ref")) { // might be wrongly tokenized as STRING_TEMPLATE_END + return false; + } + } +} diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/cpd/testdata/StringTemplateReduction.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/cpd/testdata/StringTemplateReduction.txt new file mode 100644 index 0000000000..374b95fd54 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/cpd/testdata/StringTemplateReduction.txt @@ -0,0 +1,47 @@ + [Image] or [Truncated image[ Bcol Ecol +L13 + [class] 1 6 + [StringTemplateReduction] 7 30 + [{] 31 32 +L14 + [boolean] 5 12 + [isRuleName] 13 23 + [(] 23 24 + [Object] 24 30 + [o] 31 32 + [)] 32 33 + [{] 34 35 +L15 + [if] 9 11 + [(] 12 13 + [o] 13 14 + [!=] 15 17 + [null] 18 22 + [)] 22 23 + [{] 24 25 +L16 + [return] 13 19 + [true] 20 24 +L17 + [}] 9 10 + [else] 11 15 + [if] 16 18 + [(] 19 20 + [o] 20 21 + [.] 21 22 + [equals] 22 28 + [(] 28 29 + ["ref"] 29 34 + [)] 34 35 + [)] 35 36 + [{] 37 38 +L18 + [return] 13 19 + [false] 20 25 +L19 + [}] 9 10 +L20 + [}] 5 6 +L21 + [}] 1 2 +EOF diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/cpd/testdata/StringTemplateReduction2.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/cpd/testdata/StringTemplateReduction2.java new file mode 100644 index 0000000000..803c213ca7 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/cpd/testdata/StringTemplateReduction2.java @@ -0,0 +1,16 @@ +/** + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +/** + * This is part of Java 21 Preview: String Templates. + * The tokenizer needs to use a java version. We chose the latest here, + * then the assert statement is correctly recognized. + * + * @see JEP 430: String Templates (Preview) + */ +class StringTemplateReduction2 { + { + assert foo.equals(bar); + } +} diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/cpd/testdata/StringTemplateReduction2.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/cpd/testdata/StringTemplateReduction2.txt new file mode 100644 index 0000000000..1e40f80a18 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/cpd/testdata/StringTemplateReduction2.txt @@ -0,0 +1,20 @@ + [Image] or [Truncated image[ Bcol Ecol +L12 + [class] 1 6 + [StringTemplateReduction2] 7 31 + [{] 32 33 +L13 + [{] 5 6 +L14 + [assert] 9 15 + [foo] 16 19 + [.] 19 20 + [equals] 20 26 + [(] 26 27 + [bar] 27 30 + [)] 30 31 +L15 + [}] 5 6 +L16 + [}] 1 2 +EOF diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/UseTryWithResources.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/UseTryWithResources.xml index 2f3dab0ddd..8134eae1bc 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/UseTryWithResources.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/UseTryWithResources.xml @@ -182,13 +182,13 @@ public class TryWithResources { + + + + #4578 failure with comment after annotation + 0 + diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UseExplicitTypes.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UseExplicitTypes.xml new file mode 100644 index 0000000000..122283e4d5 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UseExplicitTypes.xml @@ -0,0 +1,48 @@ + + + + quadrat = (var x) -> x*x; + } + + private String getFoo() { + return "a"; + } +} +]]> + + + No vars anywhere + 4 + 5,6,8,9 + + + + + Allow literals + true + 2 + 8,9 + + + + + Allow constructor calls + true + 3 + 5,6,8 + + + diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/CloseResource.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/CloseResource.xml index 9921cdbf96..a59b5d0be1 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/CloseResource.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/CloseResource.xml @@ -1133,7 +1133,7 @@ public class CloseResourceJMS { - CloseResource for closable - ignored if the types do not contain AutoClosable + CloseResource for closable - ignored if the types do not contain AutoCloseable java.sql.Connection,java.sql.Statement,java.sql.ResultSet 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + - 4.6.0 + 4.8.11 diff --git a/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/ast/ASTMemberParamClauseGroup.java b/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/ast/ASTMemberParamClauseGroup.java new file mode 100644 index 0000000000..0ef6b67e2e --- /dev/null +++ b/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/ast/ASTMemberParamClauseGroup.java @@ -0,0 +1,22 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +package net.sourceforge.pmd.lang.scala.ast; + +import scala.meta.Member; + +/** + * The ASTMemberParamClauseGroup node implementation. + */ +public final class ASTMemberParamClauseGroup extends AbstractScalaNode { + + ASTMemberParamClauseGroup(Member.ParamClauseGroup scalaNode) { + super(scalaNode); + } + + @Override + protected R acceptVisitor(ScalaParserVisitor visitor, P data) { + return visitor.visit(this, data); + } +} diff --git a/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/ast/ASTPatArgClause.java b/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/ast/ASTPatArgClause.java new file mode 100644 index 0000000000..3344e572f9 --- /dev/null +++ b/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/ast/ASTPatArgClause.java @@ -0,0 +1,22 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +package net.sourceforge.pmd.lang.scala.ast; + +import scala.meta.Pat; + +/** + * The ASTPatArgClause node implementation. + */ +public final class ASTPatArgClause extends AbstractScalaNode { + + ASTPatArgClause(Pat.ArgClause scalaNode) { + super(scalaNode); + } + + @Override + protected R acceptVisitor(ScalaParserVisitor visitor, P data) { + return visitor.visit(this, data); + } +} diff --git a/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/ast/ASTTermArgClause.java b/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/ast/ASTTermArgClause.java new file mode 100644 index 0000000000..68df06adcf --- /dev/null +++ b/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/ast/ASTTermArgClause.java @@ -0,0 +1,22 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +package net.sourceforge.pmd.lang.scala.ast; + +import scala.meta.Term; + +/** + * The ASTTermArgClause node implementation. + */ +public final class ASTTermArgClause extends AbstractScalaNode { + + ASTTermArgClause(Term.ArgClause scalaNode) { + super(scalaNode); + } + + @Override + protected R acceptVisitor(ScalaParserVisitor visitor, P data) { + return visitor.visit(this, data); + } +} diff --git a/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/ast/ASTTermParamClause.java b/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/ast/ASTTermParamClause.java new file mode 100644 index 0000000000..6cf316d3d7 --- /dev/null +++ b/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/ast/ASTTermParamClause.java @@ -0,0 +1,22 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +package net.sourceforge.pmd.lang.scala.ast; + +import scala.meta.Term; + +/** + * The ASTTermParamClause node implementation. + */ +public final class ASTTermParamClause extends AbstractScalaNode { + + ASTTermParamClause(Term.ParamClause scalaNode) { + super(scalaNode); + } + + @Override + protected R acceptVisitor(ScalaParserVisitor visitor, P data) { + return visitor.visit(this, data); + } +} diff --git a/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/ast/ASTTypeArgClause.java b/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/ast/ASTTypeArgClause.java new file mode 100644 index 0000000000..94b2e38707 --- /dev/null +++ b/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/ast/ASTTypeArgClause.java @@ -0,0 +1,22 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +package net.sourceforge.pmd.lang.scala.ast; + +import scala.meta.Type; + +/** + * The ASTTypeArgClause node implementation. + */ +public final class ASTTypeArgClause extends AbstractScalaNode { + + ASTTypeArgClause(Type.ArgClause scalaNode) { + super(scalaNode); + } + + @Override + protected R acceptVisitor(ScalaParserVisitor visitor, P data) { + return visitor.visit(this, data); + } +} diff --git a/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/ast/ASTTypeFuncParamClause.java b/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/ast/ASTTypeFuncParamClause.java new file mode 100644 index 0000000000..9b22266984 --- /dev/null +++ b/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/ast/ASTTypeFuncParamClause.java @@ -0,0 +1,22 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +package net.sourceforge.pmd.lang.scala.ast; + +import scala.meta.Type; + +/** + * The ASTTypeFuncParamClause node implementation. + */ +public final class ASTTypeFuncParamClause extends AbstractScalaNode { + + ASTTypeFuncParamClause(Type.FuncParamClause scalaNode) { + super(scalaNode); + } + + @Override + protected R acceptVisitor(ScalaParserVisitor visitor, P data) { + return visitor.visit(this, data); + } +} diff --git a/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/ast/ASTTypeParamClause.java b/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/ast/ASTTypeParamClause.java new file mode 100644 index 0000000000..54538f0f86 --- /dev/null +++ b/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/ast/ASTTypeParamClause.java @@ -0,0 +1,22 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +package net.sourceforge.pmd.lang.scala.ast; + +import scala.meta.Type; + +/** + * The ASTTypeParamClause node implementation. + */ +public final class ASTTypeParamClause extends AbstractScalaNode { + + ASTTypeParamClause(Type.ParamClause scalaNode) { + super(scalaNode); + } + + @Override + protected R acceptVisitor(ScalaParserVisitor visitor, P data) { + return visitor.visit(this, data); + } +} diff --git a/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/ast/ScalaTreeBuilder.java b/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/ast/ScalaTreeBuilder.java index 39f4f09301..3c8c96c7c1 100644 --- a/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/ast/ScalaTreeBuilder.java +++ b/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/ast/ScalaTreeBuilder.java @@ -21,6 +21,7 @@ import scala.meta.Importee; import scala.meta.Importer; import scala.meta.Init; import scala.meta.Lit; +import scala.meta.Member; import scala.meta.Mod; import scala.meta.Name; import scala.meta.Pat; @@ -79,6 +80,7 @@ class ScalaTreeBuilder { register(Lit.String.class, ASTLitString.class); register(Lit.Symbol.class, ASTLitSymbol.class); register(Lit.Unit.class, ASTLitUnit.class); + register(Member.ParamClauseGroup.class, ASTMemberParamClauseGroup.class); register(Mod.Abstract.class, ASTModAbstract.class); register(Mod.Annot.class, ASTModAnnot.class); register(Mod.Case.class, ASTModCase.class); @@ -97,6 +99,7 @@ class ScalaTreeBuilder { register(Name.Anonymous.class, ASTNameAnonymous.class); register(Name.Indeterminate.class, ASTNameIndeterminate.class); register(Pat.Alternative.class, ASTPatAlternative.class); + register(Pat.ArgClause.class, ASTPatArgClause.class); register(Pat.Bind.class, ASTPatBind.class); register(Pat.Extract.class, ASTPatExtract.class); register(Pat.ExtractInfix.class, ASTPatExtractInfix.class); @@ -118,6 +121,7 @@ class ScalaTreeBuilder { register(Term.ApplyInfix.class, ASTTermApplyInfix.class); register(Term.ApplyType.class, ASTTermApplyType.class); register(Term.ApplyUnary.class, ASTTermApplyUnary.class); + register(Term.ArgClause.class, ASTTermArgClause.class); register(Term.Ascribe.class, ASTTermAscribe.class); register(Term.Assign.class, ASTTermAssign.class); register(Term.Block.class, ASTTermBlock.class); @@ -133,6 +137,7 @@ class ScalaTreeBuilder { register(Term.NewAnonymous.class, ASTTermNewAnonymous.class); register(Term.New.class, ASTTermNew.class); register(Term.Param.class, ASTTermParam.class); + register(Term.ParamClause.class, ASTTermParamClause.class); register(Term.PartialFunction.class, ASTTermPartialFunction.class); register(Term.Placeholder.class, ASTTermPlaceholder.class); register(Term.Repeated.class, ASTTermRepeated.class); @@ -150,9 +155,11 @@ class ScalaTreeBuilder { register(Type.Annotate.class, ASTTypeAnnotate.class); register(Type.Apply.class, ASTTypeApply.class); register(Type.ApplyInfix.class, ASTTypeApplyInfix.class); + register(Type.ArgClause.class, ASTTypeArgClause.class); register(Type.Bounds.class, ASTTypeBounds.class); register(Type.ByName.class, ASTTypeByName.class); register(Type.Existential.class, ASTTypeExistential.class); + register(Type.FuncParamClause.class, ASTTypeFuncParamClause.class); register(Type.Function.class, ASTTypeFunction.class); register(Type.ImplicitFunction.class, ASTTypeImplicitFunction.class); register(Type.Lambda.class, ASTTypeLambda.class); @@ -160,6 +167,7 @@ class ScalaTreeBuilder { register(Type.Name.class, ASTTypeName.class); register(Type.Or.class, ASTTypeOr.class); register(Type.Param.class, ASTTypeParam.class); + register(Type.ParamClause.class, ASTTypeParamClause.class); register(Type.Placeholder.class, ASTTypePlaceholder.class); register(Type.Project.class, ASTTypeProject.class); register(Type.Refine.class, ASTTypeRefine.class); diff --git a/pmd-scala-modules/pmd-scala-common/src/main/resources/category/scala/bestpractices.xml b/pmd-scala-modules/pmd-scala-common/src/main/resources/category/scala/bestpractices.xml index 58e7fd43a3..126b820901 100644 --- a/pmd-scala-modules/pmd-scala-common/src/main/resources/category/scala/bestpractices.xml +++ b/pmd-scala-modules/pmd-scala-common/src/main/resources/category/scala/bestpractices.xml @@ -1,4 +1,4 @@ - + + + + + + xmlns="http://pmd.sourceforge.net/ruleset/2.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd"> - + Rules to detect constructs that are either broken, extremely confusing or prone to runtime errors. - - diff --git a/pmd-scala-modules/pmd-scala-common/src/main/resources/category/scala/multithreading.xml b/pmd-scala-modules/pmd-scala-common/src/main/resources/category/scala/multithreading.xml index 88c22dfc8b..0681a5d987 100644 --- a/pmd-scala-modules/pmd-scala-common/src/main/resources/category/scala/multithreading.xml +++ b/pmd-scala-modules/pmd-scala-common/src/main/resources/category/scala/multithreading.xml @@ -1,4 +1,4 @@ - + + + { + it.assertPosition(bline = 1, bcol = 11, eline = 1, ecol = 11) // node has zero length + it::isImplicit shouldBe true + } + child { it.assertPosition(bline = 1, bcol = 11, eline = 1, ecol = 11) // node has zero length it::isImplicit shouldBe true diff --git a/pmd-scala-modules/pmd-scala-common/src/test/resources/net/sourceforge/pmd/lang/scala/ast/testdata/List.txt b/pmd-scala-modules/pmd-scala-common/src/test/resources/net/sourceforge/pmd/lang/scala/ast/testdata/List.txt index 52f77880f0..18a538a8ff 100644 --- a/pmd-scala-modules/pmd-scala-common/src/test/resources/net/sourceforge/pmd/lang/scala/ast/testdata/List.txt +++ b/pmd-scala-modules/pmd-scala-common/src/test/resources/net/sourceforge/pmd/lang/scala/ast/testdata/List.txt @@ -51,59 +51,71 @@ | | +- Init | | +- TypeName | | +- NameAnonymous - | | +- LitLong + | | +- TermArgClause + | | +- LitLong | +- ModSealed | +- ModAbstract | +- TypeName - | +- TypeParam - | | +- ModCovariant - | | +- TypeName - | | +- TypeBounds + | +- TypeParamClause + | | +- TypeParam + | | +- ModCovariant + | | +- TypeName + | | +- TypeParamClause + | | +- TypeBounds | +- CtorPrimary | | +- NameAnonymous | +- Template | +- Init | | +- TypeApply | | | +- TypeName - | | | +- TypeName - | | +- NameAnonymous - | +- Init - | | +- TypeApply - | | | +- TypeName - | | | +- TypeName - | | +- NameAnonymous - | +- Init - | | +- TypeApply - | | | +- TypeName - | | | +- TypeName - | | | +- TypeName - | | | +- TypeApply - | | | +- TypeName + | | | +- TypeArgClause | | | +- TypeName | | +- NameAnonymous | +- Init | | +- TypeApply | | | +- TypeName - | | | +- TypeName - | | | +- TypeName - | | | +- TypeApply - | | | +- TypeName + | | | +- TypeArgClause | | | +- TypeName | | +- NameAnonymous | +- Init | | +- TypeApply | | | +- TypeName - | | | +- TypeName - | | | +- TypeName - | | | +- TypeApply + | | | +- TypeArgClause | | | +- TypeName | | | +- TypeName + | | | +- TypeApply + | | | +- TypeName + | | | +- TypeArgClause + | | | +- TypeName | | +- NameAnonymous | +- Init | | +- TypeApply | | | +- TypeName + | | | +- TypeArgClause + | | | +- TypeName + | | | +- TypeName + | | | +- TypeApply + | | | +- TypeName + | | | +- TypeArgClause + | | | +- TypeName + | | +- NameAnonymous + | +- Init + | | +- TypeApply | | | +- TypeName + | | | +- TypeArgClause + | | | +- TypeName + | | | +- TypeName + | | | +- TypeApply + | | | +- TypeName + | | | +- TypeArgClause + | | | +- TypeName + | | +- NameAnonymous + | +- Init + | | +- TypeApply | | | +- TypeName + | | | +- TypeArgClause + | | | +- TypeName + | | | +- TypeName | | +- NameAnonymous | +- Init | | +- TypeName @@ -115,25 +127,34 @@ | | +- TermName | | +- TypeApply | | | +- TypeName - | | | +- TypeName + | | | +- TypeArgClause + | | | +- TypeName | | +- TermName | +- DefnDef | | +- ModOverride | | +- TermName - | | +- TermParam - | | | +- TermName - | | | +- TypeName + | | +- MemberParamClauseGroup + | | | +- TypeParamClause + | | | +- TermParamClause + | | | +- TermParam + | | | +- TermName + | | | +- TypeName | | +- TypeApply | | | +- TypeName - | | | +- TypeName + | | | +- TypeArgClause + | | | +- TypeName | | +- TermIf | | +- TermApplyInfix | | | +- TermName | | | +- TermName - | | | +- TermApplyInfix - | | | +- TermName - | | | +- TermName - | | | +- LitInt + | | | +- TypeArgClause + | | | +- TermArgClause + | | | +- TermApplyInfix + | | | +- TermName + | | | +- TermName + | | | +- TypeArgClause + | | | +- TermArgClause + | | | +- LitInt | | +- TermName | | +- TermBlock | | +- DefnVal @@ -143,8 +164,9 @@ | | | +- Init | | | +- TypeName | | | +- NameAnonymous - | | | +- TermName - | | | +- TermName + | | | +- TermArgClause + | | | +- TermName + | | | +- TermName | | +- DefnVar | | | +- PatVar | | | | +- TermName @@ -170,12 +192,16 @@ | | | | +- TermApplyInfix | | | | +- TermName | | | | +- TermName - | | | | +- TermName + | | | | +- TypeArgClause + | | | | +- TermArgClause + | | | | +- TermName | | | +- TermBlock | | | +- TermApplyInfix | | | | +- TermName | | | | +- TermName - | | | | +- LitInt + | | | | +- TypeArgClause + | | | | +- TermArgClause + | | | | +- LitInt | | | +- DefnVal | | | | +- PatVar | | | | | +- TermName @@ -183,10 +209,11 @@ | | | | +- Init | | | | +- TypeName | | | | +- NameAnonymous - | | | | +- TermSelect - | | | | | +- TermName - | | | | | +- TermName - | | | | +- TermName + | | | | +- TermArgClause + | | | | +- TermSelect + | | | | | +- TermName + | | | | | +- TermName + | | | | +- TermName | | | +- TermAssign | | | | +- TermSelect | | | | | +- TermName @@ -202,19 +229,24 @@ | | | +- TermName | | +- TermApply | | | +- TermName + | | | +- TermArgClause | | +- TermName | +- DefnDef | | +- ModOverride | | +- TermName - | | +- TermParam - | | | +- TermName - | | | +- TypeName - | | +- TermParam - | | | +- TermName - | | | +- TypeName + | | +- MemberParamClauseGroup + | | | +- TypeParamClause + | | | +- TermParamClause + | | | +- TermParam + | | | | +- TermName + | | | | +- TypeName + | | | +- TermParam + | | | +- TermName + | | | +- TypeName | | +- TypeApply | | | +- TypeName - | | | +- TypeName + | | | +- TypeArgClause + | | | +- TypeName | | +- TermBlock | | +- DefnVal | | | +- PatVar @@ -225,37 +257,52 @@ | | | | | +- TermName | | | | | +- TermName | | | | +- TermName - | | | +- TermName - | | | +- LitInt + | | | +- TermArgClause + | | | +- TermName + | | | +- LitInt | | +- TermIf | | +- TermApplyInfix | | | +- TermApplyInfix | | | | +- TermName | | | | +- TermName - | | | | +- TermName - | | | +- TermName + | | | | +- TypeArgClause + | | | | +- TermArgClause + | | | | +- TermName | | | +- TermName + | | | +- TypeArgClause + | | | +- TermArgClause + | | | +- TermName | | +- TermName | | +- TermApplyInfix | | +- TermApplyInfix | | | +- TermThis | | | | +- NameAnonymous | | | +- TermName - | | | +- TermName + | | | +- TypeArgClause + | | | +- TermArgClause + | | | +- TermName | | +- TermName - | | +- TermApplyInfix - | | +- TermName - | | +- TermName - | | +- TermName + | | +- TypeArgClause + | | +- TermArgClause + | | +- TermApplyInfix + | | +- TermName + | | +- TermName + | | +- TypeArgClause + | | +- TermArgClause + | | +- TermName | +- DefnDef | | +- ModOverride | | +- TermName - | | +- TermParam - | | | +- TermName - | | | +- TypeName + | | +- MemberParamClauseGroup + | | | +- TypeParamClause + | | | +- TermParamClause + | | | +- TermParam + | | | +- TermName + | | | +- TypeName | | +- TypeApply | | | +- TypeName - | | | +- TypeName + | | | +- TypeArgClause + | | | +- TypeName | | +- TermBlock | | +- DefnDef | | | +- ModAnnot @@ -263,19 +310,25 @@ | | | | +- TypeName | | | | +- NameAnonymous | | | +- TermName - | | | +- TermParam - | | | | +- TermName - | | | | +- TypeApply - | | | | +- TypeName - | | | | +- TypeName - | | | +- TermParam - | | | | +- TermName - | | | | +- TypeApply - | | | | +- TypeName - | | | | +- TypeName + | | | +- MemberParamClauseGroup + | | | | +- TypeParamClause + | | | | +- TermParamClause + | | | | +- TermParam + | | | | | +- TermName + | | | | | +- TypeApply + | | | | | +- TypeName + | | | | | +- TypeArgClause + | | | | | +- TypeName + | | | | +- TermParam + | | | | +- TermName + | | | | +- TypeApply + | | | | +- TypeName + | | | | +- TypeArgClause + | | | | +- TypeName | | | +- TypeApply | | | | +- TypeName - | | | | +- TypeName + | | | | +- TypeArgClause + | | | | +- TypeName | | | +- TermMatch | | | +- TermName | | | +- Case @@ -285,34 +338,43 @@ | | | +- PatExtractInfix | | | | +- PatWildcard | | | | +- TermName - | | | | +- PatVar - | | | | +- TermName + | | | | +- PatArgClause + | | | | +- PatVar + | | | | +- TermName | | | +- TermApply | | | +- TermName - | | | +- TermName - | | | +- TermSelect - | | | +- TermName + | | | +- TermArgClause | | | +- TermName + | | | +- TermSelect + | | | +- TermName + | | | +- TermName | | +- TermApply | | +- TermName - | | +- TermApply - | | | +- TermName - | | | +- TermName - | | +- TermThis - | | +- NameAnonymous + | | +- TermArgClause + | | +- TermApply + | | | +- TermName + | | | +- TermArgClause + | | | +- TermName + | | +- TermThis + | | +- NameAnonymous | +- DefnDef | | +- ModOverride | | +- TermName - | | +- TermParam - | | | +- TermName - | | | +- TypeName + | | +- MemberParamClauseGroup + | | | +- TypeParamClause + | | | +- TermParamClause + | | | +- TermParam + | | | +- TermName + | | | +- TypeName | | +- TypeTuple | | | +- TypeApply | | | | +- TypeName - | | | | +- TypeName + | | | | +- TypeArgClause + | | | | +- TypeName | | | +- TypeApply | | | +- TypeName - | | | +- TypeName + | | | +- TypeArgClause + | | | +- TypeName | | +- TermBlock | | +- DefnVal | | | +- PatVar @@ -321,7 +383,8 @@ | | | +- Init | | | +- TypeApply | | | | +- TypeName - | | | | +- TypeName + | | | | +- TypeArgClause + | | | | +- TypeName | | | +- NameAnonymous | | +- DefnVar | | | +- PatVar @@ -340,21 +403,29 @@ | | | | | +- TermName | | | | | +- TermName | | | | +- TermName - | | | | +- TermApplyInfix - | | | | +- TermName - | | | | +- TermName - | | | | +- TermName + | | | | +- TypeArgClause + | | | | +- TermArgClause + | | | | +- TermApplyInfix + | | | | +- TermName + | | | | +- TermName + | | | | +- TypeArgClause + | | | | +- TermArgClause + | | | | +- TermName | | | +- TermBlock | | | +- TermApplyInfix | | | | +- TermName | | | | +- TermName - | | | | +- LitInt + | | | | +- TypeArgClause + | | | | +- TermArgClause + | | | | +- LitInt | | | +- TermApplyInfix | | | | +- TermName | | | | +- TermName - | | | | +- TermSelect - | | | | +- TermName - | | | | +- TermName + | | | | +- TypeArgClause + | | | | +- TermArgClause + | | | | +- TermSelect + | | | | +- TermName + | | | | +- TermName | | | +- TermAssign | | | +- TermName | | | +- TermSelect @@ -368,19 +439,24 @@ | +- DefnDef | | +- ModOverride | | +- TermName - | | +- TypeParam - | | | +- TypeName - | | | +- TypeBounds - | | | +- TypeName - | | +- TermParam - | | | +- TermName - | | | +- TypeName - | | +- TermParam - | | | +- TermName - | | | +- TypeName + | | +- MemberParamClauseGroup + | | | +- TypeParamClause + | | | | +- TypeParam + | | | | +- TypeName + | | | | +- TypeParamClause + | | | | +- TypeBounds + | | | | +- TypeName + | | | +- TermParamClause + | | | +- TermParam + | | | | +- TermName + | | | | +- TypeName + | | | +- TermParam + | | | +- TermName + | | | +- TypeName | | +- TypeApply | | | +- TypeName - | | | +- TypeName + | | | +- TypeArgClause + | | | +- TypeName | | +- TermBlock | | +- DefnVar | | | +- PatVar @@ -398,28 +474,37 @@ | | | +- TermSelect | | | | +- TermName | | | | +- TermName - | | | +- TypeName + | | | +- TypeArgClause + | | | +- TypeName | | +- TermWhile | | | +- TermApplyInfix | | | | +- TermApplyInfix | | | | | +- TermName | | | | | +- TermName - | | | | | +- TermName + | | | | | +- TypeArgClause + | | | | | +- TermArgClause + | | | | | +- TermName | | | | +- TermName - | | | | +- TermSelect - | | | | +- TermName - | | | | +- TermName + | | | | +- TypeArgClause + | | | | +- TermArgClause + | | | | +- TermSelect + | | | | +- TermName + | | | | +- TermName | | | +- TermBlock | | | +- TermApplyInfix | | | | +- TermName | | | | +- TermName - | | | | +- LitInt + | | | | +- TypeArgClause + | | | | +- TermArgClause + | | | | +- LitInt | | | +- TermApplyInfix | | | | +- TermName | | | | +- TermName - | | | | +- TermSelect - | | | | +- TermName - | | | | +- TermName + | | | | +- TypeArgClause + | | | | +- TermArgClause + | | | | +- TermSelect + | | | | +- TermName + | | | | +- TermName | | | +- TermAssign | | | +- TermName | | | +- TermSelect @@ -430,63 +515,83 @@ | | | +- TermApplyInfix | | | | +- TermName | | | | +- TermName - | | | | +- TermName + | | | | +- TypeArgClause + | | | | +- TermArgClause + | | | | +- TermName | | | +- TermName - | | | +- TermSelect - | | | +- TermName - | | | +- TermName + | | | +- TypeArgClause + | | | +- TermArgClause + | | | +- TermSelect + | | | +- TermName + | | | +- TermName | | +- TermBlock | | | +- TermApply | | | +- TermSelect | | | | +- TermName | | | | +- TermName - | | | +- TermApplyInfix - | | | +- TermName - | | | +- TermName - | | | +- TermSelect + | | | +- TermArgClause + | | | +- TermApplyInfix | | | +- TermName | | | +- TermName + | | | +- TypeArgClause + | | | +- TermArgClause + | | | +- TermSelect + | | | +- TermName + | | | +- TermName | | +- TermBlock | | +- TermThrow | | +- TermNew | | +- Init | | +- TypeName | | +- NameAnonymous - | | +- TermInterpolate - | | +- TermName - | | +- LitString - | | +- LitString - | | +- LitString - | | +- TermName - | | +- TermApplyInfix + | | +- TermArgClause + | | +- TermInterpolate | | +- TermName + | | +- LitString + | | +- LitString + | | +- LitString | | +- TermName | | +- TermApplyInfix | | +- TermName | | +- TermName - | | +- LitInt + | | +- TypeArgClause + | | +- TermArgClause + | | +- TermApplyInfix + | | +- TermName + | | +- TermName + | | +- TypeArgClause + | | +- TermArgClause + | | +- LitInt | +- DefnDef | | +- ModFinal | | +- ModOverride | | +- TermName - | | +- TypeParam - | | | +- TypeName - | | | +- TypeBounds - | | +- TermParam - | | | +- TermName - | | | +- TypeFunction - | | | +- TypeName - | | | +- TypeName + | | +- MemberParamClauseGroup + | | | +- TypeParamClause + | | | | +- TypeParam + | | | | +- TypeName + | | | | +- TypeParamClause + | | | | +- TypeBounds + | | | +- TermParamClause + | | | +- TermParam + | | | +- TermName + | | | +- TypeFunction + | | | +- TypeFuncParamClause + | | | | +- TypeName + | | | +- TypeName | | +- TypeApply | | | +- TypeName - | | | +- TypeName + | | | +- TypeArgClause + | | | +- TypeName | | +- TermBlock | | +- TermIf | | +- TermApplyInfix | | | +- TermThis | | | | +- NameAnonymous | | | +- TermName - | | | +- TermName + | | | +- TypeArgClause + | | | +- TermArgClause + | | | +- TermName | | +- TermName | | +- TermBlock | | +- DefnVal @@ -496,18 +601,22 @@ | | | +- Init | | | +- TypeApply | | | | +- TypeName - | | | | +- TypeName + | | | | +- TypeArgClause + | | | | +- TypeName | | | +- NameAnonymous - | | | +- TermApply - | | | | +- TermName - | | | | +- TermName - | | | +- TermName + | | | +- TermArgClause + | | | +- TermApply + | | | | +- TermName + | | | | +- TermArgClause + | | | | +- TermName + | | | +- TermName | | +- DefnVar | | | +- PatVar | | | | +- TermName | | | +- TypeApply | | | | +- TypeName - | | | | +- TypeName + | | | | +- TypeArgClause + | | | | +- TypeName | | | +- TermName | | +- DefnVar | | | +- PatVar @@ -517,7 +626,9 @@ | | | +- TermApplyInfix | | | | +- TermName | | | | +- TermName - | | | | +- TermName + | | | | +- TypeArgClause + | | | | +- TermArgClause + | | | | +- TermName | | | +- TermBlock | | | +- DefnVal | | | | +- PatVar @@ -526,12 +637,14 @@ | | | | +- Init | | | | +- TypeName | | | | +- NameAnonymous - | | | | +- TermApply - | | | | | +- TermName - | | | | | +- TermSelect - | | | | | +- TermName - | | | | | +- TermName - | | | | +- TermName + | | | | +- TermArgClause + | | | | +- TermApply + | | | | | +- TermName + | | | | | +- TermArgClause + | | | | | +- TermSelect + | | | | | +- TermName + | | | | | +- TermName + | | | | +- TermName | | | +- TermAssign | | | | +- TermSelect | | | | | +- TermName @@ -547,30 +660,39 @@ | | | +- TermName | | +- TermApply | | | +- TermName + | | | +- TermArgClause | | +- TermName | +- DefnDef | | +- ModFinal | | +- ModOverride | | +- TermName - | | +- TypeParam - | | | +- TypeName - | | | +- TypeBounds - | | +- TermParam - | | | +- TermName - | | | +- TypeApply - | | | +- TypeName - | | | +- TypeName - | | | +- TypeName + | | +- MemberParamClauseGroup + | | | +- TypeParamClause + | | | | +- TypeParam + | | | | +- TypeName + | | | | +- TypeParamClause + | | | | +- TypeBounds + | | | +- TermParamClause + | | | +- TermParam + | | | +- TermName + | | | +- TypeApply + | | | +- TypeName + | | | +- TypeArgClause + | | | +- TypeName + | | | +- TypeName | | +- TypeApply | | | +- TypeName - | | | +- TypeName + | | | +- TypeArgClause + | | | +- TypeName | | +- TermBlock | | +- TermIf | | +- TermApplyInfix | | | +- TermThis | | | | +- NameAnonymous | | | +- TermName - | | | +- TermName + | | | +- TypeArgClause + | | | +- TermArgClause + | | | +- TermName | | +- TermName | | +- TermBlock | | +- DefnVar @@ -583,7 +705,8 @@ | | | | +- TermName | | | +- TypeApply | | | | +- TypeName - | | | | +- TypeName + | | | | +- TypeArgClause + | | | | +- TypeName | | | +- LitNull | | +- DefnVar | | | +- PatVar @@ -594,7 +717,9 @@ | | | +- TermApplyInfix | | | | +- TermName | | | | +- TermName - | | | | +- LitNull + | | | | +- TypeArgClause + | | | | +- TermArgClause + | | | | +- LitNull | | | +- TermBlock | | | +- TermAssign | | | | +- TermName @@ -602,35 +727,41 @@ | | | | +- TermSelect | | | | | +- TermName | | | | | +- TermName - | | | | +- TermSelect - | | | | | +- TermName - | | | | | +- TermName - | | | | +- TermSelect - | | | | +- TermName - | | | | +- TermName + | | | | +- TermArgClause + | | | | +- TermSelect + | | | | | +- TermName + | | | | | +- TermName + | | | | +- TermSelect + | | | | +- TermName + | | | | +- TermName | | | +- TermIf | | | | +- TermApplyInfix | | | | | +- TermApplyType | | | | | | +- TermSelect | | | | | | | +- TermName | | | | | | | +- TermName - | | | | | | +- TypeName + | | | | | | +- TypeArgClause + | | | | | | +- TypeName | | | | | +- TermName - | | | | | +- TermSelect - | | | | | +- TermName - | | | | | +- TermName + | | | | | +- TypeArgClause + | | | | | +- TermArgClause + | | | | | +- TermSelect + | | | | | +- TermName + | | | | | +- TermName | | | | +- TermAssign | | | | | +- TermName | | | | | +- TermNew | | | | | +- Init | | | | | +- TypeName | | | | | +- NameAnonymous - | | | | | +- TermApplyType - | | | | | | +- TermSelect - | | | | | | | +- TermName - | | | | | | | +- TermName - | | | | | | +- TypeName - | | | | | +- TermName + | | | | | +- TermArgClause + | | | | | +- TermApplyType + | | | | | | +- TermSelect + | | | | | | | +- TermName + | | | | | | | +- TermName + | | | | | | +- TypeArgClause + | | | | | | +- TypeName + | | | | | +- TermName | | | | +- LitUnit | | | +- TermAssign | | | | +- TermName @@ -641,13 +772,17 @@ | | | +- TermApplyInfix | | | | +- TermName | | | | +- TermName - | | | | +- TermName + | | | | +- TypeArgClause + | | | | +- TermArgClause + | | | | +- TermName | | | +- TermReturn | | | | +- TermIf | | | | +- TermApplyInfix | | | | | +- TermName | | | | | +- TermName - | | | | | +- LitNull + | | | | | +- TypeArgClause + | | | | | +- TermArgClause + | | | | | +- LitNull | | | | +- TermName | | | | +- TermName | | | +- LitUnit @@ -659,7 +794,9 @@ | | | +- TermApplyInfix | | | | +- TermName | | | | +- TermName - | | | | +- TermName + | | | | +- TypeArgClause + | | | | +- TermArgClause + | | | | +- TermName | | | +- TermBlock | | | +- TermAssign | | | | +- TermName @@ -667,23 +804,27 @@ | | | | +- TermSelect | | | | | +- TermName | | | | | +- TermName - | | | | +- TermSelect - | | | | | +- TermName - | | | | | +- TermName - | | | | +- TermSelect - | | | | +- TermName - | | | | +- TermName + | | | | +- TermArgClause + | | | | +- TermSelect + | | | | | +- TermName + | | | | | +- TermName + | | | | +- TermSelect + | | | | +- TermName + | | | | +- TermName | | | +- TermIf | | | | +- TermApplyInfix | | | | | +- TermApplyType | | | | | | +- TermSelect | | | | | | | +- TermName | | | | | | | +- TermName - | | | | | | +- TypeName + | | | | | | +- TypeArgClause + | | | | | | +- TypeName | | | | | +- TermName - | | | | | +- TermSelect - | | | | | +- TermName - | | | | | +- TermName + | | | | | +- TypeArgClause + | | | | | +- TermArgClause + | | | | | +- TermSelect + | | | | | +- TermName + | | | | | +- TermName | | | | +- TermBlock | | | | | +- DefnVal | | | | | | +- PatVar @@ -692,12 +833,14 @@ | | | | | | +- Init | | | | | | +- TypeName | | | | | | +- NameAnonymous - | | | | | | +- TermApplyType - | | | | | | | +- TermSelect - | | | | | | | | +- TermName - | | | | | | | | +- TermName - | | | | | | | +- TypeName - | | | | | | +- TermName + | | | | | | +- TermArgClause + | | | | | | +- TermApplyType + | | | | | | | +- TermSelect + | | | | | | | | +- TermName + | | | | | | | | +- TermName + | | | | | | | +- TypeArgClause + | | | | | | | +- TypeName + | | | | | | +- TermName | | | | | +- TermAssign | | | | | | +- TermSelect | | | | | | | +- TermName @@ -714,24 +857,32 @@ | | | +- TermName | | +- TermApply | | | +- TermName + | | | +- TermArgClause | | +- TermName | +- DefnDef | | +- ModFinal | | +- ModOverride | | +- TermName - | | +- TypeParam - | | | +- TypeName - | | | +- TypeBounds - | | +- TermParam - | | | +- TermName - | | | +- TypeFunction - | | | +- TypeName - | | | +- TypeApply - | | | +- TypeName - | | | +- TypeName + | | +- MemberParamClauseGroup + | | | +- TypeParamClause + | | | | +- TypeParam + | | | | +- TypeName + | | | | +- TypeParamClause + | | | | +- TypeBounds + | | | +- TermParamClause + | | | +- TermParam + | | | +- TermName + | | | +- TypeFunction + | | | +- TypeFuncParamClause + | | | | +- TypeName + | | | +- TypeApply + | | | +- TypeName + | | | +- TypeArgClause + | | | +- TypeName | | +- TypeApply | | | +- TypeName - | | | +- TypeName + | | | +- TypeArgClause + | | | +- TypeName | | +- TermBlock | | +- DefnVar | | | +- PatVar @@ -743,20 +894,24 @@ | | | | +- TermName | | | +- TypeApply | | | | +- TypeName - | | | | +- TypeName + | | | | +- TypeArgClause + | | | | +- TypeName | | | +- LitNull | | +- DefnVar | | | +- PatVar | | | | +- TermName | | | +- TypeApply | | | | +- TypeName - | | | | +- TypeName + | | | | +- TypeArgClause + | | | | +- TypeName | | | +- LitNull | | +- TermWhile | | | +- TermApplyInfix | | | | +- TermName | | | | +- TermName - | | | | +- TermName + | | | | +- TypeArgClause + | | | | +- TermArgClause + | | | | +- TermName | | | +- TermBlock | | | +- DefnVal | | | | +- PatVar @@ -764,9 +919,10 @@ | | | | +- TermSelect | | | | +- TermApply | | | | | +- TermName - | | | | | +- TermSelect - | | | | | +- TermName - | | | | | +- TermName + | | | | | +- TermArgClause + | | | | | +- TermSelect + | | | | | +- TermName + | | | | | +- TermName | | | | +- TermName | | | +- TermWhile | | | | +- TermSelect @@ -780,16 +936,20 @@ | | | | | +- Init | | | | | +- TypeName | | | | | +- NameAnonymous - | | | | | +- TermApply - | | | | | | +- TermSelect - | | | | | | +- TermName - | | | | | | +- TermName - | | | | | +- TermName + | | | | | +- TermArgClause + | | | | | +- TermApply + | | | | | | +- TermSelect + | | | | | | | +- TermName + | | | | | | | +- TermName + | | | | | | +- TermArgClause + | | | | | +- TermName | | | | +- TermIf | | | | | +- TermApplyInfix | | | | | | +- TermName | | | | | | +- TermName - | | | | | | +- LitNull + | | | | | | +- TypeArgClause + | | | | | | +- TermArgClause + | | | | | | +- LitNull | | | | | +- TermBlock | | | | | | +- TermAssign | | | | | | +- TermName @@ -812,11 +972,14 @@ | | +- TermApplyInfix | | | +- TermName | | | +- TermName - | | | +- LitNull + | | | +- TypeArgClause + | | | +- TermArgClause + | | | +- LitNull | | +- TermName | | +- TermBlock | | +- TermApply | | | +- TermName + | | | +- TermArgClause | | +- TermName | +- DefnDef | | +- ModAnnot @@ -826,14 +989,19 @@ | | +- ModFinal | | +- ModOverride | | +- TermName - | | +- TermParam - | | | +- TermName - | | | +- TypeFunction - | | | +- TypeName - | | | +- TypeName + | | +- MemberParamClauseGroup + | | | +- TypeParamClause + | | | +- TermParamClause + | | | +- TermParam + | | | +- TermName + | | | +- TypeFunction + | | | +- TypeFuncParamClause + | | | | +- TypeName + | | | +- TypeName | | +- TypeApply | | | +- TypeName - | | | +- TypeName + | | | +- TypeArgClause + | | | +- TypeName | | +- TermBlock | | +- DefnVal | | | +- PatVar @@ -842,7 +1010,8 @@ | | | +- Init | | | +- TypeApply | | | | +- TypeName - | | | | +- TypeName + | | | | +- TypeArgClause + | | | | +- TypeName | | | +- NameAnonymous | | +- DefnVar | | | +- PatVar @@ -857,18 +1026,23 @@ | | | | | +- TermName | | | | | +- TermName | | | | +- TermName - | | | | +- TermApply - | | | | +- TermName - | | | | +- TermSelect - | | | | +- TermName + | | | | +- TypeArgClause + | | | | +- TermArgClause + | | | | +- TermApply | | | | +- TermName + | | | | +- TermArgClause + | | | | +- TermSelect + | | | | +- TermName + | | | | +- TermName | | | +- TermBlock | | | +- TermApplyInfix | | | | +- TermName | | | | +- TermName - | | | | +- TermSelect - | | | | +- TermName - | | | | +- TermName + | | | | +- TypeArgClause + | | | | +- TermArgClause + | | | | +- TermSelect + | | | | +- TermName + | | | | +- TermName | | | +- TermAssign | | | +- TermName | | | +- TermSelect @@ -885,18 +1059,24 @@ | | +- ModFinal | | +- ModOverride | | +- TermName - | | +- TermParam - | | | +- TermName - | | | +- TypeFunction - | | | +- TypeName - | | | +- TypeName + | | +- MemberParamClauseGroup + | | | +- TypeParamClause + | | | +- TermParamClause + | | | +- TermParam + | | | +- TermName + | | | +- TypeFunction + | | | +- TypeFuncParamClause + | | | | +- TypeName + | | | +- TypeName | | +- TypeTuple | | | +- TypeApply | | | | +- TypeName - | | | | +- TypeName + | | | | +- TypeArgClause + | | | | +- TypeName | | | +- TypeApply | | | +- TypeName - | | | +- TypeName + | | | +- TypeArgClause + | | | +- TypeName | | +- TermBlock | | +- DefnVal | | | +- PatVar @@ -905,7 +1085,8 @@ | | | +- Init | | | +- TypeApply | | | | +- TypeName - | | | | +- TypeName + | | | | +- TypeArgClause + | | | | +- TypeName | | | +- NameAnonymous | | +- DefnVar | | | +- PatVar @@ -920,18 +1101,23 @@ | | | | | +- TermName | | | | | +- TermName | | | | +- TermName - | | | | +- TermApply - | | | | +- TermName - | | | | +- TermSelect - | | | | +- TermName + | | | | +- TypeArgClause + | | | | +- TermArgClause + | | | | +- TermApply | | | | +- TermName + | | | | +- TermArgClause + | | | | +- TermSelect + | | | | +- TermName + | | | | +- TermName | | | +- TermBlock | | | +- TermApplyInfix | | | | +- TermName | | | | +- TermName - | | | | +- TermSelect - | | | | +- TermName - | | | | +- TermName + | | | | +- TypeArgClause + | | | | +- TermArgClause + | | | | +- TermSelect + | | | | +- TermName + | | | | +- TermName | | | +- TermAssign | | | +- TermName | | | +- TermSelect @@ -950,14 +1136,19 @@ | | +- ModFinal | | +- ModOverride | | +- TermName - | | +- TypeParam - | | | +- TypeName - | | | +- TypeBounds - | | +- TermParam - | | | +- TermName - | | | +- TypeFunction - | | | +- TypeName - | | | +- TypeName + | | +- MemberParamClauseGroup + | | | +- TypeParamClause + | | | | +- TypeParam + | | | | +- TypeName + | | | | +- TypeParamClause + | | | | +- TypeBounds + | | | +- TermParamClause + | | | +- TermParam + | | | +- TermName + | | | +- TypeFunction + | | | +- TypeFuncParamClause + | | | | +- TypeName + | | | +- TypeName | | +- TypeName | | +- TermBlock | | +- DefnVar @@ -974,9 +1165,10 @@ | | +- TermBlock | | +- TermApply | | | +- TermName - | | | +- TermSelect - | | | +- TermName - | | | +- TermName + | | | +- TermArgClause + | | | +- TermSelect + | | | +- TermName + | | | +- TermName | | +- TermAssign | | +- TermName | | +- TermSelect @@ -988,14 +1180,16 @@ | | +- TermName | | +- TypeApply | | | +- TypeName - | | | +- TypeName + | | | +- TypeArgClause + | | | +- TypeName | | +- TermBlock | | +- DefnVar | | | +- PatVar | | | | +- TermName | | | +- TypeApply | | | | +- TypeName - | | | | +- TypeName + | | | | +- TypeArgClause + | | | | +- TypeName | | | +- TermName | | +- DefnVar | | | +- PatVar @@ -1016,7 +1210,9 @@ | | | | | +- TermName | | | | | +- TermName | | | | +- TermName - | | | | +- TermName + | | | | +- TypeArgClause + | | | | +- TermArgClause + | | | | +- TermName | | | +- TermAssign | | | +- TermName | | | +- TermSelect @@ -1027,18 +1223,24 @@ | | +- ModFinal | | +- ModOverride | | +- TermName - | | +- TypeParam - | | | +- TypeName - | | | +- TypeBounds - | | +- TermParam - | | | +- TermName - | | | +- TypeName - | | +- TermParam - | | | +- TermName - | | | +- TypeFunction - | | | +- TypeName - | | | +- TypeName - | | | +- TypeName + | | +- MemberParamClauseGroup + | | | +- TypeParamClause + | | | | +- TypeParam + | | | | +- TypeName + | | | | +- TypeParamClause + | | | | +- TypeBounds + | | | +- TermParamClause + | | | | +- TermParam + | | | | +- TermName + | | | | +- TypeName + | | | +- TermParamClause + | | | +- TermParam + | | | +- TermName + | | | +- TypeFunction + | | | +- TypeFuncParamClause + | | | | +- TypeName + | | | | +- TypeName + | | | +- TypeName | | +- TypeName | | +- TermBlock | | +- DefnVar @@ -1050,7 +1252,8 @@ | | | | +- TermName | | | +- TypeApply | | | | +- TypeName - | | | | +- TypeName + | | | | +- TypeArgClause + | | | | +- TypeName | | | +- TermName | | +- TermWhile | | | +- TermApplyUnary @@ -1063,10 +1266,11 @@ | | | | +- TermName | | | | +- TermApply | | | | +- TermName - | | | | +- TermSelect - | | | | | +- TermName - | | | | | +- TermName - | | | | +- TermName + | | | | +- TermArgClause + | | | | +- TermSelect + | | | | | +- TermName + | | | | | +- TermName + | | | | +- TermName | | | +- TermAssign | | | +- TermName | | | +- TermSelect @@ -1098,7 +1302,9 @@ | | | +- TermApplyInfix | | | | +- TermName | | | | +- TermName - | | | | +- LitInt + | | | | +- TypeArgClause + | | | | +- TermArgClause + | | | | +- LitInt | | | +- TermAssign | | | +- TermName | | | +- TermSelect @@ -1109,9 +1315,12 @@ | | +- ModOverride | | +- ModFinal | | +- TermName - | | +- TermParam - | | | +- TermName - | | | +- TypeName + | | +- MemberParamClauseGroup + | | | +- TypeParamClause + | | | +- TermParamClause + | | | +- TermParam + | | | +- TermName + | | | +- TypeName | | +- TypeName | | +- TermBlock | | +- DefnDef @@ -1120,21 +1329,27 @@ | | | | +- TypeName | | | | +- NameAnonymous | | | +- TermName - | | | +- TermParam - | | | | +- TermName - | | | | +- TypeName - | | | +- TermParam - | | | | +- TermName - | | | | +- TypeApply - | | | | +- TypeName - | | | | +- TypeName + | | | +- MemberParamClauseGroup + | | | | +- TypeParamClause + | | | | +- TermParamClause + | | | | +- TermParam + | | | | | +- TermName + | | | | | +- TypeName + | | | | +- TermParam + | | | | +- TermName + | | | | +- TypeApply + | | | | +- TypeName + | | | | +- TypeArgClause + | | | | +- TypeName | | | +- TypeName | | | +- TermBlock | | | +- TermIf | | | +- TermApplyInfix | | | | +- TermName | | | | +- TermName - | | | | +- TermName + | | | | +- TypeArgClause + | | | | +- TermArgClause + | | | | +- TermName | | | +- TermIf | | | | +- TermSelect | | | | | +- TermName @@ -1148,32 +1363,42 @@ | | | +- LitInt | | | +- TermApply | | | +- TermName - | | | +- TermApplyInfix - | | | | +- TermName - | | | | +- TermName - | | | | +- LitInt - | | | +- TermSelect - | | | +- TermName - | | | +- TermName + | | | +- TermArgClause + | | | +- TermApplyInfix + | | | | +- TermName + | | | | +- TermName + | | | | +- TypeArgClause + | | | | +- TermArgClause + | | | | +- LitInt + | | | +- TermSelect + | | | +- TermName + | | | +- TermName | | +- TermIf | | +- TermApplyInfix | | | +- TermName | | | +- TermName - | | | +- LitInt + | | | +- TypeArgClause + | | | +- TermArgClause + | | | +- LitInt | | +- LitInt | | +- TermApply | | +- TermName - | | +- LitInt - | | +- TermName + | | +- TermArgClause + | | +- LitInt + | | +- TermName | +- DefnDef | | +- ModOverride | | +- ModFinal | | +- TermName - | | +- TermParam - | | | +- TermName - | | | +- TypeFunction - | | | +- TypeName - | | | +- TypeName + | | +- MemberParamClauseGroup + | | | +- TypeParamClause + | | | +- TermParamClause + | | | +- TermParam + | | | +- TermName + | | | +- TypeFunction + | | | +- TypeFuncParamClause + | | | | +- TypeName + | | | +- TypeName | | +- TypeName | | +- TermBlock | | +- DefnVar @@ -1181,7 +1406,8 @@ | | | | +- TermName | | | +- TypeApply | | | | +- TypeName - | | | | +- TypeName + | | | | +- TypeArgClause + | | | | +- TypeName | | | +- TermThis | | | +- NameAnonymous | | +- TermWhile @@ -1196,6 +1422,54 @@ | | | | | +- TermName | | | | | +- TermApply | | | | | +- TermName + | | | | | +- TermArgClause + | | | | | +- TermSelect + | | | | | +- TermName + | | | | | +- TermName + | | | | +- TermReturn + | | | | | +- LitBoolean + | | | | +- LitUnit + | | | +- TermAssign + | | | +- TermName + | | | +- TermSelect + | | | +- TermName + | | | +- TermName + | | +- LitBoolean + | +- DefnDef + | | +- ModOverride + | | +- ModFinal + | | +- TermName + | | +- MemberParamClauseGroup + | | | +- TypeParamClause + | | | +- TermParamClause + | | | +- TermParam + | | | +- TermName + | | | +- TypeFunction + | | | +- TypeFuncParamClause + | | | | +- TypeName + | | | +- TypeName + | | +- TypeName + | | +- TermBlock + | | +- DefnVar + | | | +- PatVar + | | | | +- TermName + | | | +- TypeApply + | | | | +- TypeName + | | | | +- TypeArgClause + | | | | +- TypeName + | | | +- TermThis + | | | +- NameAnonymous + | | +- TermWhile + | | | +- TermApplyUnary + | | | | +- TermName + | | | | +- TermSelect + | | | | +- TermName + | | | | +- TermName + | | | +- TermBlock + | | | +- TermIf + | | | | +- TermApply + | | | | | +- TermName + | | | | | +- TermArgClause | | | | | +- TermSelect | | | | | +- TermName | | | | | +- TermName @@ -1212,11 +1486,17 @@ | | +- ModOverride | | +- ModFinal | | +- TermName - | | +- TermParam - | | | +- TermName - | | | +- TypeFunction - | | | +- TypeName - | | | +- TypeName + | | +- MemberParamClauseGroup + | | | +- TypeParamClause + | | | | +- TypeParam + | | | | +- TypeName + | | | | +- TypeParamClause + | | | | +- TypeBounds + | | | | +- TypeName + | | | +- TermParamClause + | | | +- TermParam + | | | +- TermName + | | | +- TypeName | | +- TypeName | | +- TermBlock | | +- DefnVar @@ -1224,50 +1504,8 @@ | | | | +- TermName | | | +- TypeApply | | | | +- TypeName - | | | | +- TypeName - | | | +- TermThis - | | | +- NameAnonymous - | | +- TermWhile - | | | +- TermApplyUnary - | | | | +- TermName - | | | | +- TermSelect - | | | | +- TermName - | | | | +- TermName - | | | +- TermBlock - | | | +- TermIf - | | | | +- TermApply - | | | | | +- TermName - | | | | | +- TermSelect - | | | | | +- TermName - | | | | | +- TermName - | | | | +- TermReturn - | | | | | +- LitBoolean - | | | | +- LitUnit - | | | +- TermAssign - | | | +- TermName - | | | +- TermSelect - | | | +- TermName - | | | +- TermName - | | +- LitBoolean - | +- DefnDef - | | +- ModOverride - | | +- ModFinal - | | +- TermName - | | +- TypeParam - | | | +- TypeName - | | | +- TypeBounds - | | | +- TypeName - | | +- TermParam - | | | +- TermName - | | | +- TypeName - | | +- TypeName - | | +- TermBlock - | | +- DefnVar - | | | +- PatVar - | | | | +- TermName - | | | +- TypeApply - | | | | +- TypeName - | | | | +- TypeName + | | | | +- TypeArgClause + | | | | +- TypeName | | | +- TermThis | | | +- NameAnonymous | | +- TermWhile @@ -1283,7 +1521,9 @@ | | | | | | +- TermName | | | | | | +- TermName | | | | | +- TermName - | | | | | +- TermName + | | | | | +- TypeArgClause + | | | | | +- TermArgClause + | | | | | +- TermName | | | | +- TermReturn | | | | | +- LitBoolean | | | | +- LitUnit @@ -1297,21 +1537,27 @@ | +- ModOverride | +- ModFinal | +- TermName - | +- TermParam - | | +- TermName - | | +- TypeFunction - | | +- TypeName - | | +- TypeName + | +- MemberParamClauseGroup + | | +- TypeParamClause + | | +- TermParamClause + | | +- TermParam + | | +- TermName + | | +- TypeFunction + | | +- TypeFuncParamClause + | | | +- TypeName + | | +- TypeName | +- TypeApply | | +- TypeName - | | +- TypeName + | | +- TypeArgClause + | | +- TypeName | +- TermBlock | +- DefnVar | | +- PatVar | | | +- TermName | | +- TypeApply | | | +- TypeName - | | | +- TypeName + | | | +- TypeArgClause + | | | +- TypeName | | +- TermThis | | +- NameAnonymous | +- TermWhile @@ -1324,15 +1570,17 @@ | | +- TermIf | | | +- TermApply | | | | +- TermName - | | | | +- TermSelect - | | | | +- TermName - | | | | +- TermName - | | | +- TermReturn - | | | | +- TermApply - | | | | +- TermName + | | | | +- TermArgClause | | | | +- TermSelect | | | | +- TermName | | | | +- TermName + | | | +- TermReturn + | | | | +- TermApply + | | | | +- TermName + | | | | +- TermArgClause + | | | | +- TermSelect + | | | | +- TermName + | | | | +- TermName | | | +- LitUnit | | +- TermAssign | | +- TermName @@ -1344,55 +1592,64 @@ | +- ModFinal | +- ModCase | +- TypeName - | +- TypeParam - | | +- ModCovariant - | | +- TypeName - | | +- TypeBounds + | +- TypeParamClause + | | +- TypeParam + | | +- ModCovariant + | | +- TypeName + | | +- TypeParamClause + | | +- TypeBounds | +- CtorPrimary | | +- NameAnonymous - | | +- TermParam - | | | +- ModOverride - | | | +- ModValParam - | | | +- TermName - | | | +- TypeName - | | +- TermParam - | | +- ModPrivate - | | | +- NameIndeterminate - | | +- ModVarParam - | | +- TermName - | | +- TypeApply - | | +- TypeName - | | +- TypeAnnotate + | | +- TermParamClause + | | +- TermParam + | | | +- ModOverride + | | | +- ModValParam + | | | +- TermName + | | | +- TypeName + | | +- TermParam + | | +- ModPrivate + | | | +- NameIndeterminate + | | +- ModVarParam + | | +- TermName + | | +- TypeApply | | +- TypeName - | | +- ModAnnot - | | +- Init + | | +- TypeArgClause + | | +- TypeAnnotate | | +- TypeName - | | +- NameAnonymous + | | +- ModAnnot + | | +- Init + | | +- TypeName + | | +- NameAnonymous | +- Template | +- Init | | +- TypeApply | | | +- TypeName - | | | +- TypeName + | | | +- TypeArgClause + | | | +- TypeName | | +- NameAnonymous | +- Self | | +- NameAnonymous | +- TermApply | | +- TermName + | | +- TermArgClause | +- DefnDef | | +- ModOverride | | +- TermName | | +- TypeApply | | | +- TypeName - | | | +- TypeName + | | | +- TypeArgClause + | | | +- TypeName | | +- TermApply | | +- TermName - | | +- TermName + | | +- TermArgClause + | | +- TermName | +- DefnDef | +- ModOverride | +- TermName | +- TypeApply | | +- TypeName - | | +- TypeName + | | +- TypeArgClause + | | +- TypeName | +- TermName +- DefnObject | +- ModCase @@ -1401,7 +1658,8 @@ | +- Init | | +- TypeApply | | | +- TypeName - | | | +- TypeName + | | | +- TypeArgClause + | | | +- TypeName | | +- NameAnonymous | +- Self | | +- NameAnonymous @@ -1414,7 +1672,8 @@ | | +- Init | | +- TypeName | | +- NameAnonymous - | | +- LitString + | | +- TermArgClause + | | +- LitString | +- DefnDef | | +- ModOverride | | +- TermName @@ -1430,7 +1689,8 @@ | | +- Init | | +- TypeName | | +- NameAnonymous - | | +- LitString + | | +- TermArgClause + | | +- LitString | +- DefnDef | | +- ModOverride | | +- TermName @@ -1440,7 +1700,8 @@ | | +- Init | | +- TypeName | | +- NameAnonymous - | | +- LitString + | | +- TermArgClause + | | +- LitString | +- DefnDef | | +- ModOverride | | +- TermName @@ -1450,7 +1711,8 @@ | | +- Init | | +- TypeName | | +- NameAnonymous - | | +- LitString + | | +- TermArgClause + | | +- LitString | +- DefnDef | | +- ModOverride | | +- TermName @@ -1461,34 +1723,44 @@ | | +- TermName | | +- TypeApply | | | +- TypeName - | | | +- TypeName + | | | +- TypeArgClause + | | | +- TypeName | | +- TermSelect | | +- TermName | | +- TermName | +- DefnDef | | +- ModOverride | | +- TermName - | | +- TypeParam - | | | +- TypeName - | | | +- TypeBounds - | | +- TypeParam - | | | +- TypeName - | | | +- TypeBounds - | | +- TermParam - | | | +- ModImplicit - | | | +- TermName - | | | +- TypeFunction - | | | +- TypeName - | | | +- TypeTuple - | | | +- TypeName - | | | +- TypeName + | | +- MemberParamClauseGroup + | | | +- TypeParamClause + | | | | +- TypeParam + | | | | | +- TypeName + | | | | | +- TypeParamClause + | | | | | +- TypeBounds + | | | | +- TypeParam + | | | | +- TypeName + | | | | +- TypeParamClause + | | | | +- TypeBounds + | | | +- TermParamClause + | | | +- TermParam + | | | | +- ModImplicit + | | | | +- TermName + | | | | +- TypeFunction + | | | | +- TypeFuncParamClause + | | | | | +- TypeName + | | | | +- TypeTuple + | | | | +- TypeName + | | | | +- TypeName + | | | +- ModImplicit | | +- TypeTuple | | | +- TypeApply | | | | +- TypeName - | | | | +- TypeName + | | | | +- TypeArgClause + | | | | +- TypeName | | | +- TypeApply | | | +- TypeName - | | | +- TypeName + | | | +- TypeArgClause + | | | +- TypeName | | +- TermName | +- DefnVal | +- ModAnnot @@ -1508,13 +1780,15 @@ | +- Init | +- TypeName | +- NameAnonymous - | +- LitLong + | +- TermArgClause + | +- LitLong +- TermName +- Template +- Init | +- TypeApply | | +- TypeName - | | +- TypeName + | | +- TypeArgClause + | | +- TypeName | +- NameAnonymous +- Self | +- NameAnonymous @@ -1528,19 +1802,25 @@ | +- TermName +- DefnDef | +- TermName - | +- TypeParam - | | +- TypeName - | | +- TypeBounds - | +- TermParam - | | +- TermName - | | +- TypeApply - | | +- TypeSelect - | | | +- TermName - | | | +- TypeName - | | +- TypeName + | +- MemberParamClauseGroup + | | +- TypeParamClause + | | | +- TypeParam + | | | +- TypeName + | | | +- TypeParamClause + | | | +- TypeBounds + | | +- TermParamClause + | | +- TermParam + | | +- TermName + | | +- TypeApply + | | +- TypeSelect + | | | +- TermName + | | | +- TypeName + | | +- TypeArgClause + | | +- TypeName | +- TypeApply | | +- TypeName - | | +- TypeName + | | +- TypeArgClause + | | +- TypeName | +- TermMatch | +- TermName | +- Case @@ -1549,7 +1829,8 @@ | | | | +- TermName | | | +- TypeApply | | | +- TypeName - | | | +- TypeName + | | | +- TypeArgClause + | | | +- TypeName | | +- TermName | +- Case | | +- PatWildcard @@ -1558,17 +1839,21 @@ | | | | +- TermName | | | | +- TermName | | | +- TermName - | | | +- LitInt + | | | +- TypeArgClause + | | | +- TermArgClause + | | | +- LitInt | | +- TermApplyType | | +- TermName - | | +- TypeName + | | +- TypeArgClause + | | +- TypeName | +- Case | | +- PatTyped | | | +- PatVar | | | | +- TermName | | | +- TypeApply | | | +- TypeName - | | | +- TypeName + | | | +- TypeArgClause + | | | +- TypeName | | +- TermSelect | | +- TermName | | +- TermName @@ -1579,31 +1864,42 @@ | | +- TermSelect | | | +- TermName | | | +- TermName - | | +- TermName + | | +- TermArgClause + | | +- TermName | +- TermName +- DefnDef | +- TermName - | +- TypeParam - | | +- TypeName - | | +- TypeBounds + | +- MemberParamClauseGroup + | | +- TypeParamClause + | | +- TypeParam + | | +- TypeName + | | +- TypeParamClause + | | +- TypeBounds | +- TypeApply | | +- TypeName - | | +- TypeName - | | +- TypeApply - | | +- TypeName + | | +- TypeArgClause | | +- TypeName + | | +- TypeApply + | | +- TypeName + | | +- TypeArgClause + | | +- TypeName | +- TermNew | +- Init | +- TypeName | +- NameAnonymous + | +- TermArgClause +- DefnDef | +- TermName - | +- TypeParam - | | +- TypeName - | | +- TypeBounds + | +- MemberParamClauseGroup + | | +- TypeParamClause + | | +- TypeParam + | | +- TypeName + | | +- TypeParamClause + | | +- TypeBounds | +- TypeApply | | +- TypeName - | | +- TypeName + | | +- TypeArgClause + | | +- TypeName | +- TermName +- DefnVal +- ModAnnot @@ -1619,16 +1915,20 @@ +- Init | +- TypeApply | | +- TypeName - | | +- TypeName - | | +- TypeName + | | +- TypeArgClause + | | +- TypeName + | | +- TypeName | +- NameAnonymous +- Self | +- NameAnonymous +- DefnDef +- TermName - +- TermParam - | +- TermName - | +- TypeName + +- MemberParamClauseGroup + | +- TypeParamClause + | +- TermParamClause + | +- TermParam + | +- TermName + | +- TypeName +- TypeName +- TermThis +- NameAnonymous diff --git a/pmd-scala-modules/pmd-scala-common/src/test/resources/net/sourceforge/pmd/lang/scala/ast/testdata/package.txt b/pmd-scala-modules/pmd-scala-common/src/test/resources/net/sourceforge/pmd/lang/scala/ast/testdata/package.txt index fc088d5b3e..0226a70022 100644 --- a/pmd-scala-modules/pmd-scala-common/src/test/resources/net/sourceforge/pmd/lang/scala/ast/testdata/package.txt +++ b/pmd-scala-modules/pmd-scala-common/src/test/resources/net/sourceforge/pmd/lang/scala/ast/testdata/package.txt @@ -10,6 +10,7 @@ | +- NameAnonymous +- DefnType | +- TypeName + | +- TypeParamClause | +- TypeSelect | | +- TermSelect | | | +- TermName @@ -26,6 +27,7 @@ | +- TermName +- DefnType | +- TypeName + | +- TypeParamClause | +- TypeSelect | | +- TermSelect | | | +- TermName @@ -45,24 +47,29 @@ | | +- Init | | +- TypeName | | +- NameAnonymous - | | +- LitString - | | +- LitString + | | +- TermArgClause + | | +- LitString + | | +- LitString | +- TypeName - | +- TypeParam - | | +- ModCovariant - | | +- TypeName - | | +- TypeBounds + | +- TypeParamClause + | | +- TypeParam + | | +- ModCovariant + | | +- TypeName + | | +- TypeParamClause + | | +- TypeBounds | +- TypeApply | | +- TypeName - | | +- TypeName + | | +- TypeArgClause + | | +- TypeName | +- TypeBounds +- DefnVal | +- ModAnnot | | +- Init | | +- TypeName | | +- NameAnonymous - | | +- LitString - | | +- LitString + | | +- TermArgClause + | | +- LitString + | | +- LitString | +- PatVar | | +- TermName | +- TermName @@ -71,16 +78,20 @@ | +- Init | +- TypeName | +- NameAnonymous - | +- LitString - | +- LitString + | +- TermArgClause + | +- LitString + | +- LitString +- TypeName - +- TypeParam - | +- TypeName - | +- TypeBounds - +- TypeParam - | +- ModCovariant - | +- TypeName - | +- TypeBounds + +- TypeParamClause + | +- TypeParam + | | +- TypeName + | | +- TypeParamClause + | | +- TypeBounds + | +- TypeParam + | +- ModCovariant + | +- TypeName + | +- TypeParamClause + | +- TypeBounds +- TypeApply | +- TypeSelect | | +- TermSelect @@ -89,6 +100,7 @@ | | | | +- TermName | | | +- TermName | | +- TypeName - | +- TypeName - | +- TypeName + | +- TypeArgClause + | +- TypeName + | +- TypeName +- TypeBounds diff --git a/pmd-scala-modules/pmd-scala_2.12/pom.xml b/pmd-scala-modules/pmd-scala_2.12/pom.xml index d469b60e45..40a6c1628d 100644 --- a/pmd-scala-modules/pmd-scala_2.12/pom.xml +++ b/pmd-scala-modules/pmd-scala_2.12/pom.xml @@ -28,7 +28,7 @@ org.scala-lang scala-library - ${scalaVersion}.17 + ${scalaVersion}.18 org.scalameta diff --git a/pmd-scala-modules/pmd-scala_2.13/pom.xml b/pmd-scala-modules/pmd-scala_2.13/pom.xml index 2663300d8b..4244c31537 100644 --- a/pmd-scala-modules/pmd-scala_2.13/pom.xml +++ b/pmd-scala-modules/pmd-scala_2.13/pom.xml @@ -28,7 +28,7 @@ org.scala-lang scala-library - ${scalaVersion}.9 + ${scalaVersion}.12 org.scalameta diff --git a/pmd-swift/src/main/resources/category/swift/bestpractices.xml b/pmd-swift/src/main/resources/category/swift/bestpractices.xml index cab248b276..e1d9ad423e 100644 --- a/pmd-swift/src/main/resources/category/swift/bestpractices.xml +++ b/pmd-swift/src/main/resources/category/swift/bestpractices.xml @@ -1,4 +1,4 @@ - + + + + Rules that are related to code documentation. - \ No newline at end of file + diff --git a/pmd-swift/src/main/resources/category/swift/errorprone.xml b/pmd-swift/src/main/resources/category/swift/errorprone.xml index e4dab5022d..7bf277656b 100644 --- a/pmd-swift/src/main/resources/category/swift/errorprone.xml +++ b/pmd-swift/src/main/resources/category/swift/errorprone.xml @@ -1,4 +1,4 @@ - + + Rules that flag issues when dealing with multiple threads of execution. - \ No newline at end of file + diff --git a/pmd-swift/src/main/resources/category/swift/performance.xml b/pmd-swift/src/main/resources/category/swift/performance.xml index be669f985c..f791f2f69f 100644 --- a/pmd-swift/src/main/resources/category/swift/performance.xml +++ b/pmd-swift/src/main/resources/category/swift/performance.xml @@ -1,4 +1,4 @@ - + + * Each language implementation should subclass this and provide a method called {@code data}. * - *
- *     static Collection<TestDescriptor> data() {
+ * 
{@code
+ *     static Collection data() {
+ *       final Language myLanguage = LanguageRegistry.getLanguage(MyLanguageModule.NAME);
  *       return Arrays.asList(
- *            new TestDescriptor(MyLanguageModule.NAME, MyLanguageModule.TERSE_NAME, "1.1",
- *                               LanguageRegistry.getLanguage(MyLanguageModule.NAME).getVersion("1.1")),
- *            new TestDescriptor(MyLanguageModule.NAME, MyLanguageModule.TERSE_NAME, "1.2",
- *                               LanguageRegistry.getLanguage(MyLanguageModule.NAME).getVersion("1.2")),
+ *            new TestDescriptor(myLanguage, "1.1"),
+ *            new TestDescriptor(myLanguage, "1.2"),
+ *            defaultVersionIs(myLanguage, "1.2),
  *
  *            // doesn't exist
- *            new TestDescriptor(MyLanguageModule.NAME, MyLanguageModule.TERSE_NAME, "1.3", null)
+ *            versionDoesNotExist(myLanguage, "1.3")
  *       };
- * 
- * - *

For the parameters, see the constructor - * {@link TestDescriptor#TestDescriptor(String, String, String, LanguageVersion)}.

+ * }
*/ public abstract class AbstractLanguageVersionTest { @@ -67,7 +65,16 @@ public abstract class AbstractLanguageVersionTest { } public TestDescriptor(Language language, String version) { - this(language, version, language.getVersion(version)); + this(language, version, + Objects.requireNonNull(language.getVersion(version), "language version '" + version + "' doesn't exist")); + } + + public static TestDescriptor versionDoesNotExist(String name, String terseName, String version) { + return new TestDescriptor(name, terseName, version, null); + } + + public static TestDescriptor versionDoesNotExist(Language lang, String version) { + return new TestDescriptor(lang, version, null); } public static TestDescriptor defaultVersionIs(Language lang, String version) { @@ -75,10 +82,7 @@ public abstract class AbstractLanguageVersionTest { } private TestDescriptor(Language language, String version, LanguageVersion expected) { - this.name = language.getName(); - this.version = version; - this.simpleTerseName = language.getId(); - this.expected = expected; + this(language.getName(), language.getId(), version, expected); } diff --git a/pmd-test/src/main/java/net/sourceforge/pmd/AbstractRuleSetFactoryTest.java b/pmd-test/src/main/java/net/sourceforge/pmd/AbstractRuleSetFactoryTest.java index 191704fabf..8cb298bc32 100644 --- a/pmd-test/src/main/java/net/sourceforge/pmd/AbstractRuleSetFactoryTest.java +++ b/pmd-test/src/main/java/net/sourceforge/pmd/AbstractRuleSetFactoryTest.java @@ -16,6 +16,7 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -235,6 +236,36 @@ public abstract class AbstractRuleSetFactoryTest { assertTrue(allValid, "All XML must parse without producing validation messages."); } + @Test + void verifyCorrectXmlEncoding() throws Exception { + boolean allValid = true; + List ruleSetFileNames = getRuleSetFileNames(); + StringBuilder messages = new StringBuilder(); + for (String fileName : ruleSetFileNames) { + boolean valid = hasCorrectEncoding(fileName); + allValid = allValid && valid; + if (!valid) { + messages.append("RuleSet ") + .append(fileName) + .append(" is missing XML encoding or not using UTF8\n"); + } + } + assertTrue(allValid, "All XML must use correct XML encoding\n" + messages); + } + + public static boolean hasCorrectEncoding(String fileName) throws IOException { + try (InputStream inputStream = loadResourceAsStream(fileName)) { + // first bytes must be: + byte[] expectedBytes = "".getBytes(StandardCharsets.UTF_8); + byte[] bytes = new byte[expectedBytes.length]; + int count = inputStream.read(bytes); + if (count != expectedBytes.length || !Arrays.equals(expectedBytes, bytes)) { + return false; + } + } + return true; + } + /** * Verifies that all rulesets are valid XML according to the DTD. * @@ -386,8 +417,8 @@ public abstract class AbstractRuleSetFactoryTest { } } - private InputStream loadResourceAsStream(String resource) { - return getClass().getClassLoader().getResourceAsStream(resource); + private static InputStream loadResourceAsStream(String resource) { + return AbstractRuleSetFactoryTest.class.getClassLoader().getResourceAsStream(resource); } private void testRuleSet(String fileName) throws IOException, SAXException { diff --git a/pmd-visualforce/src/main/resources/category/vf/bestpractices.xml b/pmd-visualforce/src/main/resources/category/vf/bestpractices.xml index 58e7fd43a3..126b820901 100644 --- a/pmd-visualforce/src/main/resources/category/vf/bestpractices.xml +++ b/pmd-visualforce/src/main/resources/category/vf/bestpractices.xml @@ -1,4 +1,4 @@ - + + + + + + + + + + + + + + + + getXPathAttributesIterator() { + // Expose this node's attributes through reflection + return new AttributeAxisIterator(this); + } } } diff --git a/pmd-xml/src/main/resources/category/pom/bestpractices.xml b/pmd-xml/src/main/resources/category/pom/bestpractices.xml index 58e7fd43a3..126b820901 100644 --- a/pmd-xml/src/main/resources/category/pom/bestpractices.xml +++ b/pmd-xml/src/main/resources/category/pom/bestpractices.xml @@ -1,4 +1,4 @@ - + + + + + + + + + + + + + + + + + Rules which enforce generally accepted best practices. + + + +When the character encoding is missing from the XML declaration, +the parser may produce garbled text. + +This is completely dependent on how the parser is set up +and the content of the XML file, so it may be hard to reproduce. + +Providing an explicit encoding ensures accurate and consistent +parsing. + + 3 + + + + + + + + + diff --git a/pmd-xml/src/main/resources/category/xml/categories.properties b/pmd-xml/src/main/resources/category/xml/categories.properties index 5fbda38080..31b290c05f 100644 --- a/pmd-xml/src/main/resources/category/xml/categories.properties +++ b/pmd-xml/src/main/resources/category/xml/categories.properties @@ -3,12 +3,12 @@ # rulesets.filenames=\ + category/xml/bestpractices.xml,\ category/xml/errorprone.xml # # categories without rules # -# category/xml/bestpractices.xml # category/xml/codestyle.xml # category/xml/design.xml # category/xml/documentation.xml diff --git a/pmd-xml/src/main/resources/category/xml/codestyle.xml b/pmd-xml/src/main/resources/category/xml/codestyle.xml index c9a6b51d10..7d28749e66 100644 --- a/pmd-xml/src/main/resources/category/xml/codestyle.xml +++ b/pmd-xml/src/main/resources/category/xml/codestyle.xml @@ -1,4 +1,4 @@ - + + + + + + + + + + + + + + + + + + + No XML Declaration + 1 + + + + ]]> + + + + XML Declaration without encoding + 1 + + + + + ]]> + + + + XML Declaration with UTF-8 encoding + 0 + + + + + ]]> + + + + XML Declaration with ISO-8859-1 encoding + 0 + + + + + ]]> + + + + XML Declaration with UTF-8 encoding and standalone + 0 + + + + + ]]> + + diff --git a/pom.xml b/pom.xml index a5248f3505..ef6b71625d 100644 --- a/pom.xml +++ b/pom.xml @@ -81,7 +81,7 @@ - 2023-05-30T18:15:07Z + 2023-09-30T15:15:59Z 8 @@ -113,9 +113,9 @@ -Xmx512m -Dfile.encoding=${project.build.sourceEncoding} ${extraArgLine} - 22-SNAPSHOT + 22 - 7.0.0-rc1 + 7.0.0-rc4 ${settings.localRepository}/net/java/dev/javacc/javacc/${javacc.version}/javacc-${javacc.version}.jar ${project.build.directory}/generated-sources/javacc ${project.basedir}/../javacc-wrapper.xml @@ -675,7 +675,7 @@ org.ow2.asm asm - 9.4 + 9.5 org.pcollections @@ -752,7 +752,18 @@ snakeyaml 1.33 + + com.google.guava + guava + 32.0.1-jre + + + + org.scala-lang + scala-reflect + 2.13.12 + @@ -782,14 +793,6 @@ test - - com.google.guava - guava - - 31.0.1-android - test - - org.hamcrest hamcrest @@ -839,10 +842,27 @@ test + + + net.bytebuddy + byte-buddy + 1.14.9 + test + + + net.bytebuddy + byte-buddy-agent + 1.14.9 + test + + com.github.tomakehurst wiremock-jre8 - 2.33.2 + 2.35.1 test @@ -1154,18 +1174,27 @@
+ + + cli-dist + + true + + + pmd-cli + pmd-dist + + pmd-apex-jorje pmd-apex - pmd-cli pmd-coco pmd-core pmd-cpp pmd-cs pmd-dart - pmd-dist pmd-doc pmd-fortran pmd-gherkin