GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [java] UnnecessaryFullyQualifiedName false positive when nested and non-nested classes with the same name and in the same package are used together · Issue #4085 · pmd/pmd

[java] UnnecessaryFullyQualifiedName false positive when nested and non-nested classes with the same name and in the same package are used together #4085

New issue
Copy link
New issue
Copy link
Closed
#4128
Closed
[java] UnnecessaryFullyQualifiedName false positive when nested and non-nested classes with the same name and in the same package are used together#4085
#4128
Copy link
Labels
a:false-positivePMD flags a piece of code that is not problematic
Milestone
6.50.0

Description

@OlegAndreych
OlegAndreych
opened on Aug 8, 2022
Issue body actions

One can find a project to reproduce this issue here: https://github.com/OlegAndreych/PMDNestedClassFQNTest.

package some.pkg;

public class Test {
}
package some.pkg;

public class OuterTest {
    public static class Test{
        private final some.pkg.Test test; // line 5 - false positive

        public Test(some.pkg.Test test){ // line 7 - false positive

            this.test = test;
        }
    }
}

PMD Reports the following violations:

[INFO] PMD Failure: some.pkg.OuterTest$Test:5 Rule:UnnecessaryFullyQualifiedName Priority:4 Unnecessary use of fully qualified name 'some.pkg.Test' due to existing same package import 'some.pkg.*'.
[INFO] PMD Failure: some.pkg.OuterTest$Test:7 Rule:UnnecessaryFullyQualifiedName Priority:4 Unnecessary use of fully qualified name 'some.pkg.Test' due to existing same package import 'some.pkg.*'.

Both are false positives - the fully qualified name is necessary, since the enclosing class has the same name (Test).

Activity

  1. OlegAndreych
    changed the title [-]False-positive UnnecessaryFullyQualifiedName when nested and non-nested classes with the same name are used together[/-] [+]False-positive UnnecessaryFullyQualifiedName when nested and non-nested classes with the same name and in the same package are used together[/+] on Aug 8, 2022
  2. OlegAndreych
    added a commit that references this issue on Aug 25, 2022

    False-positive UnnecessaryFullyQualifiedName when nested and non-nest…

    f228bfe
  3. adangel
    changed the title [-]False-positive UnnecessaryFullyQualifiedName when nested and non-nested classes with the same name and in the same package are used together[/-] [+][java] UnnecessaryFullyQualifiedName false positive when nested and non-nested classes with the same name and in the same package are used together[/+] on Aug 29, 2022
  4. adangel
    added
    a:false-positivePMD flags a piece of code that is not problematic
    on Aug 29, 2022
  5. OlegAndreych
    added 4 commits that reference this issue on Sep 18, 2022

    False-positive UnnecessaryFullyQualifiedName when nested and non-nest…

    d468125

    False-positive UnnecessaryFullyQualifiedName when nested and non-nest…

    bb46830

    False-positive UnnecessaryFullyQualifiedName when nested and non-nest…

    7f7f8f7

    False-positive UnnecessaryFullyQualifiedName when nested and non-nest…

    af30f4c
  6. adangel
    added this to the 6.50.0 milestone on Sep 29, 2022
  7. adangel
    added a commit that references this issue on Sep 29, 2022

    [doc] Update release notes (pmd#4085, pmd#4128)

    94d343e
  8. adangel
    closed this as completedin #4128on Sep 29, 2022
  9. rdesgroppes
    added 2 commits that reference this issue on Apr 26, 2023

    Bump PMD version to last planned release (6.55.0)

    9ed8991

    Bump PMD version to last planned release (6.55.0)

    23e1897
  10. illicitonion
    added a commit that references this issue on Apr 26, 2023

    Bump PMD version to last planned release (6.55.0) (#178)

    d99cc64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    No projects

      Milestone

      • 6.50.0

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.