You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by th...@apache.org on 2017/07/07 02:05:48 UTC

[13/50] commons-dbutils git commit: Findbugs: Nullcheck of value previously dereferenced

Findbugs: Nullcheck of value previously dereferenced

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/dbutils/trunk@1611132 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/commons-dbutils/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-dbutils/commit/3f4a0e09
Tree: http://git-wip-us.apache.org/repos/asf/commons-dbutils/tree/3f4a0e09
Diff: http://git-wip-us.apache.org/repos/asf/commons-dbutils/diff/3f4a0e09

Branch: refs/heads/master
Commit: 3f4a0e09d2241221397c6de376464a7877518bee
Parents: 22183c6
Author: Benedikt Ritter <br...@apache.org>
Authored: Wed Jul 16 18:46:25 2014 +0000
Committer: Benedikt Ritter <br...@apache.org>
Committed: Wed Jul 16 18:46:25 2014 +0000

----------------------------------------------------------------------
 src/main/java/org/apache/commons/dbutils/BeanProcessor.java | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-dbutils/blob/3f4a0e09/src/main/java/org/apache/commons/dbutils/BeanProcessor.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/dbutils/BeanProcessor.java b/src/main/java/org/apache/commons/dbutils/BeanProcessor.java
index 0b0cd7f..9c3752f 100644
--- a/src/main/java/org/apache/commons/dbutils/BeanProcessor.java
+++ b/src/main/java/org/apache/commons/dbutils/BeanProcessor.java
@@ -221,10 +221,13 @@ public class BeanProcessor {
             PropertyDescriptor prop = props[columnToProperty[i]];
             Class<?> propType = prop.getPropertyType();
 
-            Object value = this.processColumn(rs, i, propType);
+            Object value = null;
+            if(propType != null) {
+                value = this.processColumn(rs, i, propType);
 
-            if (propType != null && value == null && propType.isPrimitive()) {
-                value = primitiveDefaults.get(propType);
+                if (value == null && propType.isPrimitive()) {
+                    value = primitiveDefaults.get(propType);
+                }
             }
 
             this.callSetter(bean, prop, value);