> On 7 Oct 2016, at 10:20, Stuart Marks <stuart.ma...@oracle.com> wrote: > > Hi all, > > Please review this small API adjustment to Optional.or and flatMap to add > wildcards. This provides a bit more flexibility to callers about the types of > functions they can provide to these methods. > > The or() method is new in 9 so there is no compatibility issue. > > The flatMap() method was introduced in 8, so this is a change to an existing > API. There shouldn't be a binary compatibility issue, since the method's > erasure doesn't change. I *think* it is source compatible, as anything that > was accepted by the old signature:
Source computability should be ok IICU because Optional is final and there are no overriding methods. > > flatMap(Function<? super T, Optional<U>> mapper) > > should also be accepted by the new signature: > > flatMap(Function<? super T, ? extends Optional<? extends U>> mapper) > > But there may be some subtle issues of which I'm unaware. > Optional is final so why do you need to express “? extends Optional” ? Paul. > Bug report: > > https://bugs.openjdk.java.net/browse/JDK-8152617 > > Webrev: > > http://cr.openjdk.java.net/~smarks/reviews/8152617/webrev.0/ > > Thanks, > > s'marks