Return-Path: Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: (qmail 97566 invoked from network); 9 Aug 2010 10:06:14 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 9 Aug 2010 10:06:14 -0000 Received: (qmail 5039 invoked by uid 500); 9 Aug 2010 10:06:14 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 4690 invoked by uid 500); 9 Aug 2010 10:06:12 -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 4683 invoked by uid 99); 9 Aug 2010 10:06:11 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Aug 2010 10:06:11 +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.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Aug 2010 10:06:09 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 8354523889E5; Mon, 9 Aug 2010 10:04:51 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r983569 - /commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/ConstructorUtils.java Date: Mon, 09 Aug 2010 10:04:51 -0000 To: commits@commons.apache.org From: sebb@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100809100451.8354523889E5@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: sebb Date: Mon Aug 9 10:04:51 2010 New Revision: 983569 URL: http://svn.apache.org/viewvc?rev=983569&view=rev Log: Minimise scope of @SuppressWarnings Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/ConstructorUtils.java Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/ConstructorUtils.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/ConstructorUtils.java?rev=983569&r1=983568&r2=983569&view=diff ============================================================================== --- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/ConstructorUtils.java (original) +++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/ConstructorUtils.java Mon Aug 9 10:04:51 2010 @@ -244,7 +244,6 @@ public class ConstructorUtils { * @param parameterTypes find method with compatible parameters * @return a valid Constructor object. If there's no matching constructor, returns null. */ - @SuppressWarnings("unchecked") public static Constructor getMatchingAccessibleConstructor(Class cls, Class... parameterTypes) { // see if we can find the constructor directly @@ -263,6 +262,7 @@ public class ConstructorUtils { if (ClassUtils.isAssignable(parameterTypes, ctors[i] .getParameterTypes(), true)) { // get accessible version of method + @SuppressWarnings("unchecked") // TODO is this OK? If so, why? Constructor ctor = getAccessibleConstructor((Constructor) ctors[i]); if (ctor != null) { MemberUtils.setAccessibleWorkaround(ctor);