diff --git a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/UastCreateMethodFix.kt b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/UastCreateMethodFix.kt index b278805e26bb..5b2eb9ccb9aa 100644 --- a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/UastCreateMethodFix.kt +++ b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/UastCreateMethodFix.kt @@ -39,8 +39,7 @@ class UastCreateMethodFix(containingClass: UClass, private val createMethodActio val methodsBefore = containingClass.element?.methods ?: return createMethodAction.invoke(project, null, file) val newMethod = containingClass.element?.methods?. - filterNot { method -> methodsBefore.any { it.isEquivalentTo(method) } }?. - first() ?: return + firstOrNull { method -> methodsBefore.none { it.isEquivalentTo(method) } } ?: return reformatAndOpenCreatedMethod(newMethod) }