diff --git a/spring-core/src/main/java/org/springframework/aot/generate/GeneratedFiles.java b/spring-core/src/main/java/org/springframework/aot/generate/GeneratedFiles.java index 411ec8b46b..f1ae40ddf0 100644 --- a/spring-core/src/main/java/org/springframework/aot/generate/GeneratedFiles.java +++ b/spring-core/src/main/java/org/springframework/aot/generate/GeneratedFiles.java @@ -161,7 +161,7 @@ public interface GeneratedFiles { private static String getClassNamePath(String className) { Assert.hasLength(className, "'className' must not be empty"); - Assert.isTrue(isJavaIdentifier(className), "'className' must be a valid identifier"); + Assert.isTrue(isJavaIdentifier(className), "'className' " + className + " must be a valid identifier"); return ClassUtils.convertClassNameToResourcePath(className) + ".java"; } diff --git a/spring-core/src/test/java/org/springframework/aot/generate/GeneratedFilesTests.java b/spring-core/src/test/java/org/springframework/aot/generate/GeneratedFilesTests.java index 9f1f68ef30..4f13505a7b 100644 --- a/spring-core/src/test/java/org/springframework/aot/generate/GeneratedFilesTests.java +++ b/spring-core/src/test/java/org/springframework/aot/generate/GeneratedFilesTests.java @@ -78,7 +78,7 @@ class GeneratedFilesTests { assertThatIllegalArgumentException() .isThrownBy(() -> this.generatedFiles .addSourceFile("com/example/HelloWorld.java", "{}")) - .withMessage("'className' must be a valid identifier"); + .withMessage("'className' com/example/HelloWorld.java must be a valid identifier"); } @Test