Use correct index when try to find the type of the message
This commit is contained in:
parent
ff5aec0c78
commit
2f12f95d9b
@ -50,12 +50,12 @@ public abstract class TypeParameterMatcher {
|
|||||||
for (;;) {
|
for (;;) {
|
||||||
if (currentClass.getSuperclass() == parameterizedSuperClass) {
|
if (currentClass.getSuperclass() == parameterizedSuperClass) {
|
||||||
Type[] types = ((ParameterizedType) currentClass.getGenericSuperclass()).getActualTypeArguments();
|
Type[] types = ((ParameterizedType) currentClass.getGenericSuperclass()).getActualTypeArguments();
|
||||||
if (types.length - 1 < typeParamIndex || !(types[0] instanceof Class)) {
|
if (types.length - 1 < typeParamIndex || !(types[typeParamIndex] instanceof Class)) {
|
||||||
throw new IllegalStateException(
|
throw new IllegalStateException(
|
||||||
"cannot determine the type of the type parameter of " + thisClass.getSimpleName());
|
"cannot determine the type of the type parameter of " + thisClass.getSimpleName());
|
||||||
}
|
}
|
||||||
|
|
||||||
Class<?> messageType = (Class<?>) types[0];
|
Class<?> messageType = (Class<?>) types[typeParamIndex];
|
||||||
if (messageType == Object.class) {
|
if (messageType == Object.class) {
|
||||||
matcher = NOOP;
|
matcher = NOOP;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user