Skip to content

[java] Update UnnecessaryFullyQualifiedName#2897

Merged
adangel merged 18 commits into
pmd:pmd/7.0.xfrom
oowekyala:reimplement-unnecessaryFQCN
Nov 6, 2020
Merged

[java] Update UnnecessaryFullyQualifiedName#2897
adangel merged 18 commits into
pmd:pmd/7.0.xfrom
oowekyala:reimplement-unnecessaryFQCN

Conversation

@oowekyala

Copy link
Copy Markdown
Member

Describe the PR

Update rule UnnecessaryFullyQualifiedName. The rule uses the new symbol table, so it's much simpler. Hopefully it's also more precise. For method calls we err on the side of false-negatives instead of false positives. Let's see the regression report (though, messages have changed)

Related issues

Ready?

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

Fix tests

Doesn't work yet for static method calls:
resolution of methods needs type resolution.
Also fails with same package if classloader
is not set
@oowekyala oowekyala added this to the 7.0.0 milestone Nov 2, 2020
@ghost

ghost commented Nov 2, 2020

Copy link
Copy Markdown
2 Messages
📖 Compared to pmd/7.0.x:
This changeset introduces 962 new violations, 1 new errors and 0 new configuration errors,
removes 0 violations, 1 errors and 0 configuration errors.
Full report
📖 Compared to master:
This changeset introduces 1891 new violations, 11 new errors and 0 new configuration errors,
removes 998 violations, 16 errors and 2 configuration errors.
Full report
Compared to pmd/7.0.x:
This changeset introduces 962 new violations, 3 new errors and 0 new configuration errors,
removes 0 violations, 1 errors and 0 configuration errors.
Full report
Compared to master:
This changeset introduces 1891 new violations, 13 new errors and 0 new configuration errors,
removes 998 violations, 16 errors and 2 configuration errors.
Full report
Compared to pmd/7.0.x:
This changeset introduces 677 new violations, 1 new errors and 0 new configuration errors,
removes 0 violations, 1 errors and 0 configuration errors.
Full report
Compared to master:
This changeset introduces 1606 new violations, 11 new errors and 0 new configuration errors,
removes 998 violations, 16 errors and 2 configuration errors.
Full report
Compared to pmd/7.0.x:
This changeset introduces 714 new violations, 1 new errors and 0 new configuration errors,
removes 0 violations, 1 errors and 0 configuration errors.
Full report
Compared to master:
This changeset introduces 1643 new violations, 11 new errors and 0 new configuration errors,
removes 998 violations, 16 errors and 2 configuration errors.
Full report

Generated by 🚫 Danger

@oowekyala oowekyala marked this pull request as draft November 2, 2020 21:00
if (name.equals(importDeclaration.getImportedName())) {
matches.add(importDeclaration);
continue;
JavaNode opa = next.getParent().getParent();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

😄

adangel added a commit that referenced this pull request Nov 6, 2020
[java] Update UnnecessaryFullyQualifiedName #2897
@adangel adangel merged commit b661abe into pmd:pmd/7.0.x Nov 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[java] UnnecessaryFullyQualifiedName false positive with similar package name [java] UnnecessaryFullyQualifiedName false positive with enum constant

2 participants