DelegatingDataFlowInfo: potential concurrent modification in multi map fixed
This commit is contained in:
+6
-4
@@ -297,16 +297,18 @@ internal class DelegatingDataFlowInfo private constructor(
|
||||
typeInfo: SetMultimap<DataFlowValue, KotlinType>,
|
||||
valueWithGivenTypeInfo: DataFlowValue? = null
|
||||
): DataFlowInfo {
|
||||
val toDelete = newTypeInfo()
|
||||
for (value in typeInfo.keys()) {
|
||||
var iterator = typeInfo[value].iterator()
|
||||
while (iterator.hasNext()) {
|
||||
val type = iterator.next()
|
||||
for (type in typeInfo[value]) {
|
||||
// Remove original type and for not flexible type also all its supertypes (see also KT-10666)
|
||||
if (if (value.type.isFlexible()) value.type == type else value.type.isSubtypeOf(type)) {
|
||||
iterator.remove()
|
||||
toDelete.put(value, type)
|
||||
}
|
||||
}
|
||||
}
|
||||
for ((value, type) in toDelete.entries()) {
|
||||
typeInfo.remove(value, type)
|
||||
}
|
||||
if (nullabilityInfo.isEmpty() && typeInfo.isEmpty && valueWithGivenTypeInfo == null) {
|
||||
return parent ?: DataFlowInfoFactory.EMPTY
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user