This commit is contained in:
Phillip Webb 2021-07-22 09:50:17 -07:00
parent 452446f056
commit 20a6073913

View File

@ -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;
}