Skip to content

Commit be09216

Browse files
committed
Merge pull request #42801 from jeonghyeon00
* pr/42801: Upgrade copyright year of changed file Use Kotlin String Templates Closes gh-42801
2 parents a3c34b4 + 4189f31 commit be09216

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -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)