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] UnnecessaryFullyQualifiedName false positive with similar package name #2299

Closed
davidburstrom opened this issue Feb 19, 2020 · 1 comment · Fixed by #2897
Closed
Labels
a:false-positive PMD flags a piece of code that is not problematic
Milestone

Comments

@davidburstrom
Copy link

davidburstrom commented Feb 19, 2020

Affects PMD Version:
6.20.0, at least.

Rule:
UnnecessaryFullyQualifiedName

Description:
If a FQN starts (but continues with further identifier symbols) with the current package name, there's a false positive `Unnecessary use of fully qualified name 'a.b.car.Car' due to existing same package import 'a.b.c.*'

Code Sample demonstrating the issue:

package a.b.c;

class A {
  a.b.car.Car c;
}

Running PMD through:
CLI/Gradle

@oowekyala oowekyala added the a:false-positive PMD flags a piece of code that is not problematic label Aug 3, 2020
oowekyala added a commit to oowekyala/pmd that referenced this issue Nov 2, 2020
@adangel adangel added this to the 7.0.0 milestone Nov 6, 2020
@adangel adangel linked a pull request Nov 6, 2020 that will close this issue
4 tasks
@adangel adangel changed the title [java] UnnecessaryFullyQualifiedName false positive [java] UnnecessaryFullyQualifiedName false positive with similar package name Nov 6, 2020
@adangel
Copy link
Member

adangel commented Nov 6, 2020

Fixed in PMD 7

@adangel adangel closed this as completed Nov 6, 2020
@adangel adangel mentioned this issue Jan 23, 2023
55 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:false-positive PMD flags a piece of code that is not problematic
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants