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 142838bfd4..e4f9840a8b 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. @@ -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}") } }