Re: RFR: 8287522: StringConcatFactory: Add in prependers and mixers in batches [v7]

2022-06-03 Thread Remi Forax
- Original Message - > From: "Claes Redestad" > To: "core-libs-dev" > Sent: Friday, June 3, 2022 2:19:34 PM > Subject: Re: RFR: 8287522: StringConcatFactory: Add in prependers and mixers > in batches [v7] > On Fri, 3 Jun 2022 11:19:04 GMT, ExE Boss wrote: > >>> You would think that,

Stream.fromForEach(Consumer>)

2022-05-21 Thread Remi Forax
Hi all, a stream is kind of push iterator so it can be created from any object that has a method like forEach(Consumer), but sadly there is no static method to create a Stream from a Consumer of Consumer so people usually miss that creating a Stream from events pushed to a consumer is easy. By

Re: RFR: 8286669: Replace MethodHandle specialization with ASM in mainline

2022-05-12 Thread Remi Forax
Ok, let us know when it's out of draft, i've several minor modifications about the code. regards, Rémi - Original Message - > From: "Jorn Vernee" > To: "core-libs-dev" , "hotspot-dev" > > Sent: Thursday, May 12, 2022 11:25:52 PM > Subject: Re: RFR: 8286669: Replace MethodHandle

Re: HttpClient has no explicit way of releasing threads

2022-05-10 Thread Remi Forax
- Original Message - > From: "Rafael Winterhalter" > To: "core-libs-dev" > Sent: Monday, May 9, 2022 11:43:49 PM > Subject: HttpClient has no explicit way of releasing threads > Hello, Hello, > > looking at thread dumps, I realized that the HttpClient implementation does > not offer

Re: RFR: JDK-8242888: Convert dynamic proxy to hidden classes

2022-04-19 Thread Remi Forax
- Original Message - > From: "liach" > To: "core-libs-dev" , "security-dev" > > Sent: Tuesday, April 19, 2022 3:31:24 AM > Subject: Re: RFR: JDK-8242888: Convert dynamic proxy to hidden classes > On Mon, 18 Apr 2022 20:42:48 G

Re: RFR: JDK-8242888: Convert dynamic proxy to hidden classes

2022-04-18 Thread Remi Forax
- Original Message - > From: "liach" > To: "core-libs-dev" , "security-dev" > > Sent: Monday, April 18, 2022 10:01:39 PM > Subject: Re: RFR: JDK-8242888: Convert dynamic proxy to hidden classes > On Sun, 17 Apr 2022 16:17:30 GMT, liach wrote: > >> Convert dynamic proxies to hidden

Re: RFR: JDK-8242888: Convert dynamic proxy to hidden classes

2022-04-18 Thread Remi Forax
- Original Message - > From: "Johannes Kuhn" > To: "Alan Bateman" , "core-libs-dev" > > Sent: Monday, April 18, 2022 12:53:45 PM > Subject: Re: RFR: JDK-8242888: Convert dynamic proxy to hidden classes > On 18-Apr-22 9:36, Alan Bateman wrote: >> On 17/04/2022 17:24, liach wrote: >>>

Re: fast way to infer caller

2022-04-07 Thread Remi Forax
- Original Message - > From: "Kasper Nielsen" > To: "Ceki Gülcü" > Cc: "core-libs-dev" > Sent: Thursday, April 7, 2022 1:53:33 PM > Subject: Re: fast way to infer caller >> >> MethodHandles.lookup().lookupClass() looks very promising except that >> there is no way to specify the depth.

Re: fast way to infer caller

