Replace map + filterNotNull -> mapNotNull in project
This commit is contained in:
+2
-2
@@ -470,9 +470,9 @@ class LazyJavaClassMemberScope(
|
||||
simpleFunctionDescriptor: SimpleFunctionDescriptor
|
||||
): Boolean {
|
||||
val candidatesToOverride =
|
||||
getFunctionsFromSupertypes(simpleFunctionDescriptor.name).map {
|
||||
getFunctionsFromSupertypes(simpleFunctionDescriptor.name).mapNotNull {
|
||||
BuiltinMethodsWithSpecialGenericSignature.getOverriddenBuiltinFunctionWithErasedValueParametersInJava(it)
|
||||
}.filterNotNull()
|
||||
}
|
||||
|
||||
return candidatesToOverride.any {
|
||||
candidate ->
|
||||
|
||||
+2
-3
@@ -40,11 +40,10 @@ class LazyJavaPackageFragment(
|
||||
}
|
||||
|
||||
internal val kotlinBinaryClasses by c.storageManager.createLazyValue {
|
||||
val simpleNames = c.components.packageMapper.findPackageParts(fqName.asString())
|
||||
simpleNames.map {
|
||||
c.components.packageMapper.findPackageParts(fqName.asString()).mapNotNull {
|
||||
val classId = ClassId(fqName, Name.identifier(it))
|
||||
c.components.kotlinClassFinder.findKotlinClass(classId)
|
||||
}.filterNotNull()
|
||||
}
|
||||
}
|
||||
|
||||
internal fun resolveTopLevelClass(javaClass: JavaClass) = topLevelClasses(javaClass)
|
||||
|
||||
+3
-3
@@ -132,7 +132,7 @@ fun KotlinType.computeIndexedQualifiersForOverride(fromSupertypes: Collection<Ko
|
||||
assert(isHeadTypeConstructor || !onlyHeadTypeConstructor) { "Only head type constructors should be computed" }
|
||||
|
||||
val qualifiers = indexedThisType[index]
|
||||
val verticalSlice = indexedFromSupertypes.map { it.getOrElse(index, { null }) }.filterNotNull()
|
||||
val verticalSlice = indexedFromSupertypes.mapNotNull { it.getOrNull(index) }
|
||||
|
||||
// Only the head type constructor is safely co-variant
|
||||
qualifiers.computeQualifiersForOverride(verticalSlice, isCovariant && isHeadTypeConstructor)
|
||||
@@ -142,8 +142,8 @@ fun KotlinType.computeIndexedQualifiersForOverride(fromSupertypes: Collection<Ko
|
||||
}
|
||||
|
||||
private fun KotlinType.computeQualifiersForOverride(fromSupertypes: Collection<KotlinType>, isCovariant: Boolean): JavaTypeQualifiers {
|
||||
val nullabilityFromSupertypes = fromSupertypes.map { it.extractQualifiers().nullability }.filterNotNull().toSet()
|
||||
val mutabilityFromSupertypes = fromSupertypes.map { it.extractQualifiers().mutability }.filterNotNull().toSet()
|
||||
val nullabilityFromSupertypes = fromSupertypes.mapNotNull { it.extractQualifiers().nullability }.toSet()
|
||||
val mutabilityFromSupertypes = fromSupertypes.mapNotNull { it.extractQualifiers().mutability }.toSet()
|
||||
|
||||
val own = extractQualifiersFromAnnotations()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user