Re: RFR JDK-8223347 Integration of Vector API (Incubator): Java API, implementation, and tests

2020-04-20 Thread Remi Forax
Hi Paul, about the API part (not the implementation), there are location where the same concept is described with a different names which doesn't help to understand how thing work - vector length <=> vector lane count - vector shape <=> vector bits size - element size <=> lane size "size" should

Re: RFR JDK-8223347 Integration of Vector API (Incubator): Java API, implementation, and tests

2020-04-20 Thread Remi Forax
BTW, did you try to add an intermediary private non visible class between Vector and IntVector to avoid all hand-written cast inside the implementation of IntVector, something along that line public abstract class Vector { abstract void foo(Vector vector); abstract Vector bar(); }

Re: RFR 8243491: Implementation of Foreign-Memory Access API (Second Incubator)

2020-04-27 Thread Remi Forax
Hi Maurizio, Mandy, In https://cr.openjdk.java.net/~mcimadamore/8243491_v2/webrev/src/java.base/share/classes/java/lang/invoke/MemoryAccessVarHandleGenerator.java.udiff.html, using a condy inside a static init make me sad, using a late loading constant to early load it in the static init seems co

Re: CfD: compile-time checked immutable collections

2020-05-05 Thread Remi Forax
Hallo ! This questions have been asked so many times since 1998, Josh Bloch one of the designer of the API (who will later write Effective Java) as created a FAQ around that time answering to that question: https://docs.oracle.com/javase/8/docs/technotes/guides/collections/designfaq.html Googl

Re: RFR: JDK-8225056 VM support for sealed classes

2020-05-19 Thread Remi Forax
- Mail original - > De: "David Holmes" > À: "Harold David Seigel" , "hotspot-runtime-dev" > , > "amber-dev" , "core-libs-dev" > , "serviceability-dev" > > Envoyé: Mardi 19 Mai 2020 07:26:38 > Objet: Re: RFR: JDK-8225056 VM support for sealed classes > Hi Harold, > > Adding servicea

Re: RFR: 8245455: Remove alternative StringConcatFactory strategies

2020-05-22 Thread Remi Forax
- Mail original - > De: "Paul Sandoz" > À: "Claes Redestad" > Cc: "core-libs-dev" > Envoyé: Vendredi 22 Mai 2020 19:28:39 > Objet: Re: RFR: 8245455: Remove alternative StringConcatFactory strategies > Hi, > > I support the removal of all the other strategies to simplify SCF and make it

Re: RFR: 8245756: Reduce bootstrap cost of StringConcatFactory prependers

2020-05-25 Thread Remi Forax
Hi Claes, do you have evaluated the improvement (1) in separation of the others ? (2) or (3) are clearly improvement but (1) is a trade of because you are adding a second lookup into another table and make prepender() less likely to be inlined. Rémi - Mail original - > De: "Claes Redes

Re: RFR: 8245969: Simplify String concat constant folding

2020-05-27 Thread Remi Forax
Hi Claes, so instead of having a prefix and a suffix, there is only a prefix, a suffix being seen as a prefix for the next iteration and if at the end instead of just allocating an array, you allocate an array and stuff it with the last prefix. Are you sure having a suffix at the end is uncommon

Re: RFR: 8246152: Improve String concat bootstrapping

