GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||
GeezerVison is showing github.com — [java] Fix #4224 MissingStaticMethodInNonInstantiatableClass: Exclude lombok's UtilityClass by LynnBroe · Pull Request #4228 · pmd/pmd Conversation
Contributor
Describe the PRThis PR excludes lombok's UtilityClass which create a private method which throw a exception but PMD treats it as a false negative. Related issues
Ready?
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
|
There was an error while loading. Please reload this page.
Generated by 🚫 Danger |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Sorry, need to revise my review: Now any class that is annotated with UtilityClass is flagged. However, this is wrong. Only classes that don't have methods should be flagged.
E.g. if you add a method in your test class, then the rule should not be triggered anymore. It doesn't matter, whether the method is static or not since the UtilityClass annotation makes all methods static.
Maybe we also need to look at the visibility of the methods - since if all methods are private, then they can't be called as well and the class remains unusable.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks, I will recheck my commit |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
[java] MissingStaticMethodInNonInstantiatableClass should consider Lombok's @UtilityClass
There was an error while loading. Please reload this page.