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] Derive correct classname for non-public non-classes #1340

merged 2 commits into from Sep 10, 2018


None yet
3 participants

kris-scheibe commented Sep 10, 2018

To build the class name JavaRuleViolation#setClassNameFrom(JavaNode) either iterates all ClassOrInterfaceDeclaration's or finds the first public class/enum declaration.
This fails if the file only contains a non-public non-class, e.g. a package-private enum.

This PR makes it iterate all java types (class/interface, enum and annotations).


This comment has been minimized.

pmd-test commented Sep 10, 2018

1 Message
📖 Please check the regression diff report to make sure that everything is expected

Generated by 🚫 Danger

@jsotuyod jsotuyod added this to the 6.8.0 milestone Sep 10, 2018


This comment has been minimized.


jsotuyod commented Sep 10, 2018

@kris-scheibe this is awesome! Thanks for the contribution!

@jsotuyod jsotuyod merged commit 5cca9e8 into pmd:master Sep 10, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed

jsotuyod added a commit that referenced this pull request Sep 10, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment