@@ -620,6 +620,7 @@ private boolean determineUnresolvableGenerics(@Nullable Set<Type> alreadySeen) {
620620 ResolvableType [] generics = getGenerics ();
621621 for (ResolvableType generic : generics ) {
622622 if (generic .isUnresolvableTypeVariable () ||
623+ generic .isWildcardWithoutBounds () ||
623624 generic .isUnresolvableWildcard (currentTypeSeen (alreadySeen )) ||
624625 generic .hasUnresolvableGenerics (currentTypeSeen (alreadySeen ))) {
625626 return true ;
@@ -688,7 +689,7 @@ private boolean isWildcardWithoutBounds() {
688689
689690 /**
690691 * Determine whether the underlying type represents a wildcard
691- * has unresolvable upper bound or lower bound, or simply without bound
692+ * has unresolvable upper bound or lower bound.
692693 */
693694 private boolean isUnresolvableWildcard (Set <Type > alreadySeen ) {
694695 if (this .type instanceof WildcardType wildcardType ) {
@@ -703,7 +704,7 @@ private boolean isUnresolvableWildcard(Set<Type> alreadySeen) {
703704 return upperResolvable .isUnresolvableTypeVariable () || upperResolvable .determineUnresolvableGenerics (alreadySeen );
704705 }
705706 }
706- return isWildcardWithoutBounds () ;
707+ return false ;
707708 }
708709
709710 /**
@@ -1212,18 +1213,18 @@ public static ResolvableType forClassWithGenerics(Class<?> clazz, @Nullable Reso
12121213 * @param upperBound the upper bound of the wildcardType
12131214 * @return a {@code ResolvableType} for the specific wildcardType and upperBound
12141215 */
1215- public static ResolvableType forWildCardTypeWithUpperBound (WildcardType wildcardType , ResolvableType upperBound ) {
1216+ public static ResolvableType forWildcardTypeWithUpperBound (WildcardType wildcardType , ResolvableType upperBound ) {
12161217 Assert .notNull (wildcardType , "WildcardType must not be null" );
12171218 Assert .notNull (upperBound , "UpperBound must not be null" );
12181219 Type [] originalLowerBound = wildcardType .getLowerBounds ();
12191220 Assert .isTrue (originalLowerBound .length == 0 ,
12201221 () -> "The WildcardType has lower bound while upper bound provided " + wildcardType );
12211222
12221223 Type upperBoundType = upperBound .getType ();
1223- VariableResolver variableResolver = upperBoundType instanceof TypeVariable <?> typeVariable
1224- ? new TypeVariablesVariableResolver (
1225- new TypeVariable <?>[]{typeVariable }, new ResolvableType []{upperBound })
1226- : null ;
1224+ VariableResolver variableResolver = upperBoundType instanceof TypeVariable <?> typeVariable ?
1225+ new TypeVariablesVariableResolver (
1226+ new TypeVariable <?>[]{typeVariable }, new ResolvableType []{upperBound }) :
1227+ null ;
12271228
12281229 return forType (new WildcardTypeImpl (new Type []{upperBoundType }, EMPTY_TYPE_ARRAY ), variableResolver );
12291230 }
@@ -1234,7 +1235,7 @@ public static ResolvableType forWildCardTypeWithUpperBound(WildcardType wildcard
12341235 * @param lowerBound the lower bound of the wildcardType
12351236 * @return a {@code ResolvableType} for the specific wildcardType and lowerBound
12361237 */
1237- public static ResolvableType forWildCardTypeWithLowerBound (WildcardType wildcardType , ResolvableType lowerBound ) {
1238+ public static ResolvableType forWildcardTypeWithLowerBound (WildcardType wildcardType , ResolvableType lowerBound ) {
12381239 Assert .notNull (wildcardType , "WildcardType must not be null" );
12391240 Assert .notNull (lowerBound , "LowerBound must not be null" );
12401241 Type [] originalUpperBound = wildcardType .getUpperBounds ();
@@ -1243,10 +1244,10 @@ public static ResolvableType forWildCardTypeWithLowerBound(WildcardType wildcard
12431244 .formatted (originalUpperBound [0 ], wildcardType ));
12441245
12451246 Type lowerBoundType = lowerBound .getType ();
1246- VariableResolver variableResolver = lowerBoundType instanceof TypeVariable <?> typeVariable
1247- ? new TypeVariablesVariableResolver (
1248- new TypeVariable <?>[]{typeVariable }, new ResolvableType []{lowerBound })
1249- : null ;
1247+ VariableResolver variableResolver = lowerBoundType instanceof TypeVariable <?> typeVariable ?
1248+ new TypeVariablesVariableResolver (
1249+ new TypeVariable <?>[]{typeVariable }, new ResolvableType []{lowerBound }) :
1250+ null ;
12501251
12511252 return forType (new WildcardTypeImpl (new Type []{Object .class }, new Type []{lowerBoundType }), variableResolver );
12521253 }
@@ -1700,9 +1701,10 @@ public Object getSource() {
17001701 }
17011702
17021703
1703- private static final class WildcardTypeImpl implements WildcardType , Serializable {
1704+ private static final class WildcardTypeImpl implements WildcardType , Serializable {
17041705
17051706 private final Type [] upperBound ;
1707+
17061708 private final Type [] lowerBound ;
17071709
17081710 private WildcardTypeImpl (Type [] upperBound , Type [] lowerBound ) {
@@ -1712,36 +1714,37 @@ private WildcardTypeImpl(Type[] upperBound, Type[] lowerBound) {
17121714
17131715 @ Override
17141716 public Type [] getUpperBounds () {
1715- return upperBound .clone ();
1717+ return this . upperBound .clone ();
17161718 }
17171719
17181720 @ Override
17191721 public Type [] getLowerBounds () {
1720- return lowerBound .clone ();
1722+ return this . lowerBound .clone ();
17211723 }
17221724
17231725 @ Override
17241726 public boolean equals (Object o ) {
17251727 if (!(o instanceof WildcardType that )) {
17261728 return false ;
17271729 }
1728- return Arrays .equals (upperBound , that .getUpperBounds ()) && Arrays .equals (lowerBound , that .getLowerBounds ());
1730+ return Arrays .equals (this .upperBound , that .getUpperBounds ()) &&
1731+ Arrays .equals (this .lowerBound , that .getLowerBounds ());
17291732 }
17301733
17311734 @ Override
17321735 public int hashCode () {
1733- return Arrays .hashCode (getLowerBounds ()) ^ Arrays .hashCode (getUpperBounds () );
1736+ return Arrays .hashCode (this . lowerBound ) ^ Arrays .hashCode (this . upperBound );
17341737 }
17351738
17361739 @ Override
17371740 public String toString () {
1738- if (getLowerBounds () .length == 1 ) {
1739- return "? super " + typeToString (getLowerBounds () [0 ]);
1741+ if (this . lowerBound .length == 1 ) {
1742+ return "? super " + typeToString (this . lowerBound [0 ]);
17401743 }
1741- if (getUpperBounds (). length == 0 || getUpperBounds () [0 ] == Object .class ) {
1744+ if (this . upperBound . length == 0 || this . upperBound [0 ] == Object .class ) {
17421745 return "?" ;
17431746 }
1744- return "? extends " + typeToString (getUpperBounds () [0 ]);
1747+ return "? extends " + typeToString (this . upperBound [0 ]);
17451748 }
17461749
17471750 private static String typeToString (Type type ) {
0 commit comments