Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BFA0118416 for ; Wed, 17 Jun 2015 00:34:00 +0000 (UTC) Received: (qmail 16600 invoked by uid 500); 17 Jun 2015 00:34:00 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 16501 invoked by uid 500); 17 Jun 2015 00:34:00 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 16489 invoked by uid 99); 17 Jun 2015 00:34:00 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Jun 2015 00:34:00 +0000 Date: Wed, 17 Jun 2015 00:34:00 +0000 (UTC) From: "Gary Gregory (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CSV-152) CSVRecord.isSet() does not check if value is not null MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CSV-152?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14589089#comment-14589089 ] Gary Gregory commented on CSV-152: ---------------------------------- So in you use case, the record needs the format object or just the {{nullString}} setting? > CSVRecord.isSet() does not check if value is not null > ----------------------------------------------------- > > Key: CSV-152 > URL: https://issues.apache.org/jira/browse/CSV-152 > Project: Commons CSV > Issue Type: Bug > Reporter: Michael Newcomb > > Consider: > public boolean isSet(final String name) > { > return isMapped(name) && mapping.get(name).intValue() < values.length; > } > The docs say 'and has a value', however, it does not check if values[mapping.get(name)] is null. > Propose: > public boolean isSet(final String name) > { > return isMapped(name) && mapping.get(name) < values.length && values[mapping.get(name)] != null; > } > Perhaps a new method 'hasValue' if the above is not desirable? -- This message was sent by Atlassian JIRA (v6.3.4#6332)