mirror of
https://github.com/sigmasternchen/xtext-core
synced 2025-03-16 08:48:55 +00:00
[482085] Fixed IllegalArgumentException in ImportNormalizer
This commit is contained in:
parent
065936319d
commit
505f9150d4
2 changed files with 3 additions and 3 deletions
|
@ -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;
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue