commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thecarlh...@apache.org
Subject [13/50] commons-dbutils git commit: Findbugs: Nullcheck of value previously dereferenced
Date Fri, 07 Jul 2017 02:05:48 GMT
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 <britter@apache.org>
Authored: Wed Jul 16 18:46:25 2014 +0000
Committer: Benedikt Ritter <britter@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);


Mime
View raw message