You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2010/08/09 12:04:51 UTC
svn commit: r983569 -
/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/ConstructorUtils.java
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);