From 35b19008e6ad0ea9d8a24ae49132bf9799516164 Mon Sep 17 00:00:00 2001 From: jeonghyeon00 Date: Mon, 21 Oct 2024 13:06:00 +0900 Subject: [PATCH 1/2] Use Kotlin String Templates See gh-42801 --- .../org/springframework/boot/SpringApplicationExtensions.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-boot-project/spring-boot/src/main/kotlin/org/springframework/boot/SpringApplicationExtensions.kt b/spring-boot-project/spring-boot/src/main/kotlin/org/springframework/boot/SpringApplicationExtensions.kt index 142838bfd41..40ae79f3c3c 100644 --- a/spring-boot-project/spring-boot/src/main/kotlin/org/springframework/boot/SpringApplicationExtensions.kt +++ b/spring-boot-project/spring-boot/src/main/kotlin/org/springframework/boot/SpringApplicationExtensions.kt @@ -55,14 +55,14 @@ inline fun runApplication(vararg args: String, init: SpringApp */ inline fun fromApplication(): SpringApplication.Augmented { val type = T::class - val ktClassName = type.qualifiedName + "Kt" + val ktClassName = "${type.qualifiedName}Kt" try { val ktClass = ClassUtils.resolveClassName(ktClassName, type.java.classLoader) val mainMethod = ReflectionUtils.findMethod(ktClass, "main", Array::class.java) Assert.notNull(mainMethod, "Unable to find main method") return SpringApplication.from { ReflectionUtils.invokeMethod(mainMethod!!, null, it) } } catch (ex: Exception) { - throw IllegalStateException("Unable to use 'fromApplication' with " + type.qualifiedName) + throw IllegalStateException("Unable to use 'fromApplication' with ${type.qualifiedName}") } } From 4189f31dc5dd6bcf6122022219fe76696bf1951a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Nicoll?= Date: Mon, 21 Oct 2024 16:57:16 +0200 Subject: [PATCH 2/2] Upgrade copyright year of changed file See gh-42801 --- .../org/springframework/boot/SpringApplicationExtensions.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot/src/main/kotlin/org/springframework/boot/SpringApplicationExtensions.kt b/spring-boot-project/spring-boot/src/main/kotlin/org/springframework/boot/SpringApplicationExtensions.kt index 40ae79f3c3c..e4f9840a8b9 100644 --- a/spring-boot-project/spring-boot/src/main/kotlin/org/springframework/boot/SpringApplicationExtensions.kt +++ b/spring-boot-project/spring-boot/src/main/kotlin/org/springframework/boot/SpringApplicationExtensions.kt @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.