mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-25 00:09:02 +00:00
Merge branch '7.0.x'
This commit is contained in:
+11
-1
@@ -1294,6 +1294,16 @@ public class PathMatchingResourcePatternResolver implements ResourcePatternResol
|
||||
static ClassPathManifestEntry of(File file, @Nullable Boolean useCaches) throws MalformedURLException {
|
||||
String path = fixPath(file.getAbsolutePath());
|
||||
Resource resource = asJarFileResource(path, useCaches);
|
||||
if (!resource.exists()) {
|
||||
String encodedPath = fixPath(StringUtils.replace(file.getAbsolutePath(), "%", "%25"));
|
||||
if (!encodedPath.equals(path)) {
|
||||
Resource encodedResource = asJarFileResource(encodedPath, useCaches);
|
||||
if (encodedResource.exists()) {
|
||||
path = encodedPath;
|
||||
resource = encodedResource;
|
||||
}
|
||||
}
|
||||
}
|
||||
Resource alternative = createAlternative(path, useCaches);
|
||||
return new ClassPathManifestEntry(resource, alternative);
|
||||
}
|
||||
@@ -1316,7 +1326,7 @@ public class PathMatchingResourcePatternResolver implements ResourcePatternResol
|
||||
*/
|
||||
private static @Nullable Resource createAlternative(String path, @Nullable Boolean useCaches) {
|
||||
try {
|
||||
String alternativePath = path.startsWith("/") ? path.substring(1) : "/" + path;
|
||||
String alternativePath = (path.startsWith("/") ? path.substring(1) : "/" + path);
|
||||
return asJarFileResource(alternativePath, useCaches);
|
||||
}
|
||||
catch (MalformedURLException ex) {
|
||||
|
||||
+4
-4
@@ -130,12 +130,12 @@ public class SimplePropertyRowMapper<T> implements RowMapper<T> {
|
||||
String name = this.constructorParameterNames[i];
|
||||
int index;
|
||||
try {
|
||||
// Try direct name match first
|
||||
index = rs.findColumn(name);
|
||||
// Try common underscored name match first
|
||||
index = rs.findColumn(JdbcUtils.convertPropertyNameToUnderscoreName(name));
|
||||
}
|
||||
catch (SQLException ex) {
|
||||
// Try underscored name match instead
|
||||
index = rs.findColumn(JdbcUtils.convertPropertyNameToUnderscoreName(name));
|
||||
// Try direct name match (typically with camelCase) instead
|
||||
index = rs.findColumn(name);
|
||||
}
|
||||
TypeDescriptor td = this.constructorParameterTypes[i];
|
||||
Object value = JdbcUtils.getResultSetValue(rs, index, td.getType());
|
||||
|
||||
Reference in New Issue
Block a user