-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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] BooleanGetMethodName: False-negatives with Boolean
wrapper
#5253
Comments
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. |
Hi @Aryant-Tripathi!
The rule 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. |
@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. |
I haven't permission for that @Aryant-Tripathi, sorry. |
Sure, I've just added the |
- Updated XPath rule to include both primitive and wrapper class: (PrimitiveType[@kind = 'boolean'] or ClassType[pmd-java:typeIs('java.lang.Boolean')]) - Added test cases to ensure that methods returning are also flagged correctly. - Ensured the rule enforces consistent method naming for both primitive and wrapper types.
Boolean
wrapper class?Boolean
wrapper
…Updated XPath rule to include both primitive and wrapper class:\n (PrimitiveType[@kind = 'boolean'] or ClassType[pmd-java:typeIs('java.lang.Boolean')])\n - Added test cases to ensure that methods returning are also flagged correctly.\n - Ensured the rule enforces consistent method naming for both primitive and wrapper types.
…Updated XPath rule to include both primitive and wrapper class:\n (PrimitiveType[@kind = 'boolean'] or ClassType[pmd-java:typeIs('java.lang.Boolean')])\n - Added test cases to ensure that methods returning are also flagged correctly.\n - Ensured the rule enforces consistent method naming for both primitive and wrapper types.
…Updated XPath rule to include both primitive and wrapper class:\n (PrimitiveType[@kind = 'boolean'] or ClassType[pmd-java:typeIs('java.lang.Boolean')])\n - Added test cases to ensure that methods returning are also flagged correctly.\n - Ensured the rule enforces consistent method naming for both primitive and wrapper types.
Is your feature request related to a problem? Please describe.
Methods using
Boolean
return declaration are not managed by theBooleanGetMethodName
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
pmd/pmd-java/src/main/resources/category/java/codestyle.xml
Lines 187 to 192 in a0818d5
The text was updated successfully, but these errors were encountered: