Integrated: 8280531: Remove unused DeferredCloseInputStream

2022-01-25 Thread Andrey Turbanov
On Tue, 18 Jan 2022 20:51:06 GMT, Andrey Turbanov wrote: > Class DeferredCloseInputStream is unused since removing of Solaris support > https://github.com/openjdk/jdk/blob/9fe4b69c1a1120e1d761730495c3cfac8f179d13/src/java.base/unix/classes/java/lang/ProcessImpl.java#L80-L81 This pull request has

Re: RFR: 8278753: Runtime crashes with access violation during JNI_CreateJavaVM call

2022-01-25 Thread Thomas Stuefe
On Tue, 25 Jan 2022 17:22:54 GMT, Yumin Qi wrote: >> I'm curious, under what circumstances would, before >> https://bugs.openjdk.java.net/browse/JDK-8237750, we ever hit the >> LoadLibrary in imageDecompressor.cpp? Did this ever work? Was there ever a >> scenario where the JVM was not involved

RFR: JDK-8280550: SplittableRandom#nextDouble(double,double) can return result >= bound

2022-01-25 Thread Joe Darcy
Use floating-point library methods to nudge down the result if needed. The nextAfter(r, origin) call return the next value in the direction of origin, handling cases for negative values, etc. Changing to call nextDown for the origin is bounded at zero is just a refactoring that is clearer to re

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

2022-01-25 Thread Mandy Chung
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: 8280592: Small javadoc tweaks to foreign API

2022-01-25 Thread Maurizio Cimadamore
On Tue, 25 Jan 2022 15:22:30 GMT, Maurizio Cimadamore wrote: > This patch fixes some inconsistencies in the foreign API javadoc. The main > fix is to make javadoc of all predicate methods consistent, and to use the > `@return` tag where appropriate, as to avoid duplication. > > There were als

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

2022-01-25 Thread Mandy Chung
On Wed, 26 Jan 2022 00:06:25 GMT, liach wrote: > They will probably accept a MethodHandles.Lookup object to define a class for > such a single-interface instance plus calling the default methods beyond the > restrictions. Yes, that's one option. Such library should take a Lookup parameter to

RFR: 8279598: Provide adapter from RandomGenerator to Random

2022-01-25 Thread Yasser Bazzi
Hi, could i get a review on this implementation proposed by Stuart Marks, i decided to use the https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/random/RandomGenerator.html interface to create the default method `asRandom()` that wraps around the newer algorithms to be used

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

2022-01-25 Thread Vicente Romero
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-8270476: Make floating-point test infrastructure more lambda and method reference friendly [v2]

2022-01-25 Thread Joe Darcy
> Update the java.lang.{Math, StrictMath} regression test helper library to > accept method references. This allows the test programs to be DRY-er as the > inputs to the method under test don't have to be repeated. The float test > method were not updated due to limitations in type inference if

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

2022-01-25 Thread liach
On Tue, 25 Jan 2022 22:01:22 GMT, Johannes Kuhn wrote: > My question was for when a library wants to implement something similar to > `MethodHandleProxies.asInterfaceInstace`, and for example supports Interfaces > with more than a single abstract method. Currently, such a library would also >

Re: Additional Date-Time Formats

2022-01-25 Thread Joe Wang
Hi Naoto, Looks good to me, and thanks for the explanation. I agree, AIOOBE would be a separate bug with ofPattern. Thanks, Joe On 1/25/22 2:30 PM, Naoto Sato wrote: Hi Joe, On 1/24/22 5:50 PM, Joe Wang wrote:     The 2nd and 3rd statements defined the requestedTemplate, does it imply

Re: Additional Date-Time Formats

2022-01-25 Thread Naoto Sato
Hi Joe, On 1/24/22 5:50 PM, Joe Wang wrote:    The 2nd and 3rd statements defined the requestedTemplate, does it imply the characters listed in the snippet are the only ones that are valid, in other words, can other characters under the Patterns section be used? It may be helpful to elabo

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

2022-01-25 Thread Johannes Kuhn
On Tue, 25 Jan 2022 21:35:27 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

RFR: JDK-8270476: Make floating-point test infrastructure more lambda and method reference friendly

2022-01-25 Thread Joe Darcy
Update the java.lang.{Math, StrictMath} regression test helper library to accept method references. This allows the test programs to be DRY-er as the inputs to the method under test don't have to be repeated. The float test method were not updated due to limitations in type inference if both flo

Re: [jdk18] RFR: 8280592: Small javadoc tweaks to foreign API

2022-01-25 Thread Maurizio Cimadamore
On Tue, 25 Jan 2022 17:00:34 GMT, Paul Sandoz wrote: >> This patch fixes some inconsistencies in the foreign API javadoc. The main >> fix is to make javadoc of all predicate methods consistent, and to use the >> `@return` tag where appropriate, as to avoid duplication. >> >> There were also mi

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

