mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Polish
This commit is contained in:
parent
452446f056
commit
20a6073913
@ -281,17 +281,17 @@ public final class DataSourceBuilder<T extends DataSource> {
|
||||
}
|
||||
|
||||
Method findSetter(Class<?> type) {
|
||||
return extracted("set", type, String.class);
|
||||
return findMethod("set", type, String.class);
|
||||
}
|
||||
|
||||
Method findGetter(Class<?> type) {
|
||||
return extracted("get", type);
|
||||
return findMethod("get", type);
|
||||
}
|
||||
|
||||
private Method extracted(String prefix, Class<?> type, Class<?>... paramTypes) {
|
||||
for (String candidate : this.names) {
|
||||
Method method = ReflectionUtils.findMethod(type, prefix + StringUtils.capitalize(candidate),
|
||||
paramTypes);
|
||||
private Method findMethod(String prefix, Class<?> type, Class<?>... paramTypes) {
|
||||
for (String name : this.names) {
|
||||
String candidate = prefix + StringUtils.capitalize(name);
|
||||
Method method = ReflectionUtils.findMethod(type, candidate, paramTypes);
|
||||
if (method != null) {
|
||||
return method;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user