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] Renderers output wrong class qualified name for nested classes #4904
Comments
PS: The rule is triggering on this line: |
The rule is actually triggered on the following place: https://github.com/cowwoc/lumina/blob/main/java/src/main/java/com/github/cowwoc/lumina/Form.java#L38 There is a problem with the renderer as it just takes the simple name of the class and prepends the package name. This of course is wrong when the type is a nested class like here. The name of the class is I think the renderer should output file names and not class names, for instance:
instead of the current output now (broken)
or "fixed", but it is not obvious which file the line number is for:
|
Here is the problem in the Maven renderer: But other renderers in PMD have the same problem, eg pmd/pmd-core/src/main/java/net/sourceforge/pmd/renderers/TextColorRenderer.java Lines 217 to 219 in e5f55c0
|
@adangel I'm unsure this holds for the 3.22.0 plugin version, but you may want to take this to the maven plugin's JIRA. |
For nested classes, what are the expected values in additionalinfo of rule violations? pmd/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/internal/JavaViolationDecorator.java Lines 41 to 42 in 6a328d6
https://docs.pmd-code.org/latest/pmd_languages_java.html#violation-decorators Do we miss something here? Like something like "FULLY_QUALIFIED_CLASS_NAME"? |
Yes. Maybe we can specify |
Affects PMD Version: 7.0.0
Rule: AbstractClassWithoutAbstractMethod
Description: The AbstractClassWithoutAbstractMethod rule is being triggered on a non-abstract class
Code Sample demonstrating the issue:
Expected outcome: No AbstractClassWithoutAbstractMethod violation
Actual outcome:
[INFO] PMD Failure: com.github.cowwoc.lumina.Property:38 Rule:AbstractClassWithoutAbstractMethod Priority:3 This abstract class does not have any abstract methods.
Running PMD through: Maven with the following configuration:
The text was updated successfully, but these errors were encountered: