Re: RFR: 8280166: Extend java/lang/instrument/GetObjectSizeIntrinsicsTest.java test cases

2022-01-21 Thread Aleksey Shipilev
On Tue, 18 Jan 2022 19:36:18 GMT, Chris Plummer wrote: >> While working on JDK-8280003, I noticed that >> java/lang/instrument/GetObjectSizeIntrinsicsTest.java does not test arrays >> with more than 1-byte size elements, and no large arrays (past 4G limit) are >> tested either. It would be bet

Re: RFR: 8280041: Retry loop issues in java.io.ClassCache [v4]

2022-01-21 Thread Aleksey Shipilev
> JDK-8277072 introduced java.io.ClassCache, but there seem to be at least two > issues with it: > - The cache cannot disambiguate between cleared SoftReference and the > accidental passing of `null` value; in that case, the retry loop would spin > indefinitely; > - If retry loop would spin

Re: RFR: 8280041: Retry loop issues in java.io.ClassCache [v3]

2022-01-21 Thread Aleksey Shipilev
On Wed, 19 Jan 2022 13:10:55 GMT, Peter Levart wrote: > WDYT? I like the idea of holding to a value strongly for a brief period of time, in order to guarantee progress! The sample code was a bit hard to follow, so I rewrote the loop a bit with comments, see new commit. This still passes tests.

Re: RFR: 8280166: Extend java/lang/instrument/GetObjectSizeIntrinsicsTest.java test cases [v2]

2022-01-21 Thread Aleksey Shipilev
> While working on JDK-8280003, I noticed that > java/lang/instrument/GetObjectSizeIntrinsicsTest.java does not test arrays > with more than 1-byte size elements, and no large arrays (past 4G limit) are > tested either. It would be better to add those test cases. > > Additional testing: > - [

Re: RFR: 8213905: reflection not working for type annotations applied to exception types in the inner class constructor

2022-01-21 Thread Jan Lahoda
On Thu, 16 Dec 2021 17:44:04 GMT, Vicente Romero wrote: > Hi, > > Please review this change that is fixing a bug in reflection in particular in > `sun.reflect.annotation.TypeAnnotationParser::buildAnnotatedTypes` the > current code is assuming that for inner class constructors, there are only

Re: RFR: JDK-8277795: ldap connection timeout not honoured under contention [v4]

2022-01-21 Thread Rob McKenna
> This fix attemps to resolve an issue where threads can stack up on each other > while waiting to get a connection from the ldap pool to an unreachable > server. It does this by having each thread start a countdown prior to holding > the pools' lock. (which has been changed to a ReentrantLock)

Re: RFR: JDK-8277795: ldap connection timeout not honoured under contention [v3]

2022-01-21 Thread Rob McKenna
On Wed, 19 Jan 2022 15:53:57 GMT, Daniel Fuchs wrote: >> IIRC this was a request from an earlier review. (long being the standard >> throughout other new public apis) I'm happy with either, but int does avoid >> the trouble of casting. > > Well I guess the request was "why not use long everywhe

Re: RFR: 8213905: reflection not working for type annotations applied to exception types in the inner class constructor

2022-01-21 Thread Vicente Romero
On Fri, 21 Jan 2022 12:41:37 GMT, Jan Lahoda wrote: > To me, looks good. thanks - PR: https://git.openjdk.java.net/jdk/pull/6869

Re: RFR: 8279842: HTTPS Channel Binding support for Java GSS/Kerberos [v3]

2022-01-21 Thread Michael McMahon
On Thu, 20 Jan 2022 11:04:18 GMT, Daniel Fuchs wrote: >> Michael McMahon has updated the pull request incrementally with one >> additional commit since the last revision: >> >> removed sasl module dependency and added SaslException cause > > src/java.base/share/classes/java/net/doc-files/net-

Re: RFR: 8279842: HTTPS Channel Binding support for Java GSS/Kerberos [v3]

2022-01-21 Thread Michael McMahon
On Thu, 20 Jan 2022 11:14:40 GMT, Michael Osipov wrote: >> Michael McMahon has updated the pull request incrementally with one >> additional commit since the last revision: >> >> removed sasl module dependency and added SaslException cause > > src/java.naming/share/classes/com/sun/jndi/ldap/s

Re: RFR: 8279842: HTTPS Channel Binding support for Java GSS/Kerberos [v3]

2022-01-21 Thread Michael McMahon
On Thu, 20 Jan 2022 11:16:16 GMT, Daniel Fuchs wrote: >> Michael McMahon has updated the pull request incrementally with one >> additional commit since the last revision: >> >> removed sasl module dependency and added SaslException cause > > src/java.base/share/classes/sun/security/util/Chann

Re: RFR: 8279842: HTTPS Channel Binding support for Java GSS/Kerberos [v3]

2022-01-21 Thread Michael Osipov
On Fri, 21 Jan 2022 13:35:53 GMT, Michael McMahon wrote: >> src/java.naming/share/classes/com/sun/jndi/ldap/sasl/LdapSasl.java line 133: >> >>> 131: >>> (String)env.get(TlsChannelBinding.CHANNEL_BINDING_TYPE)); >>> 132: } catch (ChannelBindingExce

Re: RFR: 8279842: HTTPS Channel Binding support for Java GSS/Kerberos [v3]

2022-01-21 Thread Michael McMahon
On Fri, 21 Jan 2022 13:38:08 GMT, Michael McMahon wrote: >> src/java.base/share/classes/sun/net/www/http/HttpClient.java line 189: >> >>> 187: } else { >>> 188: logError("Unexpected value for \"jdk.https.negotiate.cbt\" >>> system property"); >>> 189: return s; >

Re: RFR: 8279842: HTTPS Channel Binding support for Java GSS/Kerberos [v4]

2022-01-21 Thread Michael McMahon
> Hi, > > This change adds Channel Binding Token (CBT) support to HTTPS > (java.net.HttpsURLConnection) when used with the Negotiate (SPNEGO, Kerberos) > authentication scheme. When enabled, the implementation preemptively includes > a CBT with authentication requests over Kerberos. The feature

RFR: 8280459: Suspicious integer division in Hashtable.readHashtable

2022-01-21 Thread Aleksey Shipilev
Found by Sonar. See details in the bug. Additional testing: - [x] Linux x86_64 fastdebug `tier1` - [x] Linux x86_64 fastdebug `java/util/Hashtable` - Commit messages: - Fix Changes: https://git.openjdk.java.net/jdk/pull/7178/files Webrev: https://webrevs.openjdk.java.net/?repo=j

Re: RFR: 8279842: HTTPS Channel Binding support for Java GSS/Kerberos [v3]

2022-01-21 Thread Daniel Fuchs
On Fri, 21 Jan 2022 15:08:58 GMT, Michael McMahon wrote: >> It was being handled elsewhere as "never". But, I agree it would be clearer >> to normalise it to "never" here. > > Sorry, I should have checked back to the source rather than the snippet > quoted. The problem is that the logError call

Re: RFR: 8279842: HTTPS Channel Binding support for Java GSS/Kerberos [v4]

2022-01-21 Thread Daniel Fuchs
On Fri, 21 Jan 2022 15:26:33 GMT, Michael McMahon wrote: >> Hi, >> >> This change adds Channel Binding Token (CBT) support to HTTPS >> (java.net.HttpsURLConnection) when used with the Negotiate (SPNEGO, >> Kerberos) authentication scheme. When enabled, the implementation >> preemptively inclu

Re: RFR: 8279842: HTTPS Channel Binding support for Java GSS/Kerberos [v4]

2022-01-21 Thread Daniel Fuchs
On Fri, 21 Jan 2022 15:26:33 GMT, Michael McMahon wrote: >> Hi, >> >> This change adds Channel Binding Token (CBT) support to HTTPS >> (java.net.HttpsURLConnection) when used with the Negotiate (SPNEGO, >> Kerberos) authentication scheme. When enabled, the implementation >> preemptively inclu

RFR: 8240908: RetransformClass does not know about MethodParameters attribute

2022-01-21 Thread Alex Menkov
Changes: - ClassFileReconstituter is updated to restore "MethodParameters" attribute; - handling of the attribute in VM_RedefineClasses is moved to be consistent with other code (like local variable table); - copied ClassTransformer class (from test/jdk/com/sun/jdi/lib/jdb) to /test/lib as it's u

Re: RFR: 8279842: HTTPS Channel Binding support for Java GSS/Kerberos [v3]

2022-01-21 Thread Michael McMahon
On Fri, 21 Jan 2022 13:39:06 GMT, Michael Osipov wrote: >> Actually, it turns out I should be throwing `NamingException` here. That is >> what was being thrown by `TlsChannelBinding.parseType` before and an >> existing test was expecting that. NamingException only takes a String >> message. So

Re: RFR: 8279842: HTTPS Channel Binding support for Java GSS/Kerberos [v5]

2022-01-21 Thread Michael McMahon
> Hi, > > This change adds Channel Binding Token (CBT) support to HTTPS > (java.net.HttpsURLConnection) when used with the Negotiate (SPNEGO, Kerberos) > authentication scheme. When enabled, the implementation preemptively includes > a CBT with authentication requests over Kerberos. The feature

Re: RFR: 8279842: HTTPS Channel Binding support for Java GSS/Kerberos [v3]

2022-01-21 Thread Michael Osipov
On Fri, 21 Jan 2022 15:51:10 GMT, Michael McMahon wrote: >> `NamingException` has `setRootCause()`. Why not use that? I use that one too >> and full stack is retained. > > Yes, I can do that. Though it will cause the existing LDAP channel binding > test to fail which is checking for an empty ro

Re: RFR: 8280166: Extend java/lang/instrument/GetObjectSizeIntrinsicsTest.java test cases [v2]

2022-01-21 Thread Leonid Mesnik
On Fri, 21 Jan 2022 11:04:26 GMT, Aleksey Shipilev wrote: >> While working on JDK-8280003, I noticed that >> java/lang/instrument/GetObjectSizeIntrinsicsTest.java does not test arrays >> with more than 1-byte size elements, and no large arrays (past 4G limit) are >> tested either. It would be

Re: RFR: 8280459: Suspicious integer division in Hashtable.readHashtable

2022-01-21 Thread Roger Riggs
On Fri, 21 Jan 2022 15:19:38 GMT, Aleksey Shipilev wrote: > Found by Sonar. See details in the bug. > > Additional testing: > - [x] Linux x86_64 fastdebug `tier1` > - [x] Linux x86_64 fastdebug `java/util/Hashtable` LGTM. Seems reasonable though it might increase heap allocation of the array

RFR: 8280470: Confusing instanceof check in HijrahChronology.range

2022-01-21 Thread Andrey Turbanov
Parameter `ChronoField field` is checked by `if (field instanceof ChronoField)`. Such check is confusing, because only one case, when this could be `false` is when `field == null`. But if condition is not satisfied we will get immediate NullPointerException anyway in `return field.range();`. --

Re: RFR: JDK-8277795: ldap connection timeout not honoured under contention [v3]

2022-01-21 Thread Mark Sheppard
On Fri, 21 Jan 2022 13:02:36 GMT, Rob McKenna wrote: >> Well I guess the request was "why not use long everywhere to avoid casting >> to int" ;-) >> But I'm happy with either too - as long as the place where you have a long >> (e.g obtained by substracting two nano times) and call a method that

