KT-5419 J2K: convert string concatenation to string template + implemented corresponding inspection
#KT-5419 Fixed
This commit is contained in:
@@ -1 +1 @@
|
||||
assert(true) { "string details:" + x }
|
||||
assert(true) { "string details:$x" }
|
||||
+3
-3
@@ -3,10 +3,10 @@ package demo
|
||||
object Test {
|
||||
fun subListRangeCheck(fromIndex: Int, toIndex: Int, size: Int) {
|
||||
if (fromIndex < 0)
|
||||
throw IndexOutOfBoundsException("fromIndex = " + fromIndex)
|
||||
throw IndexOutOfBoundsException("fromIndex = $fromIndex")
|
||||
if (toIndex > size)
|
||||
throw IndexOutOfBoundsException("toIndex = " + toIndex)
|
||||
throw IndexOutOfBoundsException("toIndex = $toIndex")
|
||||
if (fromIndex > toIndex)
|
||||
throw IllegalArgumentException("fromIndex(" + fromIndex + ") > toIndex(" + toIndex + ")")
|
||||
throw IllegalArgumentException("fromIndex($fromIndex) > toIndex($toIndex)")
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -30,6 +30,6 @@ class A {
|
||||
}
|
||||
|
||||
public fun f(p: Int) {
|
||||
println("p = " + p)
|
||||
println("p = $p")
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ interface I {
|
||||
|
||||
open class A : I {
|
||||
override fun foo(i: Int, c: Char, s: String) {
|
||||
println("foo" + i + c + s)
|
||||
println("foo$i$c$s")
|
||||
}
|
||||
|
||||
public fun foo(i: Int, c: Char) {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
class A {
|
||||
jvmOverloads fun foo(i: Int, c: Char = 'a', s: String = "") {
|
||||
println("foo" + i + c + s)
|
||||
println("foo$i$c$s")
|
||||
}
|
||||
|
||||
jvmOverloads fun bar(s: String? = null): Int {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
class A {
|
||||
public fun foo(p: Int) {
|
||||
println("p = [" + p + "]")
|
||||
println("p = [$p]")
|
||||
}
|
||||
|
||||
synchronized public fun foo() {
|
||||
|
||||
Reference in New Issue
Block a user