Skip to content

Commit 0d126ac

Browse files
committed
Refactor: Replace hardcoded path separator with PATH_SEPARATOR constant
Replaced the hardcoded '/' path separator with the `PATH_SEPARATOR` constant to improve code readability and maintainability. This change ensures consistency across the codebase when handling path separators.
1 parent d65bdce commit 0d126ac

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

spring-core/src/main/java/org/springframework/util/ClassUtils.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
* @author Rob Harrop
6565
* @author Sam Brannen
6666
* @author Sebastien Deleuze
67+
* @author Sungbin Yang
6768
* @since 1.1
6869
* @see TypeUtils
6970
* @see ReflectionUtils
@@ -694,7 +695,7 @@ public static String convertClassNameToResourcePath(String className) {
694695
public static String addResourcePathToPackagePath(Class<?> clazz, String resourceName) {
695696
Assert.notNull(resourceName, "Resource name must not be null");
696697
if (!resourceName.startsWith("/")) {
697-
return classPackageAsResourcePath(clazz) + '/' + resourceName;
698+
return classPackageAsResourcePath(clazz) + PATH_SEPARATOR + resourceName;
698699
}
699700
return classPackageAsResourcePath(clazz) + resourceName;
700701
}

0 commit comments

Comments
 (0)