[java] Fix #4225 MissingStaticMethodInNonInstantiatableClass: Exclude lombok's @NoArgsConstructor annotation#4227
Merged
Conversation
Generated by 🚫 Danger |
adangel
reviewed
Nov 24, 2022
adangel
left a comment
Member
There was a problem hiding this comment.
Thanks for the PR!
Can you please also create test cases for the other two lombok annotations which generate constructors?
@RequiredArgsConstructor@AllArgsConstructor
See https://projectlombok.org/features/constructor for the full lombok documentation.
Contributor
Author
|
Ok, Iwill create some test cases for the other two lombok annotations |
adangel
approved these changes
Nov 25, 2022
Comment on lines
+392
to
+393
| private Test(int a, int b, int c, String abc, long d, double p, | ||
| String[] arr, int data, long in, float fl, String res) { } // 11 params |
Member
There was a problem hiding this comment.
I'll change these test samples myself when I merge it, because the sample classes should have fields and not constructors. The constructors are generated by lombok, so no need to define them. But the generated constructors would depend on the fields (at least for allargs and required args). That way, the examples are more "realistic".
adangel
added a commit
to adangel/pmd
that referenced
this pull request
Nov 25, 2022
adangel
added a commit
to adangel/pmd
that referenced
this pull request
Nov 25, 2022
[java] Fix pmd#4225 MissingStaticMethodInNonInstantiatableClass: Exclude lombok's @NoArgsConstructor annotation pmd#4227
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe the PR
This PR excludes lombok's @NoArgsConstructor annotation which generates a public constructor but PMD treats it as a false positive.
Related issues
Ready?
./mvnw clean verifypasses (checked automatically by github actions)