Correct handling of erroneous code during code extraction

This commit is contained in:
Mikhail Glukhikh
2016-02-12 11:17:22 +03:00
parent eed4aa71db
commit 5def6eae5b
8 changed files with 31 additions and 10 deletions
@@ -0,0 +1,8 @@
// EXTRACTION_TARGET: property with getter
fun doSomethingStrangeWithCollection(collection: Collection<String>): Collection<String>? {
val groupsByLength = collection.groupBy { s -> { s.length } }
val maximumSizeOfGroup = groupsByLength.values.maxBy { it.size }.
return groupsByLength.values.firstOrNull { group -> {<selection>group.size == maximumSizeOfGroup</selection>} }
}
@@ -0,0 +1 @@
Cannot refactor due to erroneous code