Add quickfixes for unnecessary casts and nullability operations to cleanup inspection. Rewrite two quickfixes from Java to Kotlin. Add inspection description. Use marker interface for identifying quickfixes applicable for code cleanup.

This commit is contained in:
Dmitry Jemerov
2015-05-21 17:06:59 +02:00
parent e2dbfebf32
commit 58e4ff0502
22 changed files with 285 additions and 333 deletions
@@ -30,3 +30,15 @@ fun foo() {
continue@loop
}
}
fun unnecessarySafeCall(x: String) {
x?.length()
}
fun unnecessaryExclExcl(x: String) {
x!!.length()
}
fun unnecessaryCast(x: String) = x as String
fun unnecessaryElvis(x: String) = x ?: ""
@@ -32,3 +32,15 @@ fun foo() {
continue@loop
}
}
fun unnecessarySafeCall(x: String) {
x.length()
}
fun unnecessaryExclExcl(x: String) {
x.length()
}
fun unnecessaryCast(x: String) = x
fun unnecessaryElvis(x: String) = x