Fix tests after disabling trailing comma

#KT-34744
This commit is contained in:
Dmitry Gridin
2020-01-31 16:18:13 +07:00
parent 3fb34596ae
commit c34b417d0c
146 changed files with 612 additions and 945 deletions
+2 -4
View File
@@ -1,7 +1,5 @@
internal annotation class Anon(
val stringArray: Array<String>, val intArray: IntArray, // string
val string: String
)
internal annotation class Anon(val stringArray: Array<String>, val intArray: IntArray, // string
val string: String)
@Anon(string = "a", stringArray = ["a", "b"], intArray = [1, 2])
@Target(AnnotationTarget.CONSTRUCTOR, AnnotationTarget.FIELD)
+1 -2
View File
@@ -1,8 +1,7 @@
import javaApi.SpecialExternal
//Annotation class:
annotation class Special(
val names: Array<String> //array is used
annotation class Special(val names: Array<String> //array is used
) //Class with annotation:
@Special(names = ["name1"])
@@ -1,9 +1,7 @@
internal class C(
// field p1
private val p1: Int, /* parameter p1 */
internal class C(// field p1
private val p1: Int /* parameter p1 */,
/**
* Field myP2
*/
private val myP2: Int, /* Field p3 */
var p3: Int
)
var p3: Int)
@@ -1,17 +1,11 @@
internal class C1(
arg1: Int,
arg2: Int,
arg3: Int
) {
constructor(
x: Int,
y: Int
) : this(x, x + y, 0) {
internal class C1(arg1: Int,
arg2: Int,
arg3: Int) {
constructor(x: Int,
y: Int) : this(x, x + y, 0) {
}
}
internal class C2(
private val arg1: Int,
private val arg2: Int,
arg3: Int
)
internal class C2(private val arg1: Int,
private val arg2: Int,
arg3: Int)
+2 -4
View File
@@ -1,9 +1,7 @@
internal class A(
// comment for field2 setter
internal class A(// comment for field2 setter
// comment for field2 getter
var field2 // comment for field2
: Int
) {
: Int) {
/**
* Comment for field1 setter
*/
@@ -2,8 +2,6 @@ internal annotation class TestAnnotationField
internal annotation class TestAnnotationParam
internal annotation class TestAnnotationGet
internal annotation class TestAnnotationSet
class Test(
@field:TestAnnotationField @set:TestAnnotationSet
@get:TestAnnotationGet
@param:TestAnnotationParam var arg: String
)
class Test(@field:TestAnnotationField @set:TestAnnotationSet
@get:TestAnnotationGet
@param:TestAnnotationParam var arg: String)
@@ -1,9 +1,7 @@
@Deprecated(
"""Ph'nglui mglw'nafh
@Deprecated("""Ph'nglui mglw'nafh
Cthulhu R'lyeh wgah'nagl fhtagn.
'In His House at R'lyeh
Dead Cthulhu waits dreaming,
yet He shall rise and His kingdom
shall cover the Earth.'"""
)
shall cover the Earth.'""")
class TestDeprecatedInJavadocWithMultilineMessage
+2 -4
View File
@@ -2,9 +2,7 @@ internal enum class Color : Runnable {
WHITE, BLACK, RED, YELLOW, BLUE;
override fun run() {
println(
"name()=" + name +
", toString()=" + toString()
)
println("name()=" + name +
", toString()=" + toString())
}
}
@@ -1,8 +1,7 @@
internal class F {
fun f1(p1: Int, p2: Int, p3: Int, p4: Int, vararg p5: Int) {}
fun f2(array: IntArray) {
f1(
1, 2,
f1(1, 2,
3, 4,
*array
)
@@ -2,14 +2,11 @@ internal class C {
fun foo1(p1: Int, p2: Int) {}
fun foo2(
p1: Int,
p2: Int
) {
p2: Int) {
}
fun foo3(
p1: Int,
p2: Int
) {
fun foo3(p1: Int,
p2: Int) {
}
fun foo4(
+3 -5
View File
@@ -1,8 +1,6 @@
class TestJavaBoxedPrimitives {
fun foo(
x1: Boolean, x2: Byte, x3: Short, x4: Int,
x5: Long, x6: Float, x7: Double, x8: Char
): Array<Any> {
fun foo(x1: Boolean, x2: Byte, x3: Short, x4: Int,
x5: Long, x6: Float, x7: Double, x8: Char): Array<Any> {
return arrayOf(x1, x2, x3, x4, x5, x6, x7, x8)
}
}
}
+4 -6
View File
@@ -66,17 +66,15 @@ internal class A {
val s = "test string"
s == "test"
s.equals(
"tesT",
ignoreCase = true
)
"tesT"
, ignoreCase = true)
s.compareTo("Test", ignoreCase = true)
s.regionMatches(
0,
"TE",
0,
2,
ignoreCase = true
)
2
, ignoreCase = true)
s.regionMatches(0, "st", 1, 2)
s.replace("\\w+".toRegex(), "---")
.replaceFirst("([s-t])".toRegex(), "A$1")
@@ -1,10 +1,8 @@
internal class A<T> {
fun foo(
nonMutableCollection: Collection<String?>?,
fun foo(nonMutableCollection: Collection<String?>?,
mutableCollection: MutableCollection<String?>,
mutableSet: MutableSet<T?>,
mutableMap: MutableMap<String?, T>
) {
mutableMap: MutableMap<String?, T>) {
mutableCollection.addAll(nonMutableCollection!!)
mutableSet.add(mutableMap.remove("a"))
}
+2 -4
View File
@@ -1,10 +1,8 @@
internal class C(p1: Int, p2: Int, p3: Int)
internal class User {
fun foo() {
C(
1,
C(1,
2,
3
)
3)
}
}
+3 -5
View File
@@ -20,11 +20,9 @@ internal class Client : Frame() {
override fun windowClosing() {}
}
addWindowListener(a)
addWindowListener(
object : WindowAdapter() {
override fun windowClosing() {}
}
)
addWindowListener(object : WindowAdapter() {
override fun windowClosing() {}
})
val b: EmptyWindowListener = object : EmptyWindowListener {}
val c: EmptyWindowAdapter = object : EmptyWindowAdapter() {}
}
+4 -6
View File
@@ -5,12 +5,10 @@ internal interface I {
internal class C {
val `object`: Any?
get() {
foo(
object : I {
override val int: Int
get() = 0
}
)
foo(object : I {
override val int: Int
get() = 0
})
return string
}
@@ -11,15 +11,12 @@ class C {
@Throws(IOException::class)
fun foo() {
ByteArrayInputStream(ByteArray(10)).use { stream ->
bar(
object : I {
@Throws(IOException::class)
override fun doIt(stream: InputStream): Int {
return stream.available()
}
},
stream
)
bar(object : I {
@Throws(IOException::class)
override fun doIt(stream: InputStream): Int {
return stream.available()
}
}, stream)
}
}
@@ -11,15 +11,12 @@ class C {
@Throws(IOException::class)
fun foo(): Int {
ByteArrayInputStream(ByteArray(10)).use { stream ->
return bar(
object : I {
@Throws(IOException::class)
override fun doIt(stream: InputStream): Int {
return stream.available()
}
},
stream
)
return bar(object : I {
@Throws(IOException::class)
override fun doIt(stream: InputStream): Int {
return stream.available()
}
}, stream)
}
}