Collectors.joining() simplified [patch]

2019-02-04 Thread Tomasz Linkowski
Hi, I found out that `Collectors.joining()` can be simplified as follows: 1) `` reduced to `<>` 2) `(r1, r2) -> { r1.append(r2); return r1; }` replaced with `StringBuilder::append` If such a small contribution is considered worthwhile, please sponsor it (patch below). Regards, Tomasz

Re: RFR - JDK-8203442 String::transform (Code Review)

2018-12-11 Thread Tomasz Linkowski
ps://blog.tlinkowski.pl/2018/transformer-pattern/ Regards, Tomasz Linkowski On Fri, Sep 21, 2018 at 12:42 PM Remi Forax wrote: > - Mail original - > > De: "Alan Bateman" > > À: "Jim Laskey" , "core-libs-dev" < > core-libs-dev@openjdk.jav

Re: RFR - JDK-8203442 String::transform (Code Review)

2018-12-03 Thread Tomasz Linkowski
ds) nor by `applyMutation` (confusing, like Tagir said). On a side note: regardless of the name, I bet we'll see some `string.transform(String::toLowerCase)` or `stream.chain(s->s.map(mapper))` :) Regards, Tomasz Linkowski On Mon, Dec 3, 2018 at 12:32 PM Tagir Valeev wrote: > +1 to Stephen a

Re: Proposal: Stream.iterateWhile(T seed, Function> mapper)

2018-10-29 Thread Tomasz Linkowski
non-null. Regards, Tomasz Linkowski On Fri, Oct 26, 2018 at 5:44 PM Tomasz Linkowski wrote: > Hi, > > Please, consider adding a new static method to the `Stream` interface > (names TBD): > > static Stream iterateWhile( > T seed, Function> > m

Proposal: Stream.iterateWhile(T seed, Function> mapper)

2018-10-26 Thread Tomasz Linkowski
ava.util.function.Function) [3] http://mail.openjdk.java.net/pipermail/amber-spec-experts/2018-October/000826.html -- Regards, Tomasz Linkowski

Re: Why Stream.concat is a static method - type variable contravariance

2018-10-15 Thread Tomasz Linkowski
Stream.of(specialElement).append(remainingStream).collect(toList()); has better "flow" than Stream.concat(Stream.of(specialElement), remainingStream).collect(toList()); Regards, Tomasz Linkowski On Mon, Oct 15, 2018 at 4:51 AM Tagir Valeev wrote: > Hello! > > Still from

Re: RFR: JDK-8205461 Create Collector which merges results of two other collectors

2018-09-16 Thread Tomasz Linkowski
ES, well-named: YES Personally, I don't find n-ary *homogeneous* Collector composition that much useful, but if it were to be added, I agree List would be the best result type. Regards, Tomasz Linkowski [1] https://stackoverflow.com/a/52211175/2032415 On Sun, Sep 16, 2018 at 11:23 AM, Tagir

Re: RFR: JDK-8205461 Create Collector which merges results of two other collectors

2018-09-14 Thread Tomasz Linkowski
th wordwise and letterwise). On the other hand, it seems that "collectingBothAndThen" could be much easier to understand than "duplexing", especially for non-natives. Regards, Tomasz Linkowski On Fri, Sep 14, 2018 at 9:11 PM, Federico Peralta Schaffner < federico.pera...@g

Re: RFR: JDK-8205461 Create Collector which merges results of two other collectors

2018-09-14 Thread Tomasz Linkowski
but "Collectors.compositing" looks a bit strange. "Collectors.composing" seems much better to me, but - as far as I understand - there was some concern that the users could misunderstand it as element-wise composition, is that right? Regards, Tomasz Linkowski [1] https://en.wikipedi

Re: ByteArrayOutputStream should not have a new writeBytes method in Java

2018-09-11 Thread Tomasz Linkowski
om/help/idea/running-inspection-by-name.html It will fix all such C-style array declarations for you automatically. -- Regards, Tomasz Linkowski From: Stuart Marks > To: "ullenb...@gmail.com" > Cc: "core-libs-dev@openjdk.java.net" > Bcc: > Date: Tue, 11 Sep 2018

RFR: JDK-8205461 Create Collector which merges results of two other collectors

2018-09-08 Thread Tomasz Linkowski
.html [5] http://mail.openjdk.java.net/pipermail/core-libs-dev/2018-August/054736.html [6] http://mail.openjdk.java.net/pipermail/core-libs-dev/2018-August/054724.html [7] http://mail.openjdk.java.net/pipermail/core-libs-dev/2018-August/054949.html -- Regards, Tomasz Linkowski