Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core] Referencing category errorprone.xml produces deprecation warnings for InvalidSlf4jMessageFormat #2096

Closed
cmuchinsky opened this issue Nov 3, 2019 · 1 comment · Fixed by #2097
Assignees
Labels
a:bug PMD crashes or fails to analyse a file. has:pr The issue is already tackled in a PR
Milestone

Comments

@cmuchinsky
Copy link

Affects PMD Version:

6.19.0

Rule:

category/java/errorprone.xml

Description:

After upgrading from 6.17.0 to 6.19.0 started seeing deprecation warnings for a rule that is never explicitly referenced (InvalidSlf4jMessageFormat):

Use Rule name category/java/errorprone.xml/InvalidLogMessageFormat instead of the deprecated Rule name category/java/errorprone.xml/InvalidSlf4jMessageFormat. PMD 7.0.0 will remove support for this deprecated Rule name usage.

Code Sample demonstrating the issue:

<rule ref="category/java/errorprone.xml"/>

Running PMD through: [CLI | Ant | Maven | Gradle | Designer | Other]

Gradle

@adangel adangel added the a:bug PMD crashes or fails to analyse a file. label Nov 3, 2019
@jsotuyod jsotuyod added this to the 6.20.0 milestone Nov 4, 2019
@adangel adangel self-assigned this Nov 4, 2019
@adangel adangel changed the title [core] Referencing category errorprone.xml produces deprecation warnings for InvalidSlf4jMessageFormat. [core] Referencing category errorprone.xml produces deprecation warnings for InvalidSlf4jMessageFormat Nov 4, 2019
adangel added a commit to adangel/pmd that referenced this issue Nov 4, 2019
There are two variants, how a renamed rule can be expressed in the
ruleset via a deprecated rule reference: referencing just the
new rule name or referencing the ruleset+new rule name. The latter
case was not covered yet, it was not detected, that the rule ref
references are rule in the same ruleset.

Fixes pmd#2096
@adangel
Copy link
Member

adangel commented Nov 4, 2019

I unfortunately used a different variant of deprecating/renaming the rule than I used in the unit test, that checks for the message:

    <rule name="InvalidSlf4jMessageFormat"
          ref="category/java/errorprone.xml/InvalidLogMessageFormat"
          deprecated="true" />

vs.

    <rule name="InvalidSlf4jMessageFormat"
          ref="InvalidLogMessageFormat"
          deprecated="true" />

But this will be fixed with 6.20.0 as well. Thanks for reporting.

adangel added a commit to adangel/pmd that referenced this issue Nov 4, 2019
There are two variants, how a renamed rule can be expressed in the
ruleset via a deprecated rule reference: referencing just the
new rule name or referencing the ruleset+new rule name. The latter
case was not covered yet, it was not detected, that the rule ref
references are rule in the same ruleset.

Fixes pmd#2096
@adangel adangel added the has:pr The issue is already tackled in a PR label Nov 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:bug PMD crashes or fails to analyse a file. has:pr The issue is already tackled in a PR
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants