[java] Fix same package import from default package

- If the package was passed as an empty string rather than a `null`, we
    would attempt to load classes such as `.Foo` rather than `Foo`.
This commit is contained in:
Juan Martín Sotuyo Dodero
2017-01-31 01:44:59 -03:00
committed by Andreas Dangel
parent e25844fb01
commit 357b10952d

View File

@ -215,7 +215,7 @@ public class TypeSet {
*/
public CurrentPackageResolver(PMDASMClassLoader pmdClassLoader, String pkg) {
super(pmdClassLoader);
if (pkg == null) {
if (pkg == null || pkg.length() == 0) {
this.pkg = null;
} else {
this.pkg = pkg + ".";