GeezerVison is showing github.com — [java] BooleanGetMethodName: False-negatives with `Boolean` wrapper · Issue #5253 · pmd/pmd
[java] BooleanGetMethodName: False-negatives with Boolean wrapper #5253DescriptionIs your feature request related to a problem? Please describe.
Methods using Boolean return declaration are not managed by the BooleanGetMethodName rule.
Describe the solution you'd like
Update the rule to consider the Boolean wrapper too.
Describe alternatives you've considered
If this is considered as a BC break, I guess a property enabling the detection for the Boolean type could work.
Additional context
Boolean getFoo() {
return true;
}
|
<![CDATA[ |
|
//MethodDeclaration |
|
[starts-with(@Name, 'get')] |
|
[@Arity = 0 or $checkParameterizedMethods = true()] |
|
[ PrimitiveType[@Kind = 'boolean'] and @Overridden = false() ] |
|
]]> |
Activityaryanttripathi commented on Oct 8, 2024 Hello @phansys, I would like to work on this issue. I didn't get clarification on what we need to do here. Could you explain a little about what we need to perform here? I will be happy to do. Reacted by Javier Spagnoletti phansys commented on Oct 8, 2024 Hi @Aryant-Tripathi!
Could you explain a little about what we need to perform here?
The rule BooleanGetMethodName is catching cases like this:
boolean getFoo() {
return true;
}
but isn't detecting any violation in cases like this:
Boolean getFoo() {
return true;
}
Please, let me know if you need more context.
Thank you in advance. aryanttripathi commented on Oct 9, 2024 @phansys sir, If possible may you be able to mark/tag PR as hacktoberfest-accepted / hacktoberfest label. It will help me in contributing a PR in hacktoberfest. phansys commented on Oct 9, 2024 I haven't permission for that @Aryant-Tripathi, sorry.
Maybe @jsotuyod can help. jsotuyod commented on Oct 9, 2024 Sure, I've just added the hacktoberfest topic to the repo. Happy coding! Reacted by Javier Spagnoletti and Aryant Tripathi changed the title [-][java] [BooleanGetMethodName] Is there an explicit reason for not supporting `Boolean` wrapper class?[/-] [+][java] BooleanGetMethodName: False-negatives with `Boolean` wrapper[/+] on Oct 11, 2024added a commit that references this issue on Oct 12, 2024This issue will close once commit 08bcf29 is merged into the 'main' branch.08bcf29
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|