From 342da40713adbc15425331534a0237fac9ac0b8d Mon Sep 17 00:00:00 2001 From: Nicolay Mitropolsky Date: Tue, 16 May 2017 12:09:45 +0200 Subject: [PATCH] `UastCreateMethodFix` new method finding simplification --- .../codeInsight/daemon/impl/quickfix/UastCreateMethodFix.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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) }