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

[java] 3 rules reporting a comment twice for same line #3461

Closed
dinesh150 opened this issue Aug 10, 2021 · 2 comments
Closed

[java] 3 rules reporting a comment twice for same line #3461

dinesh150 opened this issue Aug 10, 2021 · 2 comments
Labels
a:bug PMD crashes or fails to analyse a file.

Comments

@dinesh150
Copy link

dinesh150 commented Aug 10, 2021

Affects PMD Version: 6.37.0
Description: Three rules from java reporting a comment twice for same line

DoNotTerminateVM, ImplicitSwitchFallThrough and ComparisonWithNaN

These three rules from java produces report twice for same line.

Code Sample demonstrating the issue:

// Code is sample for ComparisonWithNaN rule.
 public class Sample{
     public void doSomething(){
        double test = 0;
	boolean rule = (test == Double.NaN);
    }
}

Steps to reproduce:
Use the shared code and shared rule name from CLI.

Running PMD through: [CLI]

@dinesh150 dinesh150 added the a:bug PMD crashes or fails to analyse a file. label Aug 10, 2021
@adangel adangel changed the title [ Java] 3 rules reporting a comment twice for same line. [java] 3 rules reporting a comment twice for same line Aug 15, 2021
@adangel
Copy link
Member

adangel commented Aug 15, 2021

Can you share your ruleset?

All three rules have been renamed lately:

  • ComparisonWithNaN was previously called BadComparison
  • ImplicitSwitchFallThrough was previously called MissingBreakInSwitch
  • DoNotTerminateVM was previously called DoNotCallSystemExit

The old rule names are still available, but deprecated:

<rule name="BadComparison" ref="ComparisonWithNaN" deprecated="true" />

If you use the complete errorprone category, the old (deprecated) rules should be ignored. You should see duplicated reports only if you explicitly enable e.g. BadComparison and ComparisonWithNaN (which are essentially the same rule).

@jsotuyod jsotuyod added needs:pmd7-revalidation The issue hasn't yet been retested vs PMD 7 and may be stale and removed needs:pmd7-revalidation The issue hasn't yet been retested vs PMD 7 and may be stale labels Apr 2, 2024
@jsotuyod
Copy link
Member

jsotuyod commented Apr 3, 2024

Marking this as stale after 3 years with no response from the reporter nor a way to reproduce it.

@jsotuyod jsotuyod closed this as not planned Won't fix, can't repro, duplicate, stale Apr 3, 2024
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.
Projects
None yet
Development

No branches or pull requests

3 participants