[482085] Fixed IllegalArgumentException in ImportNormalizer

This commit is contained in:
Sebastian Zarnekow 2015-11-13 10:23:50 +01:00
parent 065936319d
commit 505f9150d4
2 changed files with 3 additions and 3 deletions

View file

@ -23,7 +23,7 @@ public class ImportNormalizer {
public ImportNormalizer(QualifiedName importedNamespace, boolean wildCard, boolean ignoreCase) {
this.ignoreCase = ignoreCase;
if (importedNamespace == null || importedNamespace.getSegmentCount() < 1) {
if (importedNamespace == null || importedNamespace.isEmpty()) {
throw new IllegalArgumentException("Imported namespace must not be null / empty");
}
hasWildCard = wildCard;

View file

@ -161,7 +161,7 @@ public class ImportedNamespaceAwareLocalScopeProvider extends AbstractGlobalScop
if (Strings.isEmpty(namespace))
return null;
QualifiedName importedNamespace = qualifiedNameConverter.toQualifiedName(namespace);
if (importedNamespace == null || importedNamespace.getSegmentCount() < 1) {
if (importedNamespace == null || importedNamespace.isEmpty()) {
return null;
}
boolean hasWildCard = ignoreCase ?
@ -191,7 +191,7 @@ public class ImportedNamespaceAwareLocalScopeProvider extends AbstractGlobalScop
boolean ignoreCase = isIgnoreCase(reference);
final List<ImportNormalizer> namespaceResolvers = getImportedNamespaceResolvers(context, ignoreCase);
if (!namespaceResolvers.isEmpty()) {
if (isRelativeImport() && name!=null) {
if (isRelativeImport() && name!=null && !name.isEmpty()) {
ImportNormalizer localNormalizer = doCreateImportNormalizer(name, true, ignoreCase);
result = createImportScope(result, singletonList(localNormalizer), allDescriptions, reference.getEReferenceType(), isIgnoreCase(reference));
}