Alwaysgaurav1 opened a new pull request, #1782:
URL: https://github.com/apache/commons-lang/pull/1782
## Description
Fixes an issue in `TypeUtils.isAssignable(Type, WildcardType, Map)` where
checking assignability of a `WildcardType` with multiple upper bounds
(intersection types such as `? extends Serializable & Cloneable`) to another
`WildcardType` (such as `? extends Serializable`) incorrectly returned `false`.
### Root Cause
When the subject `type` is a `WildcardType`, the upper bounds loop
previously enforced that **every** upper bound in the subject wildcard had to
be assignable to each target upper bound `toBound` (`forall bound in
upperBounds: isAssignable(bound, toBound)`):
```java
for (Type toBound : toUpperBounds) {
toBound = substituteTypeVariables(toBound, typeVarAssigns);
for (final Type bound : upperBounds) {
if (!isAssignable(bound, toBound, typeVarAssigns)) {
return false;
}
}
}
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]