A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pmd/pmd/issues/1114 below:

[java] Star import overwritten by explicit import is not correctly handled · Issue #1114 · pmd/pmd · GitHub

Affects PMD Version: ??

Rule: java-codestyle.xml/UnnecessaryFullyQualifiedName??

Description:
Hi,
When we have two classes with the same name, but in separate packages and one is imported by
import package.*
and the other by
import otherPackage.fullName;

Then in code if I use for example new fullName() java uses class defined by otherPackage.fullName.
So if I want to instantiate package.fullname I have to write new package.fullname(). But PMD says that it should not be fully qualified. But if it were not fully qualified then it would mean an another class.

Code Sample demonstrating the issue:

Please see attached sample:
./pmd.bat -d import_sample -format text -R default-java-ruleset.xml -version 1.6
import_sample.zip

Running PMD through: [Maven]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4