Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 73075 invoked from network); 5 Nov 2009 07:26:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 5 Nov 2009 07:26:56 -0000 Received: (qmail 92526 invoked by uid 500); 5 Nov 2009 07:26:56 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 92398 invoked by uid 500); 5 Nov 2009 07:26:55 -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 92388 invoked by uid 99); 5 Nov 2009 07:26:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Nov 2009 07:26:55 +0000 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, 05 Nov 2009 07:26:53 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 8EB3E234C045 for ; Wed, 4 Nov 2009 23:26:32 -0800 (PST) Message-ID: <412164411.1257405992570.JavaMail.jira@brutus> Date: Thu, 5 Nov 2009 07:26:32 +0000 (UTC) From: "Henri Yandell (JIRA)" To: issues@commons.apache.org Subject: [jira] Closed: (LANG-358) ObjectUtils.coalesce In-Reply-To: <2635341.1192170471152.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/LANG-358?page=3Dcom.atlassian.= jira.plugin.system.issuetabpanels:all-tabpanel ] Henri Yandell closed LANG-358. ------------------------------ Resolution: Fixed svn ci -m "Applying J=C3=B6rg Gottschling's patch from LANG-358 with Thomas= Menzel's naming from LANG-550 and some of his tests. This adds a firstNonN= ull method to ObjectUtils. " src Sending src/java/org/apache/commons/lang/ObjectUtils.java Sending src/test/org/apache/commons/lang/ObjectUtilsTest.java Transmitting file data .. Committed revision 833016. > ObjectUtils.coalesce > -------------------- > > Key: LANG-358 > URL: https://issues.apache.org/jira/browse/LANG-358 > Project: Commons Lang > Issue Type: New Feature > Reporter: J=C3=B6rg Gottschling > Priority: Minor > Fix For: 3.0 > > Attachments: ObjectUtils.java, ObjectUtilsTest.java > > > I like to see the coalesce-function from SQL implemented in ObjectUtils. = Something like this: > T ObjectUtils.coalesce(T... t) > The first object, which is not null will be returned. This would replace = all the defaultValue/defaultString/... methods, with al flexibler and short= er method. It will also reuse an existing name. > I think it's simple. Perhaps there should be overloading methods with fix= ed parameter sizes. Following the jdk this seems to a little faster: > T ObjectUtils.coalesce(T t1, T t2) > T ObjectUtils.coalesce(T t1, T t2, T t3) > ... > I would provide it, including tests, if you like. --=20 This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.