commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brit...@apache.org
Subject svn commit: r1611132 - /commons/proper/dbutils/trunk/src/main/java/org/apache/commons/dbutils/BeanProcessor.java
Date Wed, 16 Jul 2014 18:46:25 GMT
Author: britter
Date: Wed Jul 16 18:46:25 2014
New Revision: 1611132

URL: http://svn.apache.org/r1611132
Log:
Findbugs: Nullcheck of value previously dereferenced

Modified:
    commons/proper/dbutils/trunk/src/main/java/org/apache/commons/dbutils/BeanProcessor.java

Modified: commons/proper/dbutils/trunk/src/main/java/org/apache/commons/dbutils/BeanProcessor.java
URL: http://svn.apache.org/viewvc/commons/proper/dbutils/trunk/src/main/java/org/apache/commons/dbutils/BeanProcessor.java?rev=1611132&r1=1611131&r2=1611132&view=diff
==============================================================================
--- commons/proper/dbutils/trunk/src/main/java/org/apache/commons/dbutils/BeanProcessor.java
(original)
+++ commons/proper/dbutils/trunk/src/main/java/org/apache/commons/dbutils/BeanProcessor.java
Wed Jul 16 18:46:25 2014
@@ -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