Skip to content

Commit c485e9b

Browse files
committed
Merge branch '6.0.x'
2 parents 3a70c71 + 51cdff5 commit c485e9b

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

spring-core/src/main/java/org/springframework/aot/generate/GeneratedFiles.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2023 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.
@@ -161,7 +161,8 @@ default void addFile(Kind kind, String path, ThrowingConsumer<Appendable> conten
161161

162162
private static String getClassNamePath(String className) {
163163
Assert.hasLength(className, "'className' must not be empty");
164-
Assert.isTrue(isJavaIdentifier(className), "'className' must be a valid identifier");
164+
Assert.isTrue(isJavaIdentifier(className),
165+
"'className' must be a valid identifier, got '" + className + "'");
165166
return ClassUtils.convertClassNameToResourcePath(className) + ".java";
166167
}
167168

spring-core/src/test/java/org/springframework/aot/generate/GeneratedFilesTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2023 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.
@@ -78,7 +78,7 @@ void addSourceFileWithCharSequenceWhenClassNameIsInvalidThrowsException() {
7878
assertThatIllegalArgumentException()
7979
.isThrownBy(() -> this.generatedFiles
8080
.addSourceFile("com/example/HelloWorld.java", "{}"))
81-
.withMessage("'className' must be a valid identifier");
81+
.withMessage("'className' must be a valid identifier, got 'com/example/HelloWorld.java'");
8282
}
8383

8484
@Test

0 commit comments

Comments
 (0)