diff --git a/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java index 0c164d9fe47..ffadf13e879 100644 --- a/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java @@ -3323,6 +3323,56 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/casts/javaInterop/instanceOfWithWrongType.kt"); } + @TestMetadata("noNullCheckOnCollectionContains.kt") + public void testNoNullCheckOnCollectionContains() throws Exception { + runTest("compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnCollectionContains.kt"); + } + + @TestMetadata("noNullCheckOnCollectionRemove.kt") + public void testNoNullCheckOnCollectionRemove() throws Exception { + runTest("compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnCollectionRemove.kt"); + } + + @TestMetadata("noNullCheckOnListIndexOf.kt") + public void testNoNullCheckOnListIndexOf() throws Exception { + runTest("compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnListIndexOf.kt"); + } + + @TestMetadata("noNullCheckOnListLastIndexOf.kt") + public void testNoNullCheckOnListLastIndexOf() throws Exception { + runTest("compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnListLastIndexOf.kt"); + } + + @TestMetadata("noNullCheckOnMapContainsKey.kt") + public void testNoNullCheckOnMapContainsKey() throws Exception { + runTest("compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnMapContainsKey.kt"); + } + + @TestMetadata("noNullCheckOnMapContainsValue.kt") + public void testNoNullCheckOnMapContainsValue() throws Exception { + runTest("compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnMapContainsValue.kt"); + } + + @TestMetadata("noNullCheckOnMapGet.kt") + public void testNoNullCheckOnMapGet() throws Exception { + runTest("compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnMapGet.kt"); + } + + @TestMetadata("noNullCheckOnMapRemove.kt") + public void testNoNullCheckOnMapRemove() throws Exception { + runTest("compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnMapRemove.kt"); + } + + @TestMetadata("nullCheckOnMapGetOrDefault.kt") + public void testNullCheckOnMapGetOrDefault() throws Exception { + runTest("compiler/testData/codegen/box/casts/javaInterop/nullCheckOnMapGetOrDefault.kt"); + } + + @TestMetadata("nullCheckOnMapRemove2.kt") + public void testNullCheckOnMapRemove2() throws Exception { + runTest("compiler/testData/codegen/box/casts/javaInterop/nullCheckOnMapRemove2.kt"); + } + @TestMetadata("safeCastWithWrongType.kt") public void testSafeCastWithWrongType() throws Exception { runTest("compiler/testData/codegen/box/casts/javaInterop/safeCastWithWrongType.kt"); diff --git a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/SpecialBridgeMethods.kt b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/SpecialBridgeMethods.kt index 93bf837ac17..d68b25eeb52 100644 --- a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/SpecialBridgeMethods.kt +++ b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/SpecialBridgeMethods.kt @@ -9,6 +9,7 @@ import org.jetbrains.kotlin.backend.common.CommonBackendContext import org.jetbrains.kotlin.backend.common.ir.allOverridden import org.jetbrains.kotlin.builtins.KotlinBuiltIns import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET +import org.jetbrains.kotlin.ir.declarations.IrClass import org.jetbrains.kotlin.ir.declarations.IrSimpleFunction import org.jetbrains.kotlin.ir.expressions.IrConstKind import org.jetbrains.kotlin.ir.expressions.IrExpression @@ -107,8 +108,14 @@ class SpecialBridgeMethods(val context: CommonBackendContext) { val specialMethodNames = (specialMethodsWithDefaults + specialMethods).map { (description) -> description.name }.toHashSet() val specialPropertyNames = specialProperties.map { (description) -> description.name }.toHashSet() - fun findSpecialWithOverride(irFunction: IrSimpleFunction): Pair? { - for (overridden in irFunction.allOverridden()) { + fun findSpecialWithOverride( + irFunction: IrSimpleFunction, + includeSelf: Boolean = false + ): Pair? { + if (irFunction.parent !is IrClass) + return null + + for (overridden in irFunction.allOverridden(includeSelf)) { val description = overridden.toDescription() specialMethodsWithDefaults[description]?.let { return Pair(overridden, it) diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/JvmArgumentNullabilityAssertionsLowering.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/JvmArgumentNullabilityAssertionsLowering.kt index b51b85b4217..7cc162a4dc1 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/JvmArgumentNullabilityAssertionsLowering.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/JvmArgumentNullabilityAssertionsLowering.kt @@ -9,6 +9,7 @@ import org.jetbrains.kotlin.backend.common.FileLoweringPass import org.jetbrains.kotlin.backend.common.lower.SpecialBridgeMethods import org.jetbrains.kotlin.backend.common.phaser.makeIrFilePhase import org.jetbrains.kotlin.backend.jvm.JvmBackendContext +import org.jetbrains.kotlin.backend.jvm.ir.hasPlatformDependent import org.jetbrains.kotlin.ir.IrElement import org.jetbrains.kotlin.ir.IrStatement import org.jetbrains.kotlin.ir.declarations.IrFile @@ -30,7 +31,8 @@ private enum class AssertionScope { Enabled, Disabled } -private class JvmArgumentNullabilityAssertionsLowering(context: JvmBackendContext) : FileLoweringPass, IrElementTransformer { +private class JvmArgumentNullabilityAssertionsLowering(context: JvmBackendContext) : FileLoweringPass, + IrElementTransformer { private val isWithUnifiedNullChecks = context.state.unifiedNullChecks private val isCallAssertionsDisabled = context.state.isCallAssertionsDisabled @@ -90,7 +92,13 @@ private class JvmArgumentNullabilityAssertionsLowering(context: JvmBackendContex } private fun isCallToMethodWithTypeCheckBarrier(expression: IrMemberAccessExpression<*>): Boolean = - expression.symbol.owner.safeAs()?.let { specialBridgeMethods.findSpecialWithOverride(it) != null } == true + expression.symbol.owner.safeAs() + ?.let { + val bridgeInfo = specialBridgeMethods.findSpecialWithOverride(it, includeSelf = true) + // The JVM BE adds null checks around platform dependent special bridge methods (Map.getOrDefault and the version of + // MutableMap.remove with two arguments). + bridgeInfo != null && !bridgeInfo.first.hasPlatformDependent() + } == true private val IrStatementOrigin?.isOperatorWithNoNullabilityAssertionsOnExtensionReceiver get() = this is IrStatementOrigin.COMPONENT_N || this in operatorsWithNoNullabilityAssertionsOnExtensionReceiver diff --git a/compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnCollectionContains.kt b/compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnCollectionContains.kt new file mode 100644 index 00000000000..70dfbaac1d5 --- /dev/null +++ b/compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnCollectionContains.kt @@ -0,0 +1,12 @@ +// TARGET_BACKEND: JVM +// WITH_RUNTIME +// FILE: A.java +public class A { + public static A nil() { return null; } +} + +// FILE: test.kt +fun box(): String { + val m = mapOf() + return if (A.nil() in m.keys) "Fail" else "OK" +} diff --git a/compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnCollectionRemove.kt b/compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnCollectionRemove.kt new file mode 100644 index 00000000000..64fcb8dfa44 --- /dev/null +++ b/compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnCollectionRemove.kt @@ -0,0 +1,12 @@ +// TARGET_BACKEND: JVM +// WITH_RUNTIME +// FILE: A.java +public class A { + public static A nil() { return null; } +} + +// FILE: test.kt +fun box(): String { + val m = mutableMapOf() + return if (m.remove(A.nil()) == null) "OK" else "Fail" +} diff --git a/compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnListIndexOf.kt b/compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnListIndexOf.kt new file mode 100644 index 00000000000..327624098bc --- /dev/null +++ b/compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnListIndexOf.kt @@ -0,0 +1,12 @@ +// TARGET_BACKEND: JVM +// WITH_RUNTIME +// FILE: A.java +public class A { + public static A nil() { return null; } +} + +// FILE: test.kt +fun box(): String { + val l = listOf() + return if (l.indexOf(A.nil()) == -1) "OK" else "Fail" +} diff --git a/compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnListLastIndexOf.kt b/compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnListLastIndexOf.kt new file mode 100644 index 00000000000..162c9779464 --- /dev/null +++ b/compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnListLastIndexOf.kt @@ -0,0 +1,12 @@ +// TARGET_BACKEND: JVM +// WITH_RUNTIME +// FILE: A.java +public class A { + public static A nil() { return null; } +} + +// FILE: test.kt +fun box(): String { + val l = listOf() + return if (l.lastIndexOf(A.nil()) == -1) "OK" else "Fail" +} diff --git a/compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnMapContainsKey.kt b/compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnMapContainsKey.kt new file mode 100644 index 00000000000..dc9d967cc06 --- /dev/null +++ b/compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnMapContainsKey.kt @@ -0,0 +1,12 @@ +// TARGET_BACKEND: JVM +// WITH_RUNTIME +// FILE: A.java +public class A { + public static A nil() { return null; } +} + +// FILE: test.kt +fun box(): String { + val m = mapOf() + return if (m.containsKey(A.nil())) "Fail" else "OK" +} diff --git a/compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnMapContainsValue.kt b/compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnMapContainsValue.kt new file mode 100644 index 00000000000..690026e6ee8 --- /dev/null +++ b/compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnMapContainsValue.kt @@ -0,0 +1,12 @@ +// TARGET_BACKEND: JVM +// WITH_RUNTIME +// FILE: A.java +public class A { + public static A nil() { return null; } +} + +// FILE: test.kt +fun box(): String { + val m = mapOf() + return if (m.containsValue(A.nil())) "Fail" else "OK" +} diff --git a/compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnMapGet.kt b/compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnMapGet.kt new file mode 100644 index 00000000000..82f3507273a --- /dev/null +++ b/compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnMapGet.kt @@ -0,0 +1,12 @@ +// TARGET_BACKEND: JVM +// WITH_RUNTIME +// FILE: A.java +public class A { + public static A nil() { return null; } +} + +// FILE: test.kt +fun box(): String { + val m = mapOf() + return m[A.nil()] ?: "OK" +} diff --git a/compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnMapRemove.kt b/compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnMapRemove.kt new file mode 100644 index 00000000000..64fcb8dfa44 --- /dev/null +++ b/compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnMapRemove.kt @@ -0,0 +1,12 @@ +// TARGET_BACKEND: JVM +// WITH_RUNTIME +// FILE: A.java +public class A { + public static A nil() { return null; } +} + +// FILE: test.kt +fun box(): String { + val m = mutableMapOf() + return if (m.remove(A.nil()) == null) "OK" else "Fail" +} diff --git a/compiler/testData/codegen/box/casts/javaInterop/nullCheckOnMapGetOrDefault.kt b/compiler/testData/codegen/box/casts/javaInterop/nullCheckOnMapGetOrDefault.kt new file mode 100644 index 00000000000..544a5e8212c --- /dev/null +++ b/compiler/testData/codegen/box/casts/javaInterop/nullCheckOnMapGetOrDefault.kt @@ -0,0 +1,27 @@ +// IGNORE_BACKEND_FIR: JVM_IR +// TARGET_BACKEND: JVM +// JVM_TARGET: 1.8 +// WITH_RUNTIME +// FULL_JDK +// FILE: A.java +public class A { + public static A nil() { return null; } +} + +// FILE: test.kt +fun box(): String { + // There is a null check on both arguments of Map.getOrDefault, so we expect this code to throw an exception. + // Which exception this is depends on the language version (it's a NullPointerException in Kotlin 1.4). + val m = mapOf() + try { + m.getOrDefault(A.nil(), A()) + } catch (e: Exception) { + try { + m.getOrDefault(A(), A.nil()) + } catch (e: Exception) { + return "OK" + } + return "Fail 2" + } + return "Fail 1" +} diff --git a/compiler/testData/codegen/box/casts/javaInterop/nullCheckOnMapRemove2.kt b/compiler/testData/codegen/box/casts/javaInterop/nullCheckOnMapRemove2.kt new file mode 100644 index 00000000000..e23d2ed3aec --- /dev/null +++ b/compiler/testData/codegen/box/casts/javaInterop/nullCheckOnMapRemove2.kt @@ -0,0 +1,27 @@ +// IGNORE_BACKEND_FIR: JVM_IR +// TARGET_BACKEND: JVM +// JVM_TARGET: 1.8 +// WITH_RUNTIME +// FULL_JDK +// FILE: A.java +public class A { + public static A nil() { return null; } +} + +// FILE: test.kt +fun box(): String { + // There is a null check on both arguments of MutableMap.remove, so we expect this code to throw an exception. + // Which exception this is depends on the language version (it's a NullPointerException in Kotlin 1.4). + val m = mutableMapOf() + try { + m.remove(A.nil(), A()) + } catch (e: Exception) { + try { + m.remove(A(), A.nil()) + } catch (e: Exception) { + return "OK" + } + return "Fail 2" + } + return "Fail 1" +} diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java index 7e2215e93c0..57bcda6cfe9 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java @@ -3343,6 +3343,56 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/casts/javaInterop/instanceOfWithWrongType.kt"); } + @TestMetadata("noNullCheckOnCollectionContains.kt") + public void testNoNullCheckOnCollectionContains() throws Exception { + runTest("compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnCollectionContains.kt"); + } + + @TestMetadata("noNullCheckOnCollectionRemove.kt") + public void testNoNullCheckOnCollectionRemove() throws Exception { + runTest("compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnCollectionRemove.kt"); + } + + @TestMetadata("noNullCheckOnListIndexOf.kt") + public void testNoNullCheckOnListIndexOf() throws Exception { + runTest("compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnListIndexOf.kt"); + } + + @TestMetadata("noNullCheckOnListLastIndexOf.kt") + public void testNoNullCheckOnListLastIndexOf() throws Exception { + runTest("compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnListLastIndexOf.kt"); + } + + @TestMetadata("noNullCheckOnMapContainsKey.kt") + public void testNoNullCheckOnMapContainsKey() throws Exception { + runTest("compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnMapContainsKey.kt"); + } + + @TestMetadata("noNullCheckOnMapContainsValue.kt") + public void testNoNullCheckOnMapContainsValue() throws Exception { + runTest("compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnMapContainsValue.kt"); + } + + @TestMetadata("noNullCheckOnMapGet.kt") + public void testNoNullCheckOnMapGet() throws Exception { + runTest("compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnMapGet.kt"); + } + + @TestMetadata("noNullCheckOnMapRemove.kt") + public void testNoNullCheckOnMapRemove() throws Exception { + runTest("compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnMapRemove.kt"); + } + + @TestMetadata("nullCheckOnMapGetOrDefault.kt") + public void testNullCheckOnMapGetOrDefault() throws Exception { + runTest("compiler/testData/codegen/box/casts/javaInterop/nullCheckOnMapGetOrDefault.kt"); + } + + @TestMetadata("nullCheckOnMapRemove2.kt") + public void testNullCheckOnMapRemove2() throws Exception { + runTest("compiler/testData/codegen/box/casts/javaInterop/nullCheckOnMapRemove2.kt"); + } + @TestMetadata("safeCastWithWrongType.kt") public void testSafeCastWithWrongType() throws Exception { runTest("compiler/testData/codegen/box/casts/javaInterop/safeCastWithWrongType.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 27d2f887b61..11560793ad7 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -3343,6 +3343,56 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/casts/javaInterop/instanceOfWithWrongType.kt"); } + @TestMetadata("noNullCheckOnCollectionContains.kt") + public void testNoNullCheckOnCollectionContains() throws Exception { + runTest("compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnCollectionContains.kt"); + } + + @TestMetadata("noNullCheckOnCollectionRemove.kt") + public void testNoNullCheckOnCollectionRemove() throws Exception { + runTest("compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnCollectionRemove.kt"); + } + + @TestMetadata("noNullCheckOnListIndexOf.kt") + public void testNoNullCheckOnListIndexOf() throws Exception { + runTest("compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnListIndexOf.kt"); + } + + @TestMetadata("noNullCheckOnListLastIndexOf.kt") + public void testNoNullCheckOnListLastIndexOf() throws Exception { + runTest("compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnListLastIndexOf.kt"); + } + + @TestMetadata("noNullCheckOnMapContainsKey.kt") + public void testNoNullCheckOnMapContainsKey() throws Exception { + runTest("compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnMapContainsKey.kt"); + } + + @TestMetadata("noNullCheckOnMapContainsValue.kt") + public void testNoNullCheckOnMapContainsValue() throws Exception { + runTest("compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnMapContainsValue.kt"); + } + + @TestMetadata("noNullCheckOnMapGet.kt") + public void testNoNullCheckOnMapGet() throws Exception { + runTest("compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnMapGet.kt"); + } + + @TestMetadata("noNullCheckOnMapRemove.kt") + public void testNoNullCheckOnMapRemove() throws Exception { + runTest("compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnMapRemove.kt"); + } + + @TestMetadata("nullCheckOnMapGetOrDefault.kt") + public void testNullCheckOnMapGetOrDefault() throws Exception { + runTest("compiler/testData/codegen/box/casts/javaInterop/nullCheckOnMapGetOrDefault.kt"); + } + + @TestMetadata("nullCheckOnMapRemove2.kt") + public void testNullCheckOnMapRemove2() throws Exception { + runTest("compiler/testData/codegen/box/casts/javaInterop/nullCheckOnMapRemove2.kt"); + } + @TestMetadata("safeCastWithWrongType.kt") public void testSafeCastWithWrongType() throws Exception { runTest("compiler/testData/codegen/box/casts/javaInterop/safeCastWithWrongType.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java index b75fe5f761b..fa427f62639 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java @@ -3323,6 +3323,56 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/casts/javaInterop/instanceOfWithWrongType.kt"); } + @TestMetadata("noNullCheckOnCollectionContains.kt") + public void testNoNullCheckOnCollectionContains() throws Exception { + runTest("compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnCollectionContains.kt"); + } + + @TestMetadata("noNullCheckOnCollectionRemove.kt") + public void testNoNullCheckOnCollectionRemove() throws Exception { + runTest("compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnCollectionRemove.kt"); + } + + @TestMetadata("noNullCheckOnListIndexOf.kt") + public void testNoNullCheckOnListIndexOf() throws Exception { + runTest("compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnListIndexOf.kt"); + } + + @TestMetadata("noNullCheckOnListLastIndexOf.kt") + public void testNoNullCheckOnListLastIndexOf() throws Exception { + runTest("compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnListLastIndexOf.kt"); + } + + @TestMetadata("noNullCheckOnMapContainsKey.kt") + public void testNoNullCheckOnMapContainsKey() throws Exception { + runTest("compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnMapContainsKey.kt"); + } + + @TestMetadata("noNullCheckOnMapContainsValue.kt") + public void testNoNullCheckOnMapContainsValue() throws Exception { + runTest("compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnMapContainsValue.kt"); + } + + @TestMetadata("noNullCheckOnMapGet.kt") + public void testNoNullCheckOnMapGet() throws Exception { + runTest("compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnMapGet.kt"); + } + + @TestMetadata("noNullCheckOnMapRemove.kt") + public void testNoNullCheckOnMapRemove() throws Exception { + runTest("compiler/testData/codegen/box/casts/javaInterop/noNullCheckOnMapRemove.kt"); + } + + @TestMetadata("nullCheckOnMapGetOrDefault.kt") + public void testNullCheckOnMapGetOrDefault() throws Exception { + runTest("compiler/testData/codegen/box/casts/javaInterop/nullCheckOnMapGetOrDefault.kt"); + } + + @TestMetadata("nullCheckOnMapRemove2.kt") + public void testNullCheckOnMapRemove2() throws Exception { + runTest("compiler/testData/codegen/box/casts/javaInterop/nullCheckOnMapRemove2.kt"); + } + @TestMetadata("safeCastWithWrongType.kt") public void testSafeCastWithWrongType() throws Exception { runTest("compiler/testData/codegen/box/casts/javaInterop/safeCastWithWrongType.kt");