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] Improve ASTMethodDeclaration::isOverridden #3757

Merged
merged 6 commits into from
Feb 3, 2022

Conversation

oowekyala
Copy link
Member

Describe the PR

Move the logic that's currently in MissingOverrideRule into a separate attribution pass, so that every rule can benefit from it.

Related issues

Ready?

  • Added unit tests for fixed bug/feature
  • Passing all unit tests
  • Complete build ./mvnw clean verify passes (checked automatically by github actions)
  • Added (in-code) documentation (if needed)

@oowekyala oowekyala added this to the 7.0.0 milestone Jan 30, 2022
@pmd-test
Copy link

pmd-test commented Jan 30, 2022

2 Messages
📖 Compared to pmd/7.0.x:
This changeset changes 26 violations,
introduces 0 new violations, 0 new errors and 0 new configuration errors,
removes 5757 violations, 0 errors and 0 configuration errors.
Full report
📖 Compared to master:
This changeset changes 49303 violations,
introduces 26818 new violations, 5 new errors and 0 new configuration errors,
removes 146082 violations, 25 errors and 0 configuration errors.
Full report
Compared to pmd/7.0.x:
This changeset changes 26 violations,
introduces 0 new violations, 0 new errors and 0 new configuration errors,
removes 5757 violations, 0 errors and 0 configuration errors.
Full report
Compared to master:
This changeset changes 49303 violations,
introduces 26818 new violations, 5 new errors and 0 new configuration errors,
removes 146082 violations, 25 errors and 0 configuration errors.
Full report
Compared to pmd/7.0.x:
This changeset changes 0 violations,
introduces 1 new violations, 0 new errors and 0 new configuration errors,
removes 5777 violations, 0 errors and 0 configuration errors.
Full report
Compared to master:
This changeset changes 49303 violations,
introduces 26816 new violations, 5 new errors and 0 new configuration errors,
removes 146099 violations, 25 errors and 0 configuration errors.
Full report
Compared to pmd/7.0.x:
This changeset changes 0 violations,
introduces 1 new violations, 0 new errors and 0 new configuration errors,
removes 5777 violations, 0 errors and 0 configuration errors.
Full report
Compared to master:
This changeset changes 49303 violations,
introduces 26816 new violations, 5 new errors and 0 new configuration errors,
removes 146099 violations, 25 errors and 0 configuration errors.
Full report

Generated by 🚫 Danger

Copy link
Member

@adangel adangel left a comment

Choose a reason for hiding this comment

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

Looks good, I like this change!

This removes many false positives for the rules, that depend on the overridden flag:

  • CommentRequired won't flag methods, that are overridden by default (there is an option to enable this).
  • BooleanGetMethodName doesn't flag methods, which are overridden and thus can't be renamed easily (or not at all)
  • LooseCoupling doesn't flag methods, whose return type is a concrete collection type, if the method is overridden
  • MethodNamingConvention doesn't flag methods, which are overridden and thus can't be renamed easily (or not at all)
  • SignatureDeclareThrowsException
  • UseVarArgs

I'll merge this later this week.

@adangel adangel self-assigned this Jan 31, 2022
Copy link
Member Author

@oowekyala oowekyala left a comment

Choose a reason for hiding this comment

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

thanks for the review @adangel

@adangel adangel merged commit e7f9f6b into pmd:pmd/7.0.x Feb 3, 2022
@oowekyala oowekyala deleted the java-override-resolution branch February 3, 2022 11:24
@adangel adangel added the in:ast About the AST structure or API, the parsing step label Jan 13, 2023
@adangel adangel mentioned this pull request Jan 23, 2023
55 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in:ast About the AST structure or API, the parsing step
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants