[UCL] Minor fixes

This commit is contained in:
Igor Yakovlev
2020-09-04 14:17:02 +03:00
parent 97ac86273a
commit 8fc94ddb8c
2 changed files with 2 additions and 4 deletions
@@ -11,7 +11,6 @@ import com.intellij.openapi.project.Project
import com.intellij.openapi.util.Comparing
import com.intellij.openapi.util.Key
import com.intellij.openapi.util.TextRange
import com.intellij.openapi.util.registry.Registry
import com.intellij.psi.*
import com.intellij.psi.impl.InheritanceImplUtil
import com.intellij.psi.impl.java.stubs.PsiJavaFileStub
@@ -55,7 +54,6 @@ import org.jetbrains.kotlin.psi.stubs.KotlinClassOrObjectStub
import org.jetbrains.kotlin.resolve.DescriptorUtils
import java.util.*
import javax.swing.Icon
import kotlin.jvm.Throws
private class KtLightClassModifierList(containingClass: KtLightClassForSourceDeclaration, computeModifiers: () -> Set<String>) :
KtLightModifierList<KtLightClassForSourceDeclaration>(containingClass) {
@@ -360,7 +358,7 @@ abstract class KtLightClassForSourceDeclaration(
LightClassGenerationSupport.getInstance(classOrObject.project).run {
if (useUltraLightClasses) {
return createUltraLightClass(classOrObject)
?: error { "Unable to create UL class for ${classOrObject::javaClass.name}" }
?: error { "Unable to create UL class for ${classOrObject.javaClass.name}" }
}
}
}
@@ -296,7 +296,7 @@ open class KtLightNullabilityAnnotation<D : KtLightElement<*, PsiModifierListOwn
// all data-class generated members are not-null
if (annotatedElement is KtClass && annotatedElement.isData()) return NotNull::class.java.name
// objects and companion objects are not null but ctor that does not annotated
// objects and companion objects have NotNull annotation (if annotated element is implicit ctor then skip annotation)
if (annotatedElement is KtObjectDeclaration) {
if ((parent.parent as? PsiMethod)?.isConstructor == true) return null
return NotNull::class.java.name