Use LinkedHashSet instead of HashSet in DataFlowInfo.getCollectedTypes
This fixes DiagnosticsTestGenerated$Tests.testImplicitIntersection, which began to fail after update to JDK 8 because the iteration order of HashMap/HashSet has changed in JDK 8: http://openjdk.java.net/jeps/180 http://hg.openjdk.java.net/jdk8/jdk8/jdk/rev/43bd5ee0205e
This commit is contained in:
committed by
Dmitry Jemerov
parent
211b58ac6e
commit
555b3f12ee
+5
-6
@@ -20,15 +20,14 @@ import com.google.common.collect.*
|
||||
import org.jetbrains.kotlin.builtins.KotlinBuiltIns
|
||||
import org.jetbrains.kotlin.config.LanguageFeature
|
||||
import org.jetbrains.kotlin.config.LanguageVersionSettings
|
||||
import org.jetbrains.kotlin.types.*
|
||||
import org.jetbrains.kotlin.resolve.calls.smartcasts.Nullability.NOT_NULL
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
import org.jetbrains.kotlin.types.TypeUtils
|
||||
import org.jetbrains.kotlin.types.typeUtil.*
|
||||
|
||||
import org.jetbrains.kotlin.types.isFlexible
|
||||
import org.jetbrains.kotlin.types.typeUtil.isSubtypeOf
|
||||
import org.jetbrains.kotlin.utils.newLinkedHashSetWithExpectedSize
|
||||
import java.util.*
|
||||
|
||||
import org.jetbrains.kotlin.resolve.calls.smartcasts.Nullability.NOT_NULL
|
||||
|
||||
internal class DelegatingDataFlowInfo private constructor(
|
||||
private val parent: DataFlowInfo?,
|
||||
private val nullabilityInfo: ImmutableMap<DataFlowValue, Nullability>,
|
||||
@@ -121,7 +120,7 @@ internal class DelegatingDataFlowInfo private constructor(
|
||||
return types
|
||||
}
|
||||
|
||||
val enrichedTypes = Sets.newHashSetWithExpectedSize<KotlinType>(types.size + 1)
|
||||
val enrichedTypes = newLinkedHashSetWithExpectedSize<KotlinType>(types.size + 1)
|
||||
val originalType = key.type
|
||||
if (originalType.isMarkedNullable) {
|
||||
enrichedTypes.add(TypeUtils.makeNotNullable(originalType))
|
||||
|
||||
Reference in New Issue
Block a user