commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
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 GMT
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 <code>null</code>.
      */
-    @SuppressWarnings("unchecked")
     public static <T> Constructor<T> getMatchingAccessibleConstructor(Class<T>
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<T> ctor = getAccessibleConstructor((Constructor<T>)
ctors[i]);
                 if (ctor != null) {
                     MemberUtils.setAccessibleWorkaround(ctor);



Mime
View raw message