2022-04-06 Thread Remi Forax
er() must be exceptionally good, assuming we >> wish to avoid having the user accidentally shooting herself on the foot, >> ergo the 100 nanosecond performance per call requirement. >> >> Noting that invoking MethodHandles.lookup().lookupClass() seems very >> fast (about 2 na

Re: fast way to infer caller

2022-04-06 Thread Remi Forax
read (even when the logger is de-activated) which destroy performance in tight loop (you loose hoisting). I believe that if your users are fine with that, they are also fine with a call to LoggerFactory.getLogger() being a little slow. > > -- > Ceki Gülcü Rémi > > > On 4/6/2022 5:5

Re: fast way to infer caller

2022-04-06 Thread Remi Forax
- Original Message - > From: "Ceki Gülcü" > To: "core-libs-dev" > Sent: Wednesday, April 6, 2022 5:30:51 PM > Subject: fast way to infer caller > Hello, Hello, > > As you are probably aware, one of the important primitives used in > logging libraries is inferring the caller of a

Re: When to initialize the method's class for MethodHandles.Lookup.findStatic()?

2022-03-17 Thread Remi Forax
- Original Message - > From: "Cheng Jin" > To: "core-libs-dev" > Sent: Thursday, March 17, 2022 5:42:57 PM > Subject: When to initialize the method's class for > MethodHandles.Lookup.findStatic()? > Hi there, > > The document of >

Re: Making enum hashcodes consistent across JVM's

2022-03-17 Thread Remi Forax
- Original Message - > From: "dfranken jdk" > To: "core-libs-dev" > Sent: Thursday, March 17, 2022 1:49:08 PM > Subject: Making enum hashcodes consistent across JVM's > Dear all, > > Currently enums do not have a well-defined hashCode() implementation so > they defer to

Re: Behavior change in the jar tool JDK11 vs JDK8.

2022-03-14 Thread Remi Forax
- Original Message - > From: "Pasam Soujanya1" > To: "core-libs-dev" > Sent: Monday, March 14, 2022 12:48:42 PM > Subject: Behavior change in the jar tool JDK11 vs JDK8. > There is a significant difference in the way the JAR tool (starting JDK11) > seems > to be responding to target

Re: Questions about enhancement and Correction to Java OpenJDK Floating Point?

2022-03-14 Thread Remi Forax
- Original Message - > From: "A Z" > To: "core-libs-dev" > Sent: Monday, March 14, 2022 7:49:04 AM > Subject: Questions about enhancement and Correction to Java OpenJDK Floating > Point? Hi Terry, if you want to have the same output as C, instead of println() use printf(). In your

Re: RFR: JDK-8282798 java.lang.runtime.Carrier

2022-03-08 Thread Remi Forax
- Original Message - > From: "John R Rose" > To: "core-libs-dev" > Sent: Tuesday, March 8, 2022 5:55:00 PM > Subject: Re: RFR: JDK-8282798 java.lang.runtime.Carrier > On Tue, 8 Mar 2022 15:59:59 GMT, Maurizio Cimadamore > wrote: > >>> We propose to provide a runtime anonymous carrier

Re: RFR: JDK-8282798 java.lang.runtime.Carrier

2022-03-08 Thread Remi Forax
Hi Jim, I believe that there is a mismatch about what is needed for the pattern matching and the API you propose. The Carrier API allows to map one tuple of types to one storage representation based on ints, longs and references. But what we need is to have several shapes for the same storage,

Re: Replace simple iterations of Map.entrySet with Map.forEach calls

2022-03-05 Thread Remi Forax
- Original Message - > From: "Stuart Marks" > To: "-" , "core-libs-dev" > > Sent: Saturday, March 5, 2022 1:58:30 AM > Subject: Re: Replace simple iterations of Map.entrySet with Map.forEach calls > Hi, I have to say I'm pretty skeptical of this change overall. > > It sounds like the

Re: RFR: 8282143: Objects.requireNonNull should be ForceInline

2022-02-28 Thread Remi Forax
- Original Message - > From: "Paul Sandoz" > To: "core-libs-dev" > Sent: Tuesday, March 1, 2022 1:48:02 AM > Subject: Re: RFR: 8282143: Objects.requireNonNull should be ForceInline > On Sat, 19 Feb 2022 05:51:52 GMT, Quan Anh Mai wrote: > >> Hi, >> >> `Objects.requireNonNull` may

Re: Should System.exit be controlled by a Scope Local?

2022-02-27 Thread Remi Forax
Hi Ethan, there is a far simpler solution, call org.apache.ivy.run(args, true) instead of org.apache.ivy.main(args) in your tool provider. regards, Rémi - Original Message - > From: "Ethan McCue" > To: "core-libs-dev" > Sent: Saturday, February 26, 2022 11:14:19 PM > Subject: Should

Sequenced Collections

2022-02-10 Thread Remi Forax
I've read the draft of the JEP on sequenced collection, and i think the proposed design can be improved. https://bugs.openjdk.java.net/browse/JDK-8280836 I agree with the motivation, there is a need for an API to consider the element of a list, a sorted set and a linked hash set as an ordered

Re: Thread.dispatchUncaughtException possible NPE?

2022-01-17 Thread Remi Forax
- Original Message - > From: "Andrey Turbanov" > To: "core-libs-dev" > Sent: Monday, January 17, 2022 10:37:04 AM > Subject: Thread.dispatchUncaughtException possible NPE? > Hello. Hello Andrey, > I see that Thread.dispatchUncaughtException calls > getUncaughtExceptionHandler() which

Re: LambdaMetafactory requires full privilege access, but doesn't seem to actually restrict functionality

2022-01-13 Thread Remi Forax
- Original Message - > From: "Steven Schlansker" > To: "core-libs-dev" > Sent: Wednesday, January 12, 2022 9:56:30 PM > Subject: LambdaMetafactory requires full privilege access, but doesn't seem > to actually restrict functionality > Hi core-libs-dev, > > I am maintaining a module

Re: RFR: JDK-8277175 : Add a parallel multiply method to BigInteger [v3]

2021-11-18 Thread Remi Forax
- Original Message - > From: "Bernd Eckenfels" > To: "core-libs-dev" > Sent: Jeudi 18 Novembre 2021 12:07:19 > Subject: Re: RFR: JDK-8277175 : Add a parallel multiply method to BigInteger > [v3] > What about a new API multiply method which takes an forkjoinpool, and only if > that is

Re: RFR: 8274412: Add a method to Stream API to consume and close the stream without using try-with-resources

2021-10-16 Thread Remi Forax
- Original Message - > From: "Glavo" > To: "Tagir F.Valeev" > Cc: "core-libs-dev" > Sent: Samedi 16 Octobre 2021 06:25:40 > Subject: Re: RFR: 8274412: Add a method to Stream API to consume and close > the stream without using try-with-resources > I don't think it is a perfect

Re: RFR: 8274412: Add a method to Stream API to consume and close the stream without using try-with-resources

2021-10-11 Thread Remi Forax
I agree with the idea of a try() syntax, but i don't think we need more interfaces. Yes, John is right about the fact that the TWR Aucloseable does not work well with checked exceptions, but the issue is more that there is nothing that works well with checked exceptions because Java has no way

Re: RFR: 8274412: Add a method to Stream API to consume and close the stream without using try-with-resources

2021-10-09 Thread Remi Forax
- Original Message - > From: "Tagir F.Valeev" > To: "core-libs-dev" > Sent: Lundi 4 Octobre 2021 08:51:55 > Subject: RFR: 8274412: Add a method to Stream API to consume and close the > stream without using try-with-resources > Currently, when the stream holds a resource, it's

Re: Discussion: easier Stream closing

2021-10-02 Thread Remi Forax
At that point, the real question is why not call close() at the end of all terminal operations by wrapping each implementation in a try-with-resources ? Rémi - Original Message - > From: "Brian Goetz" > To: "Tagir Valeev" , "core-libs-dev" > > Sent: Lundi 27 Septembre 2021 22:41:00 >

Re: Discussion: easier Stream closing

2021-09-26 Thread Remi Forax
- Original Message - > From: "Tagir Valeev" > To: "core-libs-dev" > Sent: Dimanche 26 Septembre 2021 11:27:58 > Subject: Discussion: easier Stream closing > Hello! > > With current NIO file API, a very simple problem to get the list of > all files in the directory requires some

Re: StringBuilder OOMs earlier with JRE 11 compared to JRE 8

2021-08-27 Thread Remi Forax
- Original Message - > From: "David Holmes" > To: "S" , "core-libs-dev" > > Cc: "Andrey Loskutov" > Sent: Vendredi 27 Août 2021 15:25:25 > Subject: Re: StringBuilder OOMs earlier with JRE 11 compared to JRE 8 > Hi Simeon, > > Redirecting this to core-libs-dev as it is not a

Re: Implementing MethodHandleProxies#asInterfaceInstance with hidden classes

2021-08-25 Thread Remi Forax
- Original Message - > From: "-" > To: "Brian Goetz" , "core-libs-dev" > > Sent: Lundi 23 Août 2021 08:34:17 > Subject: Re: Implementing MethodHandleProxies#asInterfaceInstance with hidden > classes > Thanks for the quick reply! > > The main drawback, API wise, with LMF is that it

Re: [jdk17] RFR: 8269096: Add java.util.Objects.newIdentity method [v5]

2021-06-29 Thread Remi Forax
- Original Message - > From: "Roger Riggs" > To: "core-libs-dev" > Sent: Mardi 29 Juin 2021 18:44:04 > Subject: Re: [jdk17] RFR: 8269096: Add java.util.Objects.newIdentity method > [v5] > On Tue, 29 Jun 2021 05:47:03 GMT, Tagir F. Valeev wrote: > >>> Roger Riggs has updated the pull

Release of ASM 9.2

2021-06-26 Thread Remi Forax
Hi everybody, we are happy to announce the release of ASM 9.2 which support Java 18 (available via Maven Central). I still hope to find the time this summer to work of the support of Valhalla new bytecodes. Rémi

Re: JEP 411: Deprecation with removal would break most existing Java libraries

2021-06-13 Thread Remi Forax
- Mail original - > De: "Rafael Winterhalter" > À: "core-libs-dev" > Envoyé: Dimanche 13 Juin 2021 22:28:33 > Objet: JEP 411: Deprecation with removal would break most existing Java > libraries > I am currently looking into how I should address JEP 411 in my library Byte > Buddy and I

javac throws an AssertionError while compiling a switch on types

2021-06-07 Thread Remi Forax
Hi all, javac does like this code, there is a check missing because javac should not reach Gen with a code like this. Object o = null; var value = switch(o) { default -> 0; case String s -> 0; }; System.out.println(value); An exception has occurred in the

case null vs case dominance

2021-06-07 Thread Remi Forax
Hi all, the first part of the message is about javac error message that could be improved, the second part is about the current spec being not very logical. With this code Object o = null; var value = switch(o) { //case null -> 0; case Object __ -> 0; case

Pattern matching, not informative error message when the binding name is missing

2021-06-07 Thread Remi Forax
Hi all, with this code sealed interface Vehicle {} record Car(String owner, String color) implements Vehicle {} record Bus(String owner) implements Vehicle {} public static void example3() { var vehicles = List.of( new Car("Bob", "red"), new Bus("Ana") ); var

Pattern matching - exhaustiveness is botched

2021-06-07 Thread Remi Forax
I don't know if you know but using the latest version of the source, this code does not compile. sealed interface Vehicle {} record Car(String owner, String color) implements Vehicle {} record Bus(String owner) implements Vehicle {} public static void example2() { var vehicles =

Re: RFR: 8199318: add idempotent copy operation for Map.Entry

2021-06-03 Thread Remi Forax
- Mail original - > De: "Peter Levart" > À: "Rémi Forax" , "core-libs-dev" > > Envoyé: Jeudi 3 Juin 2021 20:49:05 > Objet: Re: RFR: 8199318: add idempotent copy operation for Map.Entry > On 02/06/2021 19:24, Rémi Forax wrote: >> I foolishly hoped that nobody would subclass a class with

Re: RFR: 8262891: Compiler implementation for Pattern Matching for switch (Preview) [v4]

2021-05-25 Thread Remi Forax
- Mail original - > De: "Evgeny Mandrikov" > À: "build-dev" , "compiler-dev" > , "core-libs-dev" > , "javadoc-dev" > Envoyé: Mardi 25 Mai 2021 11:32:03 > Objet: Re: RFR: 8262891: Compiler implementation for Pattern Matching for > switch (Preview) [v4] > On Mon, 17 May 2021 19:01:01

Re: JEP draft: Scope Locals

2021-05-15 Thread Remi Forax
Apart the performance, threadLocal has currently two issues that are addressed by scope locals. ThreadLocal let the programmer defines the lifecycle, while it seems great on paper, it's a huge mess in reality. Because not everybody wraps the calls to set()/remove() in a try/finally, so the

Re: [External] : Re: ReversibleCollection proposal

2021-05-12 Thread Remi Forax
- Mail original - > De: "Peter Levart" > À: "Stuart Marks" > Cc: "core-libs-dev" > Envoyé: Mercredi 12 Mai 2021 08:28:07 > Objet: Re: [External] : Re: ReversibleCollection proposal > On 5/12/21 2:55 AM, Stuart Marks wrote: >> As you point out, add() is kind of like addLast(), except

Re: Draft JEP: Reimplement Core Reflection on Method Handles

2021-05-11 Thread Remi Forax
Hi Mandy, impressive work ! I think that the method that are a caller-sensitive adapter (the one that takes a supplementary class as last parameter) should be annotated with a specific JDK internal annotation, so the link between the caller sensitive method and it's adapter is obvious for the

Re: Review CSR JDK-8266760: Remove sun.misc.Unsafe::defineAnonymousClass

2021-05-10 Thread Remi Forax
- Mail original - > De: "mandy chung" > À: "core-libs-dev" , "valhalla-dev" > > Envoyé: Lundi 10 Mai 2021 21:26:33 > Objet: Review CSR JDK-8266760: Remove sun.misc.Unsafe::defineAnonymousClass > Hidden classes were added in Java SE 15. Class data support was added in > 16.

Re: Collection::getAny discussion

2021-05-10 Thread Remi Forax
- Mail original - > De: "Stephen Colebourne" > À: "core-libs-dev" > Envoyé: Vendredi 30 Avril 2021 23:15:45 > Objet: Re: Collection::getAny discussion > On Fri, 30 Apr 2021 at 19:50, Stuart Marks wrote: >> You're asking for something that's somewhat different, which you called the >>

Re: ReversibleCollection proposal

2021-04-28 Thread Remi Forax
- Mail original - > De: "Stuart Marks" > À: "Peter Levart" > Cc: "core-libs-dev" , "Stephen Colebourne" > > Envoyé: Mercredi 28 Avril 2021 02:04:22 > Objet: Re: ReversibleCollection proposal > On 4/27/21 2:25 AM, Peter Levart wrote: >> Right, I'm persuaded. Now if only the problems of

Re: New Collections interface - Sized

2021-04-23 Thread Remi Forax
- Mail original - > De: "Stephen Colebourne" > À: "core-libs-dev" > Envoyé: Vendredi 23 Avril 2021 11:23:03 > Objet: New Collections interface - Sized > Hi all, > While a discussion on ReversibleCollection is going on, I'd like to > raise the interface I've always found most missing

Re: New Collections interface - Sized

2021-04-23 Thread Remi Forax
- Mail original - > De: "Stephen Colebourne" > À: "core-libs-dev" > Envoyé: Samedi 24 Avril 2021 00:14:51 > Objet: Re: New Collections interface - Sized > On Fri, 23 Apr 2021 at 23:07, Brian Goetz wrote: >> >> Is there a compelling example of where this would be used by clients? >> >

Re: ReversibleCollection proposal

2021-04-22 Thread Remi Forax
- Mail original - > De: "Stephen Colebourne" > À: "core-libs-dev" > Envoyé: Jeudi 22 Avril 2021 00:14:10 > Objet: Re: ReversibleCollection proposal > On Wed, 21 Apr 2021 at 18:39, Stuart Marks wrote: >> The value being provided here is that the ReversibleCollection interface >>

Re: ReversibleCollection proposal

2021-04-19 Thread Remi Forax
- Mail original - > De: "Stuart Marks" > À: "core-libs-dev" > Envoyé: Vendredi 16 Avril 2021 19:40:55 > Objet: ReversibleCollection proposal > This is a proposal to add a ReversibleCollection interface to the Collections > Framework. I'm looking for comments on overall design before I

Re: ReversibleCollection proposal

2021-04-17 Thread Remi Forax
- Mail original - > De: "Stuart Marks" > À: "core-libs-dev" > Envoyé: Vendredi 16 Avril 2021 19:40:55 > Objet: ReversibleCollection proposal > This is a proposal to add a ReversibleCollection interface to the Collections > Framework. I'm looking for comments on overall design before I

Re: RFR: 8200559: Java agents doing instrumentation need a means to define auxilary classes

2021-04-16 Thread Remi Forax
- Mail original - > De: "Rafael Winterhalter" > À: "core-libs-dev" , "serviceability-dev" > > Envoyé: Vendredi 16 Avril 2021 15:52:07 > Objet: RFR: 8200559: Java agents doing instrumentation need a means to define > auxilary classes > To allow agents the definition of auxiliary

Re: ObjectMethods seems generating wrong methods for array-type field

2021-04-14 Thread Remi Forax
- Mail original - > De: "Kengo TODA" > À: "core-libs-dev" > Envoyé: Mercredi 14 Avril 2021 11:03:14 > Objet: Re: ObjectMethods seems generating wrong methods for array-type field Hello, > I found that the JLS 16 does not cover the array type record component: >

Re: RFR: 8263087: Add a MethodHandle combinator that switches over a set of MethodHandles

2021-04-13 Thread Remi Forax
- Mail original - > De: "Jorn Vernee" > À: "core-libs-dev" > Envoyé: Mardi 13 Avril 2021 16:59:58 > Objet: Re: RFR: 8263087: Add a MethodHandle combinator that switches over a > set of MethodHandles > On Thu, 8 Apr 2021 18:51:21 GMT, Jorn Vernee wrote: > >> This patch adds a

Re: [External] : Re: RFR: 8263087: Add a MethodHandle combinator that switches over a set of MethodHandles

2021-04-13 Thread Remi Forax
> De: "John Rose" > À: "Remi Forax" > Cc: "Jorn Vernee" , "core-libs-dev" > > Envoyé: Samedi 10 Avril 2021 01:43:49 > Objet: Re: [External] : Re: RFR: 8263087: Add a MethodHandle combinator that > switches over a set of MethodHandles

Re: RFR: 8263087: Add a MethodHandle combinator that switches over a set of MethodHandles

2021-04-09 Thread Remi Forax
- Mail original - > De: "Jorn Vernee" > À: "core-libs-dev" > Envoyé: Vendredi 9 Avril 2021 12:51:53 > Objet: RFR: 8263087: Add a MethodHandle combinator that switches over a set > of MethodHandles > This patch adds a `tableSwitch` combinator that can be used to switch over a > set >

Re: Instrumenting Executors - issues in Spring Cloud Sleuth and JDK16

2021-04-09 Thread Remi Forax
- Mail original - > De: "Marcin Grzejszczak" > À: "core-libs-dev" > Envoyé: Vendredi 9 Avril 2021 16:29:32 > Objet: Instrumenting Executors - issues in Spring Cloud Sleuth and JDK16 > Hi! > > I'm the lead of Spring Cloud Sleuth [1], a project dedicated to working with > distributed

Re: RFR: 8263668: Update java.time to use instanceof pattern variable

2021-03-24 Thread Remi Forax
- Mail original - > De: "Michael Kuhlmann" > À: "core-libs-dev" > Envoyé: Mercredi 24 Mars 2021 13:23:08 > Objet: Re: RFR: 8263668: Update java.time to use instanceof pattern variable > On 3/24/21 12:09 PM, Rémi Forax wrote: >> On Wed, 24 Mar 2021 09:56:16 GMT, Patrick Concannon >>

Re: New candidate JEP: 400: UTF-8 by Default

2021-03-10 Thread Remi Forax
- Mail original - > De: "Bernd Eckenfels" > À: "core-libs-dev" > Cc: "jdk-dev" > Envoyé: Jeudi 11 Mars 2021 02:12:49 > Objet: Re: New candidate JEP: 400: UTF-8 by Default > I like it. The only thing which I feel is missing would be an official API to > get the operating environments

Re: Inconsistency in Constructor.getGenericParameterTypes()

2021-03-01 Thread Remi Forax
Hi Joe, i think the overview of the package java.lang.reflect should discuss the fact that the reflection view is what is stored in the classfile, not exactly a reflection of the java code. So depending on what you are requesting, you can see synthetic parameters generated by javac or only the

Re: Class.getRecordComponents security checks

2021-02-21 Thread Remi Forax
- Mail original - > De: "Attila Szegedi" > À: "core-libs-dev" > Envoyé: Dimanche 21 Février 2021 21:14:48 > Objet: Class.getRecordComponents security checks > Hey folks, > > Why are security checks for Class.getRecordComponents as strict as those for > e.g. getDeclaredMethods? I

Re: System.getEnv(String name, String def)

2021-02-16 Thread Remi Forax
tional-class-as-its-meant-to-be-used yep, you are right. Optional.ofNullable(...).orElse(...) is not the best pattern in term of readability. > > Best, > Michael regards, Rémi > > On 2/15/21 3:09 PM, Remi Forax wrote: >> Hi Loic, >> You can use Optional.OfNullable() which is

Re: System.getEnv(String name, String def)

2021-02-15 Thread Remi Forax
Hi Loic, You can use Optional.OfNullable() which is a kind of the general bridge between the nullable world and the non-nullable one. var fooOptional = Optional.ofNullable(System.getenv("FOO")); var fooValue = fooOptional.orElse(defaultValue); regards, Rémi Forax - Mail original -

Re: RFR: 8252399: Update mapMulti documentation to use type test pattern instead of instanceof once JEP 375 exits preview [v3]

2021-02-12 Thread Remi Forax
Hi Patrick, "Iterable" is Ok as runtime type of the classical instanceof but not in a type pattern where it is a raw type, so if (e instanceof Iterable elements) { should be if (e instanceof Iterable elements) { regards, Rémi - Mail original - > De: "Patrick Concannon" > À:

Re: JDK-6824466 java.lang.reflect.Method should use java.lang.invoke.MethodHandle

2021-02-01 Thread Remi Forax
- Mail original - > De: "Johannes Kuhn" > À: "core-libs-dev" > Envoyé: Lundi 1 Février 2021 15:50:51 > Objet: JDK-6824466 java.lang.reflect.Method should use > java.lang.invoke.MethodHandle > While implementing a prototype for JDK-8242888 (Convert dynamic proxy to > hidden classes) I

Re: Why does Set.of disallow duplicate elements?

2021-01-30 Thread Remi Forax
Set.of() is the closest way we've got to a literal Set without having introduced a special syntax for that in the language. The idea is that if you conceptually want to write Set set = { "hello", "world" }; instead, you write Set set = Set.of("hello", "world"); In that context, it makes

It's not a bug but it's not user friendly

2020-12-12 Thread Remi Forax
A student of mine send me a code that can be reduced to this code --- import java.lang.invoke.MethodHandles; import java.lang.invoke.VarHandle; public class ThereIsABugButWhere { private static final VarHandle TEXT; static { try { TEXT =

Re: RFR: 8257596: Clarify trusted final fields for record classes

2020-12-10 Thread Remi Forax
- Mail original - > De: "Mandy Chung" > À: "core-libs-dev" , "hotspot-runtime-dev" > > Envoyé: Mercredi 9 Décembre 2020 01:43:34 > Objet: Re: RFR: 8257596: Clarify trusted final fields for record classes > On Tue, 8 Dec 2020 22:52:37 GMT, Mandy Chung wrote: > >> This is a follow-up

Re: RFR: 8257596: Clarify trusted final fields for record classes

2020-12-08 Thread Remi Forax
- Mail original - > De: "Mandy Chung" > À: "core-libs-dev" , "hotspot-dev" > > Envoyé: Mardi 8 Décembre 2020 23:57:39 > Objet: RFR: 8257596: Clarify trusted final fields for record classes Hi Mandy, > This is a follow-up on JDK-8255342 that removes non-specified JVM checks on >

Re: Has it been considered to add inverse methods to collections which are in Optional?

2020-12-08 Thread Remi Forax
- Mail original - > De: "Dave Franken" > À: "core-libs-dev" > Envoyé: Mardi 8 Décembre 2020 13:17:25 > Objet: Has it been considered to add inverse methods to collections which are > in Optional? > Dear all, Hi Dave, > > The class java.util.Optional could be considered a collection

Why having the wrong InnerClasses attribute is an issue for the VM ?

2020-11-29 Thread Remi Forax
I've forgotten a cast in an invokedynamic, hence a call to wrongTargetType, but in order to create the error message, MethodType.toString(), getSimpleName() is called and it fails because getDeclaringClass() verifies the InnerClasses attribute. For me InnerClasses was just an attribute for

Lookup.defineAnonymousClass() vs indy

2020-11-29 Thread Remi Forax
Hi Mandy, hi all, it seems that when defineAnonymousClass rewrites the currentClass, it doesn't work if there is an invokedynamic in the classfile, so defineHiddenClass fails with a VerifyError when the hidden class is verified. Here is an example showing the issue --- import

Re: RFR: 8180352: Add Stream.toList() method [v4]

2020-11-25 Thread Remi Forax
- Mail original - > De: "Stuart Marks" > À: "core-libs-dev" > Envoyé: Mardi 24 Novembre 2020 08:10:14 > Objet: Re: RFR: 8180352: Add Stream.toList() method [v4] >> This change introduces a new terminal operation on Stream. This looks like a >> convenience method for

Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview)

2020-11-24 Thread Remi Forax
- Mail original - > De: "Mandy Chung" > À: "compiler-dev" , "core-libs-dev" > , "hotspot-dev" > > Envoyé: Mercredi 25 Novembre 2020 00:02:53 > Objet: Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second > Preview) > On Tue, 17 Nov 2020 00:25:51 GMT, Mandy Chung wrote:

Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview)

2020-11-24 Thread Remi Forax
- Mail original - > De: "David Holmes" > À: "Harold David Seigel" , "Vicente Romero" > , "compiler-dev" > , "core-libs-dev" > , "hotspot-dev" > > Envoyé: Mardi 24 Novembre 2020 02:04:55 > Objet: Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second > Preview) > Hi

Re: RFR: 8248862: Implement Enhanced Pseudo-Random Number Generators

2020-11-21 Thread Remi Forax
Ok, i've taking the time to read some literature about random generators because for me the Mersenne Twister was still the king. The current API proposed as clearly two levels, you have the user level and the implementation level, at least the implementation level should seen as a SPI

Re: RFR: 8180352: Add Stream.toList() method [v2]

2020-11-18 Thread Remi Forax
- Mail original - > De: "Florian Weimer" > À: "Peter Levart" > Cc: "Stuart Marks" , "core-libs-dev" > > Envoyé: Mercredi 18 Novembre 2020 12:55:02 > Objet: Re: RFR: 8180352: Add Stream.toList() method [v2] > * Peter Levart: > >> But I see that the new  IMM_LIST_NULLS type is needed

Re: RFR: 8248862: Implement Enhanced Pseudo-Random Number Generators [v3]

2020-11-17 Thread Remi Forax
An honest question, why do we need so many interfaces for the different categories of RandomGenerator ? My fear is that we are encoding the state of our knowledge of the different kinds of random generators now so it will not be pretty in the future when new categories of random generator are

Re: 'Find' method for Iterable

2020-11-17 Thread Remi Forax
- Mail original - > De: "Brian Goetz" > À: "Michael Kuhlmann" , "core-libs-dev" > > Envoyé: Mardi 17 Novembre 2020 20:44:17 > Objet: Re: 'Find' method for Iterable > On 9/21/2020 4:08 AM, Michael Kuhlmann wrote: >> But after thinking about it, I'm now convinced that it would be a bad

Re: RFR: 8230501: Class data support for hidden classes

2020-11-11 Thread Remi Forax
Hi Mandy, maybe a stupid question but why this mechanism is limited to hidden classes ? regards, Rémi - Mail original - > De: "Mandy Chung" > À: "core-libs-dev" , "hotspot compiler" > > Envoyé: Mercredi 11 Novembre 2020 19:57:04 > Objet: RFR: 8230501: Class data support for hidden

Re: Class TreeMap | Lower and Upper Count Support

2020-11-08 Thread Remi Forax
Is it different from headMap(key, true).size() / tailMap(key, true).size() ? https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/util/NavigableMap.html#headMap(K,boolean) https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/util/NavigableMap.html#tailMap(K,boolean)

Re: RFR: 8180352: Add Stream.toList() method

2020-11-06 Thread Remi Forax
- Mail original - > De: "Simon Roberts" > À: "core-libs-dev" > Envoyé: Jeudi 5 Novembre 2020 18:40:44 > Objet: Re: RFR: 8180352: Add Stream.toList() method > At the risk of a can of worms, or at least of raising something that has > long since been discussed and rejected... > > This

Re: RFR: 8180352: Add Stream.toList() method

2020-11-04 Thread Remi Forax
- Mail original - > De: "Stuart Marks" > À: "core-libs-dev" > Envoyé: Mercredi 4 Novembre 2020 01:14:54 > Objet: Re: RFR: 8180352: Add Stream.toList() method > On Tue, 3 Nov 2020 18:53:23 GMT, Stuart Marks wrote: > >>> Should there be a test that tests the default implementation in

Re: RFR: 8180352: Add Stream.toList() method

2020-11-03 Thread Remi Forax
- Mail original - > De: "Martin Desruisseaux" > À: "core-libs-dev" > Envoyé: Mardi 3 Novembre 2020 23:16:49 > Objet: Re: RFR: 8180352: Add Stream.toList() method > Hello > > Le 03/11/2020 à 21:30, fo...@univ-mlv.fr a écrit : > >> You know that you can not change the implementation of

Re: RFR: 8180352: Add Stream.toList() method

2020-11-03 Thread Remi Forax
- Mail original - > De: "Stuart Marks" > À: "core-libs-dev" > Envoyé: Mardi 3 Novembre 2020 04:18:08 > Objet: RFR: 8180352: Add Stream.toList() method > This change introduces a new terminal operation on Stream. This looks like a > convenience method for

Re: RFR: 8255398: Add a dropReturn MethodHandle combinator

2020-10-26 Thread Remi Forax
- Mail original - > De: "Jorn Vernee" > À: "core-libs-dev" > Envoyé: Lundi 26 Octobre 2020 16:37:20 > Objet: RFR: 8255398: Add a dropReturn MethodHandle combinator > Hi, > > This patch adds a `dropReturn` combinator to `MethodHandles` that can be used > to > create a new method handle

Re: 'Find' method for Iterable

2020-09-16 Thread Remi Forax
- Mail original - > De: "Nir Lisker" > À: "core-libs-dev" > Envoyé: Lundi 14 Septembre 2020 20:56:27 > Objet: 'Find' method for Iterable > Hi, > > This has probably been brought up at some point. When we need to find an > item in a collection based on its properties, we can either do

Re: JDK 15 hidden classes & stack trace visibility

2020-09-05 Thread Remi Forax
Hi Uwe, - Mail original - > De: "Uwe Schindler" > À: "core-libs-dev" > Envoyé: Samedi 5 Septembre 2020 13:55:03 > Objet: JDK 15 hidden classes & stack trace visibility > Hi, > > I am doing a mockup for dynamically compiled scripts in Apache Lucene (later > also painless scripting in

Re: Review request for JDK-8251538: Modernize and lint Dynalink code

2020-08-20 Thread Remi Forax
- Mail original - > De: "Attila Szegedi" > À: "core-libs-dev" > Envoyé: Jeudi 20 Août 2020 22:40:53 > Objet: Review request for JDK-8251538: Modernize and lint Dynalink code > Following up on the previous e-mail, here’s the modernization and linting work > on the existing Dynalink

Re: RFR[8238286]: 'Add new flatMap stream operation that is more amenable to pushing’

2020-08-12 Thread Remi Forax
Hi Patrick, I still don't like the fact that IntMapMultiConsumer, DoubleMapMultiConsumer and LongMapMultiConsumer are not in java.util.function unlike all other functional interfaces used by the Stream API. Otherwise looks good. regards, Rémi - Mail original - > De: "Patrick

Re: Type inference: bug or feature?

2020-07-27 Thread Remi Forax
- Mail original - > De: "Maurizio Cimadamore" > À: "Justin Dekeyser" , "core-libs-dev" > > Envoyé: Lundi 27 Juillet 2020 12:26:40 > Objet: Re: Type inference: bug or feature? > CC'ing compiler-dev > > Hi Justin, > the behavior you are observing is normal. For a Java expression to be >

Re: RFR[8238286]: 'Add new flatMap stream operation that is more amenable to pushing’

2020-07-02 Thread Remi Forax
Hi Patrick & Julia, this version starts to look good. I just don't understand why the new functional interfaces are not in java.util.function like the other ones ? (BTW, in the javadoc, the link to the summary overview point to the wrong one, to java.util.stream and not java.util.function).

Re: Explicitly constructed NPE is showing (wrong) message

2020-06-27 Thread Remi Forax
- Mail original - > De: "Christoph Dreis" > À: "hotspot-runtime-dev" > Envoyé: Samedi 27 Juin 2020 11:54:19 > Objet: Explicitly constructed NPE is showing (wrong) message > Hi, Hi Christoph, > > I hope this is the correct mailing list. > > The latest changes on JDK-8233014 to enable

Re: RFR[8238286]: 'Add new flatMap stream operation that is more amenable to pushing’

2020-06-25 Thread Remi Forax
- Mail original - > De: "Remi Forax" > À: "Daniel Fuchs" > Cc: "Patrick Concannon" , "core-libs-dev" > > Envoyé: Jeudi 25 Juin 2020 23:46:08 > Objet: Re: RFR[8238286]: 'Add new flatMap stream operation that is more > ame

Re: RFR[8238286]: 'Add new flatMap stream operation that is more amenable to pushing’

2020-06-24 Thread Remi Forax
Hi Patrick, - Mail original - > De: "Patrick Concannon" > À: "core-libs-dev" > Envoyé: Mercredi 24 Juin 2020 12:57:01 > Objet: RFR[8238286]: 'Add new flatMap stream operation that is more amenable > to pushing’ > Hi, Hi, > > Could someone please review myself and Julia's RFE and

Re: [PATCH] remove redundant initialization of volatile fields with default values

2020-06-19 Thread Remi Forax
Hi Sergei, the problem is that you are changing the semantics if there are several fields. By example with the code below, you have the guarantee that the code will print 4 (if it prints something), if you remove the assignment field = false, the code can print 0 or 4. class A { int i =

Re: RFR: 8247532: Records deserialization is slow

2020-06-16 Thread Remi Forax
Hi Peter, is their a reason to not use a ClassValue using the record class as key instead of the more complex keys you are proposing ? Rémi - Mail original - > De: "Chris Hegarty" > À: "Peter Levart" > Cc: "core-libs-dev" > Envoyé: Mardi 16 Juin 2020 17:15:03 > Objet: Re: RFR:

Re: (15) RFR: JDK-8247444: Trust final fields in records

2020-06-16 Thread Remi Forax
Hi Mndy, Looks good, I don't like too much the fact that there is a new boolean field in j.l.r.Field instead of using the modifiers like in the VM counterpart, but it will require masking and unmasking the modifiers which is a far bigger change, too big to worth it in my opinion. So +1 Rémi

Re: Comparator.reversed() type inference issue

2020-06-09 Thread Remi Forax
- Mail original - > De: "Tagir Valeev" > À: "Attila Szegedi" > Cc: "core-libs-dev" > Envoyé: Mardi 9 Juin 2020 09:05:42 > Objet: Re: Comparator.reversed() type inference issue > Hello! > > This is more related to Java language specification and implementation > than to core libraries,

Re: Comparator.reversed() type inference issue

2020-06-09 Thread Remi Forax
yep, the inference is not smart enough. So the way to fix the code is either to explicitly specify the type arguments var rs1 = x.entrySet().stream().sorted( Map.Entry.comparingByValue().reversed() ); or to store the result of comparingByValue() in a variable (so it's a poly

  1   2   3   4   5   6   7   >