Re: RFR: 8244224: Implementation of JEP 381: Remove the Solaris and SPARC Ports - (core libraries)

2020-05-05 Thread Daniel Fuchs
Hi Mikael, I spotted another place where a residual reference to Solaris remains in a comment: src/java.base/unix/native/libnet/PlainSocketImpl.c 857 #if defined(_AIX) 858 if (errno == EINVAL) { 859 // On Solaris setsockopt will set errno to EINVAL if the socket 860

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

2020-05-05 Thread Maurizio Cimadamore
On 02/05/2020 09:45, Peter Levart wrote: Thread 1 does: a) increments 'acquires' b) reads OPEN from 'state' Thread 2 does: c) writes CLOSING to 'state' d) sums 'acquires' 'a' happens before 'b' happens before 'c' happens before 'd' => 'a' happens before 'd' Where did you get the "b"

Re: 8244293 : Remove outdated @apiNote in java.util.Objects

2020-05-05 Thread Anirvan Sarkar
Hi Paul, Thanks for sponsoring ! On Tue, 5 May 2020 at 01:16, Paul Sandoz wrote: > Hi, > > Removing all of the api note looks good, since it was really written in > the context of the removed methods. > > I’ll sponsor. (I removed the methods but forgot to remove the note.) > > Paul. > > > On Ma

Re: [15] RFR: 8244152: Remove unnecessary hash map resize in LocaleProviderAdapters

2020-05-05 Thread Peter Levart
Hi Naoto, On 4/30/20 12:18 AM, naoto.s...@oracle.com wrote: Hello, Please review this small fix to the following issue: https://bugs.openjdk.java.net/browse/JDK-8244152 The proposed changeset is located at: https://cr.openjdk.java.net/~naoto/8244152/webrev.00/ The hash map used there didn't

RFR [LDAP]: 8062947: Fix exception message to correctly represent LDAP connection failure

2020-05-05 Thread Aleks Efimov
Hi, NamingException message is not precise about the cause of LDAP connection failure, i.e. in case of LDAP connection closure the NamingException with misleading message is thrown: "LDAP response read timed out, timeout used:-1ms.": https://bugs.openjdk.java.net/browse/JDK-8062947 The follow

Re: [15] RFR: 8244152: Remove unnecessary hash map resize in LocaleProviderAdapters

2020-05-05 Thread naoto . sato
Hi Peter, You are correct. Thanks. I'll remove that initial value of 16. Naoto On 5/5/20 9:37 AM, Peter Levart wrote: Hi Naoto, On 4/30/20 12:18 AM, naoto.s...@oracle.com wrote: Hello, Please review this small fix to the following issue: https://bugs.openjdk.java.net/browse/JDK-8244152 Th

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

2020-05-05 Thread Peter Levart
Hi Maurizio, On 5/5/20 4:12 PM, Maurizio Cimadamore wrote: On 02/05/2020 09:45, Peter Levart wrote: Thread 1 does: a) increments 'acquires' b) reads OPEN from 'state' Thread 2 does: c) writes CLOSING to 'state' d) sums 'acquires' 'a' happens before 'b' happens before 'c' happens befo

[15] RFR: 8244459: Optimize the hash map size in LocaleProviderAdapters

2020-05-05 Thread naoto . sato
And here is the fix. Please review. http://cr.openjdk.java.net/~naoto/8244459/webrev.00/ Naoto On 5/5/20 10:25 AM, naoto.s...@oracle.com wrote: Hi Peter, You are correct. Thanks. I'll remove that initial value of 16. Naoto On 5/5/20 9:37 AM, Peter Levart wrote: Hi Naoto, On 4/30/20 12:18

Re: [15] RFR: 8244459: Optimize the hash map size in LocaleProviderAdapters

