@@ -60,6 +60,8 @@ class TypeDiscoverer<S> implements TypeInformation<S> {
60
60
private final Map <Constructor <?>, List <TypeInformation <?>>> constructorParameters = new ConcurrentHashMap <>();
61
61
private final Lazy <List <TypeInformation <?>>> typeArguments ;
62
62
63
+ private final Lazy <List <Class >> resolvedGenerics ;
64
+
63
65
protected TypeDiscoverer (ResolvableType type ) {
64
66
65
67
Assert .notNull (type , "Type must not be null" );
@@ -68,6 +70,8 @@ protected TypeDiscoverer(ResolvableType type) {
68
70
this .componentType = Lazy .of (this ::doGetComponentType );
69
71
this .valueType = Lazy .of (this ::doGetMapValueType );
70
72
this .typeArguments = Lazy .of (this ::doGetTypeArguments );
73
+ this .resolvedGenerics = Lazy .of (() -> Arrays .stream (resolvableType .getGenerics ()) //
74
+ .map (ResolvableType ::toClass ).collect (Collectors .toList ()));
71
75
}
72
76
73
77
static TypeDiscoverer <?> td (ResolvableType type ) {
@@ -325,15 +329,7 @@ public boolean equals(@Nullable Object o) {
325
329
return false ;
326
330
}
327
331
328
- var collect1 = Arrays .stream (resolvableType .getGenerics ()) //
329
- .map (ResolvableType ::toClass ) //
330
- .collect (Collectors .toList ());
331
-
332
- var collect2 = Arrays .stream (that .resolvableType .getGenerics ()) //
333
- .map (ResolvableType ::toClass ) //
334
- .collect (Collectors .toList ());
335
-
336
- return ObjectUtils .nullSafeEquals (collect1 , collect2 );
332
+ return ObjectUtils .nullSafeEquals (resolvedGenerics .get (), that .resolvedGenerics .get ());
337
333
}
338
334
339
335
@ Override
0 commit comments