Fix internal raw types
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@829367 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
fdb8010676
commit
6622091f9b
|
@ -145,7 +145,7 @@ public class ConstructorUtils {
|
||||||
if (args == null) {
|
if (args == null) {
|
||||||
args = ArrayUtils.EMPTY_OBJECT_ARRAY;
|
args = ArrayUtils.EMPTY_OBJECT_ARRAY;
|
||||||
}
|
}
|
||||||
Constructor ctor = getMatchingAccessibleConstructor(cls, parameterTypes);
|
Constructor<?> ctor = getMatchingAccessibleConstructor(cls, parameterTypes);
|
||||||
if (null == ctor) {
|
if (null == ctor) {
|
||||||
throw new NoSuchMethodException(
|
throw new NoSuchMethodException(
|
||||||
"No such accessible constructor on object: "
|
"No such accessible constructor on object: "
|
||||||
|
@ -238,7 +238,7 @@ public class ConstructorUtils {
|
||||||
if (parameterTypes == null) {
|
if (parameterTypes == null) {
|
||||||
parameterTypes = ArrayUtils.EMPTY_CLASS_ARRAY;
|
parameterTypes = ArrayUtils.EMPTY_CLASS_ARRAY;
|
||||||
}
|
}
|
||||||
Constructor ctor = getAccessibleConstructor(cls, parameterTypes);
|
Constructor<?> ctor = getAccessibleConstructor(cls, parameterTypes);
|
||||||
if (null == ctor) {
|
if (null == ctor) {
|
||||||
throw new NoSuchMethodException(
|
throw new NoSuchMethodException(
|
||||||
"No such accessible constructor on object: "
|
"No such accessible constructor on object: "
|
||||||
|
@ -309,20 +309,20 @@ public class ConstructorUtils {
|
||||||
// see if we can find the constructor directly
|
// see if we can find the constructor directly
|
||||||
// most of the time this works and it's much faster
|
// most of the time this works and it's much faster
|
||||||
try {
|
try {
|
||||||
Constructor ctor = cls.getConstructor(parameterTypes);
|
Constructor<?> ctor = cls.getConstructor(parameterTypes);
|
||||||
MemberUtils.setAccessibleWorkaround(ctor);
|
MemberUtils.setAccessibleWorkaround(ctor);
|
||||||
return ctor;
|
return ctor;
|
||||||
} catch (NoSuchMethodException e) { /* SWALLOW */
|
} catch (NoSuchMethodException e) { /* SWALLOW */
|
||||||
}
|
}
|
||||||
Constructor result = null;
|
Constructor<?> result = null;
|
||||||
// search through all constructors
|
// search through all constructors
|
||||||
Constructor[] ctors = cls.getConstructors();
|
Constructor<?>[] ctors = cls.getConstructors();
|
||||||
for (int i = 0; i < ctors.length; i++) {
|
for (int i = 0; i < ctors.length; i++) {
|
||||||
// compare parameters
|
// compare parameters
|
||||||
if (ClassUtils.isAssignable(parameterTypes, ctors[i]
|
if (ClassUtils.isAssignable(parameterTypes, ctors[i]
|
||||||
.getParameterTypes(), true)) {
|
.getParameterTypes(), true)) {
|
||||||
// get accessible version of method
|
// get accessible version of method
|
||||||
Constructor ctor = getAccessibleConstructor(ctors[i]);
|
Constructor<?> ctor = getAccessibleConstructor(ctors[i]);
|
||||||
if (ctor != null) {
|
if (ctor != null) {
|
||||||
MemberUtils.setAccessibleWorkaround(ctor);
|
MemberUtils.setAccessibleWorkaround(ctor);
|
||||||
if (result == null
|
if (result == null
|
||||||
|
|
Loading…
Reference in New Issue