Re: class SplittableRandom

2013-07-14 Thread Doug Lea
(Sorry to postpone answering this one while tied up in logistics...) On 07/11/13 08:23, Aleksey Shipilev wrote: On 07/11/2013 04:16 PM, Doug Lea wrote: (I've been contemplating re-exploring alternatives in TLR, but the options are more limited because it is a subclass of Random. Which made

Re: RFR: 8015317: Optional.filter, map, and flatMap

2013-07-14 Thread Henry Jen
I think I understand what you are saying. However, unless we make Optional not final, the extends part just doesn't matter. You probably know that the example provided is not completed ported to work with our Optional implementation, and fugue works around the type system with Option as abstract

Re: RFR: 8015317: Optional.filter, map, and flatMap

2013-07-14 Thread Henry Jen
I think the type you talking about here is Optional? extends U instead of ? extends OptionalU. IIRC, Optional? extends U is not a subtype of OptionalU, just like any other Collection class. ListChild is not a ListParent. Cheers, Henry On Jul 13, 2013, at 3:15 AM, Jed Wesley-Smith

Re: RFR: 8015317: Optional.filter, map, and flatMap

2013-07-14 Thread Zhong Yu
XYChild is not a subtype of XY? extends Parent. We have to go wildcard all the way - X? extends Y? extends Parent. The subtyping rules don't care about final-ness of types. For example, XString is a distinct type from X? extends String, even though String has only one subtype (itself). Zhong Yu

Re: RFR: 8015317: Optional.filter, map, and flatMap

2013-07-14 Thread Zhong Yu
Another example of possible missing a wildcard http://gee.cs.oswego.edu/dl/jsr166/dist/docs/java/util/concurrent/CompletionStage.html#thenCompose%28java.util.function.Function%29 thenCompose(Function? super T,? extends CompletionStageU fn) should be thenCompose(Function? super T,?

Re: RFR: 8017513: Support for closeable streams

2013-07-14 Thread David Holmes
On 12/07/2013 11:57 PM, Paul Benedict wrote: I see closeability as a postcondition. A subtype can't weaken it. The contract of AutoCloseable says its a resource that must be closed. Now MHCR says it can/should/doesn't have to be closed -- so it is backwards. A postcondition of what? pre- and

Re: RFR: 8017513: Support for closeable streams

2013-07-14 Thread Paul Benedict
It's a post-condition to using the object. I've emphasized the must part of the contract but the full contract is: must be closed when it is no longer needed. That's a pretty clear post-condition language that must be true. So when you're done with the AutoCloseable type, as in the post-condition,

Re: RFR: 8017513: Support for closeable streams

2013-07-14 Thread David Holmes
On 15/07/2013 2:47 PM, Paul Benedict wrote: It's a post-condition to using the object. I've emphasized the must part of the contract but the full contract is: must be closed when it is no longer needed. That's a pretty clear post-condition language that must be true. So when you're done with the

Re: RFR 7122142 : (ann) Race condition between isAnnotationPresent and getAnnotations

2013-07-14 Thread David Holmes
Joel, Peter, I've looked at the synchronization changes and the use of CAS and it seems sound. The only performance-related concern is the wasted effort when multiple threads each call new AnnotationType(annotationClass). But if that turns out to be an issue we can address it (using