Re: RFR: 8280470: Confusing instanceof check in HijrahChronology.range

2022-01-21 Thread Roger Riggs
On Mon, 17 Jan 2022 21:02:35 GMT, Andrey Turbanov wrote: > Parameter `ChronoField field` is checked by `if (field instanceof > ChronoField)`. Such check is confusing, because only one case, when this > could be `false` is when `field == null`. > But if condition is not satisfied we will get imm

Re: RFR: JDK-8277795: ldap connection timeout not honoured under contention [v4]

2022-01-21 Thread Daniel Fuchs
On Fri, 21 Jan 2022 13:06:40 GMT, Rob McKenna wrote: >> This fix attemps to resolve an issue where threads can stack up on each >> other while waiting to get a connection from the ldap pool to an unreachable >> server. It does this by having each thread start a countdown prior to >> holding th

Re: RFR: 8280470: Confusing instanceof check in HijrahChronology.range

2022-01-21 Thread Naoto Sato
On Mon, 17 Jan 2022 21:02:35 GMT, Andrey Turbanov wrote: > Parameter `ChronoField field` is checked by `if (field instanceof > ChronoField)`. Such check is confusing, because only one case, when this > could be `false` is when `field == null`. > But if condition is not satisfied we will get imm

Re: RFR: 8279842: HTTPS Channel Binding support for Java GSS/Kerberos [v5]

