Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id F1C2B200CE1 for ; Fri, 7 Jul 2017 04:05:42 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id F0352167E3A; Fri, 7 Jul 2017 02:05:42 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 4DD21167E44 for ; Fri, 7 Jul 2017 04:05:42 +0200 (CEST) Received: (qmail 73065 invoked by uid 500); 7 Jul 2017 02:05:37 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 72226 invoked by uid 99); 7 Jul 2017 02:05:37 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Jul 2017 02:05:37 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id E8413E961F; Fri, 7 Jul 2017 02:05:36 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: thecarlhall@apache.org To: commits@commons.apache.org Date: Fri, 07 Jul 2017 02:05:48 -0000 Message-Id: In-Reply-To: <61130dcfb8c9434aba8ddd07d7d7485c@git.apache.org> References: <61130dcfb8c9434aba8ddd07d7d7485c@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [13/50] commons-dbutils git commit: Findbugs: Nullcheck of value previously dereferenced archived-at: Fri, 07 Jul 2017 02:05:43 -0000 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 Authored: Wed Jul 16 18:46:25 2014 +0000 Committer: Benedikt Ritter 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);