Skip to content

[java] UnnecessaryFullyQualifiedName false positive with similar package name #2299

@davidburstrom

Description

@davidburstrom

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    a:false-positivePMD flags a piece of code that is not problematic

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions