Return-Path: Delivered-To: apmail-commons-issues-archive@locus.apache.org Received: (qmail 77313 invoked from network); 10 Oct 2008 20:03:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Oct 2008 20:03:09 -0000 Received: (qmail 50459 invoked by uid 500); 10 Oct 2008 20:03:05 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 50367 invoked by uid 500); 10 Oct 2008 20:03:05 -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 50197 invoked by uid 99); 10 Oct 2008 20:03:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Oct 2008 13:03:04 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Oct 2008 20:02:08 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 50737234C219 for ; Fri, 10 Oct 2008 13:02:44 -0700 (PDT) Message-ID: <54402957.1223668964328.JavaMail.jira@brutus> Date: Fri, 10 Oct 2008 13:02:44 -0700 (PDT) From: "Viraj Turakhia (JIRA)" To: issues@commons.apache.org Subject: [jira] Updated: (LANG-458) Add methods to return boolean from Validate.java instead of throwing IllegalArgumentException In-Reply-To: <1812615181.1221308326204.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/LANG-458?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Viraj Turakhia updated LANG-458: -------------------------------- Attachment: validate_test_diff.txt vaidate_diff.txt As per the discussion, attaching diff for code and test file (Validate.java and ValidateTest.java). Change includes removing code duplication and adding of two utility methods. Let me know what you think. > Add methods to return boolean from Validate.java instead of throwing IllegalArgumentException > --------------------------------------------------------------------------------------------- > > Key: LANG-458 > URL: https://issues.apache.org/jira/browse/LANG-458 > Project: Commons Lang > Issue Type: Improvement > Environment: software > Reporter: Viraj Turakhia > Priority: Minor > Attachments: vaidate_diff.txt, validate_test_diff.txt > > > I am using Validate.java since long and find it difficult to use when I just want to validate collections or string. > With current interface, I go like this: > while(cnt < list.size()) { > List list1 = list.get(cnt); > try { > Validate.notEmpty(list1); > } catch(IllegalArgumentException e) { > continue; > } > } > much better approach is: > while(cnt < list.size()) { > List list1 = list.get(cnt); > try { > if(! Validate.notEmpty(list1)) { > continue; > } > } > If you all agree with this change, I am willing to submit a patch for this. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.