Return-Path: Delivered-To: apmail-commons-commits-archive@locus.apache.org Received: (qmail 60182 invoked from network); 15 Feb 2008 00:27:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Feb 2008 00:27:34 -0000 Received: (qmail 75284 invoked by uid 500); 15 Feb 2008 00:27:27 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 75220 invoked by uid 500); 15 Feb 2008 00:27:27 -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 75211 invoked by uid 99); 15 Feb 2008 00:27:27 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Feb 2008 16:27:27 -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.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Feb 2008 00:27:04 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 8A49A1A9832; Thu, 14 Feb 2008 16:27:12 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r627916 - /commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/PropertyConverter.java Date: Fri, 15 Feb 2008 00:27:12 -0000 To: commits@commons.apache.org From: ebourg@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080215002712.8A49A1A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ebourg Date: Thu Feb 14 16:27:11 2008 New Revision: 627916 URL: http://svn.apache.org/viewvc?rev=627916&view=rev Log: Minor change in PropertyConverter to use the varargs methods Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/PropertyConverter.java Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/PropertyConverter.java URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/PropertyConverter.java?rev=627916&r1=627915&r2=627916&view=diff ============================================================================== --- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/PropertyConverter.java (original) +++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/PropertyConverter.java Thu Feb 14 16:27:11 2008 @@ -150,7 +150,7 @@ { result = toLocale(value); } - else if (isEnum(cls)) + else if (cls.isEnum()) { // This causes an unchecked warning because the concrete Enum class // cannot be fully determined. @@ -410,7 +410,7 @@ try { Constructor constr = targetClass.getConstructor(CONSTR_ARGS); - return (Number) constr.newInstance(new Object[]{str}); + return (Number) constr.newInstance(str); } catch (InvocationTargetException itex) { @@ -708,8 +708,8 @@ // should be optional. try { - Constructor ctor = Class.forName(INTERNET_ADDRESS_CLASSNAME).getConstructor(new Class[] {String.class}); - return ctor.newInstance(new Object[] {value}); + Constructor ctor = Class.forName(INTERNET_ADDRESS_CLASSNAME).getConstructor(String.class); + return ctor.newInstance(value); } catch (Exception e) { @@ -720,14 +720,6 @@ { throw new ConversionException("The value " + value + " can't be converted to a InternetAddress"); } - } - - /** - * Calls Class.isEnum() on Java 5, returns false on older JRE. - */ - static boolean isEnum(Class cls) - { - return cls.isEnum(); } /**