Return-Path: Delivered-To: apmail-commons-issues-archive@locus.apache.org Received: (qmail 18428 invoked from network); 6 Nov 2008 20:41:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Nov 2008 20:41:41 -0000 Received: (qmail 41637 invoked by uid 500); 6 Nov 2008 20:41:46 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 41553 invoked by uid 500); 6 Nov 2008 20:41:46 -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 41523 invoked by uid 99); 6 Nov 2008 20:41:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Nov 2008 12:41:45 -0800 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; Thu, 06 Nov 2008 20:40:36 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id B0727234C287 for ; Thu, 6 Nov 2008 12:40:48 -0800 (PST) Message-ID: <1236596456.1226004048721.JavaMail.jira@brutus> Date: Thu, 6 Nov 2008 12:40:48 -0800 (PST) From: "Henri Yandell (JIRA)" To: issues@commons.apache.org Subject: [jira] Updated: (LANG-458) Refactor Validate.java to eliminate code redundancy 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 ] Henri Yandell updated LANG-458: ------------------------------- Fix Version/s: 3.0 Summary: Refactor Validate.java to eliminate code redundancy (was: Add methods to return boolean from Validate.java instead of throwing IllegalArgumentException) Renaming issue to match patches > Refactor Validate.java to eliminate code redundancy > --------------------------------------------------- > > 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 > Fix For: 3.0 > > 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.