Re: RFR: 8314759: VirtualThread.parkNanos timeout adjustment when pinned should be replaced

2023-08-23 Thread Andrey Turbanov
On Wed, 23 Aug 2023 16:41:23 GMT, Alan Bateman wrote: > If yielding fails due to the pinning then VirtualThread.parkNanos parks on > the carrier thread with the remaining time. The calculation of the remaining > time needs to be replaced so that it obviously uses the difference between > the s

RFR: 8314759: VirtualThread.parkNanos timeout adjustment when pinned should be replaced

2023-08-23 Thread Alan Bateman
If yielding fails due to the pinning then VirtualThread.parkNanos parks on the carrier thread with the remaining time. The calculation of the remaining time needs to be replaced so that it obviously uses the difference between the start and end time in the calculation. The current code isn't cor

Re: RFR: 4799358: BufferOutputStream.write() should immediately throw IOExcept on closed stream [v2]

2023-08-23 Thread Alan Bateman
On Thu, 24 Aug 2023 04:24:21 GMT, Vyom Tewari wrote: > I am unable to understand how proposed change breaks longstanding > behavior(what behavior). With current implementation if the underline stream > is closed ‘BufferedOutputStream.write’ will throw IOException when the > internal buffer is

Re: RFR: JDK-8314883: Java_java_util_prefs_FileSystemPreferences_lockFile0 write result errno in missing case

2023-08-23 Thread Jaikiran Pai
On Wed, 23 Aug 2023 13:45:14 GMT, Matthias Baesken wrote: > There seems to be a codepath in > Java_java_util_prefs_FileSystemPreferences_lockFile0 where the errno is not > stored but potentially accessed in the calling Java code. The change looks OK to me. Please wait for another review from

Re: RFR: 8314483: Optionally override copyright header in generated source

2023-08-23 Thread David Holmes
On Fri, 18 Aug 2023 14:22:49 GMT, Erik Joelsson wrote: > In the JDK build we have various build tools that generate source code from > data files. For most of these tools, the source files are based on template > files, which already have copyright headers, but for some, the complete > source

Re: RFR: 8311220: Optimization for StringLatin UpperLower [v3]

2023-08-23 Thread 温绍锦
On Thu, 6 Jul 2023 05:20:14 GMT, 温绍锦 wrote: >> # Benchmark Result >> >> >> sh make/devkit/createJMHBundle.sh >> bash configure --with-jmh=build/jmh/jars >> make test TEST="micro:java.lang.StringUpperLower.*" >> >> >> >> ## 1. >> [aliyun_ecs_c8i.xlarge](https://help.aliyun.com/document_detai

Re: RFR: 4799358: BufferOutputStream.write() should immediately throw IOExcept on closed stream [v2]

2023-08-23 Thread Vyom Tewari
On Wed, 23 Aug 2023 21:54:31 GMT, Brian Burkhalter wrote: > The proposed change does not appear to add a great deal of value and breaks > longstanding behavior. In such cases, the preferred approach is usually to > modify the specification to match the current, albeit incorrect, behavior > rat

Re: RFR: 8314236: Overflow in Collections.rotate [v4]

