@@ -329,9 +329,6 @@ private boolean isAssignableFrom(ResolvableType other, boolean strict,
329
329
other .getComponentType (), true , matchedBefore , upUntilUnresolvable ));
330
330
}
331
331
332
- // We're checking nested generic variables now...
333
- boolean exactMatch = (strict && matchedBefore != null );
334
-
335
332
// Deal with wildcard bounds
336
333
WildcardBounds ourBounds = WildcardBounds .get (this );
337
334
WildcardBounds otherBounds = WildcardBounds .get (other );
@@ -345,8 +342,9 @@ private boolean isAssignableFrom(ResolvableType other, boolean strict,
345
342
else if (upUntilUnresolvable ) {
346
343
return otherBounds .isAssignableFrom (this , matchedBefore );
347
344
}
348
- else if (!exactMatch ) {
349
- return otherBounds .isAssignableTo (this , matchedBefore );
345
+ else if (!strict ) {
346
+ return (matchedBefore != null ? otherBounds .equalsType (this ) :
347
+ otherBounds .isAssignableTo (this , matchedBefore ));
350
348
}
351
349
else {
352
350
return false ;
@@ -359,6 +357,7 @@ else if (!exactMatch) {
359
357
}
360
358
361
359
// Main assignability check about to follow
360
+ boolean exactMatch = (strict && matchedBefore != null );
362
361
boolean checkGenerics = true ;
363
362
Class <?> ourResolved = null ;
364
363
if (this .type instanceof TypeVariable <?> variable ) {
@@ -1782,6 +1781,21 @@ public boolean isAssignableTo(ResolvableType type, @Nullable Map<Type, Type> mat
1782
1781
}
1783
1782
}
1784
1783
1784
+ /**
1785
+ * Return {@code true} if these bounds are equal to the specified type.
1786
+ * @param type the type to test against
1787
+ * @return {@code true} if these bounds are equal to the type
1788
+ * @since 6.2.3
1789
+ */
1790
+ public boolean equalsType (ResolvableType type ) {
1791
+ for (ResolvableType bound : this .bounds ) {
1792
+ if (!type .equalsType (bound )) {
1793
+ return false ;
1794
+ }
1795
+ }
1796
+ return true ;
1797
+ }
1798
+
1785
1799
/**
1786
1800
* Return the underlying bounds.
1787
1801
*/
0 commit comments