From 507eccc4eccd421a46be940073ae6d6ecac897fb Mon Sep 17 00:00:00 2001 From: Denis Zharkov Date: Tue, 6 Jun 2017 17:48:57 +0300 Subject: [PATCH] Replace another allowFlexible=false with isNotNullable Having field initilized doesn't make it inflexible in a sense of mutability --- .../kotlin/load/java/lazy/descriptors/LazyJavaScope.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaScope.kt b/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaScope.kt index 9f9218b92b2..bc092a38cf4 100644 --- a/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaScope.kt +++ b/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaScope.kt @@ -283,12 +283,12 @@ abstract class LazyJavaScope(protected val c: LazyJavaResolverContext) : MemberS private fun getPropertyType(field: JavaField, annotations: Annotations): KotlinType { // Fields do not have their own generic parameters. // Simple static constants should not have flexible types. - val allowFlexible = !(field.isFinalStatic && field.hasConstantNotNullInitializer) + val isNotNullable = !(field.isFinalStatic && field.hasConstantNotNullInitializer) val propertyType = c.typeResolver.transformJavaType( field.type, - LazyJavaTypeAttributes(TypeUsage.COMMON, annotations, allowFlexible) + LazyJavaTypeAttributes(TypeUsage.COMMON, annotations) ) - if (!allowFlexible) { + if (!isNotNullable) { return TypeUtils.makeNotNullable(propertyType) }