diff --git a/plugins/kotlin/uast/uast-kotlin-base/src/org/jetbrains/uast/kotlin/expressions/KotlinUFunctionCallExpression.kt b/plugins/kotlin/uast/uast-kotlin-base/src/org/jetbrains/uast/kotlin/expressions/KotlinUFunctionCallExpression.kt index f53d49eb32b7..d5e8c999c3bc 100644 --- a/plugins/kotlin/uast/uast-kotlin-base/src/org/jetbrains/uast/kotlin/expressions/KotlinUFunctionCallExpression.kt +++ b/plugins/kotlin/uast/uast-kotlin-base/src/org/jetbrains/uast/kotlin/expressions/KotlinUFunctionCallExpression.kt @@ -213,7 +213,7 @@ class KotlinUFunctionCallExpression( return false } - override fun methodNameCanBeOneOf(names: Collection): Boolean { + fun methodNameCanBeOneOf(names: Collection): Boolean { if (isMethodNameOneOfWithoutConsideringImportAliases(names)) return true val ktFile = sourcePsi.containingKtFile val aliasedNames = collectAliasedNamesForName(ktFile, names) diff --git a/plugins/kotlin/uast/uast-kotlin-base/test/org/jetbrains/uast/test/common/kotlin/UastResolveApiFixtureTestBase.kt b/plugins/kotlin/uast/uast-kotlin-base/test/org/jetbrains/uast/test/common/kotlin/UastResolveApiFixtureTestBase.kt index fa30cb294a98..425ab64621c2 100644 --- a/plugins/kotlin/uast/uast-kotlin-base/test/org/jetbrains/uast/test/common/kotlin/UastResolveApiFixtureTestBase.kt +++ b/plugins/kotlin/uast/uast-kotlin-base/test/org/jetbrains/uast/test/common/kotlin/UastResolveApiFixtureTestBase.kt @@ -1381,7 +1381,8 @@ interface UastResolveApiFixtureTestBase : UastPluginSelection { "Call should be present in the test" } TestCase.assertTrue(call is KotlinUFunctionCallExpression) - TestCase.assertTrue("expected method name to be one of ${names}", call!!.methodNameCanBeOneOf(names)) + val ktCall = call as KotlinUFunctionCallExpression + TestCase.assertTrue("expected method name to be one of ${names}", ktCall.methodNameCanBeOneOf(names)) } } diff --git a/uast/uast-common/src/org/jetbrains/uast/expressions/UCallExpression.kt b/uast/uast-common/src/org/jetbrains/uast/expressions/UCallExpression.kt index 40e69517641e..1ff67996d7d1 100644 --- a/uast/uast-common/src/org/jetbrains/uast/expressions/UCallExpression.kt +++ b/uast/uast-common/src/org/jetbrains/uast/expressions/UCallExpression.kt @@ -116,9 +116,8 @@ interface UCallExpression : UExpression, UResolvable { /** * Tries to perform optimized name checking for cases when [methodName] requires reference resolution. * - * May perform some heavy resolution inside for some languages (e.g., for Kotlin). For a lightweight check (with weaker guaranties), see [methodNameCanBeOneOf]. + * May perform some heavy resolution inside for some languages (e.g., for Kotlin). * - * @see methodNameCanBeOneOf * @see methodName */ @ApiStatus.Experimental @@ -126,22 +125,6 @@ interface UCallExpression : UExpression, UResolvable { return names.contains(methodName ?: return false) } - /** - * Tries to check if the call can be resolved to some method with name from [names]. - * - * It may return false-positive results, so an additional resolution check is needed in the case of [methodNameCanBeOneOf] returns `true`. - * - * Usually do not perform heavy resolution at the cost of sacrificing accuracy (may return false-positive results). For an accurate version which may perform heavy resolve see [isMethodNameOneOf]. - * - * @param names list of method names we want to check it the call can be resolved to - * @return `false` if the call can definitely not be resolved to the method with name from [names]. Returns `true` if the call is resolved to the method with name from [names] or this is a false-positive result. - * @see isMethodNameOneOf - * @see methodName - */ - @ApiStatus.Experimental - fun methodNameCanBeOneOf(names: Collection): Boolean { - return isMethodNameOneOf(names) - } } @Deprecated("useless since IDEA 2019.2, because getArgumentForParameter moved to UCallExpression", ReplaceWith("UCallExpression"))