JDK 16 RFR of JDK-8250660: Clarify that WildcardType and AnnotatedWildcardType bounds methods return one

David Holmes david.holmes at oracle.com
Wed Aug 5 22:40:11 UTC 2020


On 6/08/2020 7:37 am, Joe Darcy wrote:
> Hello,
> 
> Addressing some feedback from off-list discussions with Mandy, I propose 
> changing the API notes to:
> 
>      @apiNote While to date a wildcard may have at most one upper[lower] 
> bound, callers of this method should be written to accommodate multiple 
> bounds.

I can live with that version. :)

Someone will still need to remember to change it if/when we get multiple 
bounds.

Cheers,
David

> Thanks,
> 
> -Joe
> 
> On 8/3/2020 9:24 AM, Joe Darcy wrote:
>> Hi David,
>>
>> To provide a bit more context, the API was consciously designed to be 
>> future-proofed against the possibility of Java supporting multiple 
>> bounds here (JDK-4891872). As of yet, that change has not come to 
>> pass, and as you note may never come to pass. So besides in addition 
>> to the links into the JLS, I think it is reasonable to include an API 
>> note acknowledging the situation. How about:
>>
>>     This method supports the existence of multiple bounds, but to 
>> date, a wildcard may have at most one upper/lower bound.
>>
>> -Joe
>>
>>


More information about the core-libs-dev mailing list