@@ -60,6 +60,8 @@ class TypeDiscoverer<S> implements TypeInformation<S> {
6060 private final Map <Constructor <?>, List <TypeInformation <?>>> constructorParameters = new ConcurrentHashMap <>();
6161 private final Lazy <List <TypeInformation <?>>> typeArguments ;
6262
63+ private final Lazy <List <Class >> resolvedGenerics ;
64+
6365 protected TypeDiscoverer (ResolvableType type ) {
6466
6567 Assert .notNull (type , "Type must not be null" );
@@ -68,6 +70,8 @@ protected TypeDiscoverer(ResolvableType type) {
6870 this .componentType = Lazy .of (this ::doGetComponentType );
6971 this .valueType = Lazy .of (this ::doGetMapValueType );
7072 this .typeArguments = Lazy .of (this ::doGetTypeArguments );
73+ this .resolvedGenerics = Lazy .of (() -> Arrays .stream (resolvableType .getGenerics ()) //
74+ .map (ResolvableType ::toClass ).collect (Collectors .toList ()));
7175 }
7276
7377 static TypeDiscoverer <?> td (ResolvableType type ) {
@@ -325,15 +329,7 @@ public boolean equals(@Nullable Object o) {
325329 return false ;
326330 }
327331
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 ());
337333 }
338334
339335 @ Override
0 commit comments