Optional.or() doesn't use a wildcard in its signature
Michael Nascimento
misterm at gmail.com
Sun Nov 1 00:12:30 UTC 2015
Hi Vitaly,
Exactly, I was just trying to point out the method signature seems broken
anyway.
Regards,
Michael
On 31 Oct 2015 11:59, "Vitaly Davidovich" <vitalyd at gmail.com> wrote:
> This would require Supplier<Optional<? extends T>>, not Supplier<? extends
> Optional<T>>.
>
> sent from my phone
> On Oct 31, 2015 2:49 PM, "Michael Nascimento" <misterm at gmail.com> wrote:
>
>> If this instance is an Optional<CharSequence> , passing an
>> Optional<StringBuilder> will fail to compile.
>>
>> Regards,
>> Michael
>> On 31 Oct 2015 11:21, "Stefan Zobel" <spliterator at gmail.com> wrote:
>>
>> > 2015-10-31 19:11 GMT+01:00 Remi Forax <forax at univ-mlv.fr>:
>> >
>> > > Hi all, hi Paul,
>> > >
>> > > I've just seen that Optional.or is declared as
>> > > public Optional<T> or(Supplier<Optional<T>> supplier) {
>> > > instead of
>> > > public Optional<T> or(Supplier<? extends Optional<T>> supplier) {
>> > >
>> > > regards,
>> > > Rémi
>> > >
>> >
>> >
>> > I don't get it. Optional is final anyway. Can you explain?
>> >
>> > Thanks,
>> > Stefan
>> >
>>
>
More information about the core-libs-dev
mailing list