From 0e557c5a026235019769486685a60eea1f914de7 Mon Sep 17 00:00:00 2001 From: SungbinYang Date: Fri, 4 Oct 2024 14:06:06 +0900 Subject: [PATCH] Use EXTENSION_SEPARATOR constant instead of hardcoded '.' Replaced all instances of the hardcoded '.' character with the EXTENSION_SEPARATOR constant in the StringUtils class. This refactor improves the code's readability and maintainability by ensuring that separator characters are defined consistently through the use of constants. No functional changes have been made. --- .../src/main/java/org/springframework/util/StringUtils.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spring-core/src/main/java/org/springframework/util/StringUtils.java b/spring-core/src/main/java/org/springframework/util/StringUtils.java index c7aa9ffc268b..c6e8b47cb5a2 100644 --- a/spring-core/src/main/java/org/springframework/util/StringUtils.java +++ b/spring-core/src/main/java/org/springframework/util/StringUtils.java @@ -60,6 +60,7 @@ * @author Sam Brannen * @author Brian Clozel * @author Sebastien Deleuze + * @author SungbinYang * @since 16 April 2001 */ public abstract class StringUtils { @@ -536,7 +537,7 @@ public static Object quoteIfString(@Nullable Object obj) { * @param qualifiedName the qualified name */ public static String unqualify(String qualifiedName) { - return unqualify(qualifiedName, '.'); + return unqualify(qualifiedName, EXTENSION_SEPARATOR); } /** @@ -722,7 +723,7 @@ public static String cleanPath(String path) { String pathToUse = normalizedPath; // Shortcut if there is no work to do - if (pathToUse.indexOf('.') == -1) { + if (pathToUse.indexOf(EXTENSION_SEPARATOR) == -1) { return pathToUse; }