2020-05-05 Thread Joe Wang
Hi Naoto, It seems you've missed the parentheses in : Set tagset = new HashSet<>(tokens.countTokens() * 4 + 2 / 3); vs Set tagset = new HashSet<>((tokens.countTokens() * 4 + 2) / 3); -Joe On 5/5/2020 11:01 AM, naoto.s...@oracle.com wrote: And here is the fix. Please review. http://cr.openjdk.

Re: [15] RFR: 8244459: Optimize the hash map size in LocaleProviderAdapters

2020-05-05 Thread Martin Buchholz
See related: https://guava.dev/releases/23.0/api/docs/com/google/common/collect/Maps.html#newHashMapWithExpectedSize-int- On Tue, May 5, 2020 at 11:03 AM wrote: > And here is the fix. Please review. > > http://cr.openjdk.java.net/~naoto/8244459/webrev.00/ > > Naoto > > On 5/5/20 10:25 AM, naoto.

CfD: compile-time checked immutable collections

2020-05-05 Thread M. Kroll
Hey there! I am new here so first i want to introduce myself. My name is Michael and i live in germany. For a job i am a java developer with 10 years of java EE experience. At work my passion is to create long-living core tools for our projects. But now for the reason i joined openjdk and th

Re: [15] RFR: 8244459: Optimize the hash map size in LocaleProviderAdapters

2020-05-05 Thread Peter Levart
Hi Martin, On 5/5/20 8:26 PM, Martin Buchholz wrote: See related: https://guava.dev/releases/23.0/api/docs/com/google/common/collect/Maps.html#newHashMapWithExpectedSize-int- This is basically the same calculation (or at least gives same result) as Naoto did (without the max part): Naoto:

Re: [15] RFR: 8244459: Optimize the hash map size in LocaleProviderAdapters

2020-05-05 Thread Martin Buchholz
Hi Peter, Are you saying guava has a tiny bug? On Tue, May 5, 2020 at 12:12 PM Peter Levart wrote: > Hi Martin, > On 5/5/20 8:26 PM, Martin Buchholz wrote: > > See related: > > https://guava.dev/releases/23.0/api/docs/com/google/common/collect/Maps.html#newHashMapWithExpectedSize-int- > > > Thi

RFR: JDK-8241602 jlink does not produce reproducible jimage files

2020-05-05 Thread Jim Laskey
This fix addresses the inconsistent ordering by jimage content by jlink from run to run. Bottom line, the implementer was using HashSet without defining hashcode/equals for the Set entry classes. webrev: http://cr.openjdk.java.net/~jlaskey/8241602/webrev-00

Re: [15] RFR: 8244459: Optimize the hash map size in LocaleProviderAdapters

2020-05-05 Thread Peter Levart
On 5/5/20 9:41 PM, Martin Buchholz wrote: Hi Peter, Are you saying guava has a tiny bug? If it was just 1 too much when expected size is a multiple of 3 then that would not be a bug, just sub-optimal calculation. And the same calculation is performed also in JDK when a copy constructor is

Re: [15] RFR: 8244459: Optimize the hash map size in LocaleProviderAdapters

2020-05-05 Thread Peter Levart
There's more... Guava (and JDK in copy constructor) formula:     (int) ((float) expectedSize / 0.75f + 1.0f) is not the same as Naoto's formula:     (int) (expectedSize / 0.75f) + 1 Notice that Naoto does addition of 1 in integer arithmetic after conversion to int, while Guava/JDK does in

Re: [15] RFR: 8244459: Optimize the hash map size in LocaleProviderAdapters

2020-05-05 Thread Peter Levart
On 5/5/20 8:29 PM, Joe Wang wrote: Hi Naoto, It seems you've missed the parentheses in : Set tagset = new HashSet<>(tokens.countTokens() * 4 + 2 / 3); vs Set tagset = new HashSet<>((tokens.countTokens() * 4 + 2) / 3); -Joe Just a reminder to Naoto: In all this excitement, don't loose track

Re: [15] RFR: 8244459: Optimize the hash map size in LocaleProviderAdapters

