diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3d52aa82b5..01b91ce2d5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -46,7 +46,7 @@ jobs: run: | echo "LANG=en_US.UTF-8" >> $GITHUB_ENV echo "MAVEN_OPTS=-Dmaven.wagon.httpconnectionManager.ttlSeconds=180 -Dmaven.wagon.http.retryHandler.count=3 -DautoReleaseAfterClose=true -DstagingProgressTimeoutMinutes=30" >> $GITHUB_ENV - echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/17/scripts" >> $GITHUB_ENV + echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/18/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 250dd00933..a990a6726b 100644 --- a/.github/workflows/git-repo-sync.yml +++ b/.github/workflows/git-repo-sync.yml @@ -22,7 +22,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/17/scripts" >> $GITHUB_ENV + echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/18/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 04ac1cd39c..ea4bd54fd9 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=-Dmaven.wagon.httpconnectionManager.ttlSeconds=180 -Dmaven.wagon.http.retryHandler.count=3 -DstagingProgressTimeoutMinutes=30" >> $GITHUB_ENV - echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/17/scripts" >> $GITHUB_ENV + echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/18/scripts" >> $GITHUB_ENV - name: Check Environment shell: bash run: | diff --git a/docs/_config.yml b/docs/_config.yml index 13469ef975..8e8f958f65 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -2,7 +2,7 @@ repository: pmd/pmd pmd: version: 7.0.0-SNAPSHOT - previous_version: 6.45.0 + previous_version: 6.46.0 date: ??-?????-2022 release_type: major diff --git a/docs/pages/next_major_development.md b/docs/pages/next_major_development.md index 0deeb1ba60..1d3c7ef787 100644 --- a/docs/pages/next_major_development.md +++ b/docs/pages/next_major_development.md @@ -246,6 +246,39 @@ the breaking API changes will be performed in 7.0.0. an API is tagged as `@Deprecated` or not in the latest minor release. During the development of 7.0.0, we may decide to remove some APIs that were not tagged as deprecated, though we'll try to avoid it." %} +#### 6.46.0 + +##### Deprecated ruleset references + +Ruleset references with the following formats are now deprecated and will produce a warning +when used on the CLI or in a ruleset XML file: +- `-`, eg `java-basic`, which resolves to `rulesets/java/basic.xml` +- the internal release number, eg `600`, which resolves to `rulesets/releases/600.xml` + +Use the explicit forms of these references to be compatible with PMD 7. + +##### Deprecated API + +- {% jdoc core::RuleSetReferenceId#toString() %} is now deprecated. The format of this + method will remain the same until PMD 7. The deprecation is intended to steer users + away from relying on this format, as it may be changed in PMD 7. +- {% jdoc core::PMDConfiguration#getInputPaths() %} and + {% jdoc core::PMDConfiguration#setInputPaths(java.lang.String) %} are now deprecated. + A new set of methods have been added, which use lists and do not rely on comma splitting. + +##### Internal API + +Those APIs are not intended to be used by clients, and will be hidden or removed with PMD 7.0.0. +You can identify them with the `@InternalApi` annotation. You'll also get a deprecation warning. + +- {% jdoc core::cpd.CPDCommandLineInterface %} has been internalized. In order to execute CPD either + {% jdoc !!core::cpd.CPD#run(java.lang.String...) %} or {% jdoc !!core::cpd.CPD#main(java.lang.String[]) %} + should be used. +- Several members of {% jdoc test::cli.BaseCPDCLITest %} have been deprecated with replacements. +- The methods {% jdoc !!core::ant.Formatter#start(java.lang.String) %}, + {% jdoc !!core::ant.Formatter#end(net.sourceforge.pmd.Report) %}, {% jdoc !!core::ant.Formatter#getRenderer() %}, + and {% jdoc !!core::ant.Formatter#isNoOutputSupplied() %} have been internalized. + #### 6.45.0 ##### Experimental APIs @@ -1468,18 +1501,18 @@ large projects, with many duplications, it was causing `OutOfMemoryError`s (see * The Java rules NcssConstructorCount (java-design), NcssMethodCount (java-design), and NcssTypeCount (java-design) have been deprecated. They will be replaced by the new rule {% rule java/design/NcssCount %} in the category `design`. -* The Java rule `LooseCoupling` in ruleset `java-typeresolution` is deprecated. Use the rule with the same name from category `bestpractices` instead. +* The Java rule `LooseCoupling` in ruleset `java-typeresolution` is deprecated. Use the rule with the same name from category `bestpractices` instead. -* The Java rule `CloneMethodMustImplementCloneable` in ruleset `java-typeresolution` is deprecated. Use the rule with the same name from category `errorprone` instead. +* The Java rule `CloneMethodMustImplementCloneable` in ruleset `java-typeresolution` is deprecated. Use the rule with the same name from category `errorprone` instead. -* The Java rule `UnusedImports` in ruleset `java-typeresolution` is deprecated. Use the rule with +* The Java rule `UnusedImports` in ruleset `java-typeresolution` is deprecated. Use the rule with the same name from category `bestpractices` instead. -* The Java rule `SignatureDeclareThrowsException` in ruleset `java-typeresolution` is deprecated. Use the rule with the same name from category `design` instead. +* The Java rule `SignatureDeclareThrowsException` in ruleset `java-typeresolution` is deprecated. Use the rule with the same name from category `design` instead. -* The Java rule `EmptyStaticInitializer` in ruleset `java-empty` is deprecated. Use the rule {% rule java/errorprone/EmptyInitializer %}, which covers both static and non-static empty initializers.` +* The Java rule `EmptyStaticInitializer` in ruleset `java-empty` is deprecated. Use the rule {% rule java/errorprone/EmptyInitializer %}, which covers both static and non-static empty initializers.` -* The Java rules `GuardDebugLogging` (ruleset `java-logging-jakarta-commons`) and `GuardLogStatementJavaUtil` +* The Java rules `GuardDebugLogging` (ruleset `java-logging-jakarta-commons`) and `GuardLogStatementJavaUtil` (ruleset `java-logging-java`) have been deprecated. Use the rule {% rule java/bestpractices/GuardLogStatement %}, which covers all cases regardless of the logging framework. * The Java rule "java/multithreading/UnsynchronizedStaticDateFormatter" has been deprecated and @@ -1490,20 +1523,20 @@ large projects, with many duplications, it was causing `OutOfMemoryError`s (see and [`PositionLiteralsFirstInCaseInsensitiveComparisons`](https://pmd.github.io/pmd-6.29.0/pmd_rules_java_bestpractices.html#positionliteralsfirstincaseinsensitivecomparisons) (ruleset `java-bestpractices`) have been deprecated in favor of the new rule {% rule "java/bestpractices/LiteralsFirstInComparisons" %}. -* The Java rule [`AvoidFinalLocalVariable`](https://pmd.github.io/pmd-6.16.0/pmd_rules_java_codestyle.html#avoidfinallocalvariable) (`java-codestyle`) has been deprecated +* The Java rule [`AvoidFinalLocalVariable`](https://pmd.github.io/pmd-6.16.0/pmd_rules_java_codestyle.html#avoidfinallocalvariable) (`java-codestyle`) has been deprecated and will be removed with PMD 7.0.0. The rule is controversial and also contradicts other existing rules such as [`LocalVariableCouldBeFinal`](https://pmd.github.io/pmd-6.16.0/pmd_rules_java_codestyle.html#localvariablecouldbefinal). If the goal is to avoid defining constants in a scope smaller than the class, then the rule [`AvoidDuplicateLiterals`](https://pmd.github.io/pmd-6.16.0/pmd_rules_java_errorprone.html#avoidduplicateliterals) should be used instead. -* The Apex rule [`VariableNamingConventions`](https://pmd.github.io/pmd-6.15.0/pmd_rules_apex_codestyle.html#variablenamingconventions) (`apex-codestyle`) has been deprecated and +* The Apex rule [`VariableNamingConventions`](https://pmd.github.io/pmd-6.15.0/pmd_rules_apex_codestyle.html#variablenamingconventions) (`apex-codestyle`) has been deprecated and will be removed with PMD 7.0.0. The rule is replaced by the more general rules [`FieldNamingConventions`](https://pmd.github.io/pmd-6.15.0/pmd_rules_apex_codestyle.html#fieldnamingconventions), [`FormalParameterNamingConventions`](https://pmd.github.io/pmd-6.15.0/pmd_rules_apex_codestyle.html#formalparameternamingconventions), [`LocalVariableNamingConventions`](https://pmd.github.io/pmd-6.15.0/pmd_rules_apex_codestyle.html#localvariablenamingconventions), and [`PropertyNamingConventions`](https://pmd.github.io/pmd-6.15.0/pmd_rules_apex_codestyle.html#propertynamingconventions). -* The Java rule [`LoggerIsNotStaticFinal`](https://pmd.github.io/pmd-6.15.0/pmd_rules_java_errorprone.html#loggerisnotstaticfinal) (`java-errorprone`) has been deprecated +* The Java rule [`LoggerIsNotStaticFinal`](https://pmd.github.io/pmd-6.15.0/pmd_rules_java_errorprone.html#loggerisnotstaticfinal) (`java-errorprone`) has been deprecated and will be removed with PMD 7.0.0. The rule is replaced by [`ProperLogger`](https://pmd.github.io/pmd-6.15.0/pmd_rules_java_errorprone.html#properlogger). * The Java rule [`DataflowAnomalyAnalysis`](https://pmd.github.io/pmd-6.27.0/pmd_rules_java_errorprone.html#dataflowanomalyanalysis) (`java-errorprone`) @@ -1516,7 +1549,7 @@ large projects, with many duplications, it was causing `OutOfMemoryError`s (see * The Java rule `CloneThrowsCloneNotSupportedException` (java-errorprone) has been deprecated without replacement. -* The following Java rules are deprecated and removed from the quickstart ruleset, +* The following Java rules are deprecated and removed from the quickstart ruleset, as the new rule {% rule java/bestpractices/SimplifiableTestAssertion %} merges their functionality: * `UseAssertEqualsInsteadOfAssertTrue` (java-bestpractices) @@ -1529,7 +1562,7 @@ large projects, with many duplications, it was causing `OutOfMemoryError`s (see the quickstart ruleset, as the new rule {% rule java/errorprone/ReturnEmptyCollectionRatherThanNull %} supersedes it. -* The following Java rules are deprecated and removed from the quickstart ruleset, +* The following Java rules are deprecated and removed from the quickstart ruleset, as the new rule {% rule java/bestpractices/PrimitiveWrapperInstantiation %} merges their functionality: * java/performance/BooleanInstantiation @@ -1543,3 +1576,17 @@ large projects, with many duplications, it was causing `OutOfMemoryError`s (see as it finds only contrived cases of creating a primitive wrapper and unboxing it explicitly in the same expression. In PMD 7 this and more cases will be covered by a new rule `UnnecessaryBoxing`. + +* Since 6.46.0: The following Java rules are deprecated and removed from the quickstart ruleset, as the new rule + {% rule java/codestyle/EmptyControlStatement %} merges their functionality: + * {% rule java/errorprone/EmptyFinallyBlock %} + * {% rule java/errorprone/EmptyIfStmt %} + * {% rule java/errorprone/EmptyInitializer %} + * {% rule java/errorprone/EmptyStatementBlock %} + * {% rule java/errorprone/EmptySwitchStatements %} + * {% rule java/errorprone/EmptySynchronizedBlock %} + * {% rule java/errorprone/EmptyTryBlock %} + * {% rule java/errorprone/EmptyWhileStmt %} + +* Since 6.46.0: The Java rule {% rule java/errorprone/EmptyStatementNotInLoop %} is deprecated and removed from the quickstart + ruleset. Use the new rule {% rule java/codestyle/UnnecessarySemicolon %} instead. diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 77e8f0f8e6..8abb75f161 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -19,142 +19,11 @@ This is a {{ site.pmd.release_type }} release. ### New and noteworthy -#### CLI improvements - -The PMD CLI now allows repeating the `--dir` (`-d`) and `--rulesets` (`-R`) options, - as well as providing several space-separated arguments to either of them. For instance: -```shell -pmd -d src/main/java src/test/java -R rset1.xml -R rset2.xml -``` -This also allows globs to be used on the CLI if your shell supports shell expansion. -For instance, the above can be written -```shell -pmd -d src/*/java -R rset*.xml -``` -Please use theses new forms instead of using comma-separated lists as argument to these options. - -#### C# Improvements - -When executing CPD on C# sources, the option `--ignore-annotations` is now supported as well. -It ignores C# attributes when detecting duplicated code. This option can also be enabled via -the CPD GUI. See [#3974](https://github.com/pmd/pmd/pull/3974) for details. - -#### New Rules - -This release ships with 2 new Java rules. - -* {% rule java/codestyle/EmptyControlStatement %} reports many instances of empty things, e.g. control statements whose - body is empty, as well as empty initializers. - - EmptyControlStatement also works for empty `for` and `do` loops, while there were previously - no corresponding rules. - - This new rule replaces the rules EmptyFinallyBlock, EmptyIfStmt, EmptyInitializer, EmptyStatementBlock, - EmptySwitchStatements, EmptySynchronizedBlock, EmptyTryBlock, and EmptyWhileStmt. - -```xml - -``` - -The rule is part of the quickstart.xml ruleset. - -* {%rule java/codestyle/UnnecessarySemicolon %} reports semicolons that are unnecessary (so called "empty statements" - and "empty declarations"). - - This new rule replaces the rule EmptyStatementNotInLoop. - -```xml - -``` - -The rule is part of the quickstart.xml ruleset. - -#### Deprecated Rules - -* The following Java rules are deprecated and removed from the quickstart ruleset, as the new rule -{% rule java/codestyle/EmptyControlStatement %} merges their functionality: - * {% rule java/errorprone/EmptyFinallyBlock %} - * {% rule java/errorprone/EmptyIfStmt %} - * {% rule java/errorprone/EmptyInitializer %} - * {% rule java/errorprone/EmptyStatementBlock %} - * {% rule java/errorprone/EmptySwitchStatements %} - * {% rule java/errorprone/EmptySynchronizedBlock %} - * {% rule java/errorprone/EmptyTryBlock %} - * {% rule java/errorprone/EmptyWhileStmt %} -* The Java rule {% rule java/errorprone/EmptyStatementNotInLoop %} is deprecated and removed from the quickstart -ruleset. Use the new rule {% rule java/codestyle/UnnecessarySemicolon %} instead. - ### Fixed Issues -* cli - * [#1445](https://github.com/pmd/pmd/issues/1445): \[core] Allow CLI to take globs as parameters -* core - * [#2352](https://github.com/pmd/pmd/issues/2352): \[core] Deprecate \-\ hyphen notation for ruleset references - * [#3787](https://github.com/pmd/pmd/issues/3787): \[core] Internalize some methods in Ant Formatter - * [#3835](https://github.com/pmd/pmd/issues/3835): \[core] Deprecate system properties of CPDCommandLineInterface - * [#3942](https://github.com/pmd/pmd/issues/3942): \[core] common-io path traversal vulnerability (CVE-2021-29425) -* cs (c#) - * [#3974](https://github.com/pmd/pmd/pull/3974): \[cs] Add option to ignore C# attributes (annotations) -* go - * [#2752](https://github.com/pmd/pmd/issues/2752): \[go] Error parsing unicode values -* html - * [#3955](https://github.com/pmd/pmd/pull/3955): \[html] Improvements for handling text and comment nodes - * [#3978](https://github.com/pmd/pmd/pull/3978): \[html] Add additional file extensions htm, xhtml, xht, shtml -* java - * [#3423](https://github.com/pmd/pmd/issues/3423): \[java] Error processing identifiers with Unicode -* java-bestpractices - * [#3954](https://github.com/pmd/pmd/issues/3954): \[java] NPE in UseCollectionIsEmptyRule when .size() is called in a record -* java-design - * [#3874](https://github.com/pmd/pmd/issues/3874): \[java] ImmutableField reports fields annotated with @Autowired (Spring) and @Mock (Mockito) -* java-errorprone - * [#3096](https://github.com/pmd/pmd/issues/3096): \[java] EmptyStatementNotInLoop FP in 6.30.0 with IfStatement -* java-performance - * [#3379](https://github.com/pmd/pmd/issues/3379): \[java] UseArraysAsList must ignore primitive arrays - * [#3965](https://github.com/pmd/pmd/issues/3965): \[java] UseArraysAsList false positive with non-trivial loops -* javascript - * [#2605](https://github.com/pmd/pmd/issues/2605): \[js] Support unicode characters - * [#3948](https://github.com/pmd/pmd/issues/3948): \[js] Invalid operator error for method property in object literal -* python - * [#2604](https://github.com/pmd/pmd/issues/2604): \[python] Support unicode identifiers - ### API Changes -#### Deprecated ruleset references - -Ruleset references with the following formats are now deprecated and will produce a warning -when used on the CLI or in a ruleset XML file: -- `-`, eg `java-basic`, which resolves to `rulesets/java/basic.xml` -- the internal release number, eg `600`, which resolves to `rulesets/releases/600.xml` - -Use the explicit forms of these references to be compatible with PMD 7. - -#### Deprecated API - -- {% jdoc core::RuleSetReferenceId#toString() %} is now deprecated. The format of this - method will remain the same until PMD 7. The deprecation is intended to steer users - away from relying on this format, as it may be changed in PMD 7. -- {% jdoc core::PMDConfiguration#getInputPaths() %} and -{% jdoc core::PMDConfiguration#setInputPaths(java.lang.String) %} are now deprecated. -A new set of methods have been added, which use lists and do not rely on comma splitting. - -#### Internal API - -Those APIs are not intended to be used by clients, and will be hidden or removed with PMD 7.0.0. -You can identify them with the `@InternalApi` annotation. You'll also get a deprecation warning. - -- {% jdoc core::cpd.CPDCommandLineInterface %} has been internalized. In order to execute CPD either -{% jdoc !!core::cpd.CPD#run(java.lang.String...) %} or {% jdoc !!core::cpd.CPD#main(java.lang.String[]) %} -should be used. -- Several members of {% jdoc test::cli.BaseCPDCLITest %} have been deprecated with replacements. -- The methods {% jdoc !!core::ant.Formatter#start(java.lang.String) %}, -{% jdoc !!core::ant.Formatter#end(net.sourceforge.pmd.Report) %}, {% jdoc !!core::ant.Formatter#getRenderer() %}, -and {% jdoc !!core::ant.Formatter#isNoOutputSupplied() %} have been internalized. - ### External Contributions -* [#3961](https://github.com/pmd/pmd/pull/3961): \[java] Fix #3954 - NPE in UseCollectionIsEmptyRule with record - [@flyhard](https://github.com/flyhard) -* [#3964](https://github.com/pmd/pmd/pull/3964): \[java] Fix #3874 - ImmutableField: fix mockito/spring false positives - [@lukelukes](https://github.com/lukelukes) -* [#3974](https://github.com/pmd/pmd/pull/3974): \[cs] Add option to ignore C# attributes (annotations) - [@maikelsteneker](https://github.com/maikelsteneker) - {% endtocmaker %} diff --git a/docs/pages/release_notes_old.md b/docs/pages/release_notes_old.md index 08788a3064..7653bc5ba2 100644 --- a/docs/pages/release_notes_old.md +++ b/docs/pages/release_notes_old.md @@ -5,6 +5,171 @@ permalink: pmd_release_notes_old.html Previous versions of PMD can be downloaded here: https://github.com/pmd/pmd/releases +## 28-May-2022 - 6.46.0 + +The PMD team is pleased to announce PMD 6.46.0. + +This is a minor release. + +### Table Of Contents + +* [New and noteworthy](#new-and-noteworthy) + * [CLI improvements](#cli-improvements) + * [C# Improvements](#c#-improvements) + * [New Rules](#new-rules) + * [Deprecated Rules](#deprecated-rules) +* [Fixed Issues](#fixed-issues) +* [API Changes](#api-changes) + * [Deprecated ruleset references](#deprecated-ruleset-references) + * [Deprecated API](#deprecated-api) + * [Internal API](#internal-api) +* [External Contributions](#external-contributions) +* [Stats](#stats) + +### New and noteworthy + +#### CLI improvements + +The PMD CLI now allows repeating the `--dir` (`-d`) and `--rulesets` (`-R`) options, + as well as providing several space-separated arguments to either of them. For instance: +```shell +pmd -d src/main/java src/test/java -R rset1.xml -R rset2.xml +``` +This also allows globs to be used on the CLI if your shell supports shell expansion. +For instance, the above can be written +```shell +pmd -d src/*/java -R rset*.xml +``` +Please use theses new forms instead of using comma-separated lists as argument to these options. + +#### C# Improvements + +When executing CPD on C# sources, the option `--ignore-annotations` is now supported as well. +It ignores C# attributes when detecting duplicated code. This option can also be enabled via +the CPD GUI. See [#3974](https://github.com/pmd/pmd/pull/3974) for details. + +#### New Rules + +This release ships with 2 new Java rules. + +* [`EmptyControlStatement`](https://pmd.github.io/pmd-6.46.0/pmd_rules_java_codestyle.html#emptycontrolstatement) reports many instances of empty things, e.g. control statements whose + body is empty, as well as empty initializers. + + EmptyControlStatement also works for empty `for` and `do` loops, while there were previously + no corresponding rules. + + This new rule replaces the rules EmptyFinallyBlock, EmptyIfStmt, EmptyInitializer, EmptyStatementBlock, + EmptySwitchStatements, EmptySynchronizedBlock, EmptyTryBlock, and EmptyWhileStmt. + +```xml + +``` + +The rule is part of the quickstart.xml ruleset. + +* [`UnnecessarySemicolon`](https://pmd.github.io/pmd-6.46.0/pmd_rules_java_codestyle.html#unnecessarysemicolon) reports semicolons that are unnecessary (so called "empty statements" + and "empty declarations"). + + This new rule replaces the rule EmptyStatementNotInLoop. + +```xml + +``` + +The rule is part of the quickstart.xml ruleset. + +#### Deprecated Rules + +* The following Java rules are deprecated and removed from the quickstart ruleset, as the new rule +[`EmptyControlStatement`](https://pmd.github.io/pmd-6.46.0/pmd_rules_java_codestyle.html#emptycontrolstatement) merges their functionality: + * [`EmptyFinallyBlock`](https://pmd.github.io/pmd-6.46.0/pmd_rules_java_errorprone.html#emptyfinallyblock) + * [`EmptyIfStmt`](https://pmd.github.io/pmd-6.46.0/pmd_rules_java_errorprone.html#emptyifstmt) + * [`EmptyInitializer`](https://pmd.github.io/pmd-6.46.0/pmd_rules_java_errorprone.html#emptyinitializer) + * [`EmptyStatementBlock`](https://pmd.github.io/pmd-6.46.0/pmd_rules_java_errorprone.html#emptystatementblock) + * [`EmptySwitchStatements`](https://pmd.github.io/pmd-6.46.0/pmd_rules_java_errorprone.html#emptyswitchstatements) + * [`EmptySynchronizedBlock`](https://pmd.github.io/pmd-6.46.0/pmd_rules_java_errorprone.html#emptysynchronizedblock) + * [`EmptyTryBlock`](https://pmd.github.io/pmd-6.46.0/pmd_rules_java_errorprone.html#emptytryblock) + * [`EmptyWhileStmt`](https://pmd.github.io/pmd-6.46.0/pmd_rules_java_errorprone.html#emptywhilestmt) +* The Java rule [`EmptyStatementNotInLoop`](https://pmd.github.io/pmd-6.46.0/pmd_rules_java_errorprone.html#emptystatementnotinloop) is deprecated and removed from the quickstart +ruleset. Use the new rule [`UnnecessarySemicolon`](https://pmd.github.io/pmd-6.46.0/pmd_rules_java_codestyle.html#unnecessarysemicolon) instead. + +### Fixed Issues + +* cli + * [#1445](https://github.com/pmd/pmd/issues/1445): \[core] Allow CLI to take globs as parameters +* core + * [#2352](https://github.com/pmd/pmd/issues/2352): \[core] Deprecate \-\ hyphen notation for ruleset references + * [#3787](https://github.com/pmd/pmd/issues/3787): \[core] Internalize some methods in Ant Formatter + * [#3835](https://github.com/pmd/pmd/issues/3835): \[core] Deprecate system properties of CPDCommandLineInterface + * [#3942](https://github.com/pmd/pmd/issues/3942): \[core] common-io path traversal vulnerability (CVE-2021-29425) +* cs (c#) + * [#3974](https://github.com/pmd/pmd/pull/3974): \[cs] Add option to ignore C# attributes (annotations) +* go + * [#2752](https://github.com/pmd/pmd/issues/2752): \[go] Error parsing unicode values +* html + * [#3955](https://github.com/pmd/pmd/pull/3955): \[html] Improvements for handling text and comment nodes + * [#3978](https://github.com/pmd/pmd/pull/3978): \[html] Add additional file extensions htm, xhtml, xht, shtml +* java + * [#3423](https://github.com/pmd/pmd/issues/3423): \[java] Error processing identifiers with Unicode +* java-bestpractices + * [#3954](https://github.com/pmd/pmd/issues/3954): \[java] NPE in UseCollectionIsEmptyRule when .size() is called in a record +* java-design + * [#3874](https://github.com/pmd/pmd/issues/3874): \[java] ImmutableField reports fields annotated with @Autowired (Spring) and @Mock (Mockito) +* java-errorprone + * [#3096](https://github.com/pmd/pmd/issues/3096): \[java] EmptyStatementNotInLoop FP in 6.30.0 with IfStatement +* java-performance + * [#3379](https://github.com/pmd/pmd/issues/3379): \[java] UseArraysAsList must ignore primitive arrays + * [#3965](https://github.com/pmd/pmd/issues/3965): \[java] UseArraysAsList false positive with non-trivial loops +* javascript + * [#2605](https://github.com/pmd/pmd/issues/2605): \[js] Support unicode characters + * [#3948](https://github.com/pmd/pmd/issues/3948): \[js] Invalid operator error for method property in object literal +* python + * [#2604](https://github.com/pmd/pmd/issues/2604): \[python] Support unicode identifiers + +### API Changes + +#### Deprecated ruleset references + +Ruleset references with the following formats are now deprecated and will produce a warning +when used on the CLI or in a ruleset XML file: +- `-`, eg `java-basic`, which resolves to `rulesets/java/basic.xml` +- the internal release number, eg `600`, which resolves to `rulesets/releases/600.xml` + +Use the explicit forms of these references to be compatible with PMD 7. + +#### Deprecated API + +- toString is now deprecated. The format of this + method will remain the same until PMD 7. The deprecation is intended to steer users + away from relying on this format, as it may be changed in PMD 7. +- getInputPaths and +setInputPaths are now deprecated. +A new set of methods have been added, which use lists and do not rely on comma splitting. + +#### Internal API + +Those APIs are not intended to be used by clients, and will be hidden or removed with PMD 7.0.0. +You can identify them with the `@InternalApi` annotation. You'll also get a deprecation warning. + +- CPDCommandLineInterface has been internalized. In order to execute CPD either +CPD#run or CPD#main +should be used. +- Several members of BaseCPDCLITest have been deprecated with replacements. +- The methods Formatter#start, +Formatter#end, Formatter#getRenderer, +and Formatter#isNoOutputSupplied have been internalized. + +### External Contributions + +* [#3961](https://github.com/pmd/pmd/pull/3961): \[java] Fix #3954 - NPE in UseCollectionIsEmptyRule with record - [@flyhard](https://github.com/flyhard) +* [#3964](https://github.com/pmd/pmd/pull/3964): \[java] Fix #3874 - ImmutableField: fix mockito/spring false positives - [@lukelukes](https://github.com/lukelukes) +* [#3974](https://github.com/pmd/pmd/pull/3974): \[cs] Add option to ignore C# attributes (annotations) - [@maikelsteneker](https://github.com/maikelsteneker) + +### Stats +* 92 commits +* 30 closed tickets & PRs +* Days since last release: 28 + ## 30-April-2022 - 6.45.0 The PMD team is pleased to announce PMD 6.45.0. diff --git a/pom.xml b/pom.xml index b7725f0bd6..546c1087cf 100644 --- a/pom.xml +++ b/pom.xml @@ -76,7 +76,7 @@ - 2022-04-30T07:38:24Z + 2022-05-28T09:04:31Z 8 @@ -107,7 +107,7 @@ -Xmx512m -Dfile.encoding=${project.build.sourceEncoding} - 18-SNAPSHOT + 18 6.37.0 ${settings.localRepository}/net/java/dev/javacc/javacc/${javacc.version}/javacc-${javacc.version}.jar @@ -419,22 +419,22 @@ net.sourceforge.pmd pmd-core - 6.45.0 + 6.46.0 net.sourceforge.pmd pmd-java - 6.45.0 + 6.46.0 net.sourceforge.pmd pmd-jsp - 6.45.0 + 6.46.0 net.sourceforge.pmd pmd-javascript - 6.45.0 + 6.46.0