2022-01-21 Thread Daniel Fuchs
On Fri, 21 Jan 2022 16:02:29 GMT, Michael McMahon wrote: >> Hi, >> >> This change adds Channel Binding Token (CBT) support to HTTPS >> (java.net.HttpsURLConnection) when used with the Negotiate (SPNEGO, >> Kerberos) authentication scheme. When enabled, the implementation >> preemptively inclu

Re: RFR: 8280470: Confusing instanceof check in HijrahChronology.range

2022-01-21 Thread Daniel Fuchs
On Mon, 17 Jan 2022 21:02:35 GMT, Andrey Turbanov wrote: > Parameter `ChronoField field` is checked by `if (field instanceof > ChronoField)`. Such check is confusing, because only one case, when this > could be `false` is when `field == null`. > But if condition is not satisfied we will get imm

Re: RFR: 8280470: Confusing instanceof check in HijrahChronology.range

2022-01-21 Thread Iris Clark
On Mon, 17 Jan 2022 21:02:35 GMT, Andrey Turbanov wrote: > Parameter `ChronoField field` is checked by `if (field instanceof > ChronoField)`. Such check is confusing, because only one case, when this > could be `false` is when `field == null`. > But if condition is not satisfied we will get imm

[jdk18] RFR: JDK-8279179: Update nroff pages in JDK 18 before RC

2022-01-21 Thread Jonathan Gibbons
Please review this semi-automated update to the nroff man pages from the upstream repo. - Commit messages: - JDK-8279179: Update nroff pages in JDK 18 before RC Changes: https://git.openjdk.java.net/jdk18/pull/112/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk18&pr=112&r

Re: RFR: 8280459: Suspicious integer division in Hashtable.readHashtable

2022-01-21 Thread Brian Burkhalter
On Fri, 21 Jan 2022 15:19:38 GMT, Aleksey Shipilev wrote: > Found by Sonar. See details in the bug. > > Additional testing: > - [x] Linux x86_64 fastdebug `tier1` > - [x] Linux x86_64 fastdebug `java/util/Hashtable` Marked as reviewed by bpb (Reviewer). - PR: https://git.openjdk

RFR: 8280474: Garbage value passed to getLocaleInfoWrapper in HostLocaleProviderAdapter_md

