@@ -89,7 +89,7 @@ protected TypeDiscoverer(Type type, Map<TypeVariable<?>, Type> typeVariableMap)
89
89
this .componentType = Lazy .of (this ::doGetComponentType );
90
90
this .valueType = Lazy .of (this ::doGetMapValueType );
91
91
this .typeVariableMap = typeVariableMap ;
92
- this .hashCode = 17 + ( 31 * type .hashCode ()) + ( 31 * typeVariableMap .hashCode () );
92
+ this .hashCode = 17 + 31 * type .hashCode () + 31 * typeVariableMap .hashCode ();
93
93
}
94
94
95
95
/**
@@ -435,11 +435,12 @@ public TypeInformation<?> getSuperTypeInformation(Class<?> superType) {
435
435
}
436
436
437
437
List <Type > candidates = new ArrayList <>();
438
-
439
438
Type genericSuperclass = rawType .getGenericSuperclass ();
439
+
440
440
if (genericSuperclass != null ) {
441
441
candidates .add (genericSuperclass );
442
442
}
443
+
443
444
candidates .addAll (Arrays .asList (rawType .getGenericInterfaces ()));
444
445
445
446
for (Type candidate : candidates ) {
@@ -449,7 +450,9 @@ public TypeInformation<?> getSuperTypeInformation(Class<?> superType) {
449
450
if (superType .equals (candidateInfo .getType ())) {
450
451
return candidateInfo ;
451
452
} else {
453
+
452
454
TypeInformation <?> nestedSuperType = candidateInfo .getSuperTypeInformation (superType );
455
+
453
456
if (nestedSuperType != null ) {
454
457
return nestedSuperType ;
455
458
}
@@ -501,17 +504,19 @@ private TypeInformation<?> getTypeArgument(Class<?> bound, int index) {
501
504
502
505
Class <?>[] arguments = GenericTypeResolver .resolveTypeArguments (getType (), bound );
503
506
504
- if (arguments == null ) {
505
- return getSuperTypeInformation (bound ) instanceof ParameterizedTypeInformation ? ClassTypeInformation .OBJECT
506
- : null ;
507
+ if (arguments != null ) {
508
+ return createInfo (arguments [index ]);
507
509
}
508
510
509
- return createInfo (arguments [index ]);
511
+ return getSuperTypeInformation (bound ) instanceof ParameterizedTypeInformation //
512
+ ? ClassTypeInformation .OBJECT //
513
+ : null ;
510
514
}
511
515
512
516
private Class <?> getBaseType (Class <?>[] candidates ) {
513
517
514
518
Class <S > type = getType ();
519
+
515
520
for (Class <?> candidate : candidates ) {
516
521
if (candidate .isAssignableFrom (type )) {
517
522
return candidate ;
0 commit comments