Skip to content

Commit 35b1900

Browse files
jeonghyeon00snicoll
authored andcommitted
Use Kotlin String Templates
See gh-42801
1 parent a3c34b4 commit 35b1900

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spring-boot-project/spring-boot/src/main/kotlin/org/springframework/boot/SpringApplicationExtensions.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@ inline fun <reified T : Any> runApplication(vararg args: String, init: SpringApp
5555
*/
5656
inline fun <reified T : Any> fromApplication(): SpringApplication.Augmented {
5757
val type = T::class
58-
val ktClassName = type.qualifiedName + "Kt"
58+
val ktClassName = "${type.qualifiedName}Kt"
5959
try {
6060
val ktClass = ClassUtils.resolveClassName(ktClassName, type.java.classLoader)
6161
val mainMethod = ReflectionUtils.findMethod(ktClass, "main", Array<String>::class.java)
6262
Assert.notNull(mainMethod, "Unable to find main method")
6363
return SpringApplication.from { ReflectionUtils.invokeMethod(mainMethod!!, null, it) }
6464
} catch (ex: Exception) {
65-
throw IllegalStateException("Unable to use 'fromApplication' with " + type.qualifiedName)
65+
throw IllegalStateException("Unable to use 'fromApplication' with ${type.qualifiedName}")
6666
}
6767
}
6868

0 commit comments

Comments
 (0)