2023-08-23 Thread Stuart Marks
On Thu, 17 Aug 2023 10:54:07 GMT, Nikita Sakharin wrote: >> `Collections.rotate` method contains a bug. This method throws >> IndexOutOfBoundsException on arrays larger than $2^{30}$ elements. The way >> to reproduce: >> >> final int size = (1 << 30) + 1; >> final List list = new ArrayList<>(s

Re: RFR: 8314063 : The socket is not closed in Connection::createSocket when the handshake failed for LDAP connection [v10]

2023-08-23 Thread Weibing Xiao
On Tue, 22 Aug 2023 18:21:17 GMT, Weibing Xiao wrote: >> Please refer to JDK-8314063. >> >> The failure scenario is due to the setting of connection timeout. It is >> either too small or not an optimal value for the system. When the client >> tries to connect to the server with LDAPs protocol.

Re: RFR: 8314063 : The socket is not closed in Connection::createSocket when the handshake failed for LDAP connection [v11]

2023-08-23 Thread Weibing Xiao
> Please refer to JDK-8314063. > > The failure scenario is due to the setting of connection timeout. It is > either too small or not an optimal value for the system. When the client > tries to connect to the server with LDAPs protocol. It requires the handshake > after the socket is created and

Re: [External] : Re: RFR: 8308042: [macos] Developer ID Application Certificate not picked up by jpackage if it contains UNICODE characters

2023-08-23 Thread Michael Hall
>>> >> >> Assuming code sign will catch the errors discussed or even not. >> >> Would it make sense to do post validation of the entire app after completion? > > Good point, but I am not sure if we should be doing this. > > Thanks, > Alexander I’m not quite following that. The spctl mayb

Re: RFR: 8268829: Provide an optimized way to walk the stack with Class object only [v4]

2023-08-23 Thread Mandy Chung
On Wed, 23 Aug 2023 20:27:38 GMT, Mandy Chung wrote: >> 8268829: Provide an optimized way to walk the stack with Class object only >> >> `StackWalker::walk` creates one `StackFrame` per frame and the current >> implementation >> allocates one `StackFrameInfo` and one `MemberName` objects per fr

Re: [External] : Re: RFR: 8308042: [macos] Developer ID Application Certificate not picked up by jpackage if it contains UNICODE characters

2023-08-23 Thread Alexander Matveev
Hi Michael, On Aug 22, 2023, at 11:33 PM, Michael Hall mailto:mik3h...@gmail.com>> wrote: On Aug 22, 2023, at 9:40 PM, Alan Snyder mailto:javali...@cbfiddle.com>> wrote: On Aug 22, 2023, at 4:42 PM, Alexander Matveev mailto:alexander.matv...@oracle.com>> wrote: Hi Alan, On Aug 22, 2023,

Re: [External] : Re: RFR: 8308042: [macos] Developer ID Application Certificate not picked up by jpackage if it contains UNICODE characters

2023-08-23 Thread Alexander Matveev
Hi Alan, On Aug 22, 2023, at 7:40 PM, Alan Snyder mailto:javali...@cbfiddle.com>> wrote: On Aug 22, 2023, at 4:42 PM, Alexander Matveev mailto:alexander.matv...@oracle.com>> wrote: Hi Alan, On Aug 22, 2023, at 3:35 PM, Alan Snyder mailto:javali...@cbfiddle.com>> wrote: I’m confused by thi

Re: RFR: 4799358: BufferOutputStream.write() should immediately throw IOExcept on closed stream [v2]

2023-08-23 Thread Brian Burkhalter
On Wed, 23 Aug 2023 22:11:06 GMT, Lance Andersen wrote: >> test/jdk/java/io/BufferedOutputStream/WriteAfterClose.java line 61: >> >>> 59: public static void main(String argv[]) throws IOException { >>> 60: var file = new File(System.getProperty("test.dir", "."), >>> "test.txt"); >>>

Re: RFR: 4799358: BufferOutputStream.write() should immediately throw IOExcept on closed stream [v2]

2023-08-23 Thread Lance Andersen
On Wed, 23 Aug 2023 21:46:34 GMT, Brian Burkhalter wrote: >> Vyom Tewari has updated the pull request incrementally with one additional >> commit since the last revision: >> >> make the isOpen method to package private > > test/jdk/java/io/BufferedOutputStream/WriteAfterClose.java line 61: >

Re: RFR: 8314544: Matrix multiple benchmark using Vector API [v2]

2023-08-23 Thread Paul Sandoz
On Mon, 21 Aug 2023 03:55:42 GMT, Martin Stypinski wrote: >> Added a bunch of different implementations for Vector API Matrix >> Multiplications: >> >> - Baseline >> - Blocked (Cache Local) >> - FMA >> - Vector API Simple Implementation >> - Vector API Blocked Implementation >> >> Commit was d

Re: RFR: 4799358: BufferOutputStream.write() should immediately throw IOExcept on closed stream [v2]

2023-08-23 Thread Brian Burkhalter
On Wed, 23 Aug 2023 15:01:06 GMT, Vyom Tewari wrote: >> With the current implementation of BufferedOutputStream if you close the >> stream and try to write to the closed stream BufferedOutputStream does not >> throw an IOException until the internal buffer is full. To fix this issue i >> adde

Re: RFR: 4799358: BufferOutputStream.write() should immediately throw IOExcept on closed stream [v2]

2023-08-23 Thread Brian Burkhalter
On Wed, 23 Aug 2023 15:01:06 GMT, Vyom Tewari wrote: >> With the current implementation of BufferedOutputStream if you close the >> stream and try to write to the closed stream BufferedOutputStream does not >> throw an IOException until the internal buffer is full. To fix this issue i >> adde

Re: RFR: 4799358: BufferOutputStream.write() should immediately throw IOExcept on closed stream [v2]

2023-08-23 Thread Brian Burkhalter
On Wed, 23 Aug 2023 15:01:06 GMT, Vyom Tewari wrote: >> With the current implementation of BufferedOutputStream if you close the >> stream and try to write to the closed stream BufferedOutputStream does not >> throw an IOException until the internal buffer is full. To fix this issue i >> adde

Re: RFR: 8268829: Provide an optimized way to walk the stack with Class object only [v4]

2023-08-23 Thread Coleen Phillimore
On Wed, 23 Aug 2023 20:27:38 GMT, Mandy Chung wrote: >> 8268829: Provide an optimized way to walk the stack with Class object only >> >> `StackWalker::walk` creates one `StackFrame` per frame and the current >> implementation >> allocates one `StackFrameInfo` and one `MemberName` objects per fr

Re: Integrated: 8308042: [macos] Developer ID Application Certificate not picked up by jpackage if it contains UNICODE characters

2023-08-23 Thread Alan Snyder
What’s the point of reviewing if the reviews are ignored? > On Aug 23, 2023, at 1:25 PM, Alexander Matveev wrote: > > On Tue, 22 Aug 2023 21:59:50 GMT, Alexander Matveev > wrote: > >> - Added support for certificates with UNICODE characters. >> - Added new approach to find certificate using

Integrated: 8314734: Remove unused field TypeVariableImpl.EMPTY_ANNOTATION_ARRAY

2023-08-23 Thread Andrey Turbanov
On Tue, 22 Aug 2023 06:57:23 GMT, Andrey Turbanov wrote: > Field is unused since > [JDK-8004698](https://bugs.openjdk.org/browse/JDK-8004698) - > https://github.com/openjdk/jdk/commit/b29b4794613a2aca125c2a6e9f8ed1d0f01a4ce2#diff-2b6035b7134d61a89cfee1ad7bdc1bf21ce37421358375d6399de950c17c0c8e

Re: RFR: 8268829: Provide an optimized way to walk the stack with Class object only [v3]

2023-08-23 Thread Mandy Chung
On Wed, 23 Aug 2023 18:12:15 GMT, Daniel Fuchs wrote: >> Mandy Chung has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 16 commits: >> >> - Replace NO_METHOD_INFO option with StackWalker.Kind enums >> - Merge branch 'master' of htt

Re: RFR: 8268829: Provide an optimized way to walk the stack with Class object only [v4]

2023-08-23 Thread Mandy Chung
> 8268829: Provide an optimized way to walk the stack with Class object only > > `StackWalker::walk` creates one `StackFrame` per frame and the current > implementation > allocates one `StackFrameInfo` and one `MemberName` objects per frame. Some > frameworks > like logging may only interest in

Integrated: 8308042: [macos] Developer ID Application Certificate not picked up by jpackage if it contains UNICODE characters

2023-08-23 Thread Alexander Matveev
On Tue, 22 Aug 2023 21:59:50 GMT, Alexander Matveev wrote: > - Added support for certificates with UNICODE characters. > - Added new approach to find certificate using "security" and "openssl" > commands. Just "security" does not works, since it can truncate certificates > name. "security" is

Re: RFE: Refactor java.util.Optional and add NonNull checks

2023-08-23 Thread Roger Riggs
Hi, Also, Null checks in the VM are very cheap, likely cheaper than a virtual dispatch. Adding calls to requireNonNull is almost always a no-op, except for adding a variable name to the exception it still throws NPE. A frequently used class like Optional will be compiled to machine code and t

Re: RFR: 8268829: Provide an optimized way to walk the stack with Class object only [v3]

2023-08-23 Thread Daniel Fuchs
On Tue, 22 Aug 2023 19:01:53 GMT, Mandy Chung wrote: >> 8268829: Provide an optimized way to walk the stack with Class object only >> >> `StackWalker::walk` creates one `StackFrame` per frame and the current >> implementation >> allocates one `StackFrameInfo` and one `MemberName` objects per fr

Re: RFR: 8314063 : The socket is not closed in Connection::createSocket when the handshake failed for LDAP connection [v10]

2023-08-23 Thread Mark Sheppard
On Tue, 22 Aug 2023 18:21:17 GMT, Weibing Xiao wrote: >> Please refer to JDK-8314063. >> >> The failure scenario is due to the setting of connection timeout. It is >> either too small or not an optimal value for the system. When the client >> tries to connect to the server with LDAPs protocol.

Re: RFR: 8308042: [macos] Developer ID Application Certificate not picked up by jpackage if it contains UNICODE characters

2023-08-23 Thread Alexey Semenyuk
On Tue, 22 Aug 2023 21:59:50 GMT, Alexander Matveev wrote: > - Added support for certificates with UNICODE characters. > - Added new approach to find certificate using "security" and "openssl" > commands. Just "security" does not works, since it can truncate certificates > name. "security" is

Re: RFR: 8314263: Signed jars triggering Logger finder recursion and StackOverflowError

2023-08-23 Thread Daniel Fuchs
On Wed, 23 Aug 2023 15:41:16 GMT, Sean Coffey wrote: > Recursive initialization calls possible during loading of LoggerFinder > service. > > This fix detects the recursive call and returns a temporary LoggerFinder that > is backed by a lazy logger. Automated test case developed to simulate l

Re: RFR: 8314263: Signed jars triggering Logger finder recursion and StackOverflowError

2023-08-23 Thread Daniel Fuchs
On Wed, 23 Aug 2023 17:15:03 GMT, Daniel Fuchs wrote: >> Recursive initialization calls possible during loading of LoggerFinder >> service. >> >> This fix detects the recursive call and returns a temporary LoggerFinder >> that is backed by a lazy logger. Automated test case developed to simu

Re: RFR: 8314063 : The socket is not closed in Connection::createSocket when the handshake failed for LDAP connection [v10]

2023-08-23 Thread Aleksei Efimov
On Tue, 22 Aug 2023 18:21:17 GMT, Weibing Xiao wrote: >> Please refer to JDK-8314063. >> >> The failure scenario is due to the setting of connection timeout. It is >> either too small or not an optimal value for the system. When the client >> tries to connect to the server with LDAPs protocol.

Re: RFE: Refactor java.util.Optional and add NonNull checks

2023-08-23 Thread Remi Forax
Sorry, you can not do that. Optional is a value based class [1] (see the javadoc) so the class has to be final. And more generally, the API of a classes of OpenJDK will not change based on some stylistic issue, OOP or not. regards, Rémi Forax [1] https://docs.oracle.com/en/java/javase/20

RFR: 8314263: Signed jars triggering Logger finder recursion and StackOverflowError

2023-08-23 Thread Sean Coffey
Recursive initialization calls possible during loading of LoggerFinder service. This fix detects the recursive call and returns a temporary LoggerFinder that is backed by a lazy logger. Automated test case developed to simulate loading of an external LoggerFinder service while also having oth

Re: RFR: 8268829: Provide an optimized way to walk the stack with Class object only [v3]

2023-08-23 Thread Brent Christian
On Tue, 22 Aug 2023 19:01:53 GMT, Mandy Chung wrote: >> 8268829: Provide an optimized way to walk the stack with Class object only >> >> `StackWalker::walk` creates one `StackFrame` per frame and the current >> implementation >> allocates one `StackFrameInfo` and one `MemberName` objects per fr

Re: RFR: JDK-8313764: Offer JVM HS functionality to shared lib load operations done by the JDK codebase [v2]

2023-08-23 Thread Matthias Baesken
> Currently there is a number of functionality that would be interesting to > have for shared lib load operations in the JDK C code. > Some examples : > Events::log_dll_message for hs-err files reporting > JFR event NativeLibraryLoad > There is the need to update the shared lib Cache on AIX ( see

Re: RFR: 4799358: BufferOutputStream.write() should immediately throw IOExcept on closed stream [v2]

2023-08-23 Thread Vyom Tewari
> With the current implementation of BufferedOutputStream if you close the > stream and try to write to the closed stream BufferedOutputStream does not > throw an IOException until the internal buffer is full. To fix this issue i > added a private "ensureOpen" function to BufferedOutputStream

Withdrawn: 8294977: Convert test/jdk/java tests from ASM library to Classfile API

2023-08-23 Thread duke
On Tue, 14 Mar 2023 02:43:41 GMT, Chen Liang wrote: > Summaries: > 1. A few recommendations about updating the constant API is made at > https://mail.openjdk.org/pipermail/classfile-api-dev/2023-March/000233.html > and I may update this patch shall the API changes be integrated before > 2. One

RFE: Refactor java.util.Optional and add NonNull checks

2023-08-23 Thread Oleksii Kucheruk
Hi there. I have found that `java.util.Optional` is written procedural style and has `ifnonnull` checks in each method. I propose to refactor `Optional` in accordance to OOP-style. This will eliminates all unnecessary `if`-statements, removes duplications and reduces bytecode size more then twice.

RFR: JDK-8314883: Java_java_util_prefs_FileSystemPreferences_lockFile0 write result errno in missing case

2023-08-23 Thread Matthias Baesken
There seems to be a codepath in Java_java_util_prefs_FileSystemPreferences_lockFile0 where the errno is not stored but potentially accessed in the calling Java code. - Commit messages: - JDK-8314883 Changes: https://git.openjdk.org/jdk/pull/15402/files Webrev: https://webrevs.ope

Re: RFR: JDK-8314272: Improve java.util.prefs.BackingStoreException: Couldn't get file lock.

2023-08-23 Thread Alan Bateman
On Wed, 23 Aug 2023 13:02:37 GMT, Matthias Baesken wrote: > This might be the case, but it is a separate issue. This issue is about > improving the BackingStoreException . Normally I would not even touch the > prefs C code, but converting the errno int into something more 'nice' has to > be do

Withdrawn: JDK-8311009: Long.toUnsignedString(long, int) doesn't have to create a BigInteger

2023-08-23 Thread duke
On Mon, 26 Jun 2023 14:58:56 GMT, Tingjun Yuan wrote: > This PR changes the implementation of `Long.toUnsignedString(long, int)` for > "default" radices, which avoids creating a `BigInteger` and makes use of > `Long.divideUnsigned` and `Long.remainderUnsigned`. > > I've run the test on `test/j

Re: RFR: JDK-8314272: Improve java.util.prefs.BackingStoreException: Couldn't get file lock.

2023-08-23 Thread Alan Bateman
On Tue, 22 Aug 2023 07:48:46 GMT, Matthias Baesken wrote: > Hi Alan, should we maybe add this ? If so in this change on in another one ? I don't have a strong opinion on this, I was just surprised to see these tests run concurrently given the history of issues. - PR Comment: https

Re: RFR: JDK-8314272: Improve java.util.prefs.BackingStoreException: Couldn't get file lock.

2023-08-23 Thread Matthias Baesken
On Wed, 23 Aug 2023 12:51:30 GMT, Alan Bateman wrote: >I suspect the Unix implementation of prefs can easily be replaced with code >that uses FileChannel. I think it would be good to try > this and would allow >the old native code to be removed. This might be the case, but it is a separate iss

Re: RFR: JDK-8314272: Improve java.util.prefs.BackingStoreException: Couldn't get file lock.

2023-08-23 Thread Alan Bateman
On Wed, 23 Aug 2023 12:46:28 GMT, Matthias Baesken wrote: > Hi Alan, should this be done similar to what is done here , using strerror + > strdup and throwing an exception with the generated error message ? > https://github.com/openjdk/jdk/blob/master/src/jdk.attach/linux/native/libattach/Virtu

Re: RFR: JDK-8314272: Improve java.util.prefs.BackingStoreException: Couldn't get file lock.

2023-08-23 Thread Matthias Baesken
On Fri, 18 Aug 2023 12:35:46 GMT, Alan Bateman wrote: >No, I don't think the legacy prefs API being coupled to internals like this. >Instead I think this is case where the prefs natives >will need to use >strerror. Hi Alan, should this be done similar to what is done here , using strerror +

Re: RFR: JDK-8313764: Offer JVM HS functionality to shared lib load operations done by the JDK codebase

2023-08-23 Thread Martin Doerr
On Mon, 14 Aug 2023 07:48:00 GMT, Matthias Baesken wrote: > Currently there is a number of functionality that would be interesting to > have for shared lib load operations in the JDK C code. > Some examples : > Events::log_dll_message for hs-err files reporting > JFR event NativeLibraryLoad > Th

Re: RFR: 8313961: Enhance identification of special serialization methods

2023-08-23 Thread Raffaello Giulietti
Here's some more context about the issues that the PR attempts to fix. Currently, serialization identifies special "magic" methods by querying classical reflection. It does so by invoking `getDeclaredMethod(name, parametertypes)`. This works correctly under the assumption that a serializable c

Re: RFR: 4799358: BufferOutputStream.write() should immediately throw IOExcept on closed stream

2023-08-23 Thread Alan Bateman
On Mon, 21 Aug 2023 15:05:29 GMT, Alan Bateman wrote: > I thought of this ,but i was not 100% sure. I will create CSR first. It's probably a bit premature to create the CSR as there is no agreement here on the API change. I think it would be better to drop this part and focus on the behavior c