Re: RFR: CSR - JDK-8203428 Predicate::not

2018-05-18 Thread Remi Forax
negate(); } at least until JEP 300 [1] is implemented. regards, Rémi [1] https://bugs.openjdk.java.net/browse/JDK-8043488 - Mail original - > De: "Jim Laskey" > À: "core-libs-dev" > Envoyé: Vendredi 18 Mai 2018 18:35:24 > Objet: RFR: CSR - JDK-82034

Re: RFR: CSR - JDK-8203428 Predicate::not

2018-05-18 Thread forax
Hi Jim, - Mail original - > De: "Jim Laskey" > À: "core-libs-dev" > Cc: "Remi Forax" , "Brian Goetz" , > "Paul Sandoz" > Envoyé: Vendredi 18 Mai 2018 20:48:35 > Objet: Re: RFR: CSR - JDK-8203428 Predicate::not >

Re: RFR: CSR - JDK-8203428 Predicate::not

2018-05-18 Thread Jim Laskey
ot; , "Jim Laskey" >> >> Cc: "core-libs-dev" >> Envoyé: Vendredi 18 Mai 2018 20:08:42 >> Objet: Re: RFR: CSR - JDK-8203428 Predicate::not > >> We did discover that default methods on FIs combined with subtyping of >> FIs caused troub

Re: RFR: CSR - JDK-8203428 Predicate::not

2018-05-18 Thread Remi Forax
- Mail original - > De: "Brian Goetz" > À: "Paul Sandoz" , "Jim Laskey" > > Cc: "core-libs-dev" > Envoyé: Vendredi 18 Mai 2018 20:08:42 > Objet: Re: RFR: CSR - JDK-8203428 Predicate::not > We did discover that default m

Re: RFR: CSR - JDK-8203428 Predicate::not

2018-05-18 Thread Brian Goetz
We did discover that default methods on FIs combined with subtyping of FIs caused trouble.  But static methods are fine. If we're going to do Xxx.of(...), we should do it uniformly across FIs, not just for Predicate.  I think this is a reasonable move, but we don't have to do it right now.  (T

Re: RFR: CSR - JDK-8203428 Predicate::not

2018-05-18 Thread Paul Sandoz
> On May 18, 2018, at 9:35 AM, Jim Laskey wrote: > > Introduce a new static method Predicate::not which will allow developers to > negate predicate lambdas trivially. > > > csr: https://bugs.openjdk.java.net/browse/JDK-8203428 +1 thank you for taking action on this. Predicate not captures

Re: RFR: CSR - JDK-8203428 Predicate::not

2018-05-18 Thread Sundararajan Athijegannathan
Actually it would be: Predicate.of(String::isEmpty).negate() But not(String::isEmpty) reads almost like !str.isEmpty() -Sundar On 18/05/18, 10:41 PM, Daniel Fuchs wrote: Hi Jim, Have you thought of introducing something like: static Predicate Predicate.of(Predicate target) { re

Re: RFR: CSR - JDK-8203428 Predicate::not

2018-05-18 Thread Daniel Fuchs
Hi Jim, Have you thought of introducing something like: static Predicate Predicate.of(Predicate target) { return target; } instead? I think that might allow you to do things like: Stream.of("", "A", "b", "c") .filter(Predicate.of(String::isEmpty).not()) .filter(Predicate.of(

Re: RFR: CSR - JDK-8203428 Predicate::not

2018-05-18 Thread Sundararajan Athijegannathan
+1 -Sundar On 18/05/18, 10:05 PM, Jim Laskey wrote: Introduce a new static method Predicate::not which will allow developers to negate predicate lambdas trivially. csr: https://bugs.openjdk.java.net/browse/JDK-8203428

Re: RFR: CSR - JDK-8203428 Predicate::not

2018-05-18 Thread Chris Hegarty
On 18/05/18 17:35, Jim Laskey wrote: Introduce a new static method Predicate::not which will allow developers to negate predicate lambdas trivially. csr: https://bugs.openjdk.java.net/browse/JDK-8203428 I have looked for this a number of times. +1 -Chris.

RFR: CSR - JDK-8203428 Predicate::not

2018-05-18 Thread Jim Laskey
Introduce a new static method Predicate::not which will allow developers to negate predicate lambdas trivially. csr: https://bugs.openjdk.java.net/browse/JDK-8203428