2022-01-21 Thread Daniel Jeliński
Reported by clang-tidy. Verified manually by running Calendar c = Calendar.getInstance(); System.out.println (c.getDisplayNames(Calendar.MONTH, Calendar.SHORT_STANDALONE, Locale.getDefault())); with `-Djava.locale.providers=HOST` Without the fix the WINAPI functions fail, and [t

Re: RFR: 8279842: HTTPS Channel Binding support for Java GSS/Kerberos [v5]

2022-01-21 Thread Weijun Wang
On Fri, 21 Jan 2022 16:02:29 GMT, Michael McMahon wrote: >> Hi, >> >> This change adds Channel Binding Token (CBT) support to HTTPS >> (java.net.HttpsURLConnection) when used with the Negotiate (SPNEGO, >> Kerberos) authentication scheme. When enabled, the implementation >> preemptively inclu

Re: RFR: 8279842: HTTPS Channel Binding support for Java GSS/Kerberos [v5]

2022-01-21 Thread Weijun Wang
On Fri, 21 Jan 2022 16:02:29 GMT, Michael McMahon wrote: >> Hi, >> >> This change adds Channel Binding Token (CBT) support to HTTPS >> (java.net.HttpsURLConnection) when used with the Negotiate (SPNEGO, >> Kerberos) authentication scheme. When enabled, the implementation >> preemptively inclu

Re: [jdk18] RFR: JDK-8279179: Update nroff pages in JDK 18 before RC

2022-01-21 Thread Iris Clark
On Fri, 21 Jan 2022 18:37:50 GMT, Jonathan Gibbons wrote: > Please review this semi-automated update to the nroff man pages from the > upstream repo. Marked as reviewed by iris (Reviewer). - PR: https://git.openjdk.java.net/jdk18/pull/112

Re: RFR: 8280474: Garbage value passed to getLocaleInfoWrapper in HostLocaleProviderAdapter_md

2022-01-21 Thread Naoto Sato
On Fri, 21 Jan 2022 19:28:21 GMT, Daniel Jeliński wrote: > Reported by clang-tidy. Verified manually by running > > Calendar c = Calendar.getInstance(); > System.out.println (c.getDisplayNames(Calendar.MONTH, > Calendar.SHORT_STANDALONE, Locale.getDefault())); > > with `-Djava.

Re: [jdk18] RFR: JDK-8279179: Update nroff pages in JDK 18 before RC

2022-01-21 Thread Mandy Chung
On Fri, 21 Jan 2022 18:37:50 GMT, Jonathan Gibbons wrote: > Please review this semi-automated update to the nroff man pages from the > upstream repo. Marked as reviewed by mchung (Reviewer). - PR: https://git.openjdk.java.net/jdk18/pull/112

Re: Additional Date-Time Formats

2022-01-21 Thread Naoto Sato
Thanks, Joe. Good point. I will elaborate the pattern template part more, less depending on the LDML spec. Would have been better if we could introduce our own, such as ofLocalizedPattern(Set template), but not exactly suffices the need. Naoto On 1/20/22 9:52 PM, Joe Wang wrote: Hi Naoto

RFR: 8280377: MethodHandleProxies does not correctly invoke default methods with varags

2022-01-21 Thread Mandy Chung
The MethodHandle of a default method should be made as a fixed arity method handle because it is invoked via Proxy's invocation handle with a non-vararg array of arguments. On the other hand, the `InvocationHandle::invokeDefault` method was added in Java 16 to invoke a default method of a prox

Re: RFR: 8280377: MethodHandleProxies does not correctly invoke default methods with varags

2022-01-21 Thread liach
On Fri, 21 Jan 2022 22:49:38 GMT, Mandy Chung wrote: > The MethodHandle of a default method should be made as a fixed arity method > handle because it is invoked via Proxy's invocation handle with a non-vararg > array of arguments. On the other hand, the `InvocationHandle::invokeDefault` > me

[jdk18] Integrated: JDK-8279179: Update nroff pages in JDK 18 before RC

2022-01-21 Thread Jonathan Gibbons
On Fri, 21 Jan 2022 18:37:50 GMT, Jonathan Gibbons wrote: > Please review this semi-automated update to the nroff man pages from the > upstream repo. This pull request has now been integrated. Changeset: 7d2ef9d9 Author:Jonathan Gibbons URL: https://git.openjdk.java.net/jdk18/commi

Re: RFR: 8280377: MethodHandleProxies does not correctly invoke default methods with varags

2022-01-21 Thread Mandy Chung
On Fri, 21 Jan 2022 23:16:50 GMT, liach wrote: > Will older versions up to Java 8 get an alternative fix (changing the > accessed handle to non-vararg) too? This is up to the update release maintainers to decide. The backport fix is straight-forward. I include that in the JBS report. -

Re: RFR: 8261407: ReflectionFactory.checkInitted() is not thread-safe [v3]

2022-01-21 Thread liach
> Upon review of [8261407](https://bugs.openjdk.java.net/browse/JDK-8261407), > by design, duplicate initialization of ReflectionFactory should be safe as it > performs side-effect-free property read actions, and the suggesting of making > the `initted` field volatile cannot prevent concurrent i

Re: RFR: 8261407: ReflectionFactory.checkInitted() is not thread-safe [v4]

2022-01-21 Thread liach
> Upon review of [8261407](https://bugs.openjdk.java.net/browse/JDK-8261407), > by design, duplicate initialization of ReflectionFactory should be safe as it > performs side-effect-free property read actions, and the suggesting of making > the `initted` field volatile cannot prevent concurrent i

Re: RFR: 8261407: ReflectionFactory.checkInitted() is not thread-safe [v3]

2022-01-21 Thread liach
On Fri, 21 Jan 2022 23:51:02 GMT, liach wrote: >> Upon review of [8261407](https://bugs.openjdk.java.net/browse/JDK-8261407), >> by design, duplicate initialization of ReflectionFactory should be safe as >> it performs side-effect-free property read actions, and the suggesting of >> making the

Re: RFR: JDK-8277795: ldap connection timeout not honoured under contention [v4]

2022-01-21 Thread Aleksei Efimov
On Fri, 21 Jan 2022 13:06:40 GMT, Rob McKenna wrote: >> This fix attemps to resolve an issue where threads can stack up on each >> other while waiting to get a connection from the ldap pool to an unreachable >> server. It does this by having each thread start a countdown prior to >> holding th