2020-05-29 Thread Remi Forax
Hi Claes, For the code below the comment "Mock the recipe to reuse the concat generator code", i believe you can use String.repeat() that was introduced recently. The code that parse the the receipe can be in its own method to make the code more readable, this method returns the list and use the

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 express

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: (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: 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: 8247532

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 = 4;

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 CS

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 >

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-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). Abo

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-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 Concannon"

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 codeba

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 el

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 it

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: 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 Stream.collect(Collectors.toList(

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-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-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 dis

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) che

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 clas

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: 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 d

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 fo

Re: RFR: JDK-8223333: Use try-with-resources where feasible

2019-06-05 Thread Remi Forax
Hi Andy, A code like this is not safe try (Writer w = new BufferedWriter(new FileWriter( ... because new BufferedWriter may throw an OutOfMemoryError, in that case the file descriptor used by the FileWriter is not freed. There are two ways to fix that, either you need to expand the try-with-

Re: Lookup.unreflectSetter/unreflectGetter and volatile fields

2019-06-16 Thread Remi Forax
Hi Kasper, as usual, a getter on a volatile field will return a method handle that does a volatile read. The idea of the basic methodhandles, the one for field access, method calls, etc is to have exactly the same semantics as the bytecode equivalent, so unreflectGetter works like getfield and u

Re: RFR: JDK-8222373 Improve CDS performance for custom class loaders

2019-06-25 Thread Remi Forax
- Mail original - > De: "John Rose" > À: "Ioi Lam" > Cc: "core-libs-dev" , "hotspot-runtime-dev" > > Envoyé: Lundi 24 Juin 2019 19:13:04 > Objet: Re: RFR: JDK-8222373 Improve CDS performance for custom class loaders > On Jun 20, 2019, at 12:12 AM, Ioi Lam wrote: >> ... >> I have a

Re: Inputs on patch for JDK-8225763?

2019-06-27 Thread Remi Forax
Is a boolean isEnded that records if end() was already called is not enough ? Rémi - Mail original - > De: "Alan Bateman" > À: "Jaikiran Pai" , "core-libs-dev" > > Envoyé: Jeudi 27 Juin 2019 09:13:41 > Objet: Re: Inputs on patch for JDK-8225763? > On 27/06/2019 05:28, Jaikiran Pai wro

Re: Slow performance of StackWalker.getCallerClass() vs Reflection.getCallerClass()

2019-07-02 Thread Remi Forax
Hi Kasper, did you store the StackWalker instance in a static final field ? Rémi - Mail original - > De: "Kasper Nielsen" > À: "core-libs-dev" > Envoyé: Mardi 2 Juillet 2019 11:09:11 > Objet: Slow performance of StackWalker.getCallerClass() vs > Reflection.getCallerClass() > Hi, > >

Re: Are classes generated by LambdaMetafactory special?

2019-08-05 Thread Remi Forax
It is intentional and the implementation details are planned to change in the future (there are already some patches in the valhalla/nestmates branch). The slash in the name is because you can create several classes from the same bytecode by patching it at runtime, the number after the slash is

Re: RFE: annotation for resource wrapper methods

2019-08-10 Thread Remi Forax
Hi Rob, the problem is that if wrap() raises an exception before the wrapper is created and returned, the resource will be never closed. The correct way to fix the issue is to use several assignments in the try-with-resources try (FileInputStream fileInputStream = new FileInputStream("filename"

Re: RFR 8207814: (proxy) upgrade the proxy class generator

2019-08-19 Thread Remi Forax
A follow up should to use constant dynamic (introduce in Java 11) to get the j.l.r.Method object instead of pre-calculating all of them in the static init block. The idea is that a ldc on a constant dynamic with bootstrap method that takes a MethodHandle as parameter (as boostrap argument) can r

Re: RFR: jsr166 integration 2019-09

2019-09-12 Thread Remi Forax
This remember me something, we should refactor most of the the package-private final methods (and the corresponding constructors) at least inside java.lang/java.util to make them private, there is no need to make them package-private anymore given that since Java 11 the compiler emits nestmate a

Re: RFR (L, final): 8218626: Add detailed message to NullPointerException describing what is null.

2019-09-17 Thread Remi Forax
Hi Goetz, in bytecodeUtils.cpp, in print_local_var(), i believe that the code if (!method->is_static() && (slot == 0)) { os->print("this"); } ... is only true if the bytecode is generated by javac and ecj, tools like proguard that tries to obfuscate the code will reuse the slot 0 once

Re: JDK 14 RFR of JDK-8231202: Suppress warnings on non-serializable non-transient instance fields in serializable classes

2019-09-19 Thread Remi Forax
- Mail original - > De: "joe darcy" > À: "Roger Riggs" , "core-libs-dev" > > Envoyé: Jeudi 19 Septembre 2019 21:39:54 > Objet: Re: JDK 14 RFR of JDK-8231202: Suppress warnings on non-serializable > non-transient instance fields in > serializable classes > Hi Roger, > > I think the Obj

Re: RandomAccess Interface and List Heirarchy

2019-09-25 Thread Remi Forax
Hi Cyrus, as the javadoc says RandomAccess is a marker interface, an interface used at runtime to indicate if the implementation provides a fast random access operation or not. "marker interface" is the precursor of a runtime visible annotation. RandomAccess was introduce in 1.4 while annotations

Re: RFR: JDK-8232806: The LambdaMetaFactory eagerly initializes generated lambdas

2019-10-29 Thread Remi Forax
Looks good to me. Remi On October 28, 2019 10:29:58 PM UTC, mark.reinh...@oracle.com wrote: >2019/10/28 11:10:25 -0700, vojin.jovano...@oracle.com: >> This email proposes a change to the LambdaMetaFactory that allows to >> disable eager initialization (with Unsafe) of generated lambdas. ... >> >

Re: RFR: 8229516: Thread.isInterrupted() always returns false after thread termination

2019-10-29 Thread Remi Forax
Hi David, in java.lang.Thread interrupt0 should be renamed to setInterruptEvent, because what it does now and I don't really understand the comment in interrupted(), if a thread is interrupted by two other threads calling interrupt(), you will loose an interrupt anyway. Rémi - Mail origina

Re: RFR: CSR JDK-8233117 Escape Sequences For Line Continuation and White Space (Preview)

2019-11-05 Thread Remi Forax
Hi Jim, the rationale to add \ is well explain but why do you want to introduce \s given we already have \u0020 ? Rémi - Mail original - > De: "Jim Laskey" > À: "core-libs-dev" , "compiler-dev" > > Envoyé: Mardi 5 Novembre 2019 19:00:32 > Objet: Re: RFR: CSR JDK-8233117 Escape Sequen

Re: RFR 8233920: MethodHandles::tryFinally generates illegal bytecode for long/double return types

2019-11-12 Thread Remi Forax
Hi Jorn, Claes, Is it not better to always store in a local variable, like javac does, instead of doing the double SWAP if there is a return value of size 1 ? Rémi - Mail original - > De: "Jorn Vernee" > À: "Claes Redestad" , "core-libs-dev" > > Envoyé: Mardi 12 Novembre 2019 15:56:0

Re: JEP 358 (Helpful NPEs) and single source file mode

2019-11-19 Thread Remi Forax
- Mail original - > De: "Gunnar Morling" > À: "core-libs-dev" > Envoyé: Mardi 19 Novembre 2019 09:34:41 > Objet: JEP 358 (Helpful NPEs) and single source file mode > Hi, > > I've been exploring the new helpful NPE feature a bit. > > It's a very welcomed improvement, but I noticed one p

Re: Looking for Sponsor: JDK-8229959 Convert proxy class to use constant dynamic

2019-11-22 Thread Remi Forax
- Mail original - > De: "Johannes Kuhn" > À: "core-libs-dev" > Envoyé: Vendredi 22 Novembre 2019 04:23:31 > Objet: Looking for Sponsor: JDK-8229959 Convert proxy class to use constant > dynamic > Hi everyone, Hi Johannes, > > a few hours ago I signed the Oracle Contributor Agreement.

Re: [PATCH] Simplification proposal regarding TYPE-field initialization in primitive wrappers

2019-11-26 Thread Remi Forax
Hi Sergey, hum, it doesn't work :) int.class is compiled by javac as Integer.TYPE, the opcode ldc only works with an object/interface class, not with a primitive type [1]. regards, Rémi [1] https://docs.oracle.com/javase/specs/jvms/se13/html/jvms-6.html#jvms-6.5.ldc - Mail original - >

Re: wavl based alternative to red-black TreeMap

2019-12-01 Thread Remi Forax
Nice ! there is a wikipedia article about WAVL tree [1]. I did not know this new kind of balanced tree, worth the exploration i believe. and TreeMap code really needs some love anyway, unlike ArrayList and HashMap, this code has not be updated since a long time. Rémi [1] https://en.wikipedia.or

Re: RFR JDK-8234049: Implementation of Memory Access API (Incubator)

2019-12-05 Thread Remi Forax
Hi Maurizio, that's a huge work :) So as a guy discovering the API, i've not taken a deep look to the implementation because i've noob questions. The first sentence of the overview of GroupLayout should say that there are two types of GroupLayout struct and union instead of talking about members

Re: Note bulk methods in Javadocs for Collections.synchronizedXxx()

2020-01-01 Thread Remi Forax
Hi Roman, addAll() returns a boolean that will be not easy to compute given that forEach() takes a lambda (that can only capture local values and not change them). and the javadoc of AbstractCollection clearly states that addAll has to use an iterator if implemented https://docs.oracle.com/en/j

Re: RFR: 8236850: Operations on constant List/Set.of(element) instances does not consistently constant fold

2020-01-10 Thread Remi Forax
Seem to be a JIT bug to me, the fields of Set12 are declared final not @Stable (even if the field storing the instanceof of Set&2 itself is marked @Stable) so there is no reason not not let the constant folding happen. Rémi - Mail original - > De: "Claes Redestad" > À: "core-libs-dev"

Re: RFR [15/java.xml] 8235368 : Update BCEL to Version 6.4.1

2020-01-16 Thread Remi Forax
- Mail original - > De: "Joe Wang" > À: "Daniel Fuchs" , "core-libs-dev" > > Envoyé: Jeudi 16 Janvier 2020 18:40:18 > Objet: Re: RFR [15/java.xml] 8235368 : Update BCEL to Version 6.4.1 > On 1/16/20 2:35 AM, Daniel Fuchs wrote: >> Hi Joe, >> >> Looks OK to me as well. > > Thanks for th

Re: Depth and String handling in ObjectInputFilter

2020-01-17 Thread Remi Forax
Hi Robert, first this is the wrong mailing list, this mailing list is about how to implement the JDK, not how it works, usually stackoverflow is better for the kind of questions you are asking. - Mail original - > De: "Robert Olofsson" > À: "core-libs-dev" > Envoyé: Vendredi 17 Janvier 2

Re: New candidate JEP: 371: Hidden Classes

2020-01-27 Thread Remi Forax
- Mail original - > De: "David Lloyd" > À: "David Holmes" > Cc: "hotspot-dev" , "core-libs-dev" > > Envoyé: Lundi 27 Janvier 2020 14:56:57 > Objet: Re: New candidate JEP: 371: Hidden Classes > On Fri, Jan 24, 2020 at 4:56 PM David Holmes wrote: >> >> FYI. > > I'm a bit curious about

Re: [PATCH] Enhancement proposal for java.util.StringJoiner

2020-02-04 Thread Remi Forax
- Mail original - > De: "Сергей Цыпанов" > À: "jonathan gibbons" , "core-libs-dev" > > Envoyé: Mardi 4 Février 2020 08:53:31 > Objet: Re: [PATCH] Enhancement proposal for java.util.StringJoiner > Hello, Hi Sergey, > > I'd probably agree about a new class in java.lang, but what is wro

Re: RFR [15] 8161558: ListIterator should not discard cause on exception

2020-02-05 Thread Remi Forax
Stuart, Martin, Kiran, I think this "bug" should not be fixed because it's one of the cases where providing more information is actually bad from a user POV. The current code throws NoSuchElementException when the iterator reach the end so from the user POV, this is the right exception because

Re: RFR: 8237878: Improve ModuleLoaderMap datastructures

2020-02-06 Thread Remi Forax
Hi Claes, In ArchivedModuleGraph, there is no point to take the mainModule as parameter given that it should always be null. In ModuleLoaderMap, the constants PLATFORM_LOADER_INDEX and APP_LOADER_INDEX should be moved inside the nested class Mapper given that there are only needed by the Mapper

Re: RFR: 8238684: Override getOrDefault in immutable Map implementations

2020-02-07 Thread Remi Forax
Hi Claes, looks good, it can be written in a less Doug Lea-ish way like this V v = get(key); return (v != null)? v: default; I believe it using the same number of bytecodes :) with a ALOAD instead of a DUP Rémi - Mail original - > De: "Claes Redestad" > À: "core-libs-dev" > Envoyé

Re: 回复:回复:VM crashed at StringTable expansion

2020-02-26 Thread Remi Forax
- Mail original - > De: "向伟(识月)" > À: "Florian Weimer" > Cc: "core-libs-dev" , "hotspot-runtime-dev" > > Envoyé: Mercredi 26 Février 2020 13:45:52 > Objet: 回复:回复:VM crashed at StringTable expansion > Hi Florian, Alan, > >public static void main(String[] args) throws Exception {

Re: RFR: JDK-8241310 Fix warnings in jdk buildtools

2020-03-19 Thread Remi Forax
Hi Magnus, please try not to use @SuppressWarnings("unchecked") on methods, but on local variable instead to reduce the scope, you can introduce a local variable for that. In Bundle, your patch declare @SuppressWarnings("unchecked") on the method while you already have a local variable with a @

Re: Review Request: 8238358: Implementation of JEP 371: Hidden Classes

2020-03-27 Thread Remi Forax
Hi Mandy, in ReflectionFactory, why in the case of a constructor the check to the anonymous class is removed ? in BytecodeGenerator, the comment "// bootstrapping issue if using condy" can be promoted on top of clinit, because i ask myself the same question seeing a static block was generated i

Re: Review Request: 8238358: Implementation of JEP 371: Hidden Classes

2020-03-27 Thread Remi Forax
- Mail original - > De: "David Holmes" > À: "mandy chung" , "Vicente Romero" > , "jan lahoda" > > Cc: "serviceability-dev" , "hotspot-dev" > , > "core-libs-dev" , "valhalla-dev" > > Envoyé: Samedi 28 Mars 2020 00:01:58 > Objet: Re: Review Request: 8238358: Implementation of JEP 371: H

ASM 8 is available

2020-03-28 Thread Remi Forax
Hi all, it's a little bit OT even if the JDK itself as a dependency on ASM. I'm proud to announce that ASM 8 (nicknamed the Quarantine Edition) was released today ! It fully supports Java 14 (the Record attribute) and even support sealed types (the attribute PermittedSubtypes) as an experimenta

Re: JDK 15 RF(pre)R of JDK-8241374: add Math.absExact

2020-03-29 Thread Remi Forax
- Mail original - > De: "Stuart Marks" > À: "joe darcy" > Cc: "core-libs-dev" > Envoyé: Dimanche 29 Mars 2020 04:37:06 > Objet: Re: JDK 15 RF(pre)R of JDK-8241374: add Math.absExact > Hi Joe, > > Overall this looks quite good. Thanks for being thorough about this; I > certainly > woul

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 RandomGe

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 Harol

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: 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 Stream.collect(Collec

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 java.io.IOException

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 javac

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 w

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 > classes

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 on

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 = MethodHandles.lookup().findVarHandle(ThereIs

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 sens

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 ca

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" > À: "core-l

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: System.getEnv(String name, String def)

2021-02-16 Thread Remi Forax
or-using-the-optional-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.OfNulla

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 would’v

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: 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 def

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 >> wrot

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 trac

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 > of

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-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 `tableSwi

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: > https://docs.oracle.com/j

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 classes

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 wo

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 wo

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 >> provides

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? >> > He

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 from

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

  1   2   3   4   5   6   7   8   >