A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pmd/pmd/issues/5634 below:

[java] CommentDefaultAccessModifier doesn't recognize /* package */ comment at expected location for constructors · Issue #5634 · pmd/pmd · GitHub

Affects PMD Version:
7.11

Rule:
Please provide the rule name and a link to the rule documentation:
CodeStyle.CommentDefaultAccessModifier
https://docs.pmd-code.org/latest/pmd_rules_java_codestyle.html#commentdefaultaccessmodifier
https://pmd.github.io/pmd/pmd_rules_java_codestyle.html#commentdefaultaccessmodifier

Description:
The /* package */ comment isn't accepted in the expected location.

Code Sample demonstrating the issue:

public class Test {

  @SuppressWarnings("")
  /* package */ Test() { // <-- Missing commented default access modifier on constructor 'Test()'
    // nothing
  }

}
public class Test {

  /* package */ @SuppressWarnings("")
  Test() { // <-- works, no violation
    // nothing
  }

}
public class Test {

  @SuppressWarnings("")
  Test /* package */() { // <-- works, no violation
    // nothing
  }

}

Expected outcome:

PMD reports a violation at line 4, but that's wrong. That's a false positive.

Running PMD through: Eclipse Plugin, Gradle


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4