This is an automated email from the ASF dual-hosted git repository. thecarlhall pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-dbutils.git
The following commit(s) were added to refs/heads/master by this push: new e97220e Dedupe property name logic e97220e is described below commit e97220ed67158a959a4a3836017111b6930fe263 Author: Carl Hall <thecarlh...@apache.org> AuthorDate: Sun Oct 20 21:56:54 2019 -0700 Dedupe property name logic A bit of logic was copied from a previous iteration. This commit reduces the logic to just picking a name source. --- src/main/java/org/apache/commons/dbutils/BeanProcessor.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/apache/commons/dbutils/BeanProcessor.java b/src/main/java/org/apache/commons/dbutils/BeanProcessor.java index ada9009..6fdf8fb 100644 --- a/src/main/java/org/apache/commons/dbutils/BeanProcessor.java +++ b/src/main/java/org/apache/commons/dbutils/BeanProcessor.java @@ -478,12 +478,13 @@ public class BeanProcessor { PropertyDescriptor prop = props[i]; Column column = prop.getReadMethod().getAnnotation(Column.class); + String propertyColumnName = null; if (column != null) { - if (propertyName.equalsIgnoreCase(column.name())){ - columnToProperty[col] = i; - break; - } - } else if (propertyName.equalsIgnoreCase(prop.getName())) { + propertyColumnName = column.name(); + } else { + propertyColumnName = prop.getName(); + } + if (propertyName.equalsIgnoreCase(propertyColumnName)) { columnToProperty[col] = i; break; }