Fix tests broken by enhanced RedundantSamConstructor inspection

- The inspection now works in more cases, so the test data had to be
updated accordingly
This commit is contained in:
Roman Golyshev
2020-02-20 17:27:41 +03:00
committed by Roman Golyshev
parent 22a5bc4144
commit 4042214bb2
19 changed files with 110 additions and 30 deletions
@@ -3,5 +3,5 @@
fun foo(runnable: Runnable) {}
fun bar() {
foo(Runnable { })
foo { }
}
@@ -5,5 +5,5 @@ import java.io.FileFilter
fun foo(filter: FileFilter) {}
fun bar() {
foo(FileFilter { file -> file.name.startsWith("a") })
foo { file -> file.name.startsWith("a") }
}
@@ -5,5 +5,5 @@ import java.io.FilenameFilter
fun foo(filter: FilenameFilter) {}
fun bar() {
foo(FilenameFilter { file, name -> name == "x" })
foo { file, name -> name == "x" }
}
@@ -5,5 +5,5 @@ import java.io.FileFilter
fun foo(filter: FileFilter) {}
fun bar() {
foo(FileFilter { true })
foo { true }
}
@@ -5,5 +5,5 @@ import java.io.FilenameFilter
fun foo(filter: FilenameFilter) {}
fun bar() {
foo(FilenameFilter { file, name -> true })
foo { file, name -> true }
}
@@ -10,8 +10,7 @@ fun bar() {
val name = file.name
if (name.startsWith("a")) {
return false
}
else {
} else {
if (name.endsWith("b"))
return true
else {
@@ -5,12 +5,11 @@ import java.io.FileFilter
fun foo(filter: FileFilter) {}
fun bar() {
foo(FileFilter { file ->
foo { file ->
val name = file.name
if (name.startsWith("a")) {
false
}
else {
} else {
if (name.endsWith("b"))
true
else {
@@ -18,5 +17,5 @@ fun bar() {
l > 10
}
}
})
}
}
@@ -3,5 +3,5 @@
fun foo(runnable: Runnable) {}
fun bar() {
foo(Runnable { throw UnsupportedOperationException() })
foo { throw UnsupportedOperationException() }
}
@@ -5,5 +5,5 @@ import java.io.FileFilter
fun foo(filter: FileFilter) {}
fun bar() {
foo(FileFilter { file -> file.name.startsWith("a") })
foo { file -> file.name.startsWith("a") }
}
@@ -5,8 +5,8 @@ import java.io.FileFilter
fun foo(filter: FileFilter) {}
fun bar() {
foo(FileFilter { file ->
foo { file ->
val name = file.name
name.startsWith("a")
})
}
}
@@ -9,7 +9,7 @@ class Test {
})
// Applicable
bar(Runnable { println(this@Test) })
bar { println(this@Test) }
// Applicable
bar(object : Runnable {