2020-05-05 Thread naoto . sato
Thanks, all. I didn't see this coming! If I understand the discussion correctly, Peter's suggestion is the most optimal (Mark, your formula produces 1 for the expected size is 0, although it won't be happening in this particular case). And Joe, thank you for finding my silly mistake :-) So her

Re: [15] RFR: 8244459: Optimize the hash map size in LocaleProviderAdapters

2020-05-05 Thread Joe Wang
On 5/5/2020 2:08 PM, naoto.s...@oracle.com wrote: Thanks, all. I didn't see this coming! +1, just when one might think it was just a minor tweak... ;-) If I understand the discussion correctly, Peter's suggestion is the most optimal (Mark, your formula produces 1 for the expected size is

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

RFR: 8244413: Avoid rebinds in MethodHandle.viewAsType

2020-05-05 Thread Claes Redestad
Hi, in the current implementation MethodHandle.viewAsType eagerly rebinds when creating a view of a method type as an alternative type: MethodHandle viewAsType(MethodType newType, boolean strict) { ... MethodHandle mh = rebind(); return this.copyWith(newType, mh.form)

Re: RFR: 8244413: Avoid rebinds in MethodHandle.viewAsType

2020-05-05 Thread Mandy Chung
On 5/5/20 3:12 PM, Claes Redestad wrote: Hi, in the current implementation MethodHandle.viewAsType eagerly rebinds when creating a view of a method type as an alternative type:     MethodHandle viewAsType(MethodType newType, boolean strict) {     ...     MethodHandle mh = rebind();  

Re: RFR: 8244413: Avoid rebinds in MethodHandle.viewAsType

2020-05-05 Thread Claes Redestad
Hi Mandy, On 2020-05-06 00:23, Mandy Chung wrote: This looks good. thanks! Nit: one assert with paratheses and the other without.  Better to make them consistent. 163 assert viewAsTypeChecks(newType, strict);  164 assert(this.getClass() == DirectMethodHandle.class); // must override in

Re: [15] RFR: 8244459: Optimize the hash map size in LocaleProviderAdapters

2020-05-05 Thread Stuart Marks
Hm, interesting, good catch Peter! Very subtle. The time-honored (int) (expected / 0.75f) + 1 appears in several places around the JDK. I think most people (including me) just copy it, because it's "good enough" for most cases. I'm a little concerned about (expectedSize * 4 + 2) / 3

Re: [15] RFR: 8244459: Optimize the hash map size in LocaleProviderAdapters

2020-05-05 Thread naoto . sato
Hi Stuart, On 5/5/20 4:29 PM, Stuart Marks wrote: As for Naoto's changeset, I don't think it should be held up while we bikeshed this. :-) I'm ok with whatever he decides. I don't think the number of language tags exceed 2^29, unless languages in the whole universe are counted :-) So I would

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

2020-05-05 Thread John Rose
On May 1, 2020, at 1:36 PM, Paul Sandoz wrote: > > Hi Remi, > > Thanks for the feedback. I am gonna need to go over this with John. Some > comments inline. > > >> On Apr 20, 2020, at 6:31 AM, Remi Forax wrote: >> >> Hi Paul, >> about the API part (not the implementation), >> there are locat

Was functional-Try already discussed?

2020-05-05 Thread Justin Dekeyser
Hi everyone, I am new to the OpenJDK community and I'm using Java fora small decade now, first as a hobby, then in my academic studies and my PhD in maths, and now as a professional developer in IT companies. I'm quite active on forum to help people, I've helped teaching students in the university

[PATCH] 8244199: [TestBug]: Update sun/management/jmxremote/bootstrap tests

2020-05-05 Thread Thejasvi Voniadka
Hello, A quick follow-up on this request.. -Original Message- From: Thejasvi Voniadka Sent: Monday, May 4, 2020 12:56 PM To: core-libs-dev@openjdk.java.net Subject: [PATCH] 8244199: [TestBug]: Update sun/management/jmxremote/bootstrap tests Hi, May I please find a sponsor for this pa