From 2f66e0fdf8e37fab954fa4397b27429234e13b05 Mon Sep 17 00:00:00 2001 From: Sebastian Bazley Date: Mon, 9 Aug 2010 10:04:51 +0000 Subject: [PATCH] Minimise scope of @SuppressWarnings git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@983569 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/commons/lang3/reflect/ConstructorUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/apache/commons/lang3/reflect/ConstructorUtils.java b/src/main/java/org/apache/commons/lang3/reflect/ConstructorUtils.java index a7792e924..b893b3c65 100644 --- a/src/main/java/org/apache/commons/lang3/reflect/ConstructorUtils.java +++ b/src/main/java/org/apache/commons/lang3/reflect/ConstructorUtils.java @@ -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);