Re: Make iterators cloneable?

2016-09-10 Thread Dave Brosius
>> Iterators reading from a BufferedReader yes that's true. altho given the contract of Cloneable, adding the clone method on Iterator would be safe, as it would only be available if the real implementing class 'extends Cloneable'... it's actually kind of funny that Object methods aren't avail

Re: [PATCH] JDK-8134373: explore potential uses of convenience factories within the JDK

2016-09-10 Thread Jonathan Bluett-Duncan
Sorry, it seems Gmail is not cooperating with me... If anyone does need to see the patches in-body, then I'd be happy to inline them directly in a reply, but that wouldn't be ideal since there are 18 of them in total... :/ On 11 September 2016 at 00:54, Jonathan Bluett-Duncan < jbluettdun...@gmai

Re: [PATCH] JDK-8134373: explore potential uses of convenience factories within the JDK

2016-09-10 Thread Jonathan Bluett-Duncan
Oops, it didn't fully register for me that I actually needed to include attachments in the body! So here they are again, this time in the body (hopefully).

Re: Make iterators cloneable?

2016-09-10 Thread Louis Wasserman
Some iterators might be. Many may not be. Certainly Iterator as an interface has been out there for long enough there are Iterator implementations out there that aren't cloneable -- say, Iterators reading from a BufferedReader, where there really won't be any way to do what you're hoping for; Buf

[PATCH] JDK-8134373: explore potential uses of convenience factories within the JDK

2016-09-10 Thread Jonathan Bluett-Duncan
Hi all, Would you kindly review this patch to replace existing uses of Collections.unmodifiable*(*Arrays.asList(*)) and plain Arrays.asList(*) with (List|Set|Map).of(*). You may find the patch files in the attachments. My rationale for replacing uses of Collections.unmodifiable*... with (List|Set

Re: Make iterators cloneable?

2016-09-10 Thread Dave Brosius
Yes Louis is correct. I want the pair wise associations or all elements of a set. Fee-Fi Fee-Fo Fee-Fum Fi-Fo Fi-Fum Fo-Fum the independent iterators produce Fee-Fee (etc) as well as the duplicate Fee-Fi and Fi-Fee (etc), both of which i don't want. This is obviously simplistic with i

Re: Make iterators cloneable?

2016-09-10 Thread Jonathan Bluett-Duncan
Ah okay Louis, if that's the case then that certainly makes sense, and I'd agree that there's no good way of doing so, as one would need to copy the set into a list. Dave, did Louis hit the mark? If not, would you kindly go into further detail as to exactly what it is you're trying to do? Best, J

Re: Make iterators cloneable?

2016-09-10 Thread Jonathan Bluett-Duncan
Hi Dave, Rather than using Iterator.clone(), how about you just call collection.iterator() 2 times to return 2 unique, non-same iterators; something like the following: import java.util.Collections; import java.util.Iterator; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; p

Make iterators cloneable?

2016-09-10 Thread Dave Brosius
It would be nice to be able to associate each element in a collection with another element in the collection, which is something very easily done with index based collections, but with sets, etc this isn't so easy... unless i'm having a brainfart. So i'd like to do this, but Iterator doesn't i

Re: Participating on https://bugs.openjdk.java.net/browse/JDK-8156070

2016-09-10 Thread Jonathan Bluett-Duncan
Hi Aleksey, Sorry for the late reply. Thank for you pointing me to the contribute page; it gave me all the information I needed. Stuart, I'm now ready to make a patch review request, so submit one as soon as I have the time. Kind regards, Jonathan On 6 September 2016 at 09:46, Aleksey Shipilev

RFR: jsr166 jdk9 integration wave 10

2016-09-10 Thread Martin Buchholz
http://cr.openjdk.java.net/~martin/webrevs/openjdk9/jsr166-jdk9-integration/ Mostly docs and tests. jsr166 CVS is now caught up with jdk9+135 Paul, I think we need to update AtomicInteger for VarHandle#getAndAdd: http://cr.openjdk.java.net/~martin/webrevs/openjdk9/jsr166-jdk9-integration/miscel