Some minor cleanups for TypeParameterMatcher (#11286)
Motivation: The code in TypeParamterMatcher can be simplified and cleaned up. Modification: Cleanup Result: Cleanup
This commit is contained in:
parent
84826a4ea6
commit
b646a2670a
@ -119,18 +119,17 @@ public abstract class TypeParameterMatcher {
|
|||||||
if (actualTypeParam instanceof TypeVariable) {
|
if (actualTypeParam instanceof TypeVariable) {
|
||||||
// Resolved type parameter points to another type parameter.
|
// Resolved type parameter points to another type parameter.
|
||||||
TypeVariable<?> v = (TypeVariable<?>) actualTypeParam;
|
TypeVariable<?> v = (TypeVariable<?>) actualTypeParam;
|
||||||
currentClass = thisClass;
|
|
||||||
if (!(v.getGenericDeclaration() instanceof Class)) {
|
if (!(v.getGenericDeclaration() instanceof Class)) {
|
||||||
return Object.class;
|
return Object.class;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
currentClass = thisClass;
|
||||||
parametrizedSuperclass = (Class<?>) v.getGenericDeclaration();
|
parametrizedSuperclass = (Class<?>) v.getGenericDeclaration();
|
||||||
typeParamName = v.getName();
|
typeParamName = v.getName();
|
||||||
if (parametrizedSuperclass.isAssignableFrom(thisClass)) {
|
if (parametrizedSuperclass.isAssignableFrom(thisClass)) {
|
||||||
continue;
|
continue;
|
||||||
} else {
|
|
||||||
return Object.class;
|
|
||||||
}
|
}
|
||||||
|
return Object.class;
|
||||||
}
|
}
|
||||||
|
|
||||||
return fail(thisClass, typeParamName);
|
return fail(thisClass, typeParamName);
|
||||||
|
Loading…
Reference in New Issue
Block a user