2022-01-25 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 o

Re: RFR: 8279488: ProcessBuilder inherits contextClassLoader when spawning a process reaper thread

2022-01-25 Thread Roger Riggs
On Tue, 18 Jan 2022 15:57:58 GMT, Roger Riggs wrote: > The thread factory used to create the process reaper threads unnecessarily > inherits the callers thread context classloader. > The result is retention of the class loader. > > The thread factory used for the pool of process reaper threads

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

2022-01-25 Thread Alan Bateman
On Tue, 25 Jan 2022 17:20:50 GMT, Mandy Chung wrote: > What about this: Looks okay, main thing is to have it be consistent with the existing methods. - PR: https://git.openjdk.java.net/jdk/pull/7185

Integrated: JDK-8279242: Reflection newInstance() error message when constructor has no access modifiers could use improvement

2022-01-25 Thread Joe Darcy
On Tue, 25 Jan 2022 02:42:45 GMT, Joe Darcy wrote: > Making the exception message friendlier to users. This pull request has now been integrated. Changeset: 295c0474 Author:Joe Darcy URL: https://git.openjdk.java.net/jdk/commit/295c0474c43484e793b67a70af316aaae49fe361 Stats: 19

Re: RFR: JDK-8279242: Reflection newInstance() error message when constructor has no access modifiers could use improvement [v5]

2022-01-25 Thread Joe Darcy
> Making the exception message friendlier to users. Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: Improve formatting. - Changes: - all: https://git.openjdk.java.net/jdk/pull/7208/files - new: https://git.openjdk.java.

Integrated: 8280166: Extend java/lang/instrument/GetObjectSizeIntrinsicsTest.java test cases

2022-01-25 Thread Aleksey Shipilev
On Tue, 18 Jan 2022 18:33:29 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 bett

Integrated: 8280041: Retry loop issues in java.io.ClassCache

2022-01-25 Thread Aleksey Shipilev
On Fri, 14 Jan 2022 19:27:18 GMT, Aleksey Shipilev wrote: > 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

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

2022-01-25 Thread Aleksey Shipilev
On Tue, 25 Jan 2022 16:33:10 GMT, Aleksey Shipilev wrote: >> 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

Re: RFR: JDK-8279242: Reflection newInstance() error message when constructor has no access modifiers could use improvement [v4]

