Improve performance of some string operations
Issue: SPR-16293
This commit is contained in:
@@ -239,11 +239,9 @@ public final class Property {
|
||||
field = ReflectionUtils.findField(declaringClass, name);
|
||||
if (field == null) {
|
||||
// Same lenient fallback checking as in CachedIntrospectionResults...
|
||||
field = ReflectionUtils.findField(declaringClass,
|
||||
name.substring(0, 1).toLowerCase() + name.substring(1));
|
||||
field = ReflectionUtils.findField(declaringClass, StringUtils.uncapitalize(name));
|
||||
if (field == null) {
|
||||
field = ReflectionUtils.findField(declaringClass,
|
||||
name.substring(0, 1).toUpperCase() + name.substring(1));
|
||||
field = ReflectionUtils.findField(declaringClass, StringUtils.capitalize(name));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -427,7 +427,7 @@ public class PathMatchingResourcePatternResolver implements ResourcePatternResol
|
||||
int prefixIndex = filePath.indexOf(':');
|
||||
if (prefixIndex == 1) {
|
||||
// Possibly "c:" drive prefix on Windows, to be upper-cased for proper duplicate detection
|
||||
filePath = filePath.substring(0, 1).toUpperCase() + filePath.substring(1);
|
||||
filePath = StringUtils.capitalize(filePath);
|
||||
}
|
||||
UrlResource jarResource = new UrlResource(ResourceUtils.JAR_URL_PREFIX +
|
||||
ResourceUtils.FILE_URL_PREFIX + filePath + ResourceUtils.JAR_URL_SEPARATOR);
|
||||
|
||||
Reference in New Issue
Block a user