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: static method on shadowed implicitly imported class #1255

Closed
davidburstromspotify opened this Issue Jul 25, 2018 · 0 comments

Comments

Projects
None yet
2 participants
@davidburstromspotify

davidburstromspotify commented Jul 25, 2018

Affects PMD Version: 6.5.0

Rule:
category/java/codestyle.xml/UnnecessaryFullyQualifiedName

Description:
If there is an implicit import (e.g. java.lang.Thread), but there is an explicit import of a class of the same name, there are false positives on redundant FQ, if there's an method invocation on the implicitly imported class.

Code Sample demonstrating the issue:

import x.y.Thread;

public class ThreadStuff {
    public Thread stuff() {
        return new Thread(java.lang.Thread.currentThread());
    }
}

Running PMD through: Any

@davidburstromspotify davidburstromspotify changed the title from False positive: Redundant FQ class reference for shadowed implicitly imported class to False positive: Redundant FQ class reference for static method on shadowed implicitly imported class Jul 25, 2018

@adangel adangel changed the title from False positive: Redundant FQ class reference for static method on shadowed implicitly imported class to [java] UnnecessaryFullyQualifiedName False positive: Redundant FQ class reference for static method on shadowed implicitly imported class Jul 28, 2018

@adangel adangel changed the title from [java] UnnecessaryFullyQualifiedName False positive: Redundant FQ class reference for static method on shadowed implicitly imported class to [java] UnnecessaryFullyQualifiedName false positive: static method on shadowed implicitly imported class Jul 28, 2018

@adangel adangel self-assigned this Jul 28, 2018

adangel added a commit to adangel/pmd that referenced this issue Jul 29, 2018

@adangel adangel added this to the 6.7.0 milestone Jul 29, 2018

@adangel adangel added the has:pr label Jul 29, 2018

adangel added a commit to adangel/pmd that referenced this issue Jul 30, 2018

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