identified can have last segment "namespace", for instance, javax.xml.namespace

This commit is contained in:
Stepan Koltsov
2012-04-28 17:43:53 +04:00
parent 7af5282a26
commit 615330ca75
@@ -222,14 +222,14 @@ public class JavaDescriptorResolver {
throw new IllegalStateException("both psiClass and psiPackage cannot be null"); throw new IllegalStateException("both psiClass and psiPackage cannot be null");
} }
if (fqName.lastSegmentIs(JvmAbi.PACKAGE_CLASS)) {
throw new IllegalStateException("identified cannot have last segment " + JvmAbi.PACKAGE_CLASS + ": " + fqName);
}
this.staticMembers = staticMembers; this.staticMembers = staticMembers;
this.kotlin = psiClass != null && this.kotlin = psiClass != null &&
(new PsiClassWrapper(psiClass).getJetClass().isDefined() || psiClass.getName().equals(JvmAbi.PACKAGE_CLASS)); (new PsiClassWrapper(psiClass).getJetClass().isDefined() || psiClass.getName().equals(JvmAbi.PACKAGE_CLASS));
classOrNamespaceDescriptor = descriptor; classOrNamespaceDescriptor = descriptor;
if (fqName.lastSegmentIs(JvmAbi.PACKAGE_CLASS) && psiClass != null && kotlin) {
throw new IllegalStateException("Kotlin namespace cannot have last segment " + JvmAbi.PACKAGE_CLASS + ": " + fqName);
}
} }
protected ResolverScopeData(boolean negative) { protected ResolverScopeData(boolean negative) {