2022-01-25 Thread Mandy Chung
On Tue, 25 Jan 2022 18:25:14 GMT, Joe Darcy wrote: >> Making the exception message friendlier to users. > > Joe Darcy has updated the pull request incrementally with one additional > commit since the last revision: > > Fix typo. Looks good. - Marked as reviewed by mchung (Revie

Re: RFR: JDK-8279242: Reflection newInstance() error message when constructor has no access modifiers could use improvement [v4]

2022-01-25 Thread Iris Clark
On Tue, 25 Jan 2022 18:25:14 GMT, Joe Darcy wrote: >> Making the exception message friendlier to users. > > Joe Darcy has updated the pull request incrementally with one additional > commit since the last revision: > > Fix typo. Marked as reviewed by iris (Reviewer). - PR: http

Re: RFR: JDK-8280373: Update Xalan serializer / SystemIDResolver to align with JDK-8270492 [v3]

2022-01-25 Thread Joe Wang
On Tue, 25 Jan 2022 08:33:21 GMT, Matthias Baesken wrote: >> After 8270492 >> https://github.com/openjdk/jdk/commit/78b2c8419bc69436873e6fc9c542480949d140c5 >> has been pushed, we should adjust >> src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/utils/SystemIDResolver.java >

Re: RFR: JDK-8279242: Reflection newInstance() error message when constructor has no access modifiers could use improvement [v2]

2022-01-25 Thread Joe Darcy
On Tue, 25 Jan 2022 17:10:33 GMT, Mandy Chung wrote: > There is another `newIllegalAccessException(Class memberClass, int > modifiers)` method that also needs to be updated. Updated accordingly and refactored slightly to pull out the string suffix construction into a new method. -

Re: RFR: JDK-8279242: Reflection newInstance() error message when constructor has no access modifiers could use improvement [v4]

2022-01-25 Thread Joe Darcy
> Making the exception message friendlier to users. Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: Fix typo. - Changes: - all: https://git.openjdk.java.net/jdk/pull/7208/files - new: https://git.openjdk.java.net/jdk/pu

Re: RFR: JDK-8279242: Reflection newInstance() error message when constructor has no access modifiers could use improvement [v3]

2022-01-25 Thread Joe Darcy
> Making the exception message friendlier to users. Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: Respond to review feedback. - Changes: - all: https://git.openjdk.java.net/jdk/pull/7208/files - new: https://git.openj

Integrated: JDK-8280168: Add Objects.toIdentityString

2022-01-25 Thread Joe Darcy
On Tue, 18 Jan 2022 23:15:20 GMT, Joe Darcy wrote: > While it is strongly recommend to not use the default toString for a class, > at times it is the least-bad alternative. When that alternative needs to be > used, it would be helpful to have the implementation already available, such > as in

Re: RFR: JDK-8280168: Add Objects.toIdentityString [v8]

2022-01-25 Thread Joe Darcy
> While it is strongly recommend to not use the default toString for a class, > at times it is the least-bad alternative. When that alternative needs to be > used, it would be helpful to have the implementation already available, such > as in Objects.toDefaultString(). This method is analagous t

Re: RFR: 8278753: Runtime crashes with access violation during JNI_CreateJavaVM call

2022-01-25 Thread Yumin Qi
On Tue, 25 Jan 2022 10:29:48 GMT, Thomas Stuefe wrote: > I'm curious, under what circumstances would, before > https://bugs.openjdk.java.net/browse/JDK-8237750, we ever hit the LoadLibrary > in imageDecompressor.cpp? Did this ever work? Was there ever a scenario where > the JVM was not involve

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

2022-01-25 Thread Mandy Chung
On Tue, 25 Jan 2022 14:36:26 GMT, Alan Bateman wrote: >> Mandy Chung has updated the pull request incrementally with one additional >> commit since the last revision: >> >> fix accident argument ordering after edit > > src/java.base/share/classes/jdk/internal/access/JavaLangReflectAccess.java

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

2022-01-25 Thread Roger Riggs
On Tue, 25 Jan 2022 16:33:10 GMT, Aleksey Shipilev wrote: >> 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

Re: RFR: JDK-8279242: Reflection newInstance() error message when constructor has no access modifiers could use improvement [v2]

2022-01-25 Thread Mandy Chung
On Tue, 25 Jan 2022 05:25:12 GMT, Joe Darcy wrote: >> Making the exception message friendlier to users. > > Joe Darcy has updated the pull request incrementally with one additional > commit since the last revision: > > Respond to review feedback. There is another `newIllegalAccessException(C

Re: [jdk18] RFR: 8280592: Small javadoc tweaks to foreign API

2022-01-25 Thread Paul Sandoz
On Tue, 25 Jan 2022 15:22:30 GMT, Maurizio Cimadamore wrote: > This patch fixes some inconsistencies in the foreign API javadoc. The main > fix is to make javadoc of all predicate methods consistent, and to use the > `@return` tag where appropriate, as to avoid duplication. > > There were als

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

2022-01-25 Thread Aleksey Shipilev
On Tue, 25 Jan 2022 16:12:11 GMT, Aleksey Shipilev wrote: > > This looks good, although I don't know whether the additional check for > > strongReferent != null is needed in clearStrong(). This is all racy code > > and you have already got a non-null return from getStrong() in case you are > >

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

2022-01-25 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: 8280166: Extend java/lang/instrument/GetObjectSizeIntrinsicsTest.java test cases [v3]

2022-01-25 Thread Aleksey Shipilev
On Tue, 18 Jan 2022 19:36:18 GMT, Chris Plummer wrote: >> Aleksey Shipilev has updated the pull request with a new target base due to >> a merge or a rebase. The incremental webrev excludes the unrelated changes >> brought in by the merge/rebase. The pull request contains four additional >> co

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

2022-01-25 Thread Aleksey Shipilev
On Tue, 18 Jan 2022 20:07:10 GMT, Roger Riggs wrote: >> 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

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

2022-01-25 Thread Aleksey Shipilev
On Mon, 24 Jan 2022 21:32:16 GMT, Peter Levart wrote: > This looks good, although I don't know whether the additional check for > strongReferent != null is needed in clearStrong(). This is all racy code and > you have already got a non-null return from getStrong() in case you are > calling cle

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

2022-01-25 Thread Mark Sheppard
On Fri, 21 Jan 2022 17:07:37 GMT, Mark Sheppard wrote: >> Good point. I think its better to deal with the casts at the edges since the >> timeout handling will use long by default. > > yes a redeclaration of timeout with a type long across the component would > be a consistent approach, also

[jdk18] RFR: 8280592: Small javadoc tweaks to foreign API

2022-01-25 Thread Maurizio Cimadamore
This patch fixes some inconsistencies in the foreign API javadoc. The main fix is to make javadoc of all predicate methods consistent, and to use the `@return` tag where appropriate, as to avoid duplication. There were also minor fixes in the package-level javadoc (one typo) and in `ValueLayout

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

2022-01-25 Thread Alan Bateman
On Mon, 24 Jan 2022 23:13:24 GMT, Mandy Chung wrote: > To invoke the default method, the caller will need access to the declaring > interface of the default method (via bytecode invocation or reflection). The > bug I had was because java.base (the module of the invocation handler) does > not h

Re: RFR: JDK-8280168: Add Objects.toIdentityString [v7]

2022-01-25 Thread Roger Riggs
On Mon, 24 Jan 2022 21:31:37 GMT, Joe Darcy wrote: >> While it is strongly recommend to not use the default toString for a class, >> at times it is the least-bad alternative. When that alternative needs to be >> used, it would be helpful to have the implementation already available, such >> as

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

2022-01-25 Thread Alan Bateman
On Mon, 24 Jan 2022 23:18:41 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

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

2022-01-25 Thread Michael Osipov
On Tue, 25 Jan 2022 12:47:26 GMT, Michael McMahon wrote: >> src/java.base/share/classes/sun/net/www/http/HttpClient.java line 150: >> >>> 148: * "domain:a,c.d,*.e.f" (sent to host a, or c.d or to the domain >>> e.f and any of its subdomains). This is >>> 149: * a comma separated list

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

2022-01-25 Thread Michael McMahon
On Tue, 25 Jan 2022 11:34:57 GMT, Michael Osipov wrote: >> Michael McMahon has updated the pull request incrementally with one >> additional commit since the last revision: >> >> final review update (pre CSR) > > src/java.base/share/classes/sun/net/www/http/HttpClient.java line 150: > >> 148

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

2022-01-25 Thread Michael Osipov
On Tue, 25 Jan 2022 10:30:20 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: 8266974: duplicate property key in java.sql.rowset resource bundle

2022-01-25 Thread Lance Andersen
On Tue, 25 Jan 2022 10:47:41 GMT, Masanori Yano wrote: > I have removed the duplicate property keys. > Could you please review the fix? Marked as reviewed by lancea (Reviewer). - PR: https://git.openjdk.java.net/jdk/pull/7212

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

2022-01-25 Thread Daniel Fuchs
On Tue, 25 Jan 2022 10:30:20 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: 8266974: duplicate property key in java.sql.rowset resource bundle

2022-01-25 Thread Masanori Yano
I have removed the duplicate property keys. Could you please review the fix? - Commit messages: - 8266974: duplicate property key in java.sql.rowset resource bundle Changes: https://git.openjdk.java.net/jdk/pull/7212/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=7212&

Re: RFR: 8278753: Runtime crashes with access violation during JNI_CreateJavaVM call

2022-01-25 Thread Thomas Stuefe
On Tue, 25 Jan 2022 00:20:19 GMT, Yumin Qi wrote: > Please review, > When jlink with --compress=2, zip is used to compress the files while doing > copy. The user case failed to load zip.dll, since zip.dll is not set in PATH. > This failure is after we get NULL from GetModuleHandle("zip.dll"),

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

2022-01-25 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: JDK-8280373: Update Xalan serializer / SystemIDResolver to align with JDK-8270492 [v3]

2022-01-25 Thread Matthias Baesken
> After 8270492 > https://github.com/openjdk/jdk/commit/78b2c8419bc69436873e6fc9c542480949d140c5 > has been pushed, we should adjust > src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/utils/SystemIDResolver.java > getAbsoluteURI to what has been done in 8270492 to > src/java

Re: RFR: JDK-8280373: Update Xalan serializer / SystemIDResolver to align with JDK-8270492

2022-01-25 Thread Matthias Baesken
On Thu, 20 Jan 2022 23:32:33 GMT, Joe Wang wrote: > Thanks Alan for the reminder. The change looks good. Please add a copyright > header and the LastModified tag as the other class did. Hi, I added the header and LastModified. Best regards, Matthias - PR: https://git.openjdk.java.

Re: RFR: JDK-8280373: Update Xalan serializer / SystemIDResolver to align with JDK-8270492 [v2]

2022-01-25 Thread Matthias Baesken
> After 8270492 > https://github.com/openjdk/jdk/commit/78b2c8419bc69436873e6fc9c542480949d140c5 > has been pushed, we should adjust > src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/utils/SystemIDResolver.java > getAbsoluteURI to what has been done in 8270492 to > src/java

Re: RFR: JDK-8280168: Add Objects.toIdentityString [v7]

2022-01-25 Thread Alan Bateman
On Mon, 24 Jan 2022 21:31:37 GMT, Joe Darcy wrote: >> While it is strongly recommend to not use the default toString for a class, >> at times it is the least-bad alternative. When that alternative needs to be >> used, it would be helpful to have the implementation already available, such >> as

Integrated: 8280470: Confusing instanceof check in HijrahChronology.range

2022-01-25 Thread Andrey Turbanov
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