JDR: do not create package fragment for class statics if class cannot be resolved
This keeps behaviour consistent in rare cases when JavaClass can be found but not resolved As of now this can happen in IDE if we take PsiClass from index but file structure is wrong so we can't resolve the class Add test which documents this case
This commit is contained in:
+2
-1
@@ -43,7 +43,8 @@ public class LazyJavaPackageFragmentProvider(
|
||||
else {
|
||||
val jClass = c.findJavaClass(fqName)
|
||||
if (jClass != null && DescriptorResolverUtils.isJavaClassVisibleAsPackage(jClass)) {
|
||||
LazyPackageFragmentForJavaClass(c, _module, jClass)
|
||||
val correspondingClass = c.javaClassResolver.resolveClass(jClass)
|
||||
if (correspondingClass != null) LazyPackageFragmentForJavaClass(c, _module, jClass) else null
|
||||
}
|
||||
else null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user