[PATCH] Re: Custom spliterator for Collections.nCopies(n, obj).stream()

2015-08-22 Thread Tagir F. Valeev
Hello! PS With reuse it becomes more compelling :-) In both cases of PS singleton/nCopies the spliterator characteristics can be the same PS and that of the already existing singleton spliterator implementation. The only difference is the DISTINCT characteristic. I think it's good to report it

Re: [PATCH] Re: Custom spliterator for Collections.nCopies(n, obj).stream()

2015-08-22 Thread Tagir F. Valeev
Seems that the patch attachment was filtered out. Just for the case here it is: diff --git a/src/java.base/share/classes/java/util/Collections.java b/src/java.base/share/classes/java/util/Collections.java --- a/src/java.base/share/classes/java/util/Collections.java +++

Re: Custom spliterator for Collections.nCopies(n, obj).stream()

2015-07-30 Thread Paul Sandoz
On 30 Jul 2015, at 08:08, Tagir F. Valeev amae...@gmail.com wrote: Hello! PS I don’t particular want to add a special spliterator for this PS case to avoid some profile pollution. Will it not just push the PS pollution further down the road to Spliterator.forEachRemaining? or to within

Re: Custom spliterator for Collections.nCopies(n, obj).stream()

2015-07-30 Thread Tagir F. Valeev
Hello! PS I don’t particular want to add a special spliterator for this PS case to avoid some profile pollution. Will it not just push the PS pollution further down the road to Spliterator.forEachRemaining? or to within other code? I just thought that the current idea is to create specialized

Custom spliterator for Collections.nCopies(n, obj).stream()

2015-07-28 Thread Tagir F. Valeev
Hello! Current implementation of Collections.nCopies().stream() is as follows: http://hg.openjdk.java.net/jdk9/dev/jdk/file/f160dec9a350/src/java.base/share/classes/java/util/Collections.java#l5066 public StreamE stream() { return IntStream.range(0, n).mapToObj(i - element); } @Override

Re: Custom spliterator for Collections.nCopies(n, obj).stream()

2015-07-28 Thread Paul Sandoz
Hi Tagir, I would agree with you out about changing to use unordered() except that it is a List that is returned, whose Spliterator is specified to report ORDERED. I don’t particular want to add a special spliterator for this case to avoid some profile pollution. Will it not just push the