You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "stevenschlansker (via GitHub)" <gi...@apache.org> on 2025/10/23 00:15:11 UTC
[I] PMD failure summary names inner class, but not enclosing class [maven-pmd-plugin]
stevenschlansker opened a new issue, #665:
URL: https://github.com/apache/maven-pmd-plugin/issues/665
### Affected version
3.28.0
### Bug description
For a class that reports a bug, like
```java
public class TestOuter {
class Inner {
}
}
```
if there is a bug in `Inner`, the failure looks like:
```
[INFO] --- pmd:3.28.0:check (basepom.default) @ my-project ---
[WARNING] PMD Failure: my.package.Inner:16 Rule:ConstructorCallsOverridableMethod Priority:1 Overridable method called during object construction
```
Note `my.package.Inner` which is package-name + class-name
For top-level classes this is fine, but for inner classes, the enclosing class(es) should also be printed (as many nesting levels as are present). Otherwise, the end-user might be confused as to where to find the bug, especially if multiple classes in the same package have similarly-named nested classes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] PMD failure summary names inner class, but not enclosing class [maven-pmd-plugin]
Posted by "stevenschlansker (via GitHub)" <gi...@apache.org>.
stevenschlansker closed issue #665: PMD failure summary names inner class, but not enclosing class
URL: https://github.com/apache/maven-pmd-plugin/issues/665
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] PMD failure summary names inner class, but not enclosing class [maven-pmd-plugin]
Posted by "stevenschlansker (via GitHub)" <gi...@apache.org>.
stevenschlansker commented on issue #665:
URL: https://github.com/apache/maven-pmd-plugin/issues/665#issuecomment-3437756137
Thanks, sounds good to me!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] PMD failure summary names inner class, but not enclosing class [maven-pmd-plugin]
Posted by "adangel (via GitHub)" <gi...@apache.org>.
adangel commented on issue #665:
URL: https://github.com/apache/maven-pmd-plugin/issues/665#issuecomment-3435901279
This is actually a bug in PMD and will be fixed with the next version (see https://github.com/pmd/pmd/issues/4904 ).
However, the maven-pmd-plugin should not report the class name here, as the line numbers are then not obvious (is it line 16 of class Inner, or of class TestOuter, or is it the line number inside the file?). Instead, it should report the java source file - then the line number is not ambiguous anymore.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org