From 3aa2401f1997b9d03764a263319879a715bf0302 Mon Sep 17 00:00:00 2001 From: Dmitry Gridin Date: Tue, 9 Jul 2019 11:53:10 +0300 Subject: [PATCH] ReplaceJavaStaticMethodWithKotlinAnalogInspection: introduce Transform interface #KT-32454 Fixed --- ...aStaticMethodWithKotlinAnalogInspection.kt | 237 ++++-------------- .../idea/inspections/jdk2k/Transformation.kt | 55 ++++ .../collections/hashCodeWithImport.kt | 7 + .../collections/hashCodeWithImport.kt.after | 7 + .../io/print.kt | 2 +- .../io/println.kt | 2 +- .../math/IEEEremainder.kt | 2 +- .../math/abs.kt | 2 +- .../math/acos.kt | 2 +- .../math/asin.kt | 2 +- .../math/atan.kt | 2 +- .../math/atan2.kt | 2 +- .../math/ceil.kt | 2 +- .../math/coerceAtLeast.kt | 2 +- .../math/coerceAtMost.kt | 2 +- .../math/copySign.kt | 2 +- .../math/cos.kt | 2 +- .../math/cosh.kt | 2 +- .../math/exp.kt | 2 +- .../math/expm1.kt | 2 +- .../math/floor.kt | 2 +- .../math/hypot.kt | 2 +- .../math/log.kt | 2 +- .../math/log10.kt | 2 +- .../math/log1p.kt | 2 +- .../math/max.kt | 2 +- .../math/min.kt | 2 +- .../math/nextAfter.kt | 2 +- .../math/nextDown.kt | 2 +- .../math/nextUp.kt | 2 +- .../math/notApplicableAbs.kt | 5 + .../math/pow.kt | 2 +- .../math/rint.kt | 2 +- .../math/roundToInt.kt | 2 +- .../math/roundToLong.kt | 2 +- .../math/signum.kt | 2 +- .../math/sin.kt | 2 +- .../math/sinh.kt | 2 +- .../math/sqrt.kt | 2 +- .../math/tan.kt | 2 +- .../math/tanh.kt | 2 +- .../system/exit.kt | 2 +- .../toString/intToString2.kt | 2 +- .../toString/toExtension.kt | 2 +- .../LocalInspectionTestGenerated.java | 10 + 45 files changed, 169 insertions(+), 230 deletions(-) create mode 100644 idea/src/org/jetbrains/kotlin/idea/inspections/jdk2k/Transformation.kt create mode 100644 idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/collections/hashCodeWithImport.kt create mode 100644 idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/collections/hashCodeWithImport.kt.after create mode 100644 idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/notApplicableAbs.kt diff --git a/idea/src/org/jetbrains/kotlin/idea/inspections/jdk2k/ReplaceJavaStaticMethodWithKotlinAnalogInspection.kt b/idea/src/org/jetbrains/kotlin/idea/inspections/jdk2k/ReplaceJavaStaticMethodWithKotlinAnalogInspection.kt index a3ccdb8389d..ef2eb01f1e1 100644 --- a/idea/src/org/jetbrains/kotlin/idea/inspections/jdk2k/ReplaceJavaStaticMethodWithKotlinAnalogInspection.kt +++ b/idea/src/org/jetbrains/kotlin/idea/inspections/jdk2k/ReplaceJavaStaticMethodWithKotlinAnalogInspection.kt @@ -9,49 +9,36 @@ import com.intellij.codeInspection.LocalQuickFix import com.intellij.codeInspection.ProblemDescriptor import com.intellij.codeInspection.ProblemsHolder import com.intellij.openapi.project.Project -import com.intellij.openapi.util.TextRange import org.jetbrains.kotlin.idea.caches.resolve.analyze -import org.jetbrains.kotlin.idea.caches.resolve.resolveImportReference import org.jetbrains.kotlin.idea.caches.resolve.resolveToCall -import org.jetbrains.kotlin.idea.core.ShortenReferences -import org.jetbrains.kotlin.idea.core.replaced import org.jetbrains.kotlin.idea.inspections.AbstractKotlinInspection import org.jetbrains.kotlin.idea.inspections.collections.isCalling -import org.jetbrains.kotlin.idea.intentions.callExpression -import org.jetbrains.kotlin.idea.util.ImportInsertHelper +import org.jetbrains.kotlin.idea.util.textRangeIn import org.jetbrains.kotlin.name.FqName -import org.jetbrains.kotlin.psi.* -import org.jetbrains.kotlin.psi.psiUtil.endOffset +import org.jetbrains.kotlin.psi.KtCallExpression +import org.jetbrains.kotlin.psi.KtSimpleNameExpression +import org.jetbrains.kotlin.psi.callExpressionVisitor import org.jetbrains.kotlin.psi.psiUtil.getReceiverExpression -import org.jetbrains.kotlin.psi.psiUtil.getStrictParentOfType -import org.jetbrains.kotlin.psi.psiUtil.startOffset import org.jetbrains.kotlin.resolve.calls.callUtil.getResolvedCall import org.jetbrains.kotlin.resolve.lazy.BodyResolveMode class ReplaceJavaStaticMethodWithKotlinAnalogInspection : AbstractKotlinInspection() { override fun buildVisitor(holder: ProblemsHolder, isOnTheFly: Boolean) = callExpressionVisitor(fun(call) { val callee = call.calleeExpression ?: return - val dotQualified = call.getStrictParentOfType() ?: return val replacements = REPLACEMENTS[callee.text] - ?.filter { it.filter(call) } + ?.filter { it.filter(call) && it.transformation.isApplicable(call) } ?.takeIf { it.isNotEmpty() } ?.let { list -> val callDescriptor = call.getResolvedCall(call.analyze(BodyResolveMode.PARTIAL)) ?: return - list.filter { - callDescriptor.isCalling(FqName(it.javaMethodFqName)) && (!it.toExtensionFunction || call.valueArguments.isNotEmpty()) - } + list.filter { callDescriptor.isCalling(FqName(it.javaMethodFqName)) } } ?.takeIf { it.isNotEmpty() } - ?.map { - ReplaceWithKotlinAnalogFunction( - it - ) - } + ?.map(::ReplaceWithKotlinAnalogFunction) ?.toTypedArray() ?: return holder.registerProblem( - dotQualified, - TextRange(0, callee.endOffset - dotQualified.startOffset), + call, + callee.textRangeIn(call), "Should be replaced with Kotlin function", *replacements ) @@ -63,28 +50,8 @@ class ReplaceJavaStaticMethodWithKotlinAnalogInspection : AbstractKotlinInspecti override fun getFamilyName() = "Replace with Kotlin analog" override fun applyFix(project: Project, descriptor: ProblemDescriptor) { - val dotQualified = descriptor.psiElement as? KtDotQualifiedExpression ?: return - val call = dotQualified.callExpression ?: return - val file = dotQualified.containingKtFile - val psiFactory = KtPsiFactory(call) - val valueArguments = call.valueArguments - val typeArguments = call.typeArgumentList?.text ?: "" - if (replacement.toExtensionFunction) { - val receiverText = valueArguments.first().getArgumentExpression() - ?.run { if (this is KtOperationExpression) "($text)" else text } - ?: valueArguments.first().text - val argumentsText = valueArguments.drop(1).joinToString(separator = ", ") { it.text } - dotQualified.replaced(psiFactory.createExpression("$receiverText.${replacement.kotlinFunctionShortName}$typeArguments($argumentsText)")) - file.resolveImportReference(FqName(replacement.kotlinFunctionFqName)).firstOrNull()?.let { - ImportInsertHelper.getInstance(project).importDescriptor(file, it) - } - } else { - val argumentsText = valueArguments.joinToString(separator = ", ") { it.text } - val replaced = dotQualified.replaced( - psiFactory.createExpression("${replacement.kotlinFunctionFqName}$typeArguments($argumentsText)") - ) - ShortenReferences.DEFAULT.process(replaced) - } + val callExpression = descriptor.psiElement as? KtCallExpression ?: return + replacement.transformation(callExpression, replacement) } } @@ -99,44 +66,24 @@ class ReplaceJavaStaticMethodWithKotlinAnalogInspection : AbstractKotlinInspecti "Float" to "Float" ).flatMap { (javaPrimitive, kotlinPrimitive) -> listOf( - Replacement( - "java.lang.$javaPrimitive.toString", - "kotlin.text.toString", - toExtensionFunction = true - ) { call -> call.valueArguments.size == 2 }, - Replacement( - "java.lang.$javaPrimitive.toString", - "kotlin.primitives.$kotlinPrimitive.toString", - toExtensionFunction = true - ) { call -> call.valueArguments.size == 1 }, - Replacement( - "java.lang.$javaPrimitive.compare", - "kotlin.primitives.$kotlinPrimitive.compareTo", - toExtensionFunction = true - ) + Replacement("java.lang.$javaPrimitive.toString", "kotlin.text.toString", ToExtensionFunction) { + it.valueArguments.size == 2 + }, + Replacement("java.lang.$javaPrimitive.toString", "kotlin.primitives.$kotlinPrimitive.toString", ToExtensionFunction) { + it.valueArguments.size == 1 + }, + Replacement("java.lang.$javaPrimitive.compare", "kotlin.primitives.$kotlinPrimitive.compareTo", ToExtensionFunction) ) } private val JAVA_IO = listOf( - Replacement( - "java.io.PrintStream.print", - "kotlin.io.print", - filter = ::isJavaSystemOut - ), - Replacement( - "java.io.PrintStream.println", - "kotlin.io.println", - filter = ::isJavaSystemOut - ) + Replacement("java.io.PrintStream.print", "kotlin.io.print", filter = ::isJavaSystemOut), + Replacement("java.io.PrintStream.println", "kotlin.io.println", filter = ::isJavaSystemOut) ) private val JAVA_SYSTEM = listOf( Replacement("java.lang.System.exit", "kotlin.system.exitProcess"), - Replacement( - "java.lang.System.arraycopy", - "kotlin.collections.copyInto", - toExtensionFunction = true - ) // TODO: mapping + Replacement("java.lang.System.arraycopy", "kotlin.collections.copyInto", ToExtensionFunction) // TODO: mapping ) private val JAVA_MATH = listOf( @@ -152,137 +99,49 @@ class ReplaceJavaStaticMethodWithKotlinAnalogInspection : AbstractKotlinInspecti Replacement("java.lang.Math.expm1", "kotlin.math.expm1"), Replacement("java.lang.Math.floor", "kotlin.math.floor"), Replacement("java.lang.Math.hypot", "kotlin.math.hypot"), - Replacement( - "java.lang.Math.IEEEremainder", - "kotlin.math.IEEErem", - toExtensionFunction = true - ), + Replacement("java.lang.Math.IEEEremainder", "kotlin.math.IEEErem", ToExtensionFunction), Replacement("java.lang.Math.log", "kotlin.math.ln"), Replacement("java.lang.Math.log1p", "kotlin.math.ln1p"), Replacement("java.lang.Math.log10", "kotlin.math.log10"), Replacement("java.lang.Math.max", "kotlin.math.max"), - Replacement( - "java.lang.Math.max", - "kotlin.ranges.coerceAtLeast", - toExtensionFunction = true - ), + Replacement("java.lang.Math.max", "kotlin.ranges.coerceAtLeast", ToExtensionFunction), Replacement("java.lang.Math.min", "kotlin.math.min"), - Replacement( - "java.lang.Math.min", - "kotlin.ranges.coerceAtMost", - toExtensionFunction = true - ), - Replacement( - "java.lang.Math.nextDown", - "kotlin.math.nextDown", - toExtensionFunction = true - ), - Replacement( - "java.lang.Math.nextAfter", - "kotlin.math.nextTowards", - toExtensionFunction = true - ), - Replacement( - "java.lang.Math.nextUp", - "kotlin.math.nextUp", - toExtensionFunction = true - ), - Replacement( - "java.lang.Math.pow", - "kotlin.math.pow", - toExtensionFunction = true - ), + Replacement("java.lang.Math.min", "kotlin.ranges.coerceAtMost", ToExtensionFunction), + Replacement("java.lang.Math.nextDown", "kotlin.math.nextDown", ToExtensionFunction), + Replacement("java.lang.Math.nextAfter", "kotlin.math.nextTowards", ToExtensionFunction), + Replacement("java.lang.Math.nextUp", "kotlin.math.nextUp", ToExtensionFunction), + Replacement("java.lang.Math.pow", "kotlin.math.pow", ToExtensionFunction), Replacement("java.lang.Math.rint", "kotlin.math.round"), - Replacement( - "java.lang.Math.round", - "kotlin.math.roundToLong", - toExtensionFunction = true - ), - Replacement( - "java.lang.Math.round", - "kotlin.math.roundToInt", - toExtensionFunction = true - ), + Replacement("java.lang.Math.round", "kotlin.math.roundToLong", ToExtensionFunction), + Replacement("java.lang.Math.round", "kotlin.math.roundToInt", ToExtensionFunction), Replacement("java.lang.Math.signum", "kotlin.math.sign"), Replacement("java.lang.Math.sin", "kotlin.math.sin"), Replacement("java.lang.Math.sinh", "kotlin.math.sinh"), Replacement("java.lang.Math.sqrt", "kotlin.math.sqrt"), Replacement("java.lang.Math.tan", "kotlin.math.tan"), Replacement("java.lang.Math.tanh", "kotlin.math.tanh"), - Replacement( - "java.lang.Math.copySign", - "kotlin.math.withSign", - toExtensionFunction = true - ) + Replacement("java.lang.Math.copySign", "kotlin.math.withSign", ToExtensionFunction) ) private val JAVA_COLLECTIONS = listOf( - Replacement( - "java.util.Arrays.copyOf", - "kotlin.collections.copyOf", - toExtensionFunction = true - ) { + Replacement("java.util.Arrays.copyOf", "kotlin.collections.copyOf", ToExtensionFunction) { it.valueArguments.size == 2 }, - Replacement( - "java.util.Arrays.copyOfRange", - "kotlin.collections.copyOfRange", - toExtensionFunction = true - ), - Replacement( - "java.util.Arrays.binarySearch", - "kotlin.collections.binarySearch", - toExtensionFunction = true - ), // TODO: mapping - Replacement( - "java.util.Arrays.equals", - "kotlin.collections.contentEquals", - toExtensionFunction = true - ), - Replacement( - "java.util.Arrays.deepEquals", - "kotlin.collections.contentDeepEquals", - toExtensionFunction = true - ), - Replacement( - "java.util.Arrays.fill", - "kotlin.collections.fill", - toExtensionFunction = true - ), // TODO: mapping - Replacement( - "java.util.Arrays.sort", - "kotlin.collections.sort", - toExtensionFunction = true - ) { + Replacement("java.util.Arrays.copyOfRange", "kotlin.collections.copyOfRange", ToExtensionFunction), + Replacement("java.util.Arrays.binarySearch", "kotlin.collections.binarySearch", ToExtensionFunction), // TODO: mapping + Replacement("java.util.Arrays.equals", "kotlin.collections.contentEquals", ToExtensionFunction), + Replacement("java.util.Arrays.deepEquals", "kotlin.collections.contentDeepEquals", ToExtensionFunction), + Replacement("java.util.Arrays.fill", "kotlin.collections.fill", ToExtensionFunction), // TODO: mapping + Replacement("java.util.Arrays.sort", "kotlin.collections.sort", ToExtensionFunction) { it.valueArguments.size == 3 }, //TODO: mapping? - Replacement( - "java.util.Arrays.sort", - "kotlin.collections.sortWith", - toExtensionFunction = true - ) { + Replacement("java.util.Arrays.sort", "kotlin.collections.sortWith", ToExtensionFunction) { it.valueArguments.size != 3 }, - Replacement( - "java.util.Arrays.deepHashCode", - "kotlin.collections.contentDeepHashCode", - toExtensionFunction = true - ), - Replacement( - "java.util.Arrays.hashCode", - "kotlin.collections.contentHashCode", - toExtensionFunction = true - ), - Replacement( - "java.util.Arrays.deepToString", - "kotlin.collections.contentDeepToString", - toExtensionFunction = true - ), - Replacement( - "java.util.Arrays.toString", - "kotlin.collections.contentToString", - toExtensionFunction = true - ), + Replacement("java.util.Arrays.deepHashCode", "kotlin.collections.contentDeepHashCode", ToExtensionFunction), + Replacement("java.util.Arrays.hashCode", "kotlin.collections.contentHashCode", ToExtensionFunction), + Replacement("java.util.Arrays.deepToString", "kotlin.collections.contentDeepToString", ToExtensionFunction), + Replacement("java.util.Arrays.toString", "kotlin.collections.contentToString", ToExtensionFunction), Replacement("java.util.Arrays.asList", "kotlin.collections.listOf"), Replacement("java.util.Arrays.asList", "kotlin.collections.mutableListOf"), Replacement("java.util.Set.of", "kotlin.collections.setOf"), @@ -291,19 +150,15 @@ class ReplaceJavaStaticMethodWithKotlinAnalogInspection : AbstractKotlinInspecti Replacement("java.util.List.of", "kotlin.collections.mutableListOf") ) - private val REPLACEMENTS = (JAVA_MATH + - JAVA_SYSTEM + - JAVA_IO + - JAVA_PRIMITIVES + - JAVA_COLLECTIONS - ).groupBy { it.javaMethodShortName } + private val REPLACEMENTS = (JAVA_MATH + JAVA_SYSTEM + JAVA_IO + JAVA_PRIMITIVES + JAVA_COLLECTIONS) + .groupBy { it.javaMethodShortName } } } data class Replacement( val javaMethodFqName: String, val kotlinFunctionFqName: String, - val toExtensionFunction: Boolean = false, + val transformation: Transformation = WithoutAdditionalTransformation, val filter: (KtCallExpression) -> Boolean = { true } ) { private fun String.shortName() = takeLastWhile { it != '.' } diff --git a/idea/src/org/jetbrains/kotlin/idea/inspections/jdk2k/Transformation.kt b/idea/src/org/jetbrains/kotlin/idea/inspections/jdk2k/Transformation.kt new file mode 100644 index 00000000000..b30383ff6eb --- /dev/null +++ b/idea/src/org/jetbrains/kotlin/idea/inspections/jdk2k/Transformation.kt @@ -0,0 +1,55 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.idea.inspections.jdk2k + +import org.jetbrains.kotlin.idea.caches.resolve.resolveImportReference +import org.jetbrains.kotlin.idea.core.ShortenReferences +import org.jetbrains.kotlin.idea.core.replaced +import org.jetbrains.kotlin.idea.util.ImportInsertHelper +import org.jetbrains.kotlin.name.FqName +import org.jetbrains.kotlin.psi.KtCallExpression +import org.jetbrains.kotlin.psi.KtOperationExpression +import org.jetbrains.kotlin.psi.KtPsiFactory +import org.jetbrains.kotlin.psi.psiUtil.getQualifiedExpressionForSelectorOrThis + +interface Transformation { + operator fun invoke(callExpression: KtCallExpression, replacement: Replacement) + fun isApplicable(call: KtCallExpression): Boolean = true +} + +object WithoutAdditionalTransformation : Transformation { + override fun invoke(callExpression: KtCallExpression, replacement: Replacement) { + val psiFactory = KtPsiFactory(callExpression) + val valueArguments = callExpression.valueArguments + val typeArguments = callExpression.typeArgumentList?.text ?: "" + val argumentsText = valueArguments.joinToString(separator = ", ") { it.text } + val replaced = callExpression.getQualifiedExpressionForSelectorOrThis().replaced( + psiFactory.createExpression("${replacement.kotlinFunctionFqName}$typeArguments($argumentsText)") + ) + ShortenReferences.DEFAULT.process(replaced) + } +} + +object ToExtensionFunction : Transformation { + override fun invoke(callExpression: KtCallExpression, replacement: Replacement) { + val file = callExpression.containingKtFile + val psiFactory = KtPsiFactory(callExpression) + val valueArguments = callExpression.valueArguments + val typeArguments = callExpression.typeArgumentList?.text ?: "" + val receiverText = valueArguments.first().getArgumentExpression() + ?.run { if (this is KtOperationExpression) "($text)" else text } + ?: valueArguments.first().text + val argumentsText = valueArguments.drop(1).joinToString(separator = ", ") { it.text } + callExpression.getQualifiedExpressionForSelectorOrThis().replaced( + psiFactory.createExpression("$receiverText.${replacement.kotlinFunctionShortName}$typeArguments($argumentsText)") + ) + file.resolveImportReference(FqName(replacement.kotlinFunctionFqName)).firstOrNull()?.let { + ImportInsertHelper.getInstance(callExpression.project).importDescriptor(file, it) + } + } + + override fun isApplicable(call: KtCallExpression): Boolean = call.valueArguments.isNotEmpty() +} \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/collections/hashCodeWithImport.kt b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/collections/hashCodeWithImport.kt new file mode 100644 index 00000000000..afe61c9d424 --- /dev/null +++ b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/collections/hashCodeWithImport.kt @@ -0,0 +1,7 @@ +// WITH_RUNTIME +import java.util.Arrays.hashCode + +fun test() { + val a = arrayOf(1) + val hash = hashCode(a) +} \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/collections/hashCodeWithImport.kt.after b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/collections/hashCodeWithImport.kt.after new file mode 100644 index 00000000000..d104db5ba4d --- /dev/null +++ b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/collections/hashCodeWithImport.kt.after @@ -0,0 +1,7 @@ +// WITH_RUNTIME +import java.util.Arrays.hashCode + +fun test() { + val a = arrayOf(1) + val hash = a.contentHashCode() +} \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/io/print.kt b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/io/print.kt index 366d3435460..f8f8b9d8ed5 100644 --- a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/io/print.kt +++ b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/io/print.kt @@ -1,4 +1,4 @@ // WITH_RUNTIME fun test() { - System.out.print("foo") + System.out.print("foo") } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/io/println.kt b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/io/println.kt index 9829c10c951..5262307ac62 100644 --- a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/io/println.kt +++ b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/io/println.kt @@ -1,4 +1,4 @@ // WITH_RUNTIME fun test() { - System.out.println() + System.out.println() } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/IEEEremainder.kt b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/IEEEremainder.kt index 9c12b6034a1..433ac7e8d1a 100644 --- a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/IEEEremainder.kt +++ b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/IEEEremainder.kt @@ -1,4 +1,4 @@ // WITH_RUNTIME fun test(x: Double, y: Double) { - Math.IEEEremainder(x, y) + Math.IEEEremainder(x, y) } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/abs.kt b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/abs.kt index 55645f3cd56..0c77189ad26 100644 --- a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/abs.kt +++ b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/abs.kt @@ -1,4 +1,4 @@ // WITH_RUNTIME fun test(x: Double) { - Math.abs(x) + Math.abs(x) } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/acos.kt b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/acos.kt index a4253a348d0..5a994aa9870 100644 --- a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/acos.kt +++ b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/acos.kt @@ -1,4 +1,4 @@ // WITH_RUNTIME fun test(x: Double) { - Math.acos(x) + Math.acos(x) } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/asin.kt b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/asin.kt index 0583ead42f4..b8077ad862d 100644 --- a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/asin.kt +++ b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/asin.kt @@ -1,4 +1,4 @@ // WITH_RUNTIME fun test(x: Double) { - Math.asin(x) + Math.asin(x) } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/atan.kt b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/atan.kt index f8b3a624344..45fb989f629 100644 --- a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/atan.kt +++ b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/atan.kt @@ -1,4 +1,4 @@ // WITH_RUNTIME fun test(x: Double) { - Math.atan(x) + Math.atan(x) } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/atan2.kt b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/atan2.kt index fd025ed8c33..b6feeccf38a 100644 --- a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/atan2.kt +++ b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/atan2.kt @@ -1,4 +1,4 @@ // WITH_RUNTIME fun test(x: Double, y: Double) { - Math.atan2(x, y) + Math.atan2(x, y) } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/ceil.kt b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/ceil.kt index ea3b066f631..9a6d1b007c5 100644 --- a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/ceil.kt +++ b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/ceil.kt @@ -1,4 +1,4 @@ // WITH_RUNTIME fun test(x: Double) { - Math.ceil(x) + Math.ceil(x) } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/coerceAtLeast.kt b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/coerceAtLeast.kt index f442f397aaa..d040d61e28f 100644 --- a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/coerceAtLeast.kt +++ b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/coerceAtLeast.kt @@ -1,5 +1,5 @@ // FIX: Replace with `coerceAtLeast` function // WITH_RUNTIME fun test(x: Double, y: Double) { - Math.max(x, y) + Math.max(x, y) } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/coerceAtMost.kt b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/coerceAtMost.kt index af456cd0a9d..643942c230d 100644 --- a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/coerceAtMost.kt +++ b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/coerceAtMost.kt @@ -1,5 +1,5 @@ // FIX: Replace with `coerceAtMost` function // WITH_RUNTIME fun test(x: Double, y: Double) { - Math.min(x, y) + Math.min(x, y) } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/copySign.kt b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/copySign.kt index 71a40ae3499..4c2088c55c0 100644 --- a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/copySign.kt +++ b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/copySign.kt @@ -1,4 +1,4 @@ // WITH_RUNTIME fun test(x: Double, y: Double) { - Math.copySign(x, y) + Math.copySign(x, y) } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/cos.kt b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/cos.kt index 6d7cc1742f5..c33da857afb 100644 --- a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/cos.kt +++ b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/cos.kt @@ -1,4 +1,4 @@ // WITH_RUNTIME fun test(x: Double) { - Math.cos(x) + Math.cos(x) } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/cosh.kt b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/cosh.kt index 9a46ce2f2ec..c80d53b0396 100644 --- a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/cosh.kt +++ b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/cosh.kt @@ -1,4 +1,4 @@ // WITH_RUNTIME fun test(x: Double) { - Math.cosh(x) + Math.cosh(x) } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/exp.kt b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/exp.kt index 584a359c9fb..9499ac6eb74 100644 --- a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/exp.kt +++ b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/exp.kt @@ -1,4 +1,4 @@ // WITH_RUNTIME fun test(x: Double) { - Math.exp(x) + Math.exp(x) } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/expm1.kt b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/expm1.kt index a5ed2d50cf0..2503dfd119a 100644 --- a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/expm1.kt +++ b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/expm1.kt @@ -1,4 +1,4 @@ // WITH_RUNTIME fun test(x: Double) { - Math.expm1(x) + Math.expm1(x) } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/floor.kt b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/floor.kt index 039fabc6705..c1da6481685 100644 --- a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/floor.kt +++ b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/floor.kt @@ -1,4 +1,4 @@ // WITH_RUNTIME fun test(x: Double) { - Math.floor(x) + Math.floor(x) } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/hypot.kt b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/hypot.kt index 7621bfaa842..a3545e8d484 100644 --- a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/hypot.kt +++ b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/hypot.kt @@ -1,4 +1,4 @@ // WITH_RUNTIME fun test(x: Double, y: Double) { - Math.hypot(x, y) + Math.hypot(x, y) } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/log.kt b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/log.kt index 3e6b5d0c9fb..77c156fbc95 100644 --- a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/log.kt +++ b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/log.kt @@ -1,4 +1,4 @@ // WITH_RUNTIME fun test(x: Double) { - Math.log(x) + Math.log(x) } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/log10.kt b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/log10.kt index 9f956d07764..299e1fc415f 100644 --- a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/log10.kt +++ b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/log10.kt @@ -1,4 +1,4 @@ // WITH_RUNTIME fun test(x: Double) { - Math.log10(x) + Math.log10(x) } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/log1p.kt b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/log1p.kt index b7eb491216a..2f17a179c8a 100644 --- a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/log1p.kt +++ b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/log1p.kt @@ -1,4 +1,4 @@ // WITH_RUNTIME fun test(x: Double) { - Math.log1p(x) + Math.log1p(x) } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/max.kt b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/max.kt index 8a4ce4f6559..ef6cd83f1a9 100644 --- a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/max.kt +++ b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/max.kt @@ -1,5 +1,5 @@ // FIX: Replace with `max` function // WITH_RUNTIME fun test(x: Double, y: Double) { - Math.max(x, y) + Math.max(x, y) } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/min.kt b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/min.kt index 6aec4c3fc30..908e6c76799 100644 --- a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/min.kt +++ b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/min.kt @@ -1,5 +1,5 @@ // FIX: Replace with `min` function // WITH_RUNTIME fun test(x: Double, y: Double) { - Math.min(x, y) + Math.min(x, y) } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/nextAfter.kt b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/nextAfter.kt index fe2e53bce61..25945390da1 100644 --- a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/nextAfter.kt +++ b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/nextAfter.kt @@ -1,4 +1,4 @@ // WITH_RUNTIME fun test(x: Double, y: Double) { - Math.nextAfter(x, y) + Math.nextAfter(x, y) } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/nextDown.kt b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/nextDown.kt index 791793577a3..3991f3cc0af 100644 --- a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/nextDown.kt +++ b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/nextDown.kt @@ -1,4 +1,4 @@ // RUNTIME_WITH_FULL_JDK fun test(x: Double) { - Math.nextDown(x) + Math.nextDown(x) } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/nextUp.kt b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/nextUp.kt index fe4e65db986..39a4afdbd5e 100644 --- a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/nextUp.kt +++ b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/nextUp.kt @@ -1,4 +1,4 @@ // WITH_RUNTIME fun test(x: Double) { - Math.nextUp(x) + Math.nextUp(x) } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/notApplicableAbs.kt b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/notApplicableAbs.kt new file mode 100644 index 00000000000..e45dc44a130 --- /dev/null +++ b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/notApplicableAbs.kt @@ -0,0 +1,5 @@ +// WITH_RUNTIME +// PROBLEM: none +fun test(x: Double) { + Math.abs(x) +} \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/pow.kt b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/pow.kt index 849516a014d..ceb332729a2 100644 --- a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/pow.kt +++ b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/pow.kt @@ -1,4 +1,4 @@ // WITH_RUNTIME fun test(x: Double, y: Double) { - Math.pow(x, y) + Math.pow(x, y) } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/rint.kt b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/rint.kt index 9e5de42cc33..e3ffa39274d 100644 --- a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/rint.kt +++ b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/rint.kt @@ -1,4 +1,4 @@ // WITH_RUNTIME fun test(x: Double) { - Math.rint(x) + Math.rint(x) } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/roundToInt.kt b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/roundToInt.kt index c21feb0bfac..bdaee05acbb 100644 --- a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/roundToInt.kt +++ b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/roundToInt.kt @@ -1,5 +1,5 @@ // FIX: Replace with `roundToInt` function // WITH_RUNTIME fun test(x: Double) { - Math.round(x) + Math.round(x) } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/roundToLong.kt b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/roundToLong.kt index 313b8fd5599..2e408e7a2f2 100644 --- a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/roundToLong.kt +++ b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/roundToLong.kt @@ -1,5 +1,5 @@ // FIX: Replace with `roundToLong` function // WITH_RUNTIME fun test(x: Double) { - Math.round(x) + Math.round(x) } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/signum.kt b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/signum.kt index f58587609d0..0db316513d3 100644 --- a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/signum.kt +++ b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/signum.kt @@ -1,4 +1,4 @@ // WITH_RUNTIME fun test(x: Double) { - Math.signum(x) + Math.signum(x) } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/sin.kt b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/sin.kt index 6a1a8e7f217..281f795dfaf 100644 --- a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/sin.kt +++ b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/sin.kt @@ -1,4 +1,4 @@ // WITH_RUNTIME fun test(x: Double) { - Math.sin(x) + Math.sin(x) } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/sinh.kt b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/sinh.kt index 55c416ac774..f79ead5cd89 100644 --- a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/sinh.kt +++ b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/sinh.kt @@ -1,4 +1,4 @@ // WITH_RUNTIME fun test(x: Double) { - Math.sinh(x) + Math.sinh(x) } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/sqrt.kt b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/sqrt.kt index 8729529e5e4..b9004bfff37 100644 --- a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/sqrt.kt +++ b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/sqrt.kt @@ -1,4 +1,4 @@ // WITH_RUNTIME fun test(x: Double) { - Math.sqrt(x) + Math.sqrt(x) } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/tan.kt b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/tan.kt index dd3697320a5..657b8905d26 100644 --- a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/tan.kt +++ b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/tan.kt @@ -1,4 +1,4 @@ // WITH_RUNTIME fun test(x: Double) { - Math.tan(x) + Math.tan(x) } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/tanh.kt b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/tanh.kt index 780362c522a..c6d3c33a7d7 100644 --- a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/tanh.kt +++ b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/tanh.kt @@ -1,5 +1,5 @@ // WITH_RUNTIME // WITH_RUNTIME fun test(x: Double) { - Math.tanh(x) + Math.tanh(x) } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/system/exit.kt b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/system/exit.kt index f2b734a6e6b..66f51fab3d9 100644 --- a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/system/exit.kt +++ b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/system/exit.kt @@ -1,4 +1,4 @@ // WITH_RUNTIME fun test() { - System.exit(0) + System.exit(0) } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/toString/intToString2.kt b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/toString/intToString2.kt index 6dbb93fcb52..0cdfd078916 100644 --- a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/toString/intToString2.kt +++ b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/toString/intToString2.kt @@ -2,5 +2,5 @@ fun foo() { val b = listOf(42, 10) - println(Integer.toString(b.first(), b.last()).let{it} + 1) + println(Integer.toString(b.first(), b.last()).let{it} + 1) } diff --git a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/toString/toExtension.kt b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/toString/toExtension.kt index 984c3b47b64..299d4035cf6 100644 --- a/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/toString/toExtension.kt +++ b/idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/toString/toExtension.kt @@ -1,5 +1,5 @@ // WITH_RUNTIME fun foo() { - Integer.toString(42 + 24, 16) + Integer.toString(42 + 24, 16) } diff --git a/idea/tests/org/jetbrains/kotlin/idea/inspections/LocalInspectionTestGenerated.java b/idea/tests/org/jetbrains/kotlin/idea/inspections/LocalInspectionTestGenerated.java index 9988a93124d..50732e431b5 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/inspections/LocalInspectionTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/idea/inspections/LocalInspectionTestGenerated.java @@ -9106,6 +9106,11 @@ public class LocalInspectionTestGenerated extends AbstractLocalInspectionTest { runTest("idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/collections/hashCode.kt"); } + @TestMetadata("hashCodeWithImport.kt") + public void testHashCodeWithImport() throws Exception { + runTest("idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/collections/hashCodeWithImport.kt"); + } + @TestMetadata("mutableListOf.kt") public void testMutableListOf() throws Exception { runTest("idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/collections/mutableListOf.kt"); @@ -9365,6 +9370,11 @@ public class LocalInspectionTestGenerated extends AbstractLocalInspectionTest { runTest("idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/nextUp.kt"); } + @TestMetadata("notApplicableAbs.kt") + public void testNotApplicableAbs() throws Exception { + runTest("idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/notApplicableAbs.kt"); + } + @TestMetadata("pow.kt") public void testPow() throws Exception { runTest("idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/math/pow.kt");