Cleanup kotlin sources
1. remove unused import 2. remove redundant semicolon 3. remove redundant empty constructor and SAM-constructor 4. remove unnecessary type argument 5. adjust indent See gh-31913
This commit is contained in:
committed by
Stéphane Nicoll
parent
28a7b6103a
commit
7474af4f09
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.springframework.beans
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
import org.openjdk.jmh.annotations.Benchmark
|
||||
import org.openjdk.jmh.annotations.BenchmarkMode
|
||||
@@ -30,22 +30,22 @@ import org.openjdk.jmh.annotations.State
|
||||
@OutputTimeUnit(TimeUnit.NANOSECONDS)
|
||||
open class KotlinBeanUtilsBenchmark {
|
||||
|
||||
private val noArgConstructor = TestClass1::class.java.getDeclaredConstructor()
|
||||
private val constructor = TestClass2::class.java.getDeclaredConstructor(Int::class.java, String::class.java)
|
||||
private val noArgConstructor = TestClass1::class.java.getDeclaredConstructor()
|
||||
private val constructor = TestClass2::class.java.getDeclaredConstructor(Int::class.java, String::class.java)
|
||||
|
||||
@Benchmark
|
||||
fun emptyConstructor(): Any {
|
||||
@Benchmark
|
||||
fun emptyConstructor(): Any {
|
||||
return BeanUtils.instantiateClass(noArgConstructor)
|
||||
}
|
||||
}
|
||||
|
||||
@Benchmark
|
||||
fun nonEmptyConstructor(): Any {
|
||||
@Benchmark
|
||||
fun nonEmptyConstructor(): Any {
|
||||
return BeanUtils.instantiateClass(constructor, 1, "str")
|
||||
}
|
||||
}
|
||||
|
||||
class TestClass1()
|
||||
class TestClass1
|
||||
|
||||
@Suppress("UNUSED_PARAMETER")
|
||||
class TestClass2(int: Int, string: String)
|
||||
@Suppress("UNUSED_PARAMETER")
|
||||
class TestClass2(int: Int, string: String)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user