UastCreateMethodFix new method finding simplification

This commit is contained in:
Nicolay Mitropolsky
2017-05-16 12:13:09 +02:00
parent e8fecbf8c8
commit 342da40713
@@ -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)
}