Skip to content
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] Add ignoredAnnotations property to unusedPrivateMethod rule #951

Merged
merged 1 commit into from
Mar 11, 2018

Conversation

djydewang
Copy link
Member

Fixed Issue #907

@jsotuyod
Copy link
Member

jsotuyod commented Mar 4, 2018

@djydewang this looks very good! Remember to transform the set in UnusedPrivateField to a property too if you have the time!

@jsotuyod jsotuyod added this to the 6.2.0 milestone Mar 4, 2018
@jsotuyod jsotuyod self-assigned this Mar 4, 2018
@djydewang
Copy link
Member Author

djydewang commented Mar 5, 2018

Remember to transform the set in UnusedPrivateField to a property too if you have the time!

@jsotuyod I've already done that. (commit)

@jsotuyod
Copy link
Member

jsotuyod commented Mar 5, 2018

@djydewang oh! I missed that! awesome!

* the node to check
* @return <code>true</code> if the annotation has been found
*/
protected boolean hasNeglectAnnotation(MethodNameDeclaration node) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this should be enough of a common pattern (checking if a node has an annotation in a particular set) that we could move that logic to ASTMethodDeclaration someday. Otherwise it'll be duplicated in every rule that needs it...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same logic here.

protected boolean hasLombokAnnotation(Node node) {

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added #956 to track this.

@adangel adangel changed the title [java] Add ignoredAnnotations ptoperty to unusedPrivateMethod rule [java] Add ignoredAnnotations property to unusedPrivateMethod rule Mar 5, 2018
@adangel adangel added the an:enhancement An improvement on existing features / rules label Mar 5, 2018
@jsotuyod jsotuyod merged commit 92031b1 into pmd:master Mar 11, 2018
jsotuyod added a commit that referenced this pull request Mar 11, 2018
@jsotuyod
Copy link
Member

This is now merged and will be part of PMD 6.2.0. Thanks a lot @djydewang!

@djydewang djydewang deleted the Issue907 branch May 25, 2018 03:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
an:enhancement An improvement on existing features / rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants