From duke at openjdk.org Thu May 1 07:23:03 2025 From: duke at openjdk.org (Markus KARG) Date: Thu, 1 May 2025 07:23:03 GMT Subject: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v10] In-Reply-To: References: Message-ID: > This Pull Request proposes an implementation for [JDK-8343110](https://bugs.openjdk.org/browse/JDK-8343110): Adding the new method `public void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)` to the `CharSequence` interface, providing a **bulk-read** facility including a default implementation iterating over `charAt(int)`. > > In addition, this Pull Request proposes to replace the implementation of `Reader.of(CharSequence).read(char[] cbuf, int off, int len)` to invoke `CharSequence.getChars(next, next + n, cbuf, off)` instead of utilizing pattern matching for switch. Also, this PR proposes to implement `CharBuffer.getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)` as an alias for `CharBuffer.get(srcBegin, dst, dstBegin, srcEnd - srcBegin)`. > > To ensure quality... > * ...the method signature and JavaDocs are adapted from `AbstractStringBuilder.getChars(...)`. > * ...this PR relies upon the existing tests for `Reader.of(CharSequence)`, as these provide sufficient coverage of all changes introduced by this PR. Markus KARG has updated the pull request incrementally with one additional commit since the last revision: Applied workaround proposed by Joe: Using component @inheritDoc to enforce getChars section in JavaDocs ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21730/files - new: https://git.openjdk.org/jdk/pull/21730/files/99fcefbd..342bc842 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21730&range=09 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21730&range=08-09 Stats: 5 lines in 1 file changed: 5 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/21730.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21730/head:pull/21730 PR: https://git.openjdk.org/jdk/pull/21730 From duke at openjdk.org Thu May 1 07:23:03 2025 From: duke at openjdk.org (Markus KARG) Date: Thu, 1 May 2025 07:23:03 GMT Subject: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v9] In-Reply-To: References: <8SHcFyjNMhqcY0TDhwiLkCO-xottmOFa4nqeCDrglTc=.4122346e-5e83-4f40-abcf-415e33d214f0@github.com> Message-ID: On Wed, 30 Apr 2025 21:57:07 GMT, Joe Darcy wrote: >> Unfortunately the same happens. ? > > The following javadoc for String's getChars method has, I believe, the desired effect: > > > /** > * {@inheritDoc CharSequence} > * @param srcBegin {@inheritDoc CharSequence} > * @param srcEnd {@inheritDoc CharSequence} > * @param dst {@inheritDoc CharSequence} > * @param dstBegin {@inheritDoc CharSequence} > * @throws IndexOutOfBoundsException {@inheritDoc CharSequence} > */ > > > HTH Thank you, Joe. That actually produces the expected result. IMHO it is just a workaround for a bug in the javadoc processor, hence I would keep it *just here*, but in all locations (in particular in the CSR) I would propose to keep the shorter form. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21730#discussion_r2069929069 From duke at openjdk.org Thu May 1 08:45:06 2025 From: duke at openjdk.org (Markus KARG) Date: Thu, 1 May 2025 08:45:06 GMT Subject: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v11] In-Reply-To: References: Message-ID: > This Pull Request proposes an implementation for [JDK-8343110](https://bugs.openjdk.org/browse/JDK-8343110): Adding the new method `public void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)` to the `CharSequence` interface, providing a **bulk-read** facility including a default implementation iterating over `charAt(int)`. > > In addition, this Pull Request proposes to replace the implementation of `Reader.of(CharSequence).read(char[] cbuf, int off, int len)` to invoke `CharSequence.getChars(next, next + n, cbuf, off)` instead of utilizing pattern matching for switch. Also, this PR proposes to implement `CharBuffer.getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)` as an alias for `CharBuffer.get(srcBegin, dst, dstBegin, srcEnd - srcBegin)`. > > To ensure quality... > * ...the method signature and JavaDocs are adapted from `AbstractStringBuilder.getChars(...)`. > * ...this PR relies upon the existing tests for `Reader.of(CharSequence)`, as these provide sufficient coverage of all changes introduced by this PR. Markus KARG has updated the pull request incrementally with one additional commit since the last revision: Applied proposal by Daniel: If there's no change to this file the copyright year update could be reverted? ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21730/files - new: https://git.openjdk.org/jdk/pull/21730/files/342bc842..62a6867b Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21730&range=10 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21730&range=09-10 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/21730.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21730/head:pull/21730 PR: https://git.openjdk.org/jdk/pull/21730 From duke at openjdk.org Thu May 1 08:45:06 2025 From: duke at openjdk.org (Markus KARG) Date: Thu, 1 May 2025 08:45:06 GMT Subject: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v8] In-Reply-To: <4Rrs1AMrJ4M-_7x6li7dDhSVnasUVy8w4I42IjZCU30=.f0c85e6b-3bb8-464e-a006-3a34e77e06c9@github.com> References: <1s3MwTXb7v_7WWORxAL4WXOlbMOnpCkt8kbjc613-UM=.a81c62cc-4cc5-4714-8d3b-a63f0b9e092d@github.com> <4Rrs1AMrJ4M-_7x6li7dDhSVnasUVy8w4I42IjZCU30=.f0c85e6b-3bb8-464e-a006-3a34e77e06c9@github.com> Message-ID: On Mon, 28 Apr 2025 13:29:06 GMT, Daniel Fuchs wrote: >> Markus KARG has updated the pull request incrementally with one additional commit since the last revision: >> >> Applied changes proposed in response to Joe's CSR comments: 'understood for CharBuffer; I was thinking more of String, StringBuffer, and StringBuilder where there looks to be more textual similarities.' > > src/java.base/share/classes/java/lang/StringBuilder.java line 2: > >> 1: /* >> 2: * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved. > > If there's no change to this file the copyright year update could be reverted? Good catch, Daniel! Fixed. Thank you! ? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21730#discussion_r2069997101 From liach at openjdk.org Thu May 1 12:59:51 2025 From: liach at openjdk.org (Chen Liang) Date: Thu, 1 May 2025 12:59:51 GMT Subject: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v11] In-Reply-To: References: Message-ID: On Thu, 1 May 2025 08:45:06 GMT, Markus KARG wrote: >> This Pull Request proposes an implementation for [JDK-8343110](https://bugs.openjdk.org/browse/JDK-8343110): Adding the new method `public void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)` to the `CharSequence` interface, providing a **bulk-read** facility including a default implementation iterating over `charAt(int)`. >> >> In addition, this Pull Request proposes to replace the implementation of `Reader.of(CharSequence).read(char[] cbuf, int off, int len)` to invoke `CharSequence.getChars(next, next + n, cbuf, off)` instead of utilizing pattern matching for switch. Also, this PR proposes to implement `CharBuffer.getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)` as an alias for `CharBuffer.get(srcBegin, dst, dstBegin, srcEnd - srcBegin)`. >> >> To ensure quality... >> * ...the method signature and JavaDocs are adapted from `AbstractStringBuilder.getChars(...)`. >> * ...this PR relies upon the existing tests for `Reader.of(CharSequence)`, as these provide sufficient coverage of all changes introduced by this PR. > > Markus KARG has updated the pull request incrementally with one additional commit since the last revision: > > Applied proposal by Daniel: If there's no change to this file the copyright year update could be reverted? src/java.base/share/classes/java/lang/AbstractStringBuilder.java line 488: > 486: /** > 487: * {@inheritDoc CharSequence} > 488: */ Suggestion: * {@inheritDoc CharSequence} * @param srcBegin {@inheritDoc CharSequence} * @param srcEnd {@inheritDoc CharSequence} * @param dst {@inheritDoc CharSequence} * @param dstBegin {@inheritDoc CharSequence} * @throws IndexOutOfBoundsException {@inheritDoc CharSequence} */ Let's aim for text parity for now; can you create a bug for Javadoc for this inheritDoc inconsistency? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21730#discussion_r2070240781 From duke at openjdk.org Thu May 1 13:06:50 2025 From: duke at openjdk.org (Markus KARG) Date: Thu, 1 May 2025 13:06:50 GMT Subject: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v11] In-Reply-To: References: Message-ID: On Thu, 1 May 2025 12:56:42 GMT, Chen Liang wrote: >> Markus KARG has updated the pull request incrementally with one additional commit since the last revision: >> >> Applied proposal by Daniel: If there's no change to this file the copyright year update could be reverted? > > src/java.base/share/classes/java/lang/AbstractStringBuilder.java line 488: > >> 486: /** >> 487: * {@inheritDoc CharSequence} >> 488: */ > > Suggestion: > > * {@inheritDoc CharSequence} > * @param srcBegin {@inheritDoc CharSequence} > * @param srcEnd {@inheritDoc CharSequence} > * @param dst {@inheritDoc CharSequence} > * @param dstBegin {@inheritDoc CharSequence} > * @throws IndexOutOfBoundsException {@inheritDoc CharSequence} > */ > > Let's aim for text parity for now; can you create a bug for Javadoc for this inheritDoc inconsistency? I can open a bug report, but I think text parity makes no sense: There are lots of other places in OpenJDK where the short form is used already, so there will not be any benefit of text parity with just one other code location, but it will force use to open another JBS / PR once the bug is fixed to come back to the short form. So it brings just work but we gain nothing IMHO. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21730#discussion_r2070246526 From liach at openjdk.org Thu May 1 15:37:58 2025 From: liach at openjdk.org (Chen Liang) Date: Thu, 1 May 2025 15:37:58 GMT Subject: RFR: 8356036: Use Long::hashCode in sun.nio In-Reply-To: References: Message-ID: On Thu, 1 May 2025 14:41:09 GMT, Shaojin Wen wrote: > Similar to #24959 and #24971, sun.nio.ch.FileKey/sun.nio.fs.UnixFileKey/sun.nio.fs.UnixFileStore in java.base can also be simplified similarly. > > Replace manual bitwise operations in hashCode implementations of sun.nio.ch.FileKey/sun.nio.fs.UnixFileKey/sun.nio.fs.UnixFileStore with Long::hashCode. Confirmed all replaced variables are long. And they are all final long fields, so we can ignore the double field read in race effects (and long even permits tearing reads) ------------- Marked as reviewed by liach (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/24987#pullrequestreview-2809997529 From alanb at openjdk.org Thu May 1 15:56:44 2025 From: alanb at openjdk.org (Alan Bateman) Date: Thu, 1 May 2025 15:56:44 GMT Subject: RFR: 8356036: Use Long::hashCode in sun.nio In-Reply-To: References: Message-ID: <2ceOP0289dbHYjUWvPTbg18UqPl8tGc_Mvit9pp5d28=.36e21727-9ebd-4237-89bc-9dba41421b5b@github.com> On Thu, 1 May 2025 14:41:09 GMT, Shaojin Wen wrote: > Similar to #24959 and #24971, sun.nio.ch.FileKey/sun.nio.fs.UnixFileKey/sun.nio.fs.UnixFileStore in java.base can also be simplified similarly. > > Replace manual bitwise operations in hashCode implementations of sun.nio.ch.FileKey/sun.nio.fs.UnixFileKey/sun.nio.fs.UnixFileStore with Long::hashCode. Needs to reviewed by maintainer in this area. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24987#issuecomment-2845123348 From swen at openjdk.org Thu May 1 15:37:58 2025 From: swen at openjdk.org (Shaojin Wen) Date: Thu, 1 May 2025 15:37:58 GMT Subject: RFR: 8356036: Use Long::hashCode in sun.nio Message-ID: Similar to #24959 and #24971, sun.nio.ch.FileKey/sun.nio.fs.UnixFileKey/sun.nio.fs.UnixFileStore in java.base can also be simplified similarly. Replace manual bitwise operations in hashCode implementations of sun.nio.ch.FileKey/sun.nio.fs.UnixFileKey/sun.nio.fs.UnixFileStore with Long::hashCode. ------------- Commit messages: - Use Long::hashCode Changes: https://git.openjdk.org/jdk/pull/24987/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24987&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8356036 Stats: 5 lines in 3 files changed: 0 ins; 2 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/24987.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24987/head:pull/24987 PR: https://git.openjdk.org/jdk/pull/24987 From duke at openjdk.org Thu May 1 17:20:49 2025 From: duke at openjdk.org (Markus KARG) Date: Thu, 1 May 2025 17:20:49 GMT Subject: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v11] In-Reply-To: <2jc5ZuZmlzsOBJOD9VwObHfox_2VX8Dmy6AhasVXp3w=.4cabab81-4d24-453d-ab46-eb272f6e7c27@github.com> References: <2jc5ZuZmlzsOBJOD9VwObHfox_2VX8Dmy6AhasVXp3w=.4cabab81-4d24-453d-ab46-eb272f6e7c27@github.com> Message-ID: On Thu, 1 May 2025 16:23:13 GMT, Joe Darcy wrote: >> I can open a bug report, but I think text parity makes no sense: There are lots of other places in OpenJDK where the short form is used already, so there will not be any benefit of text parity with just one other code location, but it will force us to open another JBS / PR once the bug is fixed to come back to the short form. So it brings just work but we gain nothing IMHO. > > There are subtleties and perhaps surprises in `@inheritDoc`, but that doesn't necessarily imply the current behavior is buggy. So it is actually *wanted* behavior that in one situation the text *is* inherited, but at `String.java` no text is inherited at all? ? Could not find any hint about that in the JavaDoc manual. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21730#discussion_r2070545048 From kbarrett at openjdk.org Thu May 1 19:37:02 2025 From: kbarrett at openjdk.org (Kim Barrett) Date: Thu, 1 May 2025 19:37:02 GMT Subject: RFR: 8344332: (bf) Migrate DirectByteBuffer to use java.lang.ref.Cleaner [v13] In-Reply-To: References: Message-ID: <_MaD4F7X83A_LevqwBFFnJ7vcXjNhT0k5CPU6dWxq9M=.54ae4358-d6dc-4c51-809e-62667b3330db@github.com> On Tue, 18 Feb 2025 14:33:16 GMT, Aleksey Shipilev wrote: >> DirectByteBuffers are still using old `jdk.internal.ref.Cleaner` implementation. That implementation carries a doubly-linked list, and so makes DBB suffer from the same issue fixed for generic `java.lang.ref.Cleaner` users with [JDK-8343704](https://bugs.openjdk.org/browse/JDK-8343704). See the bug for the reproducer. >> >> We can migrate DBBs to use `java.lang.ref.Cleaner`. >> >> There are two pecularities during this rewrite. >> >> First, the old ad-hoc `Cleaner` implementation used to exit the VM when cleaning action failed. I presume it was to avoid memory leak / accidental reuse of the buffer. I moved the relevant block to `Deallocator` directly. Unfortunately, I cannot easily test it. >> >> Second is quite a bit hairy. Old DBB cleaning code was hooked straight into `Reference` processing loop. This was possible because we could infer that the weak references we are processing were DBB cleaning actions, since old `Cleaner` was the only use of this code. With standard `Cleaner`, we have lost this association, and so we cannot really do this from the reference processing loop. With the patched version, we now rely on normal `Cleaner` thread to do cleanups for us. >> >> Because of this, there is a new outpacing opportunity window where reference processing might have been over, but cleaner thread has not reacted yet. This is why we need another way to check progress that involves checking if cleaner has acted. >> >> Additional testing: >> - [x] Linux x86_64 server fastdebug, `java/nio java/io` >> - [x] Linux AArch64 server fastdebug, `java/nio java/io` >> - [x] Linux x86_64 server fastdebug, `all` >> - [x] Linux AArch64 server fastdebug, `all` > > Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision: > > A bit more comments FYI, I've been working on some more ideas here. I hope to have more to report in the next couple of days. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22165#issuecomment-2845588548 From darcy at openjdk.org Thu May 1 16:25:53 2025 From: darcy at openjdk.org (Joe Darcy) Date: Thu, 1 May 2025 16:25:53 GMT Subject: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v11] In-Reply-To: References: Message-ID: <2jc5ZuZmlzsOBJOD9VwObHfox_2VX8Dmy6AhasVXp3w=.4cabab81-4d24-453d-ab46-eb272f6e7c27@github.com> On Thu, 1 May 2025 13:03:47 GMT, Markus KARG wrote: >> src/java.base/share/classes/java/lang/AbstractStringBuilder.java line 488: >> >>> 486: /** >>> 487: * {@inheritDoc CharSequence} >>> 488: */ >> >> Suggestion: >> >> * {@inheritDoc CharSequence} >> * @param srcBegin {@inheritDoc CharSequence} >> * @param srcEnd {@inheritDoc CharSequence} >> * @param dst {@inheritDoc CharSequence} >> * @param dstBegin {@inheritDoc CharSequence} >> * @throws IndexOutOfBoundsException {@inheritDoc CharSequence} >> */ >> >> Let's aim for text parity for now; can you create a bug for Javadoc for this inheritDoc inconsistency? > > I can open a bug report, but I think text parity makes no sense: There are lots of other places in OpenJDK where the short form is used already, so there will not be any benefit of text parity with just one other code location, but it will force us to open another JBS / PR once the bug is fixed to come back to the short form. So it brings just work but we gain nothing IMHO. There are subtleties and perhaps surprises in `@inheritDoc`, but that doesn't necessarily imply the current behavior is buggy. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21730#discussion_r2070475122 From bpb at openjdk.org Fri May 2 17:02:57 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Fri, 2 May 2025 17:02:57 GMT Subject: Integrated: 8355445: [java.nio] Use @requires tag instead of exiting based on "os.name" property value In-Reply-To: References: Message-ID: On Thu, 24 Apr 2025 20:48:58 GMT, Brian Burkhalter wrote: > Use the `@requires` tag instead of obtaining the operating system name from the `os.name` property and then exiting if the test is not run on that operating system. This pull request has now been integrated. Changeset: 84f570c5 Author: Brian Burkhalter URL: https://git.openjdk.org/jdk/commit/84f570c573f5c355cf55e05d06ddb383deb476ca Stats: 44 lines in 7 files changed: 6 ins; 31 del; 7 mod 8355445: [java.nio] Use @requires tag instead of exiting based on "os.name" property value Reviewed-by: lancea, jpai, iris ------------- PR: https://git.openjdk.org/jdk/pull/24861 From duke at openjdk.org Sun May 4 14:02:45 2025 From: duke at openjdk.org (Markus KARG) Date: Sun, 4 May 2025 14:02:45 GMT Subject: RFR: 8353795: Add Writer.of(StringBuilder) In-Reply-To: <2xEfp_WiAa-QW5Yao7JoOS3zSOtPKvBq4qV5rk8obWs=.2b1cc84d-2ff4-4d0c-bb0f-bdb276dc109a@github.com> References: <2xEfp_WiAa-QW5Yao7JoOS3zSOtPKvBq4qV5rk8obWs=.2b1cc84d-2ff4-4d0c-bb0f-bdb276dc109a@github.com> Message-ID: On Sat, 5 Apr 2025 17:36:29 GMT, Markus KARG wrote: > This Pull Requests proposes an implementation for [JDK-8353795](https://bugs.openjdk.org/browse/JDK-8353795): Adding the new method `public static Writer Writer.of(StringBuilder)`, providing a non-synchronized Writer implementation optimized for writing into `StringBuilder`. > > A basic test is provided to proof that the new `Writer` behaves as expected. For comparison, the same test is also run against `StringWriter`. @liach How to proceed? ------------- PR Comment: https://git.openjdk.org/jdk/pull/24469#issuecomment-2849236880 From liach at openjdk.org Sun May 4 14:51:44 2025 From: liach at openjdk.org (Chen Liang) Date: Sun, 4 May 2025 14:51:44 GMT Subject: RFR: 8353795: Add Writer.of(StringBuilder) In-Reply-To: <2xEfp_WiAa-QW5Yao7JoOS3zSOtPKvBq4qV5rk8obWs=.2b1cc84d-2ff4-4d0c-bb0f-bdb276dc109a@github.com> References: <2xEfp_WiAa-QW5Yao7JoOS3zSOtPKvBq4qV5rk8obWs=.2b1cc84d-2ff4-4d0c-bb0f-bdb276dc109a@github.com> Message-ID: On Sat, 5 Apr 2025 17:36:29 GMT, Markus KARG wrote: > This Pull Requests proposes an implementation for [JDK-8353795](https://bugs.openjdk.org/browse/JDK-8353795): Adding the new method `public static Writer Writer.of(StringBuilder)`, providing a non-synchronized Writer implementation optimized for writing into `StringBuilder`. > > A basic test is provided to proof that the new `Writer` behaves as expected. For comparison, the same test is also run against `StringWriter`. I will raise attention to this to other Oracle's JDK core library reviewers. Meanwhile you can start drafting a CSR like that for `getChars` for `CharSequence`. One concern is that (See `HashMap.newHashMap` vs `HashMap.of`) `XxxWriter.of(StringBuilder)` now returns a basic `Writer` instead of `XxxWriter`, but since we already have that for `Reader.of` and the argument type is specific, I think this is not an issue. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24469#issuecomment-2849260129 From liach at openjdk.org Sun May 4 14:57:51 2025 From: liach at openjdk.org (Chen Liang) Date: Sun, 4 May 2025 14:57:51 GMT Subject: RFR: 8353795: Add Writer.of(StringBuilder) In-Reply-To: <2xEfp_WiAa-QW5Yao7JoOS3zSOtPKvBq4qV5rk8obWs=.2b1cc84d-2ff4-4d0c-bb0f-bdb276dc109a@github.com> References: <2xEfp_WiAa-QW5Yao7JoOS3zSOtPKvBq4qV5rk8obWs=.2b1cc84d-2ff4-4d0c-bb0f-bdb276dc109a@github.com> Message-ID: On Sat, 5 Apr 2025 17:36:29 GMT, Markus KARG wrote: > This Pull Requests proposes an implementation for [JDK-8353795](https://bugs.openjdk.org/browse/JDK-8353795): Adding the new method `public static Writer Writer.of(StringBuilder)`, providing a non-synchronized Writer implementation optimized for writing into `StringBuilder`. > > A basic test is provided to proof that the new `Writer` behaves as expected. For comparison, the same test is also run against `StringWriter`. src/java.base/share/classes/java/nio/X-Buffer.java.template line 2: > 1: /* > 2: * Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved. Redundant change. test/jdk/java/io/Writer/Of.java line 45: > 43: @Override > 44: public String toString() { > 45: return id; // allows to identify config when test case fails I used the same strategy in junit tests; the default toString already includes id=..., so I usually don't provide an explicit override to make the code concise. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24469#discussion_r2072637744 PR Review Comment: https://git.openjdk.org/jdk/pull/24469#discussion_r2072638134 From duke at openjdk.org Sun May 4 16:21:41 2025 From: duke at openjdk.org (Markus KARG) Date: Sun, 4 May 2025 16:21:41 GMT Subject: RFR: 8353795: Add Writer.of(StringBuilder) [v2] In-Reply-To: <2xEfp_WiAa-QW5Yao7JoOS3zSOtPKvBq4qV5rk8obWs=.2b1cc84d-2ff4-4d0c-bb0f-bdb276dc109a@github.com> References: <2xEfp_WiAa-QW5Yao7JoOS3zSOtPKvBq4qV5rk8obWs=.2b1cc84d-2ff4-4d0c-bb0f-bdb276dc109a@github.com> Message-ID: > This Pull Requests proposes an implementation for [JDK-8353795](https://bugs.openjdk.org/browse/JDK-8353795): Adding the new method `public static Writer Writer.of(StringBuilder)`, providing a non-synchronized Writer implementation optimized for writing into `StringBuilder`. > > A basic test is provided to proof that the new `Writer` behaves as expected. For comparison, the same test is also run against `StringWriter`. Markus KARG has updated the pull request incrementally with two additional commits since the last revision: - Undone copyright update of otherwise unchanged file. - Update Of.java Applied changnes proposed by @liach: "the default toString already includes id=..., so I usually don't provide an explicit override to make the code concise." ------------- Changes: - all: https://git.openjdk.org/jdk/pull/24469/files - new: https://git.openjdk.org/jdk/pull/24469/files/75efb7fd..ea435ed1 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=24469&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24469&range=00-01 Stats: 7 lines in 2 files changed: 0 ins; 5 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/24469.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24469/head:pull/24469 PR: https://git.openjdk.org/jdk/pull/24469 From duke at openjdk.org Sun May 4 16:21:42 2025 From: duke at openjdk.org (Markus KARG) Date: Sun, 4 May 2025 16:21:42 GMT Subject: RFR: 8353795: Add Writer.of(StringBuilder) [v2] In-Reply-To: References: <2xEfp_WiAa-QW5Yao7JoOS3zSOtPKvBq4qV5rk8obWs=.2b1cc84d-2ff4-4d0c-bb0f-bdb276dc109a@github.com> Message-ID: On Sun, 4 May 2025 14:52:39 GMT, Chen Liang wrote: >> Markus KARG has updated the pull request incrementally with two additional commits since the last revision: >> >> - Undone copyright update of otherwise unchanged file. >> - Update Of.java >> >> Applied changnes proposed by @liach: "the default toString already includes id=..., so I usually don't provide an explicit override to make the code concise." > > src/java.base/share/classes/java/nio/X-Buffer.java.template line 2: > >> 1: /* >> 2: * Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved. > > Redundant change. Good catch! Undone copyright update in https://github.com/openjdk/jdk/pull/24469/commits/ea435ed1090d8f028262f5900baf0a00472726d9. > test/jdk/java/io/Writer/Of.java line 45: > >> 43: @Override >> 44: public String toString() { >> 45: return id; // allows to identify config when test case fails > > I used the same strategy in junit tests; the default toString already includes id=..., so I usually don't provide an explicit override to make the code concise. Understood. Removed override in https://github.com/openjdk/jdk/pull/24469/commits/f48b99995723b6c4dd73014015f50b1047ff28cd. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24469#discussion_r2072655279 PR Review Comment: https://git.openjdk.org/jdk/pull/24469#discussion_r2072654985 From duke at openjdk.org Sun May 4 17:03:48 2025 From: duke at openjdk.org (Markus KARG) Date: Sun, 4 May 2025 17:03:48 GMT Subject: RFR: 8353795: Add Writer.of(StringBuilder) In-Reply-To: References: <2xEfp_WiAa-QW5Yao7JoOS3zSOtPKvBq4qV5rk8obWs=.2b1cc84d-2ff4-4d0c-bb0f-bdb276dc109a@github.com> Message-ID: On Sun, 4 May 2025 14:49:35 GMT, Chen Liang wrote: > ...you can start drafting a CSR like that for `getChars` for `CharSequence`. Done. Kindly asking your review for the CSR: https://bugs.openjdk.org/browse/JDK-8356123. > One concern is that (See `HashMap.newHashMap` vs `HashMap.of`) `XxxWriter.of(StringBuilder)` now returns a basic `Writer` instead of `XxxWriter`, but since we already have that for `Reader.of` and the argument type is specific, I think this is not an issue. The CSR indicates that `Writer.of()` is the *symmetric* API to `Reader.of()`, so I think it is understood why we have chosen that name. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24469#issuecomment-2849314924 From alanb at openjdk.org Sun May 4 18:41:46 2025 From: alanb at openjdk.org (Alan Bateman) Date: Sun, 4 May 2025 18:41:46 GMT Subject: RFR: 8353795: Add Writer.of(StringBuilder) [v2] In-Reply-To: References: <2xEfp_WiAa-QW5Yao7JoOS3zSOtPKvBq4qV5rk8obWs=.2b1cc84d-2ff4-4d0c-bb0f-bdb276dc109a@github.com> Message-ID: On Sun, 4 May 2025 16:21:41 GMT, Markus KARG wrote: >> This Pull Requests proposes an implementation for [JDK-8353795](https://bugs.openjdk.org/browse/JDK-8353795): Adding the new method `public static Writer Writer.of(StringBuilder)`, providing a non-synchronized Writer implementation optimized for writing into `StringBuilder`. >> >> A basic test is provided to proof that the new `Writer` behaves as expected. For comparison, the same test is also run against `StringWriter`. > > Markus KARG has updated the pull request incrementally with two additional commits since the last revision: > > - Undone copyright update of otherwise unchanged file. > - Update Of.java > > Applied changnes proposed by @liach: "the default toString already includes id=..., so I usually don't provide an explicit override to make the code concise." Way too early to create a PR and CSR for this. I think close the PR for now, instead start a discussion on core-libs-dev to get input. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24469#issuecomment-2849357907 From liach at openjdk.org Sun May 4 20:38:47 2025 From: liach at openjdk.org (Chen Liang) Date: Sun, 4 May 2025 20:38:47 GMT Subject: RFR: 8353795: Add Writer.of(StringBuilder) [v2] In-Reply-To: References: <2xEfp_WiAa-QW5Yao7JoOS3zSOtPKvBq4qV5rk8obWs=.2b1cc84d-2ff4-4d0c-bb0f-bdb276dc109a@github.com> Message-ID: <5mpZGPWGnNshcE30YOHry52vhvYWzdz3sOpsxOIu_nU=.2efc76c8-72c6-4938-91be-b68af5c90223@github.com> On Sun, 4 May 2025 18:39:24 GMT, Alan Bateman wrote: > start a discussion on core-libs-dev Threads about this topic have been started multiple times but failed to attract any attention on this topic, not even a rejection: - https://mail.openjdk.org/pipermail/core-libs-dev/2024-December/thread.html#137807 - https://mail.openjdk.org/pipermail/core-libs-dev/2025-March/thread.html#141272 In this situation, how can we ensure a renewed discussion will actually attract attention? I think our guide should suggest a solution to this, like "prmopting a thread after 2 weeks of no reply"? ------------- PR Comment: https://git.openjdk.org/jdk/pull/24469#issuecomment-2849406747 From alanb at openjdk.org Mon May 5 06:35:46 2025 From: alanb at openjdk.org (Alan Bateman) Date: Mon, 5 May 2025 06:35:46 GMT Subject: RFR: 8353795: Add Writer.of(StringBuilder) [v2] In-Reply-To: <5mpZGPWGnNshcE30YOHry52vhvYWzdz3sOpsxOIu_nU=.2efc76c8-72c6-4938-91be-b68af5c90223@github.com> References: <2xEfp_WiAa-QW5Yao7JoOS3zSOtPKvBq4qV5rk8obWs=.2b1cc84d-2ff4-4d0c-bb0f-bdb276dc109a@github.com> <5mpZGPWGnNshcE30YOHry52vhvYWzdz3sOpsxOIu_nU=.2efc76c8-72c6-4938-91be-b68af5c90223@github.com> Message-ID: On Sun, 4 May 2025 20:36:07 GMT, Chen Liang wrote: > In this situation, how can we ensure a renewed discussion will actually attract attention? I think our guide should suggest a solution to this, like "prmopting a thread after 2 weeks of no reply"? The mailing list is the right place to get agreement on what the problem is and what the solution/API might be if it progresses to that. Lack of engagement should not be interpreted as supporting the proposal. The lack of engagement might be better interpreted as people are busy or maybe that the problem isn't compelling or high priority enough to spend time on right now. The dev guide should not put a deadline on getting responses. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24469#issuecomment-2850034687 From jpai at openjdk.org Mon May 5 10:18:07 2025 From: jpai at openjdk.org (Jaikiran Pai) Date: Mon, 5 May 2025 10:18:07 GMT Subject: RFR: 8356154: Respecify java.net.Socket constructors that allow creating UDP sockets to throw IllegalArgumentException Message-ID: Can I please get a review of this change which proposes to respecify the 2 `java.net.Socket` constructors that allow construction of UDP sockets? This addresses https://bugs.openjdk.org/browse/JDK-8356154. As noted in that JBS issue, in Java 23 we deprecated for removal the 2 `Socket` constructors that allowed UDP socket creation. The plan continues to be to remove those constructors. Before removing those, in order to allow for applications to notice this deprecation, these constructors are now being respecified to throw an `IllegalArgumentException` when the `stream` parameter is `false`. I will create a CSR once we settle on these changes. tier1 through tier8 tests have been run with this change and no related failures have been noticed. ------------- Commit messages: - update apiNote on SocketImpl - 8356154: Respecify java.net.Socket constructors that allow creating UDP sockets to throw IllegalArgumentException Changes: https://git.openjdk.org/jdk/pull/25031/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25031&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8356154 Stats: 156 lines in 9 files changed: 37 ins; 57 del; 62 mod Patch: https://git.openjdk.org/jdk/pull/25031.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25031/head:pull/25031 PR: https://git.openjdk.org/jdk/pull/25031 From jpai at openjdk.org Mon May 5 10:22:48 2025 From: jpai at openjdk.org (Jaikiran Pai) Date: Mon, 5 May 2025 10:22:48 GMT Subject: RFR: 8356154: Respecify java.net.Socket constructors that allow creating UDP sockets to throw IllegalArgumentException In-Reply-To: References: Message-ID: On Mon, 5 May 2025 10:12:11 GMT, Jaikiran Pai wrote: > Can I please get a review of this change which proposes to respecify the 2 `java.net.Socket` constructors that allow construction of UDP sockets? This addresses https://bugs.openjdk.org/browse/JDK-8356154. > > As noted in that JBS issue, in Java 23 we deprecated for removal the 2 `Socket` constructors that allowed UDP socket creation. The plan continues to be to remove those constructors. Before removing those, in order to allow for applications to notice this deprecation, these constructors are now being respecified to throw an `IllegalArgumentException` when the `stream` parameter is `false`. > > I will create a CSR once we settle on these changes. > > tier1 through tier8 tests have been run with this change and no related failures have been noticed. src/java.base/share/classes/sun/nio/ch/NioSocketImpl.java line 453: > 451: protected void create(boolean stream) throws IOException { > 452: if (!stream) { > 453: throw new IllegalArgumentException("datagram socket creation not supported"); My initial thought was to just `assert` the `stream` value here. Then I noticed the `test/jdk/java/net/SocketImpl/BadUsages.java` test (updated as part of this PR) and thought that it might be better to do an actual check here and have it throw `IllegalArgumentException`, to allow for this behaviour to be verified. I however don't have a strong opinion about this. So if `assert` is enough, then I'll switch this to an assert and then remove the updated test method in the `BasUsages.java`. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25031#discussion_r2073193218 From alanb at openjdk.org Mon May 5 10:54:46 2025 From: alanb at openjdk.org (Alan Bateman) Date: Mon, 5 May 2025 10:54:46 GMT Subject: RFR: 8356154: Respecify java.net.Socket constructors that allow creating UDP sockets to throw IllegalArgumentException In-Reply-To: References: Message-ID: On Mon, 5 May 2025 10:19:55 GMT, Jaikiran Pai wrote: >> Can I please get a review of this change which proposes to respecify the 2 `java.net.Socket` constructors that allow construction of UDP sockets? This addresses https://bugs.openjdk.org/browse/JDK-8356154. >> >> As noted in that JBS issue, in Java 23 we deprecated for removal the 2 `Socket` constructors that allowed UDP socket creation. The plan continues to be to remove those constructors. Before removing those, in order to allow for applications to notice this deprecation, these constructors are now being respecified to throw an `IllegalArgumentException` when the `stream` parameter is `false`. >> >> I will create a CSR once we settle on these changes. >> >> tier1 through tier8 tests have been run with this change and no related failures have been noticed. > > src/java.base/share/classes/sun/nio/ch/NioSocketImpl.java line 453: > >> 451: protected void create(boolean stream) throws IOException { >> 452: if (!stream) { >> 453: throw new IllegalArgumentException("datagram socket creation not supported"); > > My initial thought was to just `assert` the `stream` value here. Then I noticed the `test/jdk/java/net/SocketImpl/BadUsages.java` test (updated as part of this PR) and thought that it might be better to do an actual check here and have it throw `IllegalArgumentException`, to allow for this behaviour to be verified. > > I however don't have a strong opinion about this. So if `assert` is enough, then I'll switch this to an assert and then remove the updated test method in the `BasUsages.java`. This method can only throw IOException so I think it will need to throw IOException. It should happen of course, at least not unless we have a bug in the Socket code. Can you change the exception message to start with "Datagram socket ..." so it's consistent with the other exception messages. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25031#discussion_r2073230057 From jpai at openjdk.org Mon May 5 11:07:28 2025 From: jpai at openjdk.org (Jaikiran Pai) Date: Mon, 5 May 2025 11:07:28 GMT Subject: RFR: 8356154: Respecify java.net.Socket constructors that allow creating UDP sockets to throw IllegalArgumentException [v2] In-Reply-To: References: Message-ID: > Can I please get a review of this change which proposes to respecify the 2 `java.net.Socket` constructors that allow construction of UDP sockets? This addresses https://bugs.openjdk.org/browse/JDK-8356154. > > As noted in that JBS issue, in Java 23 we deprecated for removal the 2 `Socket` constructors that allowed UDP socket creation. The plan continues to be to remove those constructors. Before removing those, in order to allow for applications to notice this deprecation, these constructors are now being respecified to throw an `IllegalArgumentException` when the `stream` parameter is `false`. > > I will create a CSR once we settle on these changes. > > tier1 through tier8 tests have been run with this change and no related failures have been noticed. Jaikiran Pai has updated the pull request incrementally with one additional commit since the last revision: review suggestion - throw IOException ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25031/files - new: https://git.openjdk.org/jdk/pull/25031/files/47dca9cf..5e123087 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25031&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25031&range=00-01 Stats: 6 lines in 2 files changed: 0 ins; 4 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/25031.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25031/head:pull/25031 PR: https://git.openjdk.org/jdk/pull/25031 From jpai at openjdk.org Mon May 5 11:07:28 2025 From: jpai at openjdk.org (Jaikiran Pai) Date: Mon, 5 May 2025 11:07:28 GMT Subject: RFR: 8356154: Respecify java.net.Socket constructors that allow creating UDP sockets to throw IllegalArgumentException [v2] In-Reply-To: References: Message-ID: <9FOd_T9EcyfWRxQ1cqm324Wd4kGvypAfcqxypXf__II=.edee25ec-50dd-4eb6-9a00-839ad72eb926@github.com> On Mon, 5 May 2025 10:52:12 GMT, Alan Bateman wrote: >> src/java.base/share/classes/sun/nio/ch/NioSocketImpl.java line 453: >> >>> 451: protected void create(boolean stream) throws IOException { >>> 452: if (!stream) { >>> 453: throw new IllegalArgumentException("datagram socket creation not supported"); >> >> My initial thought was to just `assert` the `stream` value here. Then I noticed the `test/jdk/java/net/SocketImpl/BadUsages.java` test (updated as part of this PR) and thought that it might be better to do an actual check here and have it throw `IllegalArgumentException`, to allow for this behaviour to be verified. >> >> I however don't have a strong opinion about this. So if `assert` is enough, then I'll switch this to an assert and then remove the updated test method in the `BasUsages.java`. > > This method can only throw IOException so I think it will need to throw IOException. It should happen of course, at least not unless we have a bug in the Socket code. Can you change the exception message to start with "Datagram socket ..." so it's consistent with the other exception messages. Done - I've updated the PR to follow these suggestions. The `BadUsages` test passes with this change. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25031#discussion_r2073244098 From eirbjo at openjdk.org Mon May 5 12:13:46 2025 From: eirbjo at openjdk.org (Eirik =?UTF-8?B?QmrDuHJzbsO4cw==?=) Date: Mon, 5 May 2025 12:13:46 GMT Subject: RFR: 8356154: Respecify java.net.Socket constructors that allow creating UDP sockets to throw IllegalArgumentException [v2] In-Reply-To: References: Message-ID: <2uoO2GAh-FEOpe9q3w9CUiVcsK5gDQGsgedNGC_53Do=.da4913c4-6c9c-45f2-bf52-73b0dcd9dcf3@github.com> On Mon, 5 May 2025 11:07:28 GMT, Jaikiran Pai wrote: >> Can I please get a review of this change which proposes to respecify the 2 `java.net.Socket` constructors that allow construction of UDP sockets? This addresses https://bugs.openjdk.org/browse/JDK-8356154. >> >> As noted in that JBS issue, in Java 23 we deprecated for removal the 2 `Socket` constructors that allowed UDP socket creation. The plan continues to be to remove those constructors. Before removing those, in order to allow for applications to notice this deprecation, these constructors are now being respecified to throw an `IllegalArgumentException` when the `stream` parameter is `false`. >> >> I will create a CSR once we settle on these changes. >> >> tier1 through tier8 tests have been run with this change and no related failures have been noticed. > > Jaikiran Pai has updated the pull request incrementally with one additional commit since the last revision: > > review suggestion - throw IOException src/java.base/share/classes/java/net/SocketImpl.java line 85: > 83: * @apiNote > 84: * The {@link Socket} constructors to create a datagram socket > 85: * are deprecated for removal and have been respecified to throw This seems to talk about past, current and future behavior. I thought we try to keep specifications focused on current behavior, with the exception of deprecation warnings. Would it be possible to reword this without mentioning the past, avoiding the ?have been respecified? part? Interested users can always use release notes to observe history..? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25031#discussion_r2073324977 From jpai at openjdk.org Mon May 5 12:27:27 2025 From: jpai at openjdk.org (Jaikiran Pai) Date: Mon, 5 May 2025 12:27:27 GMT Subject: RFR: 8356154: Respecify java.net.Socket constructors that allow creating UDP sockets to throw IllegalArgumentException [v3] In-Reply-To: References: Message-ID: > Can I please get a review of this change which proposes to respecify the 2 `java.net.Socket` constructors that allow construction of UDP sockets? This addresses https://bugs.openjdk.org/browse/JDK-8356154. > > As noted in that JBS issue, in Java 23 we deprecated for removal the 2 `Socket` constructors that allowed UDP socket creation. The plan continues to be to remove those constructors. Before removing those, in order to allow for applications to notice this deprecation, these constructors are now being respecified to throw an `IllegalArgumentException` when the `stream` parameter is `false`. > > I will create a CSR once we settle on these changes. > > tier1 through tier8 tests have been run with this change and no related failures have been noticed. Jaikiran Pai has updated the pull request incrementally with one additional commit since the last revision: reword SocketImpl.create(...) API doc ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25031/files - new: https://git.openjdk.org/jdk/pull/25031/files/5e123087..ad880d50 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25031&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25031&range=01-02 Stats: 3 lines in 1 file changed: 0 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/25031.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25031/head:pull/25031 PR: https://git.openjdk.org/jdk/pull/25031 From jpai at openjdk.org Mon May 5 12:27:27 2025 From: jpai at openjdk.org (Jaikiran Pai) Date: Mon, 5 May 2025 12:27:27 GMT Subject: RFR: 8356154: Respecify java.net.Socket constructors that allow creating UDP sockets to throw IllegalArgumentException [v2] In-Reply-To: <2uoO2GAh-FEOpe9q3w9CUiVcsK5gDQGsgedNGC_53Do=.da4913c4-6c9c-45f2-bf52-73b0dcd9dcf3@github.com> References: <2uoO2GAh-FEOpe9q3w9CUiVcsK5gDQGsgedNGC_53Do=.da4913c4-6c9c-45f2-bf52-73b0dcd9dcf3@github.com> Message-ID: On Mon, 5 May 2025 12:11:16 GMT, Eirik Bj?rsn?s wrote: >> Jaikiran Pai has updated the pull request incrementally with one additional commit since the last revision: >> >> review suggestion - throw IOException > > src/java.base/share/classes/java/net/SocketImpl.java line 85: > >> 83: * @apiNote >> 84: * The {@link Socket} constructors to create a datagram socket >> 85: * are deprecated for removal and have been respecified to throw > > This seems to talk about past, current and future behavior. > > I thought we try to keep specifications focused on current behavior, with the exception of deprecation warnings. > > Would it be possible to reword this without mentioning the past, avoiding the ?have been respecified? part? > > Interested users can always use release notes to observe history..? Hello Eirik, > This seems to talk about past, current and future behavior. > ... > Would it be possible to reword this without mentioning the past, avoiding the ?have been respecified? part? That's a good point. I've now updated the PR to reword this. Hopefully that's better. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25031#discussion_r2073342198 From alanb at openjdk.org Mon May 5 14:03:48 2025 From: alanb at openjdk.org (Alan Bateman) Date: Mon, 5 May 2025 14:03:48 GMT Subject: RFR: 8356154: Respecify java.net.Socket constructors that allow creating UDP sockets to throw IllegalArgumentException [v3] In-Reply-To: References: Message-ID: On Mon, 5 May 2025 12:27:27 GMT, Jaikiran Pai wrote: >> Can I please get a review of this change which proposes to respecify the 2 `java.net.Socket` constructors that allow construction of UDP sockets? This addresses https://bugs.openjdk.org/browse/JDK-8356154. >> >> As noted in that JBS issue, in Java 23 we deprecated for removal the 2 `Socket` constructors that allowed UDP socket creation. The plan continues to be to remove those constructors. Before removing those, in order to allow for applications to notice this deprecation, these constructors are now being respecified to throw an `IllegalArgumentException` when the `stream` parameter is `false`. >> >> I will create a CSR once we settle on these changes. >> >> tier1 through tier8 tests have been run with this change and no related failures have been noticed. > > Jaikiran Pai has updated the pull request incrementally with one additional commit since the last revision: > > reword SocketImpl.create(...) API doc src/java.base/share/classes/java/net/Socket.java line 384: > 382: * stream socket. Only stream socket creation is allowed. If the stream > 383: * argument is {@code false}, then this constructor throws > 384: * {@code IllegalArgumentException}. I would be tempted to drop this paragraph and just change the description of the `@param stream` to say "must be true". src/java.base/share/classes/java/net/SocketImpl.java line 90: > 88: *

> 89: * This method will be re-specified in a future release to not > 90: * support creating datagram sockets. I think this could do with another round of rewording. I think I would say that the "stream" parameter provided a way in early JDK releases to create a Socket that used a datagram socket. It's no longer possible to do this and therefore this method will only be called by Socket with stream == false. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25031#discussion_r2073493924 PR Review Comment: https://git.openjdk.org/jdk/pull/25031#discussion_r2073508394 From jpai at openjdk.org Mon May 5 14:18:26 2025 From: jpai at openjdk.org (Jaikiran Pai) Date: Mon, 5 May 2025 14:18:26 GMT Subject: RFR: 8356154: Respecify java.net.Socket constructors that allow creating UDP sockets to throw IllegalArgumentException [v4] In-Reply-To: References: Message-ID: > Can I please get a review of this change which proposes to respecify the 2 `java.net.Socket` constructors that allow construction of UDP sockets? This addresses https://bugs.openjdk.org/browse/JDK-8356154. > > As noted in that JBS issue, in Java 23 we deprecated for removal the 2 `Socket` constructors that allowed UDP socket creation. The plan continues to be to remove those constructors. Before removing those, in order to allow for applications to notice this deprecation, these constructors are now being respecified to throw an `IllegalArgumentException` when the `stream` parameter is `false`. > > I will create a CSR once we settle on these changes. > > tier1 through tier8 tests have been run with this change and no related failures have been noticed. Jaikiran Pai has updated the pull request incrementally with one additional commit since the last revision: additional changes to SocketImpl.create(...) API javadoc based on review suggestions ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25031/files - new: https://git.openjdk.org/jdk/pull/25031/files/ad880d50..8e329ff6 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25031&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25031&range=02-03 Stats: 10 lines in 1 file changed: 0 ins; 4 del; 6 mod Patch: https://git.openjdk.org/jdk/pull/25031.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25031/head:pull/25031 PR: https://git.openjdk.org/jdk/pull/25031 From jpai at openjdk.org Mon May 5 14:18:26 2025 From: jpai at openjdk.org (Jaikiran Pai) Date: Mon, 5 May 2025 14:18:26 GMT Subject: RFR: 8356154: Respecify java.net.Socket constructors that allow creating UDP sockets to throw IllegalArgumentException [v3] In-Reply-To: References: Message-ID: On Mon, 5 May 2025 14:00:39 GMT, Alan Bateman wrote: >> Jaikiran Pai has updated the pull request incrementally with one additional commit since the last revision: >> >> reword SocketImpl.create(...) API doc > > src/java.base/share/classes/java/net/SocketImpl.java line 90: > >> 88: *

>> 89: * This method will be re-specified in a future release to not >> 90: * support creating datagram sockets. > > I think this could do with another round of rewording. I think I would say that the "stream" parameter provided a way in early JDK releases to create a Socket that used a datagram socket. It's no longer possible to do this and therefore this method will only be called by Socket with stream == false. I pushed a change to take these suggestions. I did some minor changes to the wording. Do you recommend any further changes to that text? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25031#discussion_r2073536109 From jpai at openjdk.org Tue May 6 02:04:18 2025 From: jpai at openjdk.org (Jaikiran Pai) Date: Tue, 6 May 2025 02:04:18 GMT Subject: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v11] In-Reply-To: References: Message-ID: On Thu, 1 May 2025 08:45:06 GMT, Markus KARG wrote: >> This Pull Request proposes an implementation for [JDK-8343110](https://bugs.openjdk.org/browse/JDK-8343110): Adding the new method `public void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)` to the `CharSequence` interface, providing a **bulk-read** facility including a default implementation iterating over `charAt(int)`. >> >> In addition, this Pull Request proposes to replace the implementation of `Reader.of(CharSequence).read(char[] cbuf, int off, int len)` to invoke `CharSequence.getChars(next, next + n, cbuf, off)` instead of utilizing pattern matching for switch. Also, this PR proposes to implement `CharBuffer.getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)` as an alias for `CharBuffer.get(srcBegin, dst, dstBegin, srcEnd - srcBegin)`. >> >> To ensure quality... >> * ...the method signature and JavaDocs are adapted from `AbstractStringBuilder.getChars(...)`. >> * ...this PR relies upon the existing tests for `Reader.of(CharSequence)`, as these provide sufficient coverage of all changes introduced by this PR. > > Markus KARG has updated the pull request incrementally with one additional commit since the last revision: > > Applied proposal by Daniel: If there's no change to this file the copyright year update could be reverted? Hello Markus, it's been a while since this PR was merged with latest master branch in mainline. Could you update the PR to do that? ------------- PR Comment: https://git.openjdk.org/jdk/pull/21730#issuecomment-2853053662 From darcy at openjdk.org Tue May 6 02:24:17 2025 From: darcy at openjdk.org (Joe Darcy) Date: Tue, 6 May 2025 02:24:17 GMT Subject: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v11] In-Reply-To: References: <2jc5ZuZmlzsOBJOD9VwObHfox_2VX8Dmy6AhasVXp3w=.4cabab81-4d24-453d-ab46-eb272f6e7c27@github.com> Message-ID: <5FwC5VTxPYBUNMq8nPPyFxYQ4BMZzaiVxbm1CW9Zbi8=.1b4c9d8f-642b-4666-9961-d77841e39f8e@github.com> On Thu, 1 May 2025 17:18:07 GMT, Markus KARG wrote: >> There are subtleties and perhaps surprises in `@inheritDoc`, but that doesn't necessarily imply the current behavior is buggy. > > So it is actually *wanted* behavior that in one situation the text *is* inherited, but at `String.java` no text is inherited at all? ? Could not find any hint about that in the JavaDoc manual. > So it is actually _wanted_ behavior that in one situation the text _is_ inherited, but at `String.java` no text is inherited at all? ? Could not find any hint about that in the JavaDoc manual. The inheritDoc functionality of javadoc was reworked relatively recently so I would assume the current behavior is intentional, even if not documented. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21730#discussion_r2074634715 From duke at openjdk.org Tue May 6 04:25:26 2025 From: duke at openjdk.org (duke) Date: Tue, 6 May 2025 04:25:26 GMT Subject: Withdrawn: 8337143: (fc, fs) Move filesystem-related native objects from libnio to libjava In-Reply-To: References: Message-ID: On Wed, 24 Jul 2024 19:11:42 GMT, Brian Burkhalter wrote: > This proposed change would move the native objects required for NIO file interaction from the libnio native library to the libjava native library on Linux, macOS, and Windows. This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.org/jdk/pull/20317 From jpai at openjdk.org Tue May 6 04:48:23 2025 From: jpai at openjdk.org (Jaikiran Pai) Date: Tue, 6 May 2025 04:48:23 GMT Subject: RFR: 8356154: Respecify java.net.Socket constructors that allow creating UDP sockets to throw IllegalArgumentException [v4] In-Reply-To: References: Message-ID: On Mon, 5 May 2025 14:18:26 GMT, Jaikiran Pai wrote: >> Can I please get a review of this change which proposes to respecify the 2 `java.net.Socket` constructors that allow construction of UDP sockets? This addresses https://bugs.openjdk.org/browse/JDK-8356154. >> >> As noted in that JBS issue, in Java 23 we deprecated for removal the 2 `Socket` constructors that allowed UDP socket creation. The plan continues to be to remove those constructors. Before removing those, in order to allow for applications to notice this deprecation, these constructors are now being respecified to throw an `IllegalArgumentException` when the `stream` parameter is `false`. >> >> I will create a CSR once we settle on these changes. >> >> tier1 through tier8 tests have been run with this change and no related failures have been noticed. > > Jaikiran Pai has updated the pull request incrementally with one additional commit since the last revision: > > additional changes to SocketImpl.create(...) API javadoc based on review suggestions I've created a CSR https://bugs.openjdk.org/browse/JDK-8356225 and is ready for review. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25031#issuecomment-2853264676 From alanb at openjdk.org Tue May 6 06:35:17 2025 From: alanb at openjdk.org (Alan Bateman) Date: Tue, 6 May 2025 06:35:17 GMT Subject: RFR: 8356154: Respecify java.net.Socket constructors that allow creating UDP sockets to throw IllegalArgumentException [v3] In-Reply-To: References: Message-ID: On Mon, 5 May 2025 13:52:35 GMT, Alan Bateman wrote: >> Jaikiran Pai has updated the pull request incrementally with one additional commit since the last revision: >> >> reword SocketImpl.create(...) API doc > > src/java.base/share/classes/java/net/Socket.java line 384: > >> 382: * stream socket. Only stream socket creation is allowed. If the stream >> 383: * argument is {@code false}, then this constructor throws >> 384: * {@code IllegalArgumentException}. > > I would be tempted to drop this paragraph and just change the description of the `@param stream` to say "must be true". I re-read this paragraph again today and I think it would be better to remove it completely from both constructors. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25031#discussion_r2074807828 From alanb at openjdk.org Tue May 6 06:35:18 2025 From: alanb at openjdk.org (Alan Bateman) Date: Tue, 6 May 2025 06:35:18 GMT Subject: RFR: 8356154: Respecify java.net.Socket constructors that allow creating UDP sockets to throw IllegalArgumentException [v4] In-Reply-To: References: Message-ID: On Mon, 5 May 2025 14:18:26 GMT, Jaikiran Pai wrote: >> Can I please get a review of this change which proposes to respecify the 2 `java.net.Socket` constructors that allow construction of UDP sockets? This addresses https://bugs.openjdk.org/browse/JDK-8356154. >> >> As noted in that JBS issue, in Java 23 we deprecated for removal the 2 `Socket` constructors that allowed UDP socket creation. The plan continues to be to remove those constructors. Before removing those, in order to allow for applications to notice this deprecation, these constructors are now being respecified to throw an `IllegalArgumentException` when the `stream` parameter is `false`. >> >> I will create a CSR once we settle on these changes. >> >> tier1 through tier8 tests have been run with this change and no related failures have been noticed. > > Jaikiran Pai has updated the pull request incrementally with one additional commit since the last revision: > > additional changes to SocketImpl.create(...) API javadoc based on review suggestions src/java.base/share/classes/java/net/Socket.java line 394: > 392: * @param host the host name, or {@code null} for the loopback address. > 393: * @param port the port number. > 394: * @param stream a {@code boolean} indicating whether this is I think the parameter description has to be changed as it no longer indicates if the socket is a stream or datatgram socket. I think you can replace with something simple, like must be true, false is not allowed. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25031#discussion_r2074809933 From jpai at openjdk.org Tue May 6 07:26:05 2025 From: jpai at openjdk.org (Jaikiran Pai) Date: Tue, 6 May 2025 07:26:05 GMT Subject: RFR: 8356154: Respecify java.net.Socket constructors that allow creating UDP sockets to throw IllegalArgumentException [v5] In-Reply-To: References: Message-ID: > Can I please get a review of this change which proposes to respecify the 2 `java.net.Socket` constructors that allow construction of UDP sockets? This addresses https://bugs.openjdk.org/browse/JDK-8356154. > > As noted in that JBS issue, in Java 23 we deprecated for removal the 2 `Socket` constructors that allowed UDP socket creation. The plan continues to be to remove those constructors. Before removing those, in order to allow for applications to notice this deprecation, these constructors are now being respecified to throw an `IllegalArgumentException` when the `stream` parameter is `false`. > > I will create a CSR once we settle on these changes. > > tier1 through tier8 tests have been run with this change and no related failures have been noticed. Jaikiran Pai has updated the pull request incrementally with one additional commit since the last revision: Alan's review suggestion - simplify Socket constructor API documentation ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25031/files - new: https://git.openjdk.org/jdk/pull/25031/files/8e329ff6..9d41bbef Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25031&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25031&range=03-04 Stats: 58 lines in 3 files changed: 44 ins; 12 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/25031.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25031/head:pull/25031 PR: https://git.openjdk.org/jdk/pull/25031 From jpai at openjdk.org Tue May 6 07:26:07 2025 From: jpai at openjdk.org (Jaikiran Pai) Date: Tue, 6 May 2025 07:26:07 GMT Subject: RFR: 8356154: Respecify java.net.Socket constructors that allow creating UDP sockets to throw IllegalArgumentException [v3] In-Reply-To: References: Message-ID: On Tue, 6 May 2025 06:30:27 GMT, Alan Bateman wrote: >> src/java.base/share/classes/java/net/Socket.java line 384: >> >>> 382: * stream socket. Only stream socket creation is allowed. If the stream >>> 383: * argument is {@code false}, then this constructor throws >>> 384: * {@code IllegalArgumentException}. >> >> I would be tempted to drop this paragraph and just change the description of the `@param stream` to say "must be true". > > I re-read this paragraph again today and I think it would be better to remove it completely from both constructors. In my previous round I misread that the review comment was on SocketImpl class, so I never did apply the review changes on these `Socket` constructor. I've now updated the PR to drop this paragraph from both these constructors. I'll update the CSR if this and the rest changes look good. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25031#discussion_r2074868700 From jpai at openjdk.org Tue May 6 07:26:09 2025 From: jpai at openjdk.org (Jaikiran Pai) Date: Tue, 6 May 2025 07:26:09 GMT Subject: RFR: 8356154: Respecify java.net.Socket constructors that allow creating UDP sockets to throw IllegalArgumentException [v4] In-Reply-To: References: Message-ID: On Tue, 6 May 2025 06:32:33 GMT, Alan Bateman wrote: >> Jaikiran Pai has updated the pull request incrementally with one additional commit since the last revision: >> >> additional changes to SocketImpl.create(...) API javadoc based on review suggestions > > src/java.base/share/classes/java/net/Socket.java line 394: > >> 392: * @param host the host name, or {@code null} for the loopback address. >> 393: * @param port the port number. >> 394: * @param stream a {@code boolean} indicating whether this is > > I think the parameter description has to be changed as it no longer indicates if the socket is a stream or datatgram socket. I think you can replace with something simple, like must be true, false is not allowed. Done. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25031#discussion_r2074865018 From alanb at openjdk.org Tue May 6 08:07:16 2025 From: alanb at openjdk.org (Alan Bateman) Date: Tue, 6 May 2025 08:07:16 GMT Subject: RFR: 8356154: Respecify java.net.Socket constructors that allow creating UDP sockets to throw IllegalArgumentException [v5] In-Reply-To: References: Message-ID: On Tue, 6 May 2025 07:26:05 GMT, Jaikiran Pai wrote: >> Can I please get a review of this change which proposes to respecify the 2 `java.net.Socket` constructors that allow construction of UDP sockets? This addresses https://bugs.openjdk.org/browse/JDK-8356154. >> >> As noted in that JBS issue, in Java 23 we deprecated for removal the 2 `Socket` constructors that allowed UDP socket creation. The plan continues to be to remove those constructors. Before removing those, in order to allow for applications to notice this deprecation, these constructors are now being respecified to throw an `IllegalArgumentException` when the `stream` parameter is `false`. >> >> I will create a CSR once we settle on these changes. >> >> tier1 through tier8 tests have been run with this change and no related failures have been noticed. > > Jaikiran Pai has updated the pull request incrementally with one additional commit since the last revision: > > Alan's review suggestion - simplify Socket constructor API documentation src/java.base/share/classes/java/net/Socket.java line 384: > 382: * stream socket. If the stream argument is {@code false}, it > 383: * creates a datagram socket. > 384: *

One final though on the Socket changes is that maybe we should include an API note to say that the stream parameter provided a way in early JDK releases to create a Socket that used a datagram socket, this feature no longer exists. src/java.base/share/classes/java/net/SocketImpl.java line 86: > 84: * The {@code stream} parameter provided a way in early JDK releases > 85: * to create a {@link Socket} that used a datagram socket. > 86: * It is no longer possible to do that and therefore this method will "It is no longer possible to do that ...", can you try changing this to "The Socket API no longer provides a way to do this so the create method will ways to be called with a stream value of true". I think it might be a bit easier to read. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25031#discussion_r2074943962 PR Review Comment: https://git.openjdk.org/jdk/pull/25031#discussion_r2074941652 From jwilhelm at openjdk.org Tue May 6 08:13:21 2025 From: jwilhelm at openjdk.org (Jesper Wilhelmsson) Date: Tue, 6 May 2025 08:13:21 GMT Subject: RFR: 8353795: Add Writer.of(StringBuilder) [v2] In-Reply-To: References: <2xEfp_WiAa-QW5Yao7JoOS3zSOtPKvBq4qV5rk8obWs=.2b1cc84d-2ff4-4d0c-bb0f-bdb276dc109a@github.com> Message-ID: On Sun, 4 May 2025 16:21:41 GMT, Markus KARG wrote: >> This Pull Requests proposes an implementation for [JDK-8353795](https://bugs.openjdk.org/browse/JDK-8353795): Adding the new method `public static Writer Writer.of(StringBuilder)`, providing a non-synchronized Writer implementation optimized for writing into `StringBuilder`. >> >> A basic test is provided to proof that the new `Writer` behaves as expected. For comparison, the same test is also run against `StringWriter`. > > Markus KARG has updated the pull request incrementally with two additional commits since the last revision: > > - Undone copyright update of otherwise unchanged file. > - Update Of.java > > Applied changnes proposed by @liach: "the default toString already includes id=..., so I usually don't provide an explicit override to make the code concise." There is some wording around this topic in the guide already: _In order to prepare the community for your patch, please socialize your idea on the relevant [mailing lists](https://openjdk.org/guide/#mailing-lists). Almost all changes, and in particular any API changes, must go this route and have a broad agreement in place before there is any point in presenting code._ I've added the suggested text to clarify this paragraph: https://github.com/openjdk/guide/pull/150 ------------- PR Comment: https://git.openjdk.org/jdk/pull/24469#issuecomment-2853649815 From jpai at openjdk.org Tue May 6 09:08:23 2025 From: jpai at openjdk.org (Jaikiran Pai) Date: Tue, 6 May 2025 09:08:23 GMT Subject: RFR: 8356154: Respecify java.net.Socket constructors that allow creating UDP sockets to throw IllegalArgumentException [v6] In-Reply-To: References: Message-ID: On Tue, 6 May 2025 08:05:02 GMT, Alan Bateman wrote: >> Jaikiran Pai has updated the pull request incrementally with one additional commit since the last revision: >> >> additional updates to apiNotes > > src/java.base/share/classes/java/net/Socket.java line 384: > >> 382: * stream socket. If the stream argument is {@code false}, it >> 383: * creates a datagram socket. >> 384: *

> > One final though on the Socket changes is that maybe we should include an API note to say that the stream parameter provided a way in early JDK releases to create a Socket that used a datagram socket, this feature no longer exists. Done ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25031#discussion_r2075041966 From jpai at openjdk.org Tue May 6 09:08:22 2025 From: jpai at openjdk.org (Jaikiran Pai) Date: Tue, 6 May 2025 09:08:22 GMT Subject: RFR: 8356154: Respecify java.net.Socket constructors that allow creating UDP sockets to throw IllegalArgumentException [v6] In-Reply-To: References: Message-ID: > Can I please get a review of this change which proposes to respecify the 2 `java.net.Socket` constructors that allow construction of UDP sockets? This addresses https://bugs.openjdk.org/browse/JDK-8356154. > > As noted in that JBS issue, in Java 23 we deprecated for removal the 2 `Socket` constructors that allowed UDP socket creation. The plan continues to be to remove those constructors. Before removing those, in order to allow for applications to notice this deprecation, these constructors are now being respecified to throw an `IllegalArgumentException` when the `stream` parameter is `false`. > > I will create a CSR once we settle on these changes. > > tier1 through tier8 tests have been run with this change and no related failures have been noticed. Jaikiran Pai has updated the pull request incrementally with one additional commit since the last revision: additional updates to apiNotes ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25031/files - new: https://git.openjdk.org/jdk/pull/25031/files/9d41bbef..19cba4d1 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25031&range=05 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25031&range=04-05 Stats: 13 lines in 2 files changed: 11 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/25031.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25031/head:pull/25031 PR: https://git.openjdk.org/jdk/pull/25031 From jpai at openjdk.org Tue May 6 09:08:25 2025 From: jpai at openjdk.org (Jaikiran Pai) Date: Tue, 6 May 2025 09:08:25 GMT Subject: RFR: 8356154: Respecify java.net.Socket constructors that allow creating UDP sockets to throw IllegalArgumentException [v5] In-Reply-To: References: Message-ID: <8UhxkQ5mFn4EK9ytWaDQff95UwJAcUjKG1GORUPiei8=.f7e26903-e87a-44dc-8f71-574d01ed91a4@github.com> On Tue, 6 May 2025 08:03:27 GMT, Alan Bateman wrote: >> Jaikiran Pai has updated the pull request incrementally with one additional commit since the last revision: >> >> Alan's review suggestion - simplify Socket constructor API documentation > > src/java.base/share/classes/java/net/SocketImpl.java line 86: > >> 84: * The {@code stream} parameter provided a way in early JDK releases >> 85: * to create a {@link Socket} that used a datagram socket. >> 86: * It is no longer possible to do that and therefore this method will > > "It is no longer possible to do that ...", can you try changing this to "The Socket API no longer provides a way to do this so the create method will ways to be called with a stream value of true". I think it might be a bit easier to read. Done ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25031#discussion_r2075042155 From jpai at openjdk.org Tue May 6 09:11:32 2025 From: jpai at openjdk.org (Jaikiran Pai) Date: Tue, 6 May 2025 09:11:32 GMT Subject: RFR: 8356154: Respecify java.net.Socket constructors that allow creating UDP sockets to throw IllegalArgumentException [v7] In-Reply-To: References: Message-ID: > Can I please get a review of this change which proposes to respecify the 2 `java.net.Socket` constructors that allow construction of UDP sockets? This addresses https://bugs.openjdk.org/browse/JDK-8356154. > > As noted in that JBS issue, in Java 23 we deprecated for removal the 2 `Socket` constructors that allowed UDP socket creation. The plan continues to be to remove those constructors. Before removing those, in order to allow for applications to notice this deprecation, these constructors are now being respecified to throw an `IllegalArgumentException` when the `stream` parameter is `false`. > > I will create a CSR once we settle on these changes. > > tier1 through tier8 tests have been run with this change and no related failures have been noticed. Jaikiran Pai has updated the pull request incrementally with one additional commit since the last revision: remove unintentional file additions ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25031/files - new: https://git.openjdk.org/jdk/pull/25031/files/19cba4d1..ac71c8a6 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25031&range=06 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25031&range=05-06 Stats: 44 lines in 2 files changed: 0 ins; 44 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/25031.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25031/head:pull/25031 PR: https://git.openjdk.org/jdk/pull/25031 From alanb at openjdk.org Tue May 6 10:13:14 2025 From: alanb at openjdk.org (Alan Bateman) Date: Tue, 6 May 2025 10:13:14 GMT Subject: RFR: 8356154: Respecify java.net.Socket constructors that allow creating UDP sockets to throw IllegalArgumentException [v7] In-Reply-To: References: Message-ID: On Tue, 6 May 2025 09:11:32 GMT, Jaikiran Pai wrote: >> Can I please get a review of this change which proposes to respecify the 2 `java.net.Socket` constructors that allow construction of UDP sockets? This addresses https://bugs.openjdk.org/browse/JDK-8356154. >> >> As noted in that JBS issue, in Java 23 we deprecated for removal the 2 `Socket` constructors that allowed UDP socket creation. The plan continues to be to remove those constructors. Before removing those, in order to allow for applications to notice this deprecation, these constructors are now being respecified to throw an `IllegalArgumentException` when the `stream` parameter is `false`. >> >> I will create a CSR once we settle on these changes. >> >> tier1 through tier8 tests have been run with this change and no related failures have been noticed. > > Jaikiran Pai has updated the pull request incrementally with one additional commit since the last revision: > > remove unintentional file additions Spec + implementation changes looks fine, I have not spent time on the test changes. ------------- Marked as reviewed by alanb (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/25031#pullrequestreview-2817687955 From duke at openjdk.org Tue May 6 11:25:19 2025 From: duke at openjdk.org (Markus KARG) Date: Tue, 6 May 2025 11:25:19 GMT Subject: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v11] In-Reply-To: References: Message-ID: On Tue, 6 May 2025 02:01:24 GMT, Jaikiran Pai wrote: > Hello Markus, it's been a while since this PR was merged with latest master branch in mainline. Could you update the PR to do that? As rebasing is not wanted in OpenJDK, do you mean merging `master` branch into *this* branch? ------------- PR Comment: https://git.openjdk.org/jdk/pull/21730#issuecomment-2854207317 From duke at openjdk.org Tue May 6 11:25:20 2025 From: duke at openjdk.org (Markus KARG) Date: Tue, 6 May 2025 11:25:20 GMT Subject: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v11] In-Reply-To: <5FwC5VTxPYBUNMq8nPPyFxYQ4BMZzaiVxbm1CW9Zbi8=.1b4c9d8f-642b-4666-9961-d77841e39f8e@github.com> References: <2jc5ZuZmlzsOBJOD9VwObHfox_2VX8Dmy6AhasVXp3w=.4cabab81-4d24-453d-ab46-eb272f6e7c27@github.com> <5FwC5VTxPYBUNMq8nPPyFxYQ4BMZzaiVxbm1CW9Zbi8=.1b4c9d8f-642b-4666-9961-d77841e39f8e@github.com> Message-ID: On Tue, 6 May 2025 02:21:20 GMT, Joe Darcy wrote: >> So it is actually *wanted* behavior that in one situation the text *is* inherited, but at `String.java` no text is inherited at all? ? Could not find any hint about that in the JavaDoc manual. > >> So it is actually _wanted_ behavior that in one situation the text _is_ inherited, but at `String.java` no text is inherited at all? ? Could not find any hint about that in the JavaDoc manual. > > The inheritDoc functionality of javadoc was reworked relatively recently so I would assume the current behavior is intentional, even if not documented. Understood. Thank you for clarifying, Joe! :-) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21730#discussion_r2075255586 From jpai at openjdk.org Tue May 6 11:33:23 2025 From: jpai at openjdk.org (Jaikiran Pai) Date: Tue, 6 May 2025 11:33:23 GMT Subject: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v11] In-Reply-To: References: Message-ID: <2Awpgkw3OvX8ZzVWLnn9HKHcDqFF2jFN5-m-knxeWAw=.eb199166-6cc0-4d38-9cbc-138f82577e6f@github.com> On Tue, 6 May 2025 11:23:01 GMT, Markus KARG wrote: > do you mean merging master branch into this branch? Yes, that's correct. That should then run the GitHub actions job against this PR against a more relevant state of this PR. Since things have settled and the CSR approved, I'll also run this PR against our CI to verify nothing fails unexpectedly. I will anyway be doing the merge against master locally before submitting for tier testing, but it's always a good practice to keep the PR updated with latest master changes, when the master branch has seen too many commits since the PR was opened. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21730#issuecomment-2854228917 From michaelm at openjdk.org Tue May 6 13:14:29 2025 From: michaelm at openjdk.org (Michael McMahon) Date: Tue, 6 May 2025 13:14:29 GMT Subject: RFR: 8356154: Respecify java.net.Socket constructors that allow creating UDP sockets to throw IllegalArgumentException [v7] In-Reply-To: References: Message-ID: On Tue, 6 May 2025 09:11:32 GMT, Jaikiran Pai wrote: >> Can I please get a review of this change which proposes to respecify the 2 `java.net.Socket` constructors that allow construction of UDP sockets? This addresses https://bugs.openjdk.org/browse/JDK-8356154. >> >> As noted in that JBS issue, in Java 23 we deprecated for removal the 2 `Socket` constructors that allowed UDP socket creation. The plan continues to be to remove those constructors. Before removing those, in order to allow for applications to notice this deprecation, these constructors are now being respecified to throw an `IllegalArgumentException` when the `stream` parameter is `false`. >> >> I will create a CSR once we settle on these changes. >> >> tier1 through tier8 tests have been run with this change and no related failures have been noticed. > > Jaikiran Pai has updated the pull request incrementally with one additional commit since the last revision: > > remove unintentional file additions src/java.base/share/classes/java/net/Socket.java line 390: > 388: * The {@code stream} parameter provided a way in early JDK releases > 389: * to create a {@code Socket} that used a datagram socket, this feature > 390: * no longer exists. Suggestion: * to create a {@code Socket} that used a datagram socket. This feature * no longer exists. src/java.base/share/classes/java/net/Socket.java line 422: > 420: * The {@code stream} parameter provided a way in early JDK releases > 421: * to create a {@code Socket} that used a datagram socket, this feature > 422: * no longer exists. Suggestion: * to create a {@code Socket} that used a datagram socket. This feature * no longer exists. src/java.base/share/classes/java/net/Socket.java line 455: > 453: if (!stream) { > 454: throw new IllegalArgumentException( > 455: "Socket constructor does not support creation of datagram socket"); Suggestion: "Socket constructor does not support creation of datagram sockets"); ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25031#discussion_r2075440810 PR Review Comment: https://git.openjdk.org/jdk/pull/25031#discussion_r2075441407 PR Review Comment: https://git.openjdk.org/jdk/pull/25031#discussion_r2075443704 From jpai at openjdk.org Tue May 6 13:24:55 2025 From: jpai at openjdk.org (Jaikiran Pai) Date: Tue, 6 May 2025 13:24:55 GMT Subject: RFR: 8356154: Respecify java.net.Socket constructors that allow creating UDP sockets to throw IllegalArgumentException [v8] In-Reply-To: References: Message-ID: <4nkIGeJlHn2PayTM5dWiaHjXGTDcMzUQr6pRxxdUa7c=.04408905-6431-4ea3-a9b3-f92471bba2c0@github.com> > Can I please get a review of this change which proposes to respecify the 2 `java.net.Socket` constructors that allow construction of UDP sockets? This addresses https://bugs.openjdk.org/browse/JDK-8356154. > > As noted in that JBS issue, in Java 23 we deprecated for removal the 2 `Socket` constructors that allowed UDP socket creation. The plan continues to be to remove those constructors. Before removing those, in order to allow for applications to notice this deprecation, these constructors are now being respecified to throw an `IllegalArgumentException` when the `stream` parameter is `false`. > > I will create a CSR once we settle on these changes. > > tier1 through tier8 tests have been run with this change and no related failures have been noticed. Jaikiran Pai has updated the pull request incrementally with one additional commit since the last revision: Michael's review suggestions ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25031/files - new: https://git.openjdk.org/jdk/pull/25031/files/ac71c8a6..4cbe5178 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25031&range=07 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25031&range=06-07 Stats: 3 lines in 1 file changed: 0 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/25031.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25031/head:pull/25031 PR: https://git.openjdk.org/jdk/pull/25031 From jpai at openjdk.org Tue May 6 13:28:18 2025 From: jpai at openjdk.org (Jaikiran Pai) Date: Tue, 6 May 2025 13:28:18 GMT Subject: RFR: 8356154: Respecify java.net.Socket constructors that allow creating UDP sockets to throw IllegalArgumentException [v7] In-Reply-To: References: Message-ID: On Tue, 6 May 2025 13:08:46 GMT, Michael McMahon wrote: >> Jaikiran Pai has updated the pull request incrementally with one additional commit since the last revision: >> >> remove unintentional file additions > > src/java.base/share/classes/java/net/Socket.java line 455: > >> 453: if (!stream) { >> 454: throw new IllegalArgumentException( >> 455: "Socket constructor does not support creation of datagram socket"); > > Suggestion: > > "Socket constructor does not support creation of datagram sockets"); Thank you Michael, I updated the PR with all 3 suggestions. The CSR text too has been updated with this minor update. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25031#discussion_r2075475704 From dfuchs at openjdk.org Tue May 6 15:25:21 2025 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Tue, 6 May 2025 15:25:21 GMT Subject: RFR: 8356154: Respecify java.net.Socket constructors that allow creating UDP sockets to throw IllegalArgumentException [v8] In-Reply-To: <4nkIGeJlHn2PayTM5dWiaHjXGTDcMzUQr6pRxxdUa7c=.04408905-6431-4ea3-a9b3-f92471bba2c0@github.com> References: <4nkIGeJlHn2PayTM5dWiaHjXGTDcMzUQr6pRxxdUa7c=.04408905-6431-4ea3-a9b3-f92471bba2c0@github.com> Message-ID: <9VQz42tM2RIpwOmY4v3SKd0Akik3xtEvDSKl144H-mg=.53cfd557-0762-4dc4-8105-6dc373b8d184@github.com> On Tue, 6 May 2025 13:24:55 GMT, Jaikiran Pai wrote: >> Can I please get a review of this change which proposes to respecify the 2 `java.net.Socket` constructors that allow construction of UDP sockets? This addresses https://bugs.openjdk.org/browse/JDK-8356154. >> >> As noted in that JBS issue, in Java 23 we deprecated for removal the 2 `Socket` constructors that allowed UDP socket creation. The plan continues to be to remove those constructors. Before removing those, in order to allow for applications to notice this deprecation, these constructors are now being respecified to throw an `IllegalArgumentException` when the `stream` parameter is `false`. >> >> I will create a CSR once we settle on these changes. >> >> tier1 through tier8 tests have been run with this change and no related failures have been noticed. > > Jaikiran Pai has updated the pull request incrementally with one additional commit since the last revision: > > Michael's review suggestions src/java.base/share/classes/java/net/Socket.java line 390: > 388: * The {@code stream} parameter provided a way in early JDK releases > 389: * to create a {@code Socket} that used a datagram socket. This feature > 390: * no longer exists. Should we also re-iterate here that this constructor is deprecated? It kind of feels like this information should be in `@deprecated` instead, or that it should say that IAE is being thrown... ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25031#discussion_r2075720161 From duke at openjdk.org Tue May 6 16:56:22 2025 From: duke at openjdk.org (Markus KARG) Date: Tue, 6 May 2025 16:56:22 GMT Subject: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v11] In-Reply-To: <2Awpgkw3OvX8ZzVWLnn9HKHcDqFF2jFN5-m-knxeWAw=.eb199166-6cc0-4d38-9cbc-138f82577e6f@github.com> References: <2Awpgkw3OvX8ZzVWLnn9HKHcDqFF2jFN5-m-knxeWAw=.eb199166-6cc0-4d38-9cbc-138f82577e6f@github.com> Message-ID: On Tue, 6 May 2025 11:30:09 GMT, Jaikiran Pai wrote: > > do you mean merging master branch into this branch? > > Yes, that's correct. That should then run the GitHub actions job against this PR against a more relevant state of this PR. > > Since things have settled and the CSR approved, I'll also run this PR against our CI to verify nothing fails unexpectedly. I will anyway be doing the merge against master locally before submitting for tier testing, but it's always a good practice to keep the PR updated with latest master changes, when the master branch has seen too many commits since the PR was opened. Yes that is pretty clear. I'm using git since decades but always do rebase in all other project, so my question was only about *how* to perform the update. ? ------------- PR Comment: https://git.openjdk.org/jdk/pull/21730#issuecomment-2855286477 From jpai at openjdk.org Tue May 6 17:05:20 2025 From: jpai at openjdk.org (Jaikiran Pai) Date: Tue, 6 May 2025 17:05:20 GMT Subject: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v11] In-Reply-To: References: <2Awpgkw3OvX8ZzVWLnn9HKHcDqFF2jFN5-m-knxeWAw=.eb199166-6cc0-4d38-9cbc-138f82577e6f@github.com> Message-ID: <6tJ94UzFn2GwHMB9WK3Xeig34edB02mMoWw8_ZjPMzc=.a69e8f1b-edd4-4c89-b34f-8248b11852c4@github.com> On Tue, 6 May 2025 16:53:07 GMT, Markus KARG wrote: > so my question was only about how to perform the update. Locally, if your remote repo that points to github.com/openjdk/jdk is named `upstream` and the local branch from which you have created this PR is named `getchars`, then you would do something like the following: # fetch latest changes in master branch of github.com/openjdk/jdk git fetch upstream master # update your local workspace to your local getchars branch (if you aren't already on it) git switch getchars # merge the changes from upstream master branch into this local getchars branch git merge -m "merge latest from master branch" upstream/master If there are no merge resolution conflicts, then those command should be enough and your local `getchars` branch should now have the upstream master changes. Once you build and test locally you can then push those changes from `getchars` branch to your forked remote repo's getchars branch (and thus automatically update this PR) using: # while being on getchars branch locally and your forked remote is named mkarg-remote git push mkarg-remote getchars ------------- PR Comment: https://git.openjdk.org/jdk/pull/21730#issuecomment-2855309443 From duke at openjdk.org Tue May 6 17:33:20 2025 From: duke at openjdk.org (Markus KARG) Date: Tue, 6 May 2025 17:33:20 GMT Subject: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v11] In-Reply-To: References: Message-ID: <3KjNbuZlZwyr7pAf6idOFXuQO7TUNYXya8nUPGvlkII=.ba5d118a-17bb-4b56-a11c-065a59788ca9@github.com> On Thu, 1 May 2025 08:45:06 GMT, Markus KARG wrote: >> This Pull Request proposes an implementation for [JDK-8343110](https://bugs.openjdk.org/browse/JDK-8343110): Adding the new method `public void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)` to the `CharSequence` interface, providing a **bulk-read** facility including a default implementation iterating over `charAt(int)`. >> >> In addition, this Pull Request proposes to replace the implementation of `Reader.of(CharSequence).read(char[] cbuf, int off, int len)` to invoke `CharSequence.getChars(next, next + n, cbuf, off)` instead of utilizing pattern matching for switch. Also, this PR proposes to implement `CharBuffer.getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)` as an alias for `CharBuffer.get(srcBegin, dst, dstBegin, srcEnd - srcBegin)`. >> >> To ensure quality... >> * ...the method signature and JavaDocs are adapted from `AbstractStringBuilder.getChars(...)`. >> * ...this PR relies upon the existing tests for `Reader.of(CharSequence)`, as these provide sufficient coverage of all changes introduced by this PR. > > Markus KARG has updated the pull request incrementally with one additional commit since the last revision: > > Applied proposal by Daniel: If there's no change to this file the copyright year update could be reverted? I know all that. As I said, I am using git since decades, so I know *lots* of alternative ways to update branches and even proposed the one you want, so I just needed to know *which of those alternatives* (not the exact commands) you *want*. Don't know why posted all that, as the question was already solved by you?! ? ------------- PR Comment: https://git.openjdk.org/jdk/pull/21730#issuecomment-2855388011 From bpb at openjdk.org Tue May 6 20:14:05 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Tue, 6 May 2025 20:14:05 GMT Subject: RFR: 8337143: (fc, fs) Move filesystem-related native objects from libnio to libjava [v13] In-Reply-To: References: Message-ID: > This proposed change would move the native objects required for NIO file interaction from the libnio native library to the libjava native library on Linux, macOS, and Windows. Brian Burkhalter has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 13 commits: - Merge - Merge - Merge - Merge - Merge - 8337143: Minor makefile tweak - 8337143: Clean up to address reviewer comments - Merge - 8337143: Remove loading libnet from Inet6AddressImpl; delete commented out #include in Windows IOUtil.c - Merge - ... and 3 more: https://git.openjdk.org/jdk/compare/9477c422...da21fa69 ------------- Changes: https://git.openjdk.org/jdk/pull/20317/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=20317&range=12 Stats: 1541 lines in 93 files changed: 774 ins; 668 del; 99 mod Patch: https://git.openjdk.org/jdk/pull/20317.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20317/head:pull/20317 PR: https://git.openjdk.org/jdk/pull/20317 From duke at openjdk.org Tue May 6 20:32:17 2025 From: duke at openjdk.org (Markus KARG) Date: Tue, 6 May 2025 20:32:17 GMT Subject: RFR: 8353795: Add Writer.of(StringBuilder) [v2] In-Reply-To: References: <2xEfp_WiAa-QW5Yao7JoOS3zSOtPKvBq4qV5rk8obWs=.2b1cc84d-2ff4-4d0c-bb0f-bdb276dc109a@github.com> Message-ID: On Sun, 4 May 2025 16:21:41 GMT, Markus KARG wrote: >> This Pull Requests proposes an implementation for [JDK-8353795](https://bugs.openjdk.org/browse/JDK-8353795): Adding the new method `public static Writer Writer.of(StringBuilder)`, providing a non-synchronized Writer implementation optimized for writing into `StringBuilder`. >> >> A basic test is provided to proof that the new `Writer` behaves as expected. For comparison, the same test is also run against `StringWriter`. > > Markus KARG has updated the pull request incrementally with two additional commits since the last revision: > > - Undone copyright update of otherwise unchanged file. > - Update Of.java > > Applied changnes proposed by @liach: "the default toString already includes id=..., so I usually don't provide an explicit override to make the code concise." > There is some wording around this topic in the guide already: _In order to prepare the community for your patch, please socialize your idea on the relevant [mailing lists](https://openjdk.org/guide/#mailing-lists). Almost all changes, and in particular any API changes, must go this route and have a broad agreement in place before there is any point in presenting code._ > > I've added the suggested text to clarify this paragraph: [openjdk/guide#150](https://github.com/openjdk/guide/pull/150) Then I can literally stop working on OpenJDK rather immediately, as people never find enough time for **"broad"** agreement. At least they didn't in the past **years**. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24469#issuecomment-2855892549 From duke at openjdk.org Tue May 6 20:52:34 2025 From: duke at openjdk.org (Markus KARG) Date: Tue, 6 May 2025 20:52:34 GMT Subject: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v12] In-Reply-To: References: Message-ID: > This Pull Request proposes an implementation for [JDK-8343110](https://bugs.openjdk.org/browse/JDK-8343110): Adding the new method `public void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)` to the `CharSequence` interface, providing a **bulk-read** facility including a default implementation iterating over `charAt(int)`. > > In addition, this Pull Request proposes to replace the implementation of `Reader.of(CharSequence).read(char[] cbuf, int off, int len)` to invoke `CharSequence.getChars(next, next + n, cbuf, off)` instead of utilizing pattern matching for switch. Also, this PR proposes to implement `CharBuffer.getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)` as an alias for `CharBuffer.get(srcBegin, dst, dstBegin, srcEnd - srcBegin)`. > > To ensure quality... > * ...the method signature and JavaDocs are adapted from `AbstractStringBuilder.getChars(...)`. > * ...this PR relies upon the existing tests for `Reader.of(CharSequence)`, as these provide sufficient coverage of all changes introduced by this PR. Markus KARG has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 17 commits: - merge latest from master branch - Applied proposal by Daniel: If there's no change to this file the copyright year update could be reverted? - Applied workaround proposed by Joe: Using component @inheritDoc to enforce getChars section in JavaDocs - Applied changes proposed by Joe and Jaikiran: Using @inheritDoc to get JavaDocs without @since. - Applied changes proposed in response to Joe's CSR comments: 'understood for CharBuffer; I was thinking more of String, StringBuffer, and StringBuilder where there looks to be more textual similarities.' - Applied changes requestes by Alan: Aligning unit test for CharBuffer.getChars() with unit test for CharBuffer.chars() - Applied changes requested by Chen and Jaikiran: Unit tests for default implementation of CharSequence.getChars() and for CharBuffer.getChars() - Applied changes requested by Chen: 'We might need to specify the IOOBE behavior - when an IOOBE is thrown, some characters may be already transferred (this is important for concurrent char sequences)' - Applied changes requested by Alan: This sentence doesn't make sense, did something get deleted? - Applied changes requested by Alan: Copies chars from this sequence into the given destination array - ... and 7 more: https://git.openjdk.org/jdk/compare/b21b3a38...31537b7a ------------- Changes: https://git.openjdk.org/jdk/pull/21730/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21730&range=11 Stats: 470 lines in 8 files changed: 399 ins; 59 del; 12 mod Patch: https://git.openjdk.org/jdk/pull/21730.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21730/head:pull/21730 PR: https://git.openjdk.org/jdk/pull/21730 From duke at openjdk.org Tue May 6 20:54:17 2025 From: duke at openjdk.org (Markus KARG) Date: Tue, 6 May 2025 20:54:17 GMT Subject: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v11] In-Reply-To: References: Message-ID: On Tue, 6 May 2025 11:23:01 GMT, Markus KARG wrote: > Hello Markus, it's been a while since this PR was merged with latest master branch in mainline. Could you update the PR to do that? Updated to current `master`. Builds fine locally. Pushed to Github. Github Actions currently are running. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21730#issuecomment-2855944238 From jwilhelm at openjdk.org Tue May 6 21:57:15 2025 From: jwilhelm at openjdk.org (Jesper Wilhelmsson) Date: Tue, 6 May 2025 21:57:15 GMT Subject: RFR: 8353795: Add Writer.of(StringBuilder) [v2] In-Reply-To: References: <2xEfp_WiAa-QW5Yao7JoOS3zSOtPKvBq4qV5rk8obWs=.2b1cc84d-2ff4-4d0c-bb0f-bdb276dc109a@github.com> Message-ID: On Sun, 4 May 2025 16:21:41 GMT, Markus KARG wrote: >> This Pull Requests proposes an implementation for [JDK-8353795](https://bugs.openjdk.org/browse/JDK-8353795): Adding the new method `public static Writer Writer.of(StringBuilder)`, providing a non-synchronized Writer implementation optimized for writing into `StringBuilder`. >> >> A basic test is provided to proof that the new `Writer` behaves as expected. For comparison, the same test is also run against `StringWriter`. > > Markus KARG has updated the pull request incrementally with two additional commits since the last revision: > > - Undone copyright update of otherwise unchanged file. > - Update Of.java > > Applied changnes proposed by @liach: "the default toString already includes id=..., so I usually don't provide an explicit override to make the code concise." We must remember that the OpenJDK community is built by individuals with different backgrounds and motivations to engaging. Some people get paid to work on OpenJDK development, others do it in their own time. It would be next to impossible to dictate any kinds of rules to enforce engagement from reviewers as this would require companies and individuals to commit to prioritizing issues that may not be in their interest to spend time on. Any kind of "if you engage in a discussion you must reply within X weeks" will most likely only result in less people engaging in the first place. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24469#issuecomment-2856187951 From duke at openjdk.org Wed May 7 06:23:24 2025 From: duke at openjdk.org (Markus KARG) Date: Wed, 7 May 2025 06:23:24 GMT Subject: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v12] In-Reply-To: References: Message-ID: On Tue, 6 May 2025 20:52:34 GMT, Markus KARG wrote: >> This Pull Request proposes an implementation for [JDK-8343110](https://bugs.openjdk.org/browse/JDK-8343110): Adding the new method `public void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)` to the `CharSequence` interface, providing a **bulk-read** facility including a default implementation iterating over `charAt(int)`. >> >> In addition, this Pull Request proposes to replace the implementation of `Reader.of(CharSequence).read(char[] cbuf, int off, int len)` to invoke `CharSequence.getChars(next, next + n, cbuf, off)` instead of utilizing pattern matching for switch. Also, this PR proposes to implement `CharBuffer.getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)` as an alias for `CharBuffer.get(srcBegin, dst, dstBegin, srcEnd - srcBegin)`. >> >> To ensure quality... >> * ...the method signature and JavaDocs are adapted from `AbstractStringBuilder.getChars(...)`. >> * ...this PR relies upon the existing tests for `Reader.of(CharSequence)`, as these provide sufficient coverage of all changes introduced by this PR. > > Markus KARG has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 17 commits: > > - merge latest from master branch > - Applied proposal by Daniel: If there's no change to this file the copyright year update could be reverted? > - Applied workaround proposed by Joe: Using component @inheritDoc to enforce getChars section in JavaDocs > - Applied changes proposed by Joe and Jaikiran: Using @inheritDoc to get JavaDocs without @since. > - Applied changes proposed in response to Joe's CSR comments: 'understood for CharBuffer; I was thinking more of String, StringBuffer, and StringBuilder where there looks to be more textual similarities.' > - Applied changes requestes by Alan: Aligning unit test for CharBuffer.getChars() with unit test for CharBuffer.chars() > - Applied changes requested by Chen and Jaikiran: Unit tests for default implementation of CharSequence.getChars() and for CharBuffer.getChars() > - Applied changes requested by Chen: 'We might need to specify the IOOBE behavior - when an IOOBE is thrown, some characters may be already transferred (this is important for concurrent char sequences)' > - Applied changes requested by Alan: This sentence doesn't make sense, did something get deleted? > - Applied changes requested by Alan: Copies chars from this sequence into the given destination array > - ... and 7 more: https://git.openjdk.org/jdk/compare/b21b3a38...31537b7a Github Actions have successfully passed all checks. ?? ? ------------- PR Comment: https://git.openjdk.org/jdk/pull/21730#issuecomment-2857242098 From duke at openjdk.org Wed May 7 09:29:23 2025 From: duke at openjdk.org (Markus KARG) Date: Wed, 7 May 2025 09:29:23 GMT Subject: RFR: 8353795: Add Writer.of(StringBuilder) [v2] In-Reply-To: References: <2xEfp_WiAa-QW5Yao7JoOS3zSOtPKvBq4qV5rk8obWs=.2b1cc84d-2ff4-4d0c-bb0f-bdb276dc109a@github.com> Message-ID: On Tue, 6 May 2025 21:54:59 GMT, Jesper Wilhelmsson wrote: > We must remember that the OpenJDK community is built by individuals with different backgrounds and motivations to engaging. Some people get paid to work on OpenJDK development, others do it in their own time. It would be next to impossible to dictate any kinds of rules to enforce engagement from reviewers as this would require companies and individuals to commit to prioritizing issues that may not be in their interest to spend time on. > > Any kind of "if you engage in a discussion you must reply within X weeks" will most likely only result in less people engaging in the first place. I *am* on of those unpaid fellows, actually. Sure, we are not the project police, and it is not about *controlling* people, but what I meant is that if we enforce "broad agreement" *piror* to a PR, then we MUST tell those people that they SHOULD react *prior* to the PR. Actually, currently many of them do not respond at all, even if they like to have a feature, as they think "I will chime in once the PR is there" (this is my recognized experience with my last PRs). So when you hold me back from PRs, the other side of the medal is that you tell all those people that they cannot wait for the PR anymore, but they MUST send at least "+1" or "proceed with PR" in the mailing list. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24469#issuecomment-2857838032 From jpai at openjdk.org Wed May 7 10:08:24 2025 From: jpai at openjdk.org (Jaikiran Pai) Date: Wed, 7 May 2025 10:08:24 GMT Subject: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v12] In-Reply-To: References: Message-ID: On Tue, 6 May 2025 20:52:34 GMT, Markus KARG wrote: >> This Pull Request proposes an implementation for [JDK-8343110](https://bugs.openjdk.org/browse/JDK-8343110): Adding the new method `public void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)` to the `CharSequence` interface, providing a **bulk-read** facility including a default implementation iterating over `charAt(int)`. >> >> In addition, this Pull Request proposes to replace the implementation of `Reader.of(CharSequence).read(char[] cbuf, int off, int len)` to invoke `CharSequence.getChars(next, next + n, cbuf, off)` instead of utilizing pattern matching for switch. Also, this PR proposes to implement `CharBuffer.getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)` as an alias for `CharBuffer.get(srcBegin, dst, dstBegin, srcEnd - srcBegin)`. >> >> To ensure quality... >> * ...the method signature and JavaDocs are adapted from `AbstractStringBuilder.getChars(...)`. >> * ...this PR relies upon the existing tests for `Reader.of(CharSequence)`, as these provide sufficient coverage of all changes introduced by this PR. > > Markus KARG has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 17 commits: > > - merge latest from master branch > - Applied proposal by Daniel: If there's no change to this file the copyright year update could be reverted? > - Applied workaround proposed by Joe: Using component @inheritDoc to enforce getChars section in JavaDocs > - Applied changes proposed by Joe and Jaikiran: Using @inheritDoc to get JavaDocs without @since. > - Applied changes proposed in response to Joe's CSR comments: 'understood for CharBuffer; I was thinking more of String, StringBuffer, and StringBuilder where there looks to be more textual similarities.' > - Applied changes requestes by Alan: Aligning unit test for CharBuffer.getChars() with unit test for CharBuffer.chars() > - Applied changes requested by Chen and Jaikiran: Unit tests for default implementation of CharSequence.getChars() and for CharBuffer.getChars() > - Applied changes requested by Chen: 'We might need to specify the IOOBE behavior - when an IOOBE is thrown, some characters may be already transferred (this is important for concurrent char sequences)' > - Applied changes requested by Alan: This sentence doesn't make sense, did something get deleted? > - Applied changes requested by Alan: Copies chars from this sequence into the given destination array > - ... and 7 more: https://git.openjdk.org/jdk/compare/b21b3a38...31537b7a tier1 through tier3 testing of this PR passed without issues. The CSR has been approved and the changes in this PR look good to me. Thank you for being patient and contributing this enhancement. ------------- Marked as reviewed by jpai (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21730#pullrequestreview-2821184175 From jpai at openjdk.org Wed May 7 10:32:16 2025 From: jpai at openjdk.org (Jaikiran Pai) Date: Wed, 7 May 2025 10:32:16 GMT Subject: RFR: 8356154: Respecify java.net.Socket constructors that allow creating UDP sockets to throw IllegalArgumentException [v8] In-Reply-To: <9VQz42tM2RIpwOmY4v3SKd0Akik3xtEvDSKl144H-mg=.53cfd557-0762-4dc4-8105-6dc373b8d184@github.com> References: <4nkIGeJlHn2PayTM5dWiaHjXGTDcMzUQr6pRxxdUa7c=.04408905-6431-4ea3-a9b3-f92471bba2c0@github.com> <9VQz42tM2RIpwOmY4v3SKd0Akik3xtEvDSKl144H-mg=.53cfd557-0762-4dc4-8105-6dc373b8d184@github.com> Message-ID: On Tue, 6 May 2025 15:22:02 GMT, Daniel Fuchs wrote: >> Jaikiran Pai has updated the pull request incrementally with one additional commit since the last revision: >> >> Michael's review suggestions > > src/java.base/share/classes/java/net/Socket.java line 390: > >> 388: * The {@code stream} parameter provided a way in early JDK releases >> 389: * to create a {@code Socket} that used a datagram socket. This feature >> 390: * no longer exists. > > Should we also re-iterate here that this constructor is deprecated? It kind of feels like this information should be in `@deprecated` instead, or that it should say that IAE is being thrown... Hello Daniel, do you mean something like this: - * @apiNote - * The {@code stream} parameter provided a way in early JDK releases - * to create a {@code Socket} that used a datagram socket. This feature - * no longer exists. - * * @param host the IP address. * @param port the port number. * @param stream must be true, false is not allowed. @@ -429,7 +424,9 @@ public Socket(String host, int port, boolean stream) throws IOException { * or if the port parameter is outside the specified range of valid * port values, which is between 0 and 65535, inclusive. * @throws NullPointerException if {@code host} is null. - * @deprecated Use {@link DatagramSocket} instead for UDP transport. + * @deprecated The {@code stream} parameter provided a way in early JDK releases + * to create a {@code Socket} that used a datagram socket. This feature + * no longer exists. Use {@link DatagramSocket} instead for UDP transport. Having that text in `@deprecated` does convey the reason for deprecation and does show up prominently in the rendered javadoc: doc So if you and others think we should remove the apiNote and move the text to deprecated, then I'll update the PR and the CSR. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25031#discussion_r2077324431 From alanb at openjdk.org Wed May 7 10:37:15 2025 From: alanb at openjdk.org (Alan Bateman) Date: Wed, 7 May 2025 10:37:15 GMT Subject: RFR: 8356154: Respecify java.net.Socket constructors that allow creating UDP sockets to throw IllegalArgumentException [v8] In-Reply-To: References: <4nkIGeJlHn2PayTM5dWiaHjXGTDcMzUQr6pRxxdUa7c=.04408905-6431-4ea3-a9b3-f92471bba2c0@github.com> <9VQz42tM2RIpwOmY4v3SKd0Akik3xtEvDSKl144H-mg=.53cfd557-0762-4dc4-8105-6dc373b8d184@github.com> Message-ID: On Wed, 7 May 2025 10:29:44 GMT, Jaikiran Pai wrote: >> src/java.base/share/classes/java/net/Socket.java line 390: >> >>> 388: * The {@code stream} parameter provided a way in early JDK releases >>> 389: * to create a {@code Socket} that used a datagram socket. This feature >>> 390: * no longer exists. >> >> Should we also re-iterate here that this constructor is deprecated? It kind of feels like this information should be in `@deprecated` instead, or that it should say that IAE is being thrown... > > Hello Daniel, do you mean something like this: > > - * @apiNote > - * The {@code stream} parameter provided a way in early JDK releases > - * to create a {@code Socket} that used a datagram socket. This feature > - * no longer exists. > - * > * @param host the IP address. > * @param port the port number. > * @param stream must be true, false is not allowed. > @@ -429,7 +424,9 @@ public Socket(String host, int port, boolean stream) throws IOException { > * or if the port parameter is outside the specified range of valid > * port values, which is between 0 and 65535, inclusive. > * @throws NullPointerException if {@code host} is null. > - * @deprecated Use {@link DatagramSocket} instead for UDP transport. > + * @deprecated The {@code stream} parameter provided a way in early JDK releases > + * to create a {@code Socket} that used a datagram socket. This feature > + * no longer exists. Use {@link DatagramSocket} instead for UDP transport. > > > Having that text in `@deprecated` does convey the reason for deprecation and does show up prominently in the rendered javadoc: > > doc > > > So if you and others think we should remove the apiNote and move the text to deprecated, then I'll update the PR and the CSR. Okay with me but for SocketImpl then I think it has to be an apiNote as the create method is not deprecated. BTW: "Use DatagramSocket instead for UDP transport" switches the terminology. The first sentence uses "datagram socket" so I best to use that in the second sentence to avoid "UDP" and "transport". ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25031#discussion_r2077331080 From jpai at openjdk.org Wed May 7 10:40:15 2025 From: jpai at openjdk.org (Jaikiran Pai) Date: Wed, 7 May 2025 10:40:15 GMT Subject: RFR: 8356154: Respecify java.net.Socket constructors that allow creating UDP sockets to throw IllegalArgumentException [v8] In-Reply-To: References: <4nkIGeJlHn2PayTM5dWiaHjXGTDcMzUQr6pRxxdUa7c=.04408905-6431-4ea3-a9b3-f92471bba2c0@github.com> <9VQz42tM2RIpwOmY4v3SKd0Akik3xtEvDSKl144H-mg=.53cfd557-0762-4dc4-8105-6dc373b8d184@github.com> Message-ID: On Wed, 7 May 2025 10:34:07 GMT, Alan Bateman wrote: > Okay with me but for SocketImpl then I think it has to be an apiNote as the create method is not deprecated. Makes sense. > BTW: "Use DatagramSocket instead for UDP transport" switches the terminology. The first sentence uses "datagram socket" so I best to use that in the second sentence to avoid "UDP" and "transport". I agree, I'll use "datagram socket". ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25031#discussion_r2077336378 From duke at openjdk.org Wed May 7 10:56:19 2025 From: duke at openjdk.org (Markus KARG) Date: Wed, 7 May 2025 10:56:19 GMT Subject: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v12] In-Reply-To: References: Message-ID: On Wed, 7 May 2025 10:05:12 GMT, Jaikiran Pai wrote: > tier1 through tier3 testing of this PR passed without issues. The CSR has been approved and the changes in this PR look good to me. Thank you, Jaikiran! Will this result convince everybody to actively mark this PR as officially reviewed, so I can finally integrate it? ? ------------- PR Comment: https://git.openjdk.org/jdk/pull/21730#issuecomment-2858104713 From duke at openjdk.org Wed May 7 11:08:18 2025 From: duke at openjdk.org (Markus KARG) Date: Wed, 7 May 2025 11:08:18 GMT Subject: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v12] In-Reply-To: References: Message-ID: On Wed, 7 May 2025 10:53:09 GMT, Markus KARG wrote: > Thank you, Jaikiran! Will this result convince everybody to actively mark this PR as officially reviewed, so I can finally integrate it? ? @liach For example, you could approve your outdated approval so this PR finally has to *current* reviews. Thanks. >[Chen Liang](https://openjdk.org/census#liach) (@liach - Reviewer) ? **Re-review required** (review applies to [884e7dc1](https://git.openjdk.org/jdk/pull/21730/files/884e7dc14c25b47ff6e5056fb663cfccf17f243e)) ------------- PR Comment: https://git.openjdk.org/jdk/pull/21730#issuecomment-2858138560 From dfuchs at openjdk.org Wed May 7 11:19:16 2025 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Wed, 7 May 2025 11:19:16 GMT Subject: RFR: 8356154: Respecify java.net.Socket constructors that allow creating UDP sockets to throw IllegalArgumentException [v8] In-Reply-To: References: <4nkIGeJlHn2PayTM5dWiaHjXGTDcMzUQr6pRxxdUa7c=.04408905-6431-4ea3-a9b3-f92471bba2c0@github.com> <9VQz42tM2RIpwOmY4v3SKd0Akik3xtEvDSKl144H-mg=.53cfd557-0762-4dc4-8105-6dc373b8d184@github.com> Message-ID: <66XUrKW3cC52QrIpCV7Sn0rXMOe1nsCHub0l5mRYvts=.e91ff201-c989-4507-b5b5-d3d3a4451283@github.com> On Wed, 7 May 2025 10:37:47 GMT, Jaikiran Pai wrote: >> Okay with me but for SocketImpl then I think it has to be an apiNote as the create method is not deprecated. >> >> BTW: "Use DatagramSocket instead for UDP transport" switches the terminology. The first sentence uses "datagram socket" so I best to use that in the second sentence to avoid "UDP" and "transport". > >> Okay with me but for SocketImpl then I think it has to be an apiNote as the create method is not deprecated. > > Makes sense. > >> BTW: "Use DatagramSocket instead for UDP transport" switches the terminology. The first sentence uses "datagram socket" so I best to use that in the second sentence to avoid "UDP" and "transport". > > I agree, I'll use "datagram socket". Thanks Jaikiran. Yes - it feels weird to add an `@apiNote` to a method or constructor that has long been deprecated: if it's deprecated you're not supposed to use it. I couldn't help feeling that using an `@apiNote` there conveyed the wrong message. I am completely OK with the `@apiNote` on the `create` method though - since that one isn't deprecated. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25031#discussion_r2077398768 From jpai at openjdk.org Wed May 7 11:34:08 2025 From: jpai at openjdk.org (Jaikiran Pai) Date: Wed, 7 May 2025 11:34:08 GMT Subject: RFR: 8356154: Respecify java.net.Socket constructors that allow creating UDP sockets to throw IllegalArgumentException [v9] In-Reply-To: References: Message-ID: > Can I please get a review of this change which proposes to respecify the 2 `java.net.Socket` constructors that allow construction of UDP sockets? This addresses https://bugs.openjdk.org/browse/JDK-8356154. > > As noted in that JBS issue, in Java 23 we deprecated for removal the 2 `Socket` constructors that allowed UDP socket creation. The plan continues to be to remove those constructors. Before removing those, in order to allow for applications to notice this deprecation, these constructors are now being respecified to throw an `IllegalArgumentException` when the `stream` parameter is `false`. > > I will create a CSR once we settle on these changes. > > tier1 through tier8 tests have been run with this change and no related failures have been noticed. Jaikiran Pai has updated the pull request incrementally with one additional commit since the last revision: move apiNote text to deprecated text ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25031/files - new: https://git.openjdk.org/jdk/pull/25031/files/4cbe5178..77a332bc Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25031&range=08 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25031&range=07-08 Stats: 16 lines in 1 file changed: 4 ins; 10 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/25031.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25031/head:pull/25031 PR: https://git.openjdk.org/jdk/pull/25031 From jpai at openjdk.org Wed May 7 11:34:08 2025 From: jpai at openjdk.org (Jaikiran Pai) Date: Wed, 7 May 2025 11:34:08 GMT Subject: RFR: 8356154: Respecify java.net.Socket constructors that allow creating UDP sockets to throw IllegalArgumentException [v8] In-Reply-To: <66XUrKW3cC52QrIpCV7Sn0rXMOe1nsCHub0l5mRYvts=.e91ff201-c989-4507-b5b5-d3d3a4451283@github.com> References: <4nkIGeJlHn2PayTM5dWiaHjXGTDcMzUQr6pRxxdUa7c=.04408905-6431-4ea3-a9b3-f92471bba2c0@github.com> <9VQz42tM2RIpwOmY4v3SKd0Akik3xtEvDSKl144H-mg=.53cfd557-0762-4dc4-8105-6dc373b8d184@github.com> <66XUrKW3cC52QrIpCV7Sn0rXMOe1nsCHub0l5mRYvts=.e91ff201-c989-4507-b5b5-d3d3a4451283@github.com> Message-ID: On Wed, 7 May 2025 11:16:48 GMT, Daniel Fuchs wrote: >>> Okay with me but for SocketImpl then I think it has to be an apiNote as the create method is not deprecated. >> >> Makes sense. >> >>> BTW: "Use DatagramSocket instead for UDP transport" switches the terminology. The first sentence uses "datagram socket" so I best to use that in the second sentence to avoid "UDP" and "transport". >> >> I agree, I'll use "datagram socket". > > Thanks Jaikiran. Yes - it feels weird to add an `@apiNote` to a method or constructor that has long been deprecated: if it's deprecated you're not supposed to use it. I couldn't help feeling that using an `@apiNote` there conveyed the wrong message. I am completely OK with the `@apiNote` on the `create` method though - since that one isn't deprecated. I've updated the PR to move the text into `@deprecated` section for these 2 constructors. I'll update the CSR once this new text is approved. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25031#discussion_r2077420523 From dfuchs at openjdk.org Wed May 7 11:58:17 2025 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Wed, 7 May 2025 11:58:17 GMT Subject: RFR: 8356154: Respecify java.net.Socket constructors that allow creating UDP sockets to throw IllegalArgumentException [v9] In-Reply-To: References: Message-ID: <5dYxWt9H_6SIIW3QzGbI7cno8HbkHahguliBgHRkHkw=.231cfb0b-28bc-4632-9956-bfc70faeb373@github.com> On Wed, 7 May 2025 11:34:08 GMT, Jaikiran Pai wrote: >> Can I please get a review of this change which proposes to respecify the 2 `java.net.Socket` constructors that allow construction of UDP sockets? This addresses https://bugs.openjdk.org/browse/JDK-8356154. >> >> As noted in that JBS issue, in Java 23 we deprecated for removal the 2 `Socket` constructors that allowed UDP socket creation. The plan continues to be to remove those constructors. Before removing those, in order to allow for applications to notice this deprecation, these constructors are now being respecified to throw an `IllegalArgumentException` when the `stream` parameter is `false`. >> >> I will create a CSR once we settle on these changes. >> >> tier1 through tier8 tests have been run with this change and no related failures have been noticed. > > Jaikiran Pai has updated the pull request incrementally with one additional commit since the last revision: > > move apiNote text to deprecated text Thanks! I prefer the new version. ------------- Marked as reviewed by dfuchs (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/25031#pullrequestreview-2821467164 From liach at openjdk.org Wed May 7 12:59:14 2025 From: liach at openjdk.org (Chen Liang) Date: Wed, 7 May 2025 12:59:14 GMT Subject: RFR: 8353795: Add Writer.of(StringBuilder) [v2] In-Reply-To: References: <2xEfp_WiAa-QW5Yao7JoOS3zSOtPKvBq4qV5rk8obWs=.2b1cc84d-2ff4-4d0c-bb0f-bdb276dc109a@github.com> Message-ID: On Sun, 4 May 2025 16:21:41 GMT, Markus KARG wrote: >> This Pull Requests proposes an implementation for [JDK-8353795](https://bugs.openjdk.org/browse/JDK-8353795): Adding the new method `public static Writer Writer.of(StringBuilder)`, providing a non-synchronized Writer implementation optimized for writing into `StringBuilder`. >> >> A basic test is provided to proof that the new `Writer` behaves as expected. For comparison, the same test is also run against `StringWriter`. > > Markus KARG has updated the pull request incrementally with two additional commits since the last revision: > > - Undone copyright update of otherwise unchanged file. > - Update Of.java > > Applied changnes proposed by @liach: "the default toString already includes id=..., so I usually don't provide an explicit override to make the code concise." I guess a better approach may be to allow periodical reminders if a thread gets no reply - many of us gets quite a few hundred mails every day on workdays. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24469#issuecomment-2858492193 From rriggs at openjdk.org Wed May 7 16:04:27 2025 From: rriggs at openjdk.org (Roger Riggs) Date: Wed, 7 May 2025 16:04:27 GMT Subject: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v12] In-Reply-To: References: Message-ID: On Tue, 6 May 2025 20:52:34 GMT, Markus KARG wrote: >> This Pull Request proposes an implementation for [JDK-8343110](https://bugs.openjdk.org/browse/JDK-8343110): Adding the new method `public void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)` to the `CharSequence` interface, providing a **bulk-read** facility including a default implementation iterating over `charAt(int)`. >> >> In addition, this Pull Request proposes to replace the implementation of `Reader.of(CharSequence).read(char[] cbuf, int off, int len)` to invoke `CharSequence.getChars(next, next + n, cbuf, off)` instead of utilizing pattern matching for switch. Also, this PR proposes to implement `CharBuffer.getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)` as an alias for `CharBuffer.get(srcBegin, dst, dstBegin, srcEnd - srcBegin)`. >> >> To ensure quality... >> * ...the method signature and JavaDocs are adapted from `AbstractStringBuilder.getChars(...)`. >> * ...this PR relies upon the existing tests for `Reader.of(CharSequence)`, as these provide sufficient coverage of all changes introduced by this PR. > > Markus KARG has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 17 commits: > > - merge latest from master branch > - Applied proposal by Daniel: If there's no change to this file the copyright year update could be reverted? > - Applied workaround proposed by Joe: Using component @inheritDoc to enforce getChars section in JavaDocs > - Applied changes proposed by Joe and Jaikiran: Using @inheritDoc to get JavaDocs without @since. > - Applied changes proposed in response to Joe's CSR comments: 'understood for CharBuffer; I was thinking more of String, StringBuffer, and StringBuilder where there looks to be more textual similarities.' > - Applied changes requestes by Alan: Aligning unit test for CharBuffer.getChars() with unit test for CharBuffer.chars() > - Applied changes requested by Chen and Jaikiran: Unit tests for default implementation of CharSequence.getChars() and for CharBuffer.getChars() > - Applied changes requested by Chen: 'We might need to specify the IOOBE behavior - when an IOOBE is thrown, some characters may be already transferred (this is important for concurrent char sequences)' > - Applied changes requested by Alan: This sentence doesn't make sense, did something get deleted? > - Applied changes requested by Alan: Copies chars from this sequence into the given destination array > - ... and 7 more: https://git.openjdk.org/jdk/compare/b21b3a38...31537b7a Thanks for the persistence. ------------- Marked as reviewed by rriggs (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21730#pullrequestreview-2822378207 From liach at openjdk.org Wed May 7 16:42:30 2025 From: liach at openjdk.org (Chen Liang) Date: Wed, 7 May 2025 16:42:30 GMT Subject: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v12] In-Reply-To: References: Message-ID: On Tue, 6 May 2025 20:52:34 GMT, Markus KARG wrote: >> This Pull Request proposes an implementation for [JDK-8343110](https://bugs.openjdk.org/browse/JDK-8343110): Adding the new method `public void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)` to the `CharSequence` interface, providing a **bulk-read** facility including a default implementation iterating over `charAt(int)`. >> >> In addition, this Pull Request proposes to replace the implementation of `Reader.of(CharSequence).read(char[] cbuf, int off, int len)` to invoke `CharSequence.getChars(next, next + n, cbuf, off)` instead of utilizing pattern matching for switch. Also, this PR proposes to implement `CharBuffer.getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)` as an alias for `CharBuffer.get(srcBegin, dst, dstBegin, srcEnd - srcBegin)`. >> >> To ensure quality... >> * ...the method signature and JavaDocs are adapted from `AbstractStringBuilder.getChars(...)`. >> * ...this PR relies upon the existing tests for `Reader.of(CharSequence)`, as these provide sufficient coverage of all changes introduced by this PR. > > Markus KARG has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 17 commits: > > - merge latest from master branch > - Applied proposal by Daniel: If there's no change to this file the copyright year update could be reverted? > - Applied workaround proposed by Joe: Using component @inheritDoc to enforce getChars section in JavaDocs > - Applied changes proposed by Joe and Jaikiran: Using @inheritDoc to get JavaDocs without @since. > - Applied changes proposed in response to Joe's CSR comments: 'understood for CharBuffer; I was thinking more of String, StringBuffer, and StringBuilder where there looks to be more textual similarities.' > - Applied changes requestes by Alan: Aligning unit test for CharBuffer.getChars() with unit test for CharBuffer.chars() > - Applied changes requested by Chen and Jaikiran: Unit tests for default implementation of CharSequence.getChars() and for CharBuffer.getChars() > - Applied changes requested by Chen: 'We might need to specify the IOOBE behavior - when an IOOBE is thrown, some characters may be already transferred (this is important for concurrent char sequences)' > - Applied changes requested by Alan: This sentence doesn't make sense, did something get deleted? > - Applied changes requested by Alan: Copies chars from this sequence into the given destination array > - ... and 7 more: https://git.openjdk.org/jdk/compare/b21b3a38...31537b7a The latest iteration looks the same as the one I last reviewed. ------------- Marked as reviewed by liach (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21730#pullrequestreview-2822479972 From duke at openjdk.org Wed May 7 16:42:31 2025 From: duke at openjdk.org (duke) Date: Wed, 7 May 2025 16:42:31 GMT Subject: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v12] In-Reply-To: References: Message-ID: On Tue, 6 May 2025 20:52:34 GMT, Markus KARG wrote: >> This Pull Request proposes an implementation for [JDK-8343110](https://bugs.openjdk.org/browse/JDK-8343110): Adding the new method `public void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)` to the `CharSequence` interface, providing a **bulk-read** facility including a default implementation iterating over `charAt(int)`. >> >> In addition, this Pull Request proposes to replace the implementation of `Reader.of(CharSequence).read(char[] cbuf, int off, int len)` to invoke `CharSequence.getChars(next, next + n, cbuf, off)` instead of utilizing pattern matching for switch. Also, this PR proposes to implement `CharBuffer.getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)` as an alias for `CharBuffer.get(srcBegin, dst, dstBegin, srcEnd - srcBegin)`. >> >> To ensure quality... >> * ...the method signature and JavaDocs are adapted from `AbstractStringBuilder.getChars(...)`. >> * ...this PR relies upon the existing tests for `Reader.of(CharSequence)`, as these provide sufficient coverage of all changes introduced by this PR. > > Markus KARG has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 17 commits: > > - merge latest from master branch > - Applied proposal by Daniel: If there's no change to this file the copyright year update could be reverted? > - Applied workaround proposed by Joe: Using component @inheritDoc to enforce getChars section in JavaDocs > - Applied changes proposed by Joe and Jaikiran: Using @inheritDoc to get JavaDocs without @since. > - Applied changes proposed in response to Joe's CSR comments: 'understood for CharBuffer; I was thinking more of String, StringBuffer, and StringBuilder where there looks to be more textual similarities.' > - Applied changes requestes by Alan: Aligning unit test for CharBuffer.getChars() with unit test for CharBuffer.chars() > - Applied changes requested by Chen and Jaikiran: Unit tests for default implementation of CharSequence.getChars() and for CharBuffer.getChars() > - Applied changes requested by Chen: 'We might need to specify the IOOBE behavior - when an IOOBE is thrown, some characters may be already transferred (this is important for concurrent char sequences)' > - Applied changes requested by Alan: This sentence doesn't make sense, did something get deleted? > - Applied changes requested by Alan: Copies chars from this sequence into the given destination array > - ... and 7 more: https://git.openjdk.org/jdk/compare/b21b3a38...31537b7a @mkarg Your change (at version 31537b7a4fa0a6b0ba235f6db4d901a9a134a6fa) is now ready to be sponsored by a Committer. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21730#issuecomment-2859256566 From duke at openjdk.org Wed May 7 16:55:17 2025 From: duke at openjdk.org (Markus KARG) Date: Wed, 7 May 2025 16:55:17 GMT Subject: RFR: 8353795: Add Writer.of(StringBuilder) [v2] In-Reply-To: References: <2xEfp_WiAa-QW5Yao7JoOS3zSOtPKvBq4qV5rk8obWs=.2b1cc84d-2ff4-4d0c-bb0f-bdb276dc109a@github.com> Message-ID: On Wed, 7 May 2025 12:56:20 GMT, Chen Liang wrote: > I guess a better approach may be to allow periodical reminders if a thread gets no reply - many of us gets quite a few hundred mails every day on workdays. I think it is time to move this discussion into its own thread, but just a last word from my side: Same with me. We need to find a way how external contributors can make progress even if the core team at Oracle has no time -- because you *mostly* have no time. ? Otherwise lots of contributions will simply not happen, as they linger around for years and then nobody likes to get back to it. ? One thing I hope you don't mind if I say is: Being a committer / reviewer is not just a power, it is also a responsibility to stay in contact with "normal" contributors in a timely manner. For that reason, in the open source projects where *I* am the code owner, I reserve time for working with contributors, and I always help others before working on my own stuff. Just as an idea. ? ------------- PR Comment: https://git.openjdk.org/jdk/pull/24469#issuecomment-2859305952 From bpb at openjdk.org Wed May 7 21:51:01 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Wed, 7 May 2025 21:51:01 GMT Subject: RFR: 8356127: (fs) UnixFileSystemProvider.implDelete could save a syscall in some cases Message-ID: <__DpX8NhzRrLcm-Ev8Z7HovPQqJolMCEcWerlNYvyUg=.9e95dad9-640b-4ebb-9dae-977c216dc3ce@github.com> Modify `UnixFileSystemProvider.implDelete` to attempt first to delete the file using `unlink` and, if that fails, fall back to using `rmdir` if the file is a directory. ------------- Commit messages: - 8356127: (fs) UnixFileSystemProvider.implDelete could save a syscall in some cases Changes: https://git.openjdk.org/jdk/pull/25107/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25107&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8356127 Stats: 21 lines in 1 file changed: 13 ins; 3 del; 5 mod Patch: https://git.openjdk.org/jdk/pull/25107.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25107/head:pull/25107 PR: https://git.openjdk.org/jdk/pull/25107 From bpb at openjdk.org Wed May 7 21:51:01 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Wed, 7 May 2025 21:51:01 GMT Subject: RFR: 8356127: (fs) UnixFileSystemProvider.implDelete could save a syscall in some cases In-Reply-To: <__DpX8NhzRrLcm-Ev8Z7HovPQqJolMCEcWerlNYvyUg=.9e95dad9-640b-4ebb-9dae-977c216dc3ce@github.com> References: <__DpX8NhzRrLcm-Ev8Z7HovPQqJolMCEcWerlNYvyUg=.9e95dad9-640b-4ebb-9dae-977c216dc3ce@github.com> Message-ID: On Wed, 7 May 2025 21:44:50 GMT, Brian Burkhalter wrote: > Modify `UnixFileSystemProvider.implDelete` to attempt first to delete the file using `unlink` and, if that fails, fall back to using `rmdir` if the file is a directory. Some performance improvement has been observed for the common case of deleting a regular file. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25107#issuecomment-2860466447 From duke at openjdk.org Thu May 8 01:01:06 2025 From: duke at openjdk.org (Markus KARG) Date: Thu, 8 May 2025 01:01:06 GMT Subject: Integrated: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer In-Reply-To: References: Message-ID: On Sat, 26 Oct 2024 15:48:11 GMT, Markus KARG wrote: > This Pull Request proposes an implementation for [JDK-8343110](https://bugs.openjdk.org/browse/JDK-8343110): Adding the new method `public void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)` to the `CharSequence` interface, providing a **bulk-read** facility including a default implementation iterating over `charAt(int)`. > > In addition, this Pull Request proposes to replace the implementation of `Reader.of(CharSequence).read(char[] cbuf, int off, int len)` to invoke `CharSequence.getChars(next, next + n, cbuf, off)` instead of utilizing pattern matching for switch. Also, this PR proposes to implement `CharBuffer.getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)` as an alias for `CharBuffer.get(srcBegin, dst, dstBegin, srcEnd - srcBegin)`. > > To ensure quality... > * ...the method signature and JavaDocs are adapted from `AbstractStringBuilder.getChars(...)`. > * ...this PR relies upon the existing tests for `Reader.of(CharSequence)`, as these provide sufficient coverage of all changes introduced by this PR. This pull request has now been integrated. Changeset: 7642556a Author: Markus KARG Committer: Jaikiran Pai URL: https://git.openjdk.org/jdk/commit/7642556a5a131e9104033ad7d7abfdb4be5012cf Stats: 470 lines in 8 files changed: 399 ins; 59 del; 12 mod 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer Reviewed-by: liach, jpai, rriggs ------------- PR: https://git.openjdk.org/jdk/pull/21730 From jpai at openjdk.org Thu May 8 03:58:58 2025 From: jpai at openjdk.org (Jaikiran Pai) Date: Thu, 8 May 2025 03:58:58 GMT Subject: RFR: 8356154: Respecify java.net.Socket constructors that allow creating UDP sockets to throw IllegalArgumentException [v9] In-Reply-To: References: Message-ID: On Wed, 7 May 2025 11:34:08 GMT, Jaikiran Pai wrote: >> Can I please get a review of this change which proposes to respecify the 2 `java.net.Socket` constructors that allow construction of UDP sockets? This addresses https://bugs.openjdk.org/browse/JDK-8356154. >> >> As noted in that JBS issue, in Java 23 we deprecated for removal the 2 `Socket` constructors that allowed UDP socket creation. The plan continues to be to remove those constructors. Before removing those, in order to allow for applications to notice this deprecation, these constructors are now being respecified to throw an `IllegalArgumentException` when the `stream` parameter is `false`. >> >> I will create a CSR once we settle on these changes. >> >> tier1 through tier8 tests have been run with this change and no related failures have been noticed. > > Jaikiran Pai has updated the pull request incrementally with one additional commit since the last revision: > > move apiNote text to deprecated text Thank you all for the reviews, the CSR has been approved with this latest text. I'll go ahead with the integration. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25031#issuecomment-2861663091 From jpai at openjdk.org Thu May 8 03:58:58 2025 From: jpai at openjdk.org (Jaikiran Pai) Date: Thu, 8 May 2025 03:58:58 GMT Subject: Integrated: 8356154: Respecify java.net.Socket constructors that allow creating UDP sockets to throw IllegalArgumentException In-Reply-To: References: Message-ID: On Mon, 5 May 2025 10:12:11 GMT, Jaikiran Pai wrote: > Can I please get a review of this change which proposes to respecify the 2 `java.net.Socket` constructors that allow construction of UDP sockets? This addresses https://bugs.openjdk.org/browse/JDK-8356154. > > As noted in that JBS issue, in Java 23 we deprecated for removal the 2 `Socket` constructors that allowed UDP socket creation. The plan continues to be to remove those constructors. Before removing those, in order to allow for applications to notice this deprecation, these constructors are now being respecified to throw an `IllegalArgumentException` when the `stream` parameter is `false`. > > I will create a CSR once we settle on these changes. > > tier1 through tier8 tests have been run with this change and no related failures have been noticed. This pull request has now been integrated. Changeset: 52a5583d Author: Jaikiran Pai URL: https://git.openjdk.org/jdk/commit/52a5583d691388f833c3aeb56ce92cbfb5d61274 Stats: 172 lines in 9 files changed: 37 ins; 72 del; 63 mod 8356154: Respecify java.net.Socket constructors that allow creating UDP sockets to throw IllegalArgumentException Reviewed-by: dfuchs, alanb ------------- PR: https://git.openjdk.org/jdk/pull/25031 From alanb at openjdk.org Thu May 8 07:16:54 2025 From: alanb at openjdk.org (Alan Bateman) Date: Thu, 8 May 2025 07:16:54 GMT Subject: RFR: 8356127: (fs) UnixFileSystemProvider.implDelete could save a syscall in some cases In-Reply-To: <__DpX8NhzRrLcm-Ev8Z7HovPQqJolMCEcWerlNYvyUg=.9e95dad9-640b-4ebb-9dae-977c216dc3ce@github.com> References: <__DpX8NhzRrLcm-Ev8Z7HovPQqJolMCEcWerlNYvyUg=.9e95dad9-640b-4ebb-9dae-977c216dc3ce@github.com> Message-ID: On Wed, 7 May 2025 21:44:50 GMT, Brian Burkhalter wrote: > Modify `UnixFileSystemProvider.implDelete` to attempt first to delete the file using `unlink` and, if that fails, fall back to using `rmdir` if the file is a directory. I think this will need to be predicated on a capability (UnixNativeDispatcher.SUPPORTS_xxx) so that it only unconditionally attempts unlink on Linux or other operating systems that document EISDIR. The risk with the proposed change is that unlink will unlink a non-empty directory, e.g. macOS with super-user. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25107#issuecomment-2862022855 From vklang at openjdk.org Thu May 8 12:04:53 2025 From: vklang at openjdk.org (Viktor Klang) Date: Thu, 8 May 2025 12:04:53 GMT Subject: RFR: 8355938: Addressed rare lost unpark bug 8074773 by pre-loading LockSupport.class In-Reply-To: References: Message-ID: On Wed, 30 Apr 2025 11:25:34 GMT, Alan Bateman wrote: >> The bug description seems like it is a fault in the JVM implementation - if that is the case, a core library bypass is unreliable, as such faults might happen to other classes and cause other consequences; and we might need to fix it from the VM runtime or compiler side, as the original report implies. > >> The bug description seems like it is a fault in the JVM implementation - if that is the case, a core library bypass is unreliable, as such faults might happen to other classes and cause other consequences; and we might need to fix it from the VM runtime or compiler side, as the original report implies. > > It seems to about nested parking that can arise with the first use of LockSupport.park from a class with a defining class loader that is not the boot loader. The first usage, say an invokestatic to call the park method, will call the loadClass on caller's defining class loader. For the app class loader, and many other custom class loaders, that are parallel capable, then there will be a CHM to support the mapping of class names to locks. Contention on the CHM seems to have lead to the nested park. CHM and a lot of other code has changed since and not clear that it will duplicate easily now. Martin's ParkLoops test from the 2015 issue is in the test tree but it might be that a variant of this that uses a custom class loader that overrides getClassLoadingLock or parks in loadClass might be able to trigger it. As a custom class loader's loadClass can do anything then it almost feels like creating a class loader needs it have it recorded immediately as an initiating class loader. Hop efully David will remember more of this when he gets back. I'll second @AlanBateman 's sentiments here. I think a systemic issue needs a wholesale solution, otherwise it'll just lead to endless sprinkling of eager initializations. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24952#issuecomment-2862799361 From alanb at openjdk.org Thu May 8 12:28:51 2025 From: alanb at openjdk.org (Alan Bateman) Date: Thu, 8 May 2025 12:28:51 GMT Subject: RFR: 8355938: Addressed rare lost unpark bug 8074773 by pre-loading LockSupport.class In-Reply-To: References: Message-ID: On Wed, 30 Apr 2025 11:25:34 GMT, Alan Bateman wrote: >> The bug description seems like it is a fault in the JVM implementation - if that is the case, a core library bypass is unreliable, as such faults might happen to other classes and cause other consequences; and we might need to fix it from the VM runtime or compiler side, as the original report implies. > >> The bug description seems like it is a fault in the JVM implementation - if that is the case, a core library bypass is unreliable, as such faults might happen to other classes and cause other consequences; and we might need to fix it from the VM runtime or compiler side, as the original report implies. > > It seems to about nested parking that can arise with the first use of LockSupport.park from a class with a defining class loader that is not the boot loader. The first usage, say an invokestatic to call the park method, will call the loadClass on caller's defining class loader. For the app class loader, and many other custom class loaders, that are parallel capable, then there will be a CHM to support the mapping of class names to locks. Contention on the CHM seems to have lead to the nested park. CHM and a lot of other code has changed since and not clear that it will duplicate easily now. Martin's ParkLoops test from the 2015 issue is in the test tree but it might be that a variant of this that uses a custom class loader that overrides getClassLoadingLock or parks in loadClass might be able to trigger it. As a custom class loader's loadClass can do anything then it almost feels like creating a class loader needs it have it recorded immediately as an initiating class loader. Hop efully David will remember more of this when he gets back. > I'll second @AlanBateman 's sentiments here. I think a systemic issue needs a wholesale solution, otherwise it'll just lead to endless sprinkling of eager initializations. Right, and even then, the issue is deeper than this. It's when the reference to LockSupport is from a class with a non-null defining class loader. In that scenario, the non-null class loader is the initiating class loader and any parking in the delegation chain to get to the boot loader could potentially consume the park permit. I don't think we should go down the road of supporting nested parking, instead it may be that we need some eager setup. I think we can close this PR for now as it doesn't really address the issue (LockSupport is already loaded before any user code executes). ------------- PR Comment: https://git.openjdk.org/jdk/pull/24952#issuecomment-2862877836 From lkorinth at openjdk.org Thu May 8 15:02:42 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Thu, 8 May 2025 15:02:42 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor Message-ID: This change tries to add timeout to individual testcases so that I am able to run them with a timeout factor of 1 in the future (JDK-8260555). The first commit changes the timeout factor to 0.7, so that I can run tests and test the change (it will finally be changed to 1.0 in JDK-8260555). The next commit excludes some junit/testng tests where I can currently not change the timeout factor (CODETOOLS-7903961). Both these commits will be reverted before integrating the change. I will also apply copyright updates after the review. In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the java properties (I can not use the library function everywhere as jtreg does not allow me to add @library notations to non testcase files). My approach has been to run all test, and afterwards updating those that fails due to a timeout factor. The amount of updated testcases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed (thus the timeout will be the same after JDK-8260555 is implemented). In a few places I have added a bit more timeout so that it will work with the 0.7 timeout factor. These fixes have been created when I have plown through testcases: JDK-8352719: Add an equals sign to the modules statement JDK-8352709: Remove bad timing annotations from WhileOpTest.java JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE CODETOOLS-7903961: Make default timeout configurable Sometime in the future I will also fix: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 for which I am awaiting: CODETOOLS-7903961 that is fixed in jtreg 7.6, but we are still running 7.5.1+1 *After the review I will revert the two first commits, and update the copyrights* ------------- Commit messages: - 8356171: Increase timeout for testcases as preparation for change of default timeout factor - Fix some tests that need an upgrade of JTREG --- REVERT THIS LATER - 8260555 Changes: https://git.openjdk.org/jdk/pull/25122/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25122&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8356171 Stats: 556 lines in 272 files changed: 59 ins; 96 del; 401 mod Patch: https://git.openjdk.org/jdk/pull/25122.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25122/head:pull/25122 PR: https://git.openjdk.org/jdk/pull/25122 From stefank at openjdk.org Thu May 8 16:09:00 2025 From: stefank at openjdk.org (Stefan Karlsson) Date: Thu, 8 May 2025 16:09:00 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor In-Reply-To: References: Message-ID: <2nBGcIjZC03ee74o34IXFgtoEVTAkQV-xXEC28_oFbI=.da57d5a4-4546-4566-aa79-cacce01562d7@github.com> On Thu, 8 May 2025 14:51:24 GMT, Leo Korinth wrote: > This change tries to add timeout to individual testcases so that I am able to run them with a timeout factor of 1 in the future (JDK-8260555). > > The first commit changes the timeout factor to 0.7, so that I can run tests and test the change (it will finally be changed to 1.0 in JDK-8260555). The next commit excludes some junit/testng tests where I can currently not change the timeout factor (CODETOOLS-7903961). Both these commits will be reverted before integrating the change. I will also apply copyright updates after the review. > > In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the java properties (I can not use the library function everywhere as jtreg does not allow me to add @library notations to non testcase files). > > My approach has been to run all test, and afterwards updating those that fails due to a timeout factor. The amount of updated testcases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed (thus the timeout will be the same after JDK-8260555 is implemented). In a few places I have added a bit more timeout so that it will work with the 0.7 timeout factor. > > These fixes have been created when I have plown through testcases: > JDK-8352719: Add an equals sign to the modules statement > JDK-8352709: Remove bad timing annotations from WhileOpTest.java > JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test > CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE > CODETOOLS-7903961: Make default timeout configurable > > Sometime in the future I will also fix: > 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 > > for which I am awaiting: > CODETOOLS-7903961 that is fixed in jtreg 7.6, but we are still running 7.5.1+1 > > *After the review I will revert the two first commits, and update the copyrights* Thanks for tackling this! I look forward to the day when you change TIMEOUT_FACTOR to be 1 by default. I think that will reduce confusion. I made a cursory look through some GC files and I think that looked good. doc/testing.md line 385: > 383: (`-timeoutFactor`). Also, some test cases that programmatically wait a > 384: certain amount of time will apply this factor. If we run in > 385: interpreted mode (`-Xcomp`), [RunTest.gmk](../make/RunTests.gmk) Maybe Suggestion: interpreted mode (`-Xint`), [RunTest.gmk](../make/RunTests.gmk) ------------- PR Review: https://git.openjdk.org/jdk/pull/25122#pullrequestreview-2825661242 PR Review Comment: https://git.openjdk.org/jdk/pull/25122#discussion_r2080028720 From dfuchs at openjdk.org Thu May 8 16:10:18 2025 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Thu, 8 May 2025 16:10:18 GMT Subject: RFR: 8353642: Deprecate URL::getPermission method and networking permission classes for removal [v4] In-Reply-To: References: Message-ID: > Please find her a patch that deprecate networking permission classes for removal. The method `URL::getPermission` now serves little purpose and is also deprecated. That method was overridden in subclasses and specified to return some of the deprecated permissions. Daniel Fuchs 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 five additional commits since the last revision: - Merge branch 'master' into deprecate-net-perms-8353642 - Revert changes to SocketPermission and CodeSource - Review feedback. Deprecate getPermission for removal. - Missing white spaces - 8353642: Deprecate networking permission classes for removal ------------- Changes: - all: https://git.openjdk.org/jdk/pull/24592/files - new: https://git.openjdk.org/jdk/pull/24592/files/d47a31d1..2807f3f6 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=24592&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24592&range=02-03 Stats: 268511 lines in 2569 files changed: 76630 ins; 182086 del; 9795 mod Patch: https://git.openjdk.org/jdk/pull/24592.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24592/head:pull/24592 PR: https://git.openjdk.org/jdk/pull/24592 From dfuchs at openjdk.org Thu May 8 16:14:54 2025 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Thu, 8 May 2025 16:14:54 GMT Subject: RFR: 8353642: Deprecate URL::getPermission method and networking permission classes for removal [v4] In-Reply-To: References: Message-ID: On Thu, 8 May 2025 16:10:18 GMT, Daniel Fuchs wrote: >> Please find her a patch that deprecate networking permission classes for removal. The method `URL::getPermission` now serves little purpose and is also deprecated. That method was overridden in subclasses and specified to return some of the deprecated permissions. > > Daniel Fuchs 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 five additional commits since the last revision: > > - Merge branch 'master' into deprecate-net-perms-8353642 > - Revert changes to SocketPermission and CodeSource > - Review feedback. Deprecate getPermission for removal. > - Missing white spaces > - 8353642: Deprecate networking permission classes for removal After discussion with @seanjmullan we decided to revert the changes to `SocketPermission` and `CodeSource` from this PR. Deprecation of `SocketPermission` will be the object of another RFE ([JDK-8356557](https://bugs.openjdk.org/browse/JDK-8356557)) - once we have decided what to do with `CodeSource::implies`. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24592#issuecomment-2863592195 From dfuchs at openjdk.org Thu May 8 16:28:53 2025 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Thu, 8 May 2025 16:28:53 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor In-Reply-To: References: Message-ID: On Thu, 8 May 2025 14:51:24 GMT, Leo Korinth wrote: > This change tries to add timeout to individual testcases so that I am able to run them with a timeout factor of 1 in the future (JDK-8260555). > > The first commit changes the timeout factor to 0.7, so that I can run tests and test the change (it will finally be changed to 1.0 in JDK-8260555). The next commit excludes some junit/testng tests where I can currently not change the timeout factor (CODETOOLS-7903961). Both these commits will be reverted before integrating the change. I will also apply copyright updates after the review. > > In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the java properties (I can not use the library function everywhere as jtreg does not allow me to add @library notations to non testcase files). > > My approach has been to run all test, and afterwards updating those that fails due to a timeout factor. The amount of updated testcases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed (thus the timeout will be the same after JDK-8260555 is implemented). In a few places I have added a bit more timeout so that it will work with the 0.7 timeout factor. > > These fixes have been created when I have plown through testcases: > JDK-8352719: Add an equals sign to the modules statement > JDK-8352709: Remove bad timing annotations from WhileOpTest.java > JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test > CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE > CODETOOLS-7903961: Make default timeout configurable > > Sometime in the future I will also fix: > 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 > > for which I am awaiting: > CODETOOLS-7903961 that is fixed in jtreg 7.6, but we are still running 7.5.1+1 > > *After the review I will revert the two first commits, and update the copyrights* @lkorinth have you run all the tiers where the old default timeout factor of 4 applied? ------------- PR Comment: https://git.openjdk.org/jdk/pull/25122#issuecomment-2863633579 From lkorinth at openjdk.org Thu May 8 16:45:56 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Thu, 8 May 2025 16:45:56 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor In-Reply-To: References: Message-ID: On Thu, 8 May 2025 14:51:24 GMT, Leo Korinth wrote: > This change tries to add timeout to individual testcases so that I am able to run them with a timeout factor of 1 in the future (JDK-8260555). > > The first commit changes the timeout factor to 0.7, so that I can run tests and test the change (it will finally be changed to 1.0 in JDK-8260555). The next commit excludes some junit/testng tests where I can currently not change the timeout factor (CODETOOLS-7903961). Both these commits will be reverted before integrating the change. I will also apply copyright updates after the review. > > In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the java properties (I can not use the library function everywhere as jtreg does not allow me to add @library notations to non testcase files). > > My approach has been to run all test, and afterwards updating those that fails due to a timeout factor. The amount of updated testcases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed (thus the timeout will be the same after JDK-8260555 is implemented). In a few places I have added a bit more timeout so that it will work with the 0.7 timeout factor. > > These fixes have been created when I have plown through testcases: > JDK-8352719: Add an equals sign to the modules statement > JDK-8352709: Remove bad timing annotations from WhileOpTest.java > JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test > CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE > CODETOOLS-7903961: Make default timeout configurable > > Sometime in the future I will also fix: > 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 > > for which I am awaiting: > CODETOOLS-7903961 that is fixed in jtreg 7.6, but we are still running 7.5.1+1 > > *After the review I will revert the two first commits, and update the copyrights* Before this version, I had run tiers 1-8, with 11 fails. ** DONE 01 serviceability/jvmti/vthread/SuspendResume2/SuspendResume2.java#debug 700 ** DONE 02 jdk/internal/platform/docker/TestUseContainerSupport.java OTHER ** DONE 03 tools/javac/util/IteratorsTest.java 480 ** DONE 04 java/math/BigInteger/LargeValueExceptions.java 480 ** DONE 05 vmTestbase/gc/gctests/WeakReference/weak004/weak004.java OTHER ** DONE 06 compiler/loopstripmining/CheckLoopStripMining.java OTHER ** DONE 07 sun/security/tools/keytool/fakecacerts/TrustedCert.java 480 ** DONE 08 jdk/internal/platform/docker/TestUseContainerSupport.java OTHER ** DONE 09 containers/docker/TestJFRNetworkEvents.java OTHER ** DONE 10 java/foreign/TestMismatch.java 480 ** DONE 11 linux-riscv64-open-cmp-baseline-linux-x64-build-796 OTHER Six of those seems not related to my changes (marked `OTHER`), five I have updated for this run with new timeout. I have fixed the timeouts and rebased (I had one conflict), and I am now again running tier1-8. It will take time, and it looks like I will have more (unrelated) fails this time. After I revert the two first commits and go back to a timeout factor of 4, I will run tier 1-8 again. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25122#issuecomment-2863670496 PR Comment: https://git.openjdk.org/jdk/pull/25122#issuecomment-2863675379 From bpb at openjdk.org Thu May 8 16:52:57 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Thu, 8 May 2025 16:52:57 GMT Subject: RFR: 8356036: (fs) FileKey.hashCode and UnixFileStore.hashCode implementations can use Long.hasCode In-Reply-To: References: Message-ID: On Thu, 1 May 2025 14:41:09 GMT, Shaojin Wen wrote: > Similar to #24959 and #24971, sun.nio.ch.FileKey/sun.nio.fs.UnixFileKey/sun.nio.fs.UnixFileStore in java.base can also be simplified similarly. > > Replace manual bitwise operations in hashCode implementations of sun.nio.ch.FileKey/sun.nio.fs.UnixFileKey/sun.nio.fs.UnixFileStore with Long::hashCode. I corrected the typo in the summary of the issue so the title of this PR will need to be changed to match. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24987#issuecomment-2863694487 From lkorinth at openjdk.org Thu May 8 17:06:02 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Thu, 8 May 2025 17:06:02 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor In-Reply-To: <2nBGcIjZC03ee74o34IXFgtoEVTAkQV-xXEC28_oFbI=.da57d5a4-4546-4566-aa79-cacce01562d7@github.com> References: <2nBGcIjZC03ee74o34IXFgtoEVTAkQV-xXEC28_oFbI=.da57d5a4-4546-4566-aa79-cacce01562d7@github.com> Message-ID: On Thu, 8 May 2025 16:04:53 GMT, Stefan Karlsson wrote: >> This change tries to add timeout to individual testcases so that I am able to run them with a timeout factor of 1 in the future (JDK-8260555). >> >> The first commit changes the timeout factor to 0.7, so that I can run tests and test the change (it will finally be changed to 1.0 in JDK-8260555). The next commit excludes some junit/testng tests where I can currently not change the timeout factor (CODETOOLS-7903961). Both these commits will be reverted before integrating the change. I will also apply copyright updates after the review. >> >> In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the java properties (I can not use the library function everywhere as jtreg does not allow me to add @library notations to non testcase files). >> >> My approach has been to run all test, and afterwards updating those that fails due to a timeout factor. The amount of updated testcases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed (thus the timeout will be the same after JDK-8260555 is implemented). In a few places I have added a bit more timeout so that it will work with the 0.7 timeout factor. >> >> These fixes have been created when I have plown through testcases: >> JDK-8352719: Add an equals sign to the modules statement >> JDK-8352709: Remove bad timing annotations from WhileOpTest.java >> JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test >> CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE >> CODETOOLS-7903961: Make default timeout configurable >> >> Sometime in the future I will also fix: >> 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 >> >> for which I am awaiting: >> CODETOOLS-7903961 that is fixed in jtreg 7.6, but we are still running 7.5.1+1 >> >> *After the review I will revert the two first commits, and update the copyrights* > > doc/testing.md line 385: > >> 383: (`-timeoutFactor`). Also, some test cases that programmatically wait a >> 384: certain amount of time will apply this factor. If we run in >> 385: interpreted mode (`-Xcomp`), [RunTest.gmk](../make/RunTests.gmk) > > Maybe > Suggestion: > > interpreted mode (`-Xint`), [RunTest.gmk](../make/RunTests.gmk) Thanks for catching this fault of mine. I will update the text and change `interpreted mode`, as it is really `-Xcomp` we are looking at in the RunTest.gmk. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25122#discussion_r2080117016 From bpb at openjdk.org Thu May 8 17:16:52 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Thu, 8 May 2025 17:16:52 GMT Subject: RFR: 8356036: (fs) FileKey.hashCode and UnixFileStore.hashCode implementations can use Long.hasCode In-Reply-To: References: Message-ID: <_cwcRZeQL2Yjvaqll2DT_9OwKKqKHLgpNvhpNh-qjTo=.9a44bb5e-6163-429b-af22-3a370010b467@github.com> On Thu, 1 May 2025 14:41:09 GMT, Shaojin Wen wrote: > Similar to #24959 and #24971, sun.nio.ch.FileKey/sun.nio.fs.UnixFileKey/sun.nio.fs.UnixFileStore in java.base can also be simplified similarly. > > Replace manual bitwise operations in hashCode implementations of sun.nio.ch.FileKey/sun.nio.fs.UnixFileKey/sun.nio.fs.UnixFileStore with Long::hashCode. Looks all right to me. ------------- Marked as reviewed by bpb (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/24987#pullrequestreview-2825832974 From bpb at openjdk.org Thu May 8 17:33:53 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Thu, 8 May 2025 17:33:53 GMT Subject: RFR: 8356127: (fs) UnixFileSystemProvider.implDelete could save a syscall in some cases In-Reply-To: References: <__DpX8NhzRrLcm-Ev8Z7HovPQqJolMCEcWerlNYvyUg=.9e95dad9-640b-4ebb-9dae-977c216dc3ce@github.com> Message-ID: On Thu, 8 May 2025 07:14:42 GMT, Alan Bateman wrote: > I think this will need to be predicated on a capability (UnixNativeDispatcher.SUPPORTS_xxx) so that it only unconditionally attempts unlink on Linux or other operating systems that document EISDIR. It looks like this would have to be hard-coded as a function of the OS. The following obtains on macOS: $ cat eisdir.c #include #include int main(int argc, char** argv) { printf("EISDIR: %d\n", EISDIR); } $ ./eisdir EISDIR: 21 This shows that macOS defines `EISDIR` to be the POSIX value 21. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25107#issuecomment-2863782711 From dfuchs at openjdk.org Thu May 8 17:43:54 2025 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Thu, 8 May 2025 17:43:54 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor In-Reply-To: References: Message-ID: On Thu, 8 May 2025 14:51:24 GMT, Leo Korinth wrote: > This change tries to add timeout to individual testcases so that I am able to run them with a timeout factor of 1 in the future (JDK-8260555). > > The first commit changes the timeout factor to 0.7, so that I can run tests and test the change (it will finally be changed to 1.0 in JDK-8260555). The next commit excludes some junit/testng tests where I can currently not change the timeout factor (CODETOOLS-7903961). Both these commits will be reverted before integrating the change. I will also apply copyright updates after the review. > > In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the java properties (I can not use the library function everywhere as jtreg does not allow me to add @library notations to non testcase files). > > My approach has been to run all test, and afterwards updating those that fails due to a timeout factor. The amount of updated testcases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed (thus the timeout will be the same after JDK-8260555 is implemented). In a few places I have added a bit more timeout so that it will work with the 0.7 timeout factor. > > These fixes have been created when I have plown through testcases: > JDK-8352719: Add an equals sign to the modules statement > JDK-8352709: Remove bad timing annotations from WhileOpTest.java > JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test > CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE > CODETOOLS-7903961: Make default timeout configurable > > Sometime in the future I will also fix: > 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 > > for which I am awaiting: > CODETOOLS-7903961 that is fixed in jtreg 7.6, but we are still running 7.5.1+1 > > *After the review I will revert the two first commits, and update the copyrights* Thank you. I have imported your PR locally and running some HTTP client tests in the CI. Tests have not finished running - but I already see one intermittent failure: `java/net/httpclient/RedirectTimeoutTest.java` is timing out intermittently on windows. It would be good to flush out any such intermittent failures before this PR is integrated. This might require multiple runs before we can get confidence. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25122#issuecomment-2863805648 From djelinski at openjdk.org Thu May 8 18:11:56 2025 From: djelinski at openjdk.org (Daniel =?UTF-8?B?SmVsacWEc2tp?=) Date: Thu, 8 May 2025 18:11:56 GMT Subject: RFR: 8353642: Deprecate URL::getPermission method and networking permission classes for removal [v4] In-Reply-To: References: Message-ID: On Thu, 8 May 2025 16:10:18 GMT, Daniel Fuchs wrote: >> Please find her a patch that deprecate networking permission classes for removal. The method `URL::getPermission` now serves little purpose and is also deprecated. That method was overridden in subclasses and specified to return some of the deprecated permissions. > > Daniel Fuchs 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 five additional commits since the last revision: > > - Merge branch 'master' into deprecate-net-perms-8353642 > - Revert changes to SocketPermission and CodeSource > - Review feedback. Deprecate getPermission for removal. > - Missing white spaces > - 8353642: Deprecate networking permission classes for removal Marked as reviewed by djelinski (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/24592#pullrequestreview-2825963973 From bpb at openjdk.org Thu May 8 18:23:37 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Thu, 8 May 2025 18:23:37 GMT Subject: RFR: 8356127: (fs) UnixFileSystemProvider.implDelete could save a syscall in some cases [v2] In-Reply-To: <__DpX8NhzRrLcm-Ev8Z7HovPQqJolMCEcWerlNYvyUg=.9e95dad9-640b-4ebb-9dae-977c216dc3ce@github.com> References: <__DpX8NhzRrLcm-Ev8Z7HovPQqJolMCEcWerlNYvyUg=.9e95dad9-640b-4ebb-9dae-977c216dc3ce@github.com> Message-ID: > Modify `UnixFileSystemProvider.implDelete` to attempt first to delete the file using `unlink` and, if that fails, fall back to using `rmdir` if the file is a directory. Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: 8356127: Add capability check for EISDIR ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25107/files - new: https://git.openjdk.org/jdk/pull/25107/files/c070fd11..17b67498 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25107&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25107&range=00-01 Stats: 36 lines in 3 files changed: 21 ins; 0 del; 15 mod Patch: https://git.openjdk.org/jdk/pull/25107.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25107/head:pull/25107 PR: https://git.openjdk.org/jdk/pull/25107 From bpb at openjdk.org Thu May 8 18:23:37 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Thu, 8 May 2025 18:23:37 GMT Subject: RFR: 8356127: (fs) UnixFileSystemProvider.implDelete could save a syscall in some cases In-Reply-To: References: <__DpX8NhzRrLcm-Ev8Z7HovPQqJolMCEcWerlNYvyUg=.9e95dad9-640b-4ebb-9dae-977c216dc3ce@github.com> Message-ID: On Thu, 8 May 2025 17:31:07 GMT, Brian Burkhalter wrote: > I think this will need to be predicated on a capability (UnixNativeDispatcher.SUPPORTS_xxx) So changed into 17b6749. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25107#issuecomment-2863894756 From sebastian.stenzel at gmail.com Thu May 8 19:08:53 2025 From: sebastian.stenzel at gmail.com (Sebastian Stenzel) Date: Thu, 8 May 2025 21:08:53 +0200 Subject: Extended Attributes Support (Linux/macOS) Message-ID: <98E1D238-2117-4E24-AF3C-A70F8B8F03B8@gmail.com> Hi all, A couple of releases ago I added some UserDefinedAttributeView support on macOS and did some cleanup and deduplications [1]. One thing has been bothering me since, though: I?d like to add a new FileAttributeView named ?xattr? that basically is the same as UnixUserDefinedFileAttributeView [2] but without the ?user.? prefix, so it can be used to access extended attributes set by other applications. This shouldn?t require many code additions, just some clever class hierarchy modifications. I.e. UnixUserDefinedFileAttributeView should extend ExtendedFileAttributeView. To achieve this, I propose to replace sun.nio.fs.AbstractUserDefinedFileAttributeView with an interface with default methods (now that the security manager is gone). This isn?t public API, nevertheless I?d like to know if this would be an acceptable change or if you?d rather like me to use composition over inheritance. Any thoughts? Sebastian [1] https://github.com/openjdk/jdk/pulls?q=is%3Apr+author%3Aoverheadhunter+xattr+ [2] https://github.com/openjdk/jdk/blob/jdk-24%2B36/src/java.base/unix/classes/sun/nio/fs/UnixUserDefinedFileAttributeView.java -------------- next part -------------- An HTML attachment was scrubbed... URL: From alanb at openjdk.org Thu May 8 19:12:52 2025 From: alanb at openjdk.org (Alan Bateman) Date: Thu, 8 May 2025 19:12:52 GMT Subject: RFR: 8356127: (fs) UnixFileSystemProvider.implDelete could save a syscall in some cases [v2] In-Reply-To: References: <__DpX8NhzRrLcm-Ev8Z7HovPQqJolMCEcWerlNYvyUg=.9e95dad9-640b-4ebb-9dae-977c216dc3ce@github.com> Message-ID: On Thu, 8 May 2025 18:23:37 GMT, Brian Burkhalter wrote: >> Modify `UnixFileSystemProvider.implDelete` to attempt first to delete the file using `unlink` and, if that fails, fall back to using `rmdir` if the file is a directory. > > Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: > > 8356127: Add capability check for EISDIR src/java.base/unix/classes/sun/nio/fs/UnixNativeDispatcher.java line 552: > 550: */ > 551: static boolean eisdirSupported() { > 552: return (capabilities & SUPPORTS_EISDIR) != 0; The approach in this version looks much better. Need to find a better name for the capability and method name as "EISDIR" is supported on all Unix/like platforms. I think we want something to convey unlink detects directories or fails for directories. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25107#discussion_r2080318690 From prr at openjdk.org Thu May 8 20:02:52 2025 From: prr at openjdk.org (Phil Race) Date: Thu, 8 May 2025 20:02:52 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor In-Reply-To: References: Message-ID: On Thu, 8 May 2025 14:51:24 GMT, Leo Korinth wrote: > This change tries to add timeout to individual testcases so that I am able to run them with a timeout factor of 1 in the future (JDK-8260555). > > The first commit changes the timeout factor to 0.7, so that I can run tests and test the change (it will finally be changed to 1.0 in JDK-8260555). The next commit excludes some junit/testng tests where I can currently not change the timeout factor (CODETOOLS-7903961). Both these commits will be reverted before integrating the change. I will also apply copyright updates after the review. > > In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the java properties (I can not use the library function everywhere as jtreg does not allow me to add @library notations to non testcase files). > > My approach has been to run all test, and afterwards updating those that fails due to a timeout factor. The amount of updated testcases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed (thus the timeout will be the same after JDK-8260555 is implemented). In a few places I have added a bit more timeout so that it will work with the 0.7 timeout factor. > > These fixes have been created when I have plown through testcases: > JDK-8352719: Add an equals sign to the modules statement > JDK-8352709: Remove bad timing annotations from WhileOpTest.java > JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test > CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE > CODETOOLS-7903961: Make default timeout configurable > > Sometime in the future I will also fix: > 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 > > for which I am awaiting: > CODETOOLS-7903961 that is fixed in jtreg 7.6, but we are still running 7.5.1+1 > > *After the review I will revert the two first commits, and update the copyrights* test/jdk/java/awt/font/NumericShaper/MTTest.java - * @run main/timeout=300/othervm MTTest + * @run main/timeout=1200/othervm MTTest I'm puzzling over why you saw this test fail with timeout = 300 .. or perhaps you saw it fail with 0.7 ? Which would amount to 210 seconds .. that might just be enough to cause it to fail because if you look at the whole test you'll see it wants the core loops of the test to run for 180 seconds. https://openjdk.github.io/cr/?repo=jdk&pr=25122&range=00#new-144-test/jdk/java/awt/font/NumericShaper/MTTest.java So 300 was fine, and 1200 isn't needed. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25122#issuecomment-2864133534 From bpb at openjdk.org Thu May 8 20:10:09 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Thu, 8 May 2025 20:10:09 GMT Subject: RFR: 8356127: (fs) UnixFileSystemProvider.implDelete could save a syscall in some cases [v3] In-Reply-To: <__DpX8NhzRrLcm-Ev8Z7HovPQqJolMCEcWerlNYvyUg=.9e95dad9-640b-4ebb-9dae-977c216dc3ce@github.com> References: <__DpX8NhzRrLcm-Ev8Z7HovPQqJolMCEcWerlNYvyUg=.9e95dad9-640b-4ebb-9dae-977c216dc3ce@github.com> Message-ID: > Modify `UnixFileSystemProvider.implDelete` to attempt first to delete the file using `unlink` and, if that fails, fall back to using `rmdir` if the file is a directory. Brian Burkhalter 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 commits since the last revision: - 8356127: Change capability naming - Merge - 8356127: Add capability check for EISDIR - 8356127: (fs) UnixFileSystemProvider.implDelete could save a syscall in some cases ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25107/files - new: https://git.openjdk.org/jdk/pull/25107/files/17b67498..3814a184 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25107&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25107&range=01-02 Stats: 13976 lines in 456 files changed: 7458 ins; 4062 del; 2456 mod Patch: https://git.openjdk.org/jdk/pull/25107.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25107/head:pull/25107 PR: https://git.openjdk.org/jdk/pull/25107 From bpb at openjdk.org Thu May 8 20:10:09 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Thu, 8 May 2025 20:10:09 GMT Subject: RFR: 8356127: (fs) UnixFileSystemProvider.implDelete could save a syscall in some cases [v2] In-Reply-To: References: <__DpX8NhzRrLcm-Ev8Z7HovPQqJolMCEcWerlNYvyUg=.9e95dad9-640b-4ebb-9dae-977c216dc3ce@github.com> Message-ID: On Thu, 8 May 2025 19:10:24 GMT, Alan Bateman wrote: >> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: >> >> 8356127: Add capability check for EISDIR > > src/java.base/unix/classes/sun/nio/fs/UnixNativeDispatcher.java line 552: > >> 550: */ >> 551: static boolean eisdirSupported() { >> 552: return (capabilities & SUPPORTS_EISDIR) != 0; > > The approach in this version looks much better. Need to find a better name for the capability and method name as "EISDIR" is supported on all Unix/like platforms. I think we want something to convey unlink detects directories or fails for directories. Naming updated in [3814a18](https://github.com/openjdk/jdk/pull/25107/commits/3814a184551496b01d9f0f44a514c23aa1e094b7). ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25107#discussion_r2080393094 From iris at openjdk.org Thu May 8 20:28:57 2025 From: iris at openjdk.org (Iris Clark) Date: Thu, 8 May 2025 20:28:57 GMT Subject: RFR: 8353642: Deprecate URL::getPermission method and networking permission classes for removal [v4] In-Reply-To: References: Message-ID: On Thu, 8 May 2025 16:10:18 GMT, Daniel Fuchs wrote: >> Please find her a patch that deprecate networking permission classes for removal. The method `URL::getPermission` now serves little purpose and is also deprecated. That method was overridden in subclasses and specified to return some of the deprecated permissions. > > Daniel Fuchs 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 five additional commits since the last revision: > > - Merge branch 'master' into deprecate-net-perms-8353642 > - Revert changes to SocketPermission and CodeSource > - Review feedback. Deprecate getPermission for removal. > - Missing white spaces > - 8353642: Deprecate networking permission classes for removal Marked as reviewed by iris (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/24592#pullrequestreview-2826287061 From lmesnik at openjdk.org Thu May 8 23:12:52 2025 From: lmesnik at openjdk.org (Leonid Mesnik) Date: Thu, 8 May 2025 23:12:52 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor In-Reply-To: References: <2nBGcIjZC03ee74o34IXFgtoEVTAkQV-xXEC28_oFbI=.da57d5a4-4546-4566-aa79-cacce01562d7@github.com> Message-ID: On Thu, 8 May 2025 17:03:03 GMT, Leo Korinth wrote: >> doc/testing.md line 385: >> >>> 383: (`-timeoutFactor`). Also, some test cases that programmatically wait a >>> 384: certain amount of time will apply this factor. If we run in >>> 385: interpreted mode (`-Xcomp`), [RunTest.gmk](../make/RunTests.gmk) >> >> Maybe >> Suggestion: >> >> interpreted mode (`-Xint`), [RunTest.gmk](../make/RunTests.gmk) > > Thanks for catching this fault of mine. I will update the text and change `interpreted mode`, as it is really `-Xcomp` we are looking at in the RunTest.gmk. yep, let use Xcomp, the Xint is not really supported, a lot of tests might start failing ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25122#discussion_r2080606853 From lmesnik at openjdk.org Fri May 9 00:55:54 2025 From: lmesnik at openjdk.org (Leonid Mesnik) Date: Fri, 9 May 2025 00:55:54 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor In-Reply-To: References: Message-ID: <2oUdV1ca6y_cEHL3kTptk3jAlwCwnvsLGhRIAhVEUo8=.010c2226-c5ec-4508-be7f-90d244b2b7dc@github.com> On Thu, 8 May 2025 16:43:10 GMT, Leo Korinth wrote: >> This change tries to add timeout to individual testcases so that I am able to run them with a timeout factor of 1 in the future (JDK-8260555). >> >> The first commit changes the timeout factor to 0.7, so that I can run tests and test the change (it will finally be changed to 1.0 in JDK-8260555). The next commit excludes some junit/testng tests where I can currently not change the timeout factor (CODETOOLS-7903961). Both these commits will be reverted before integrating the change. I will also apply copyright updates after the review. >> >> In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the java properties (I can not use the library function everywhere as jtreg does not allow me to add @library notations to non testcase files). >> >> My approach has been to run all test, and afterwards updating those that fails due to a timeout factor. The amount of updated testcases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed (thus the timeout will be the same after JDK-8260555 is implemented). In a few places I have added a bit more timeout so that it will work with the 0.7 timeout factor. >> >> These fixes have been created when I have plown through testcases: >> JDK-8352719: Add an equals sign to the modules statement >> JDK-8352709: Remove bad timing annotations from WhileOpTest.java >> JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test >> CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE >> CODETOOLS-7903961: Make default timeout configurable >> >> Sometime in the future I will also fix: >> 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 >> >> for which I am awaiting: >> CODETOOLS-7903961 that is fixed in jtreg 7.6, but we are still running 7.5.1+1 >> >> *After the review I will revert the two first commits, and update the copyrights* > > After I revert the two first commits and go back to a timeout factor of 4, I will run tier 1-8 again. @lkorinth Can you please proposed fix for https://bugs.openjdk.org/browse/JDK-8260555 to make it more clear the complete goal of the fix. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25122#issuecomment-2864795990 From dholmes at openjdk.org Fri May 9 02:47:53 2025 From: dholmes at openjdk.org (David Holmes) Date: Fri, 9 May 2025 02:47:53 GMT Subject: RFR: 8355938: Addressed rare lost unpark bug 8074773 by pre-loading LockSupport.class In-Reply-To: References: Message-ID: On Wed, 30 Apr 2025 11:25:34 GMT, Alan Bateman wrote: > Hopefully David will remember more of this when he gets back. Sadly I have to page in all the details again like everyone else. The underlying issue is nested-parking as Alan notes. From re-reading 8074773, pre-loading in any class loaded by the boot loader, has no affect on the bug. The issue was the action taken by the AppLoader that involved creating an entry in the lockMap CHM. That particular bug-path was closed when CHM was rewritten to use object monitors (did it re-open again when Loom came along?). ------------- PR Comment: https://git.openjdk.org/jdk/pull/24952#issuecomment-2864931853 From dholmes at openjdk.org Fri May 9 04:57:50 2025 From: dholmes at openjdk.org (David Holmes) Date: Fri, 9 May 2025 04:57:50 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor In-Reply-To: References: Message-ID: On Thu, 8 May 2025 14:51:24 GMT, Leo Korinth wrote: > This change tries to add timeout to individual testcases so that I am able to run them with a timeout factor of 1 in the future (JDK-8260555). > > The first commit changes the timeout factor to 0.7, so that I can run tests and test the change (it will finally be changed to 1.0 in JDK-8260555). The next commit excludes some junit/testng tests where I can currently not change the timeout factor (CODETOOLS-7903961). Both these commits will be reverted before integrating the change. I will also apply copyright updates after the review. > > In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the java properties (I can not use the library function everywhere as jtreg does not allow me to add @library notations to non testcase files). > > My approach has been to run all test, and afterwards updating those that fails due to a timeout factor. The amount of updated testcases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed (thus the timeout will be the same after JDK-8260555 is implemented). In a few places I have added a bit more timeout so that it will work with the 0.7 timeout factor. > > These fixes have been created when I have plown through testcases: > JDK-8352719: Add an equals sign to the modules statement > JDK-8352709: Remove bad timing annotations from WhileOpTest.java > JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test > CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE > CODETOOLS-7903961: Make default timeout configurable > > Sometime in the future I will also fix: > 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 > > for which I am awaiting: > CODETOOLS-7903961 that is fixed in jtreg 7.6, but we are still running 7.5.1+1 > > *After the review I will revert the two first commits, and update the copyrights* My biggest concern with this change is that potentially any test that implicitly uses the default timeout, and which passes with no problem with a factor of 4, may now need to have an explicit timeout set due to the factor of 1. I see this change in a number of tests (default timeout of 120s expressed as a new timeout of 480s to maintain equivalence**), but how many times did you run the tiers? I fear that the gatekeepers will be playing timeout whack-a-mole once these changes are put in. ** though another option would be to update the jtreg default timeout instead. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25122#issuecomment-2865099247 From alanb at openjdk.org Fri May 9 06:22:53 2025 From: alanb at openjdk.org (Alan Bateman) Date: Fri, 9 May 2025 06:22:53 GMT Subject: RFR: 8356127: (fs) UnixFileSystemProvider.implDelete could save a syscall in some cases [v3] In-Reply-To: References: <__DpX8NhzRrLcm-Ev8Z7HovPQqJolMCEcWerlNYvyUg=.9e95dad9-640b-4ebb-9dae-977c216dc3ce@github.com> Message-ID: <_tmc-y1SKXOJbqGypPX5JNi6dzDvhrgv41VwpzxK_7A=.8c2dd1c1-aeb7-4771-a357-f093b84341ee@github.com> On Thu, 8 May 2025 20:10:09 GMT, Brian Burkhalter wrote: >> Modify `UnixFileSystemProvider.implDelete` to attempt first to delete the file using `unlink` and, if that fails, fall back to using `rmdir` if the file is a directory. > > Brian Burkhalter 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 commits since the last revision: > > - 8356127: Change capability naming > - Merge > - 8356127: Add capability check for EISDIR > - 8356127: (fs) UnixFileSystemProvider.implDelete could save a syscall in some cases src/java.base/unix/classes/sun/nio/fs/UnixFileSystemProvider.java line 260: > 258: // check whether the file is a directory > 259: if (e.errno() == EISDIR || > 260: UnixFileAttributes.get(file, false).isDirectory()) If unlink fails (not EISDIR) then shouldn't we just throw the error? I'm not sure why it attempts to stat the file for this case. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25107#discussion_r2081008315 From alanb at openjdk.org Fri May 9 06:22:53 2025 From: alanb at openjdk.org (Alan Bateman) Date: Fri, 9 May 2025 06:22:53 GMT Subject: RFR: 8356127: (fs) UnixFileSystemProvider.implDelete could save a syscall in some cases [v2] In-Reply-To: References: <__DpX8NhzRrLcm-Ev8Z7HovPQqJolMCEcWerlNYvyUg=.9e95dad9-640b-4ebb-9dae-977c216dc3ce@github.com> Message-ID: On Thu, 8 May 2025 20:06:49 GMT, Brian Burkhalter wrote: >> src/java.base/unix/classes/sun/nio/fs/UnixNativeDispatcher.java line 552: >> >>> 550: */ >>> 551: static boolean eisdirSupported() { >>> 552: return (capabilities & SUPPORTS_EISDIR) != 0; >> >> The approach in this version looks much better. Need to find a better name for the capability and method name as "EISDIR" is supported on all Unix/like platforms. I think we want something to convey unlink detects directories or fails for directories. > > Naming updated in [3814a18](https://github.com/openjdk/jdk/pull/25107/commits/3814a184551496b01d9f0f44a514c23aa1e094b7). Updated name looks okay, thanks for adjusting that. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25107#discussion_r2081008799 From bpb at openjdk.org Fri May 9 06:28:54 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Fri, 9 May 2025 06:28:54 GMT Subject: RFR: 8356127: (fs) UnixFileSystemProvider.implDelete could save a syscall in some cases [v3] In-Reply-To: <_tmc-y1SKXOJbqGypPX5JNi6dzDvhrgv41VwpzxK_7A=.8c2dd1c1-aeb7-4771-a357-f093b84341ee@github.com> References: <__DpX8NhzRrLcm-Ev8Z7HovPQqJolMCEcWerlNYvyUg=.9e95dad9-640b-4ebb-9dae-977c216dc3ce@github.com> <_tmc-y1SKXOJbqGypPX5JNi6dzDvhrgv41VwpzxK_7A=.8c2dd1c1-aeb7-4771-a357-f093b84341ee@github.com> Message-ID: On Fri, 9 May 2025 06:20:13 GMT, Alan Bateman wrote: >> Brian Burkhalter 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 commits since the last revision: >> >> - 8356127: Change capability naming >> - Merge >> - 8356127: Add capability check for EISDIR >> - 8356127: (fs) UnixFileSystemProvider.implDelete could save a syscall in some cases > > src/java.base/unix/classes/sun/nio/fs/UnixFileSystemProvider.java line 260: > >> 258: // check whether the file is a directory >> 259: if (e.errno() == EISDIR || >> 260: UnixFileAttributes.get(file, false).isDirectory()) > > If unlink fails (not EISDIR) then shouldn't we just throw the error? I'm not sure why it attempts to stat the file for this case. I was trying to emulate what would have happened in the previous implementation where rmdir would have been called if the stat showed a directory at issue. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25107#discussion_r2081015269 From bpb at openjdk.org Fri May 9 06:31:51 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Fri, 9 May 2025 06:31:51 GMT Subject: RFR: 8356127: (fs) UnixFileSystemProvider.implDelete could save a syscall in some cases [v3] In-Reply-To: References: <__DpX8NhzRrLcm-Ev8Z7HovPQqJolMCEcWerlNYvyUg=.9e95dad9-640b-4ebb-9dae-977c216dc3ce@github.com> <_tmc-y1SKXOJbqGypPX5JNi6dzDvhrgv41VwpzxK_7A=.8c2dd1c1-aeb7-4771-a357-f093b84341ee@github.com> Message-ID: On Fri, 9 May 2025 06:26:28 GMT, Brian Burkhalter wrote: >> src/java.base/unix/classes/sun/nio/fs/UnixFileSystemProvider.java line 260: >> >>> 258: // check whether the file is a directory >>> 259: if (e.errno() == EISDIR || >>> 260: UnixFileAttributes.get(file, false).isDirectory()) >> >> If unlink fails (not EISDIR) then shouldn't we just throw the error? I'm not sure why it attempts to stat the file for this case. > > I was trying to emulate what would have happened in the previous implementation where rmdir would have been called if the stat showed a directory at issue. But on second thought you might be right. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25107#discussion_r2081019047 From bpb at openjdk.org Fri May 9 06:37:52 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Fri, 9 May 2025 06:37:52 GMT Subject: RFR: 8356127: (fs) UnixFileSystemProvider.implDelete could save a syscall in some cases [v3] In-Reply-To: References: <__DpX8NhzRrLcm-Ev8Z7HovPQqJolMCEcWerlNYvyUg=.9e95dad9-640b-4ebb-9dae-977c216dc3ce@github.com> <_tmc-y1SKXOJbqGypPX5JNi6dzDvhrgv41VwpzxK_7A=.8c2dd1c1-aeb7-4771-a357-f093b84341ee@github.com> Message-ID: <8mOBk56Zaqo1KTinUbQm0QrLq-xL21mUjaf4O5AuSiE=.ef062a83-cd68-4137-9a72-c309fcf6f1bf@github.com> On Fri, 9 May 2025 06:29:04 GMT, Brian Burkhalter wrote: >> I was trying to emulate what would have happened in the previous implementation where rmdir would have been called if the stat showed a directory at issue. > > But on second thought you might be right. I think line 260 was an artifact of the previous commit. I will remove it tomorrow. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25107#discussion_r2081026105 From alanb at openjdk.org Fri May 9 06:40:00 2025 From: alanb at openjdk.org (Alan Bateman) Date: Fri, 9 May 2025 06:40:00 GMT Subject: RFR: 8355938: Addressed rare lost unpark bug 8074773 by pre-loading LockSupport.class In-Reply-To: References: Message-ID: On Fri, 9 May 2025 02:45:16 GMT, David Holmes wrote: > The underlying issue is nested-parking as Alan notes. From re-reading 8074773, pre-loading in any class loaded by the boot loader, has no affect on the bug. The issue was the action taken by the AppLoader that involved creating an entry in the lockMap CHM. That particular bug-path was closed when CHM was rewritten to use object monitors (did it re-open again when Loom came along?). No, it will still uses synchronized if there is contention and this will not consume the park permit when it's a virtual thread. Im not sure if Heinz ran into an issue, or just remember the issue from 2015, Heinz? ------------- PR Comment: https://git.openjdk.org/jdk/pull/24952#issuecomment-2865320135 From alanb at openjdk.org Fri May 9 06:43:52 2025 From: alanb at openjdk.org (Alan Bateman) Date: Fri, 9 May 2025 06:43:52 GMT Subject: RFR: 8356127: (fs) UnixFileSystemProvider.implDelete could save a syscall in some cases [v3] In-Reply-To: <8mOBk56Zaqo1KTinUbQm0QrLq-xL21mUjaf4O5AuSiE=.ef062a83-cd68-4137-9a72-c309fcf6f1bf@github.com> References: <__DpX8NhzRrLcm-Ev8Z7HovPQqJolMCEcWerlNYvyUg=.9e95dad9-640b-4ebb-9dae-977c216dc3ce@github.com> <_tmc-y1SKXOJbqGypPX5JNi6dzDvhrgv41VwpzxK_7A=.8c2dd1c1-aeb7-4771-a357-f093b84341ee@github.com> <8mOBk56Zaqo1KTinUbQm0QrLq-xL21mUjaf4O5AuSiE=.ef062a83-cd68-4137-9a72-c309fcf6f1bf@github.com> Message-ID: On Fri, 9 May 2025 06:35:24 GMT, Brian Burkhalter wrote: >> But on second thought you might be right. > > I think line 260 was an artifact of the previous commit. I will remove it tomorrow. It might be worth digging into how this works in NFS environments. If a program on Linux attempts to unlink a directory on a NFS mount, will this reliable get the EISDIR error? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25107#discussion_r2081033997 From dfuchs at openjdk.org Fri May 9 07:18:52 2025 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Fri, 9 May 2025 07:18:52 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor In-Reply-To: References: Message-ID: On Thu, 8 May 2025 17:41:02 GMT, Daniel Fuchs wrote: > Thank you. I have imported your PR locally and running some HTTP client tests in the CI. > Tests have not finished running - but I already see one intermittent failure: > `java/net/httpclient/RedirectTimeoutTest.java` is timing out intermittently on windows. > It would be good to flush out any such intermittent failures before this PR is integrated. > This might require multiple runs before we can get confidence. Results came back - another intermittent timeout failure (much more frequent) observed in: `java/net/httpclient/CancelledResponse.java` on macOS x64 ------------- PR Comment: https://git.openjdk.org/jdk/pull/25122#issuecomment-2865413003 From cstein at openjdk.org Fri May 9 07:36:51 2025 From: cstein at openjdk.org (Christian Stein) Date: Fri, 9 May 2025 07:36:51 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor In-Reply-To: References: Message-ID: On Fri, 9 May 2025 04:54:52 GMT, David Holmes wrote: > [...] > ** though another option would be to update the jtreg default timeout instead. And affect all other tests, too? I'd rather let the default stay on the former hard-coded 120s value. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25122#issuecomment-2865469908 From alanb at openjdk.org Fri May 9 08:12:52 2025 From: alanb at openjdk.org (Alan Bateman) Date: Fri, 9 May 2025 08:12:52 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor In-Reply-To: References: Message-ID: On Thu, 8 May 2025 16:43:10 GMT, Leo Korinth wrote: >> This change tries to add timeout to individual testcases so that I am able to run them with a timeout factor of 1 in the future (JDK-8260555). >> >> The first commit changes the timeout factor to 0.7, so that I can run tests and test the change (it will finally be changed to 1.0 in JDK-8260555). The next commit excludes some junit/testng tests where I can currently not change the timeout factor (CODETOOLS-7903961). Both these commits will be reverted before integrating the change. I will also apply copyright updates after the review. >> >> In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the java properties (I can not use the library function everywhere as jtreg does not allow me to add @library notations to non testcase files). >> >> My approach has been to run all test, and afterwards updating those that fails due to a timeout factor. The amount of updated testcases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed (thus the timeout will be the same after JDK-8260555 is implemented). In a few places I have added a bit more timeout so that it will work with the 0.7 timeout factor. >> >> These fixes have been created when I have plown through testcases: >> JDK-8352719: Add an equals sign to the modules statement >> JDK-8352709: Remove bad timing annotations from WhileOpTest.java >> JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test >> CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE >> CODETOOLS-7903961: Make default timeout configurable >> >> Sometime in the future I will also fix: >> 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 >> >> for which I am awaiting: >> CODETOOLS-7903961 that is fixed in jtreg 7.6, but we are still running 7.5.1+1 >> >> *After the review I will revert the two first commits, and update the copyrights* > > After I revert the two first commits and go back to a timeout factor of 4, I will run tier 1-8 again. @lkorinth Moving to a TIMEOUT_FACTOR of 1 seems a good goal. Would it be possible to expand a bit on what repeat testing was done to identify the tests to add /timeout ? If I read it correctly, any tests using /timeout=N have been to bumped to 4*N so no change. Most tests don't use /timeout so I assume many runs were done to identify the tests that would timeout with if there was no scaling. Test machines vary, as does the test execution times when running concurrently with other tests, so I think it would help if you could say a bit more, even to confirm that it was many test runs. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25122#issuecomment-2865581927 From lkorinth at openjdk.org Fri May 9 08:32:55 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Fri, 9 May 2025 08:32:55 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor In-Reply-To: References: Message-ID: On Thu, 8 May 2025 14:51:24 GMT, Leo Korinth wrote: > This change tries to add timeout to individual testcases so that I am able to run them with a timeout factor of 1 in the future (JDK-8260555). > > The first commit changes the timeout factor to 0.7, so that I can run tests and test the change (it will finally be changed to 1.0 in JDK-8260555). The next commit excludes some junit/testng tests where I can currently not change the timeout factor (CODETOOLS-7903961). Both these commits will be reverted before integrating the change. I will also apply copyright updates after the review. > > In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the java properties (I can not use the library function everywhere as jtreg does not allow me to add @library notations to non testcase files). > > My approach has been to run all test, and afterwards updating those that fails due to a timeout factor. The amount of updated testcases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed (thus the timeout will be the same after JDK-8260555 is implemented). In a few places I have added a bit more timeout so that it will work with the 0.7 timeout factor. > > These fixes have been created when I have plown through testcases: > JDK-8352719: Add an equals sign to the modules statement > JDK-8352709: Remove bad timing annotations from WhileOpTest.java > JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test > CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE > CODETOOLS-7903961: Make default timeout configurable > > Sometime in the future I will also fix: > 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 > > for which I am awaiting: > CODETOOLS-7903961 that is fixed in jtreg 7.6, but we are still running 7.5.1+1 > > *After the review I will revert the two first commits, and update the copyrights* I feel almost all of the comments raised here are for me changing the timeout factor to `1`. I will try to answer those questions here as well, but note that the timeout factor is not to be changed to `1` in this pull request and will remain 4, so excluding bugs I might have introduced, tiers would --- if anything --- be running more stable after the change as I have only increased timeouts. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25122#issuecomment-2865644966 From lkorinth at openjdk.org Fri May 9 08:42:58 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Fri, 9 May 2025 08:42:58 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor In-Reply-To: References: Message-ID: On Fri, 9 May 2025 07:14:11 GMT, Daniel Fuchs wrote: > Thank you. I have imported your PR locally and running some HTTP client tests in the CI. Tests have not finished running - but I already see one intermittent failure: `java/net/httpclient/RedirectTimeoutTest.java` is timing out intermittently on windows. It would be good to flush out any such intermittent failures before this PR is integrated. This might require multiple runs before we can get confidence. My change of timeout factor to `0.7` is only temporal, as I said: it will be reverted to `4` before integration. Naturally, a few test cases will timeout when I do this /temporal/ change, hopefully `java/net/httpclient/RedirectTimeoutTest.java` will behave well with a timeout factor of `1` instead of `0.7`, but note that I will revert the timeout factor to `4` before integration. The whole idea of running with a timeout factor of `0.7` is to remove intermittent failures. (I had it close to 0.5 or maybe less to begin with until I found and reported CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE) ------------- PR Comment: https://git.openjdk.org/jdk/pull/25122#issuecomment-2865685066 From stefank at openjdk.org Fri May 9 08:48:51 2025 From: stefank at openjdk.org (Stefan Karlsson) Date: Fri, 9 May 2025 08:48:51 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor In-Reply-To: References: Message-ID: <1Sa3h-gkyVwOLDdj_wJdFohAGYbhYhbAYIaqHCmW7oY=.3b58c23d-cf55-421b-aeec-e149809826f2@github.com> On Fri, 9 May 2025 08:40:44 GMT, Leo Korinth wrote: > My change of timeout factor to 0.7 is only temporal, as I said: it will be reverted to 4 before integration. Is really worth reverting back to 4 instead of trying to get jtreg released with CODETOOLS-7903961 and then integrate this change with a timeout factor of 1? ------------- PR Comment: https://git.openjdk.org/jdk/pull/25122#issuecomment-2865697701 From sebastian.stenzel at gmail.com Fri May 9 08:53:30 2025 From: sebastian.stenzel at gmail.com (Sebastian Stenzel) Date: Fri, 9 May 2025 10:53:30 +0200 Subject: Extended Attributes Support (Linux/macOS) In-Reply-To: <98E1D238-2117-4E24-AF3C-A70F8B8F03B8@gmail.com> References: <98E1D238-2117-4E24-AF3C-A70F8B8F03B8@gmail.com> Message-ID: <28ADA383-11CC-46C4-8FFD-F5DE1B7A9C7E@gmail.com> For the sake of documenting the proposal, here is an issue: https://bugs.openjdk.org/browse/JDK-8356607 If anyone would sponsor this, I?d like to work on a PR. > On 8. May 2025, at 21:08, Sebastian Stenzel wrote: > > Hi all, > > A couple of releases ago I added some UserDefinedAttributeView support on macOS and did some cleanup and deduplications [1]. One thing has been bothering me since, though: > > I?d like to add a new FileAttributeView named ?xattr? that basically is the same as UnixUserDefinedFileAttributeView [2] but without the ?user.? prefix, so it can be used to access extended attributes set by other applications. > > This shouldn?t require many code additions, just some clever class hierarchy modifications. I.e. UnixUserDefinedFileAttributeView should extend ExtendedFileAttributeView. To achieve this, I propose to replace sun.nio.fs.AbstractUserDefinedFileAttributeView with an interface with default methods (now that the security manager is gone). > > This isn?t public API, nevertheless I?d like to know if this would be an acceptable change or if you?d rather like me to use composition over inheritance. > > Any thoughts? > > Sebastian > > > [1] https://github.com/openjdk/jdk/pulls?q=is%3Apr+author%3Aoverheadhunter+xattr+ > [2] https://github.com/openjdk/jdk/blob/jdk-24%2B36/src/java.base/unix/classes/sun/nio/fs/UnixUserDefinedFileAttributeView.java -------------- next part -------------- An HTML attachment was scrubbed... URL: From lkorinth at openjdk.org Fri May 9 09:02:55 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Fri, 9 May 2025 09:02:55 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor In-Reply-To: References: Message-ID: <0AKC-4omm-W24u11ifhGm8Do8_5sqwPMJz6q3A71FNE=.f4209d38-51d6-4eda-b11e-d670e5ee5575@github.com> On Thu, 8 May 2025 20:00:21 GMT, Phil Race wrote: > test/jdk/java/awt/font/NumericShaper/MTTest.java > > * * @run main/timeout=300/othervm MTTest > > > * * @run main/timeout=1200/othervm MTTest > > > I'm puzzling over why you saw this test fail with timeout = 300 .. or perhaps you saw it fail with 0.7 ? Which would amount to 210 seconds .. that might just be enough to cause it to fail because if you look at the whole test you'll see it wants the core loops of the test to run for 180 seconds. > > https://openjdk.github.io/cr/?repo=jdk&pr=25122&range=00#new-144-test/jdk/java/awt/font/NumericShaper/MTTest.java > > So 300 was fine, and 1200 isn't needed. I started with a timeout factor less than `0.7` but I got hindered by CODETOOLS-7903937. That is probably the reason. Maybe I should change the timeout to 400? I think it is reasonable to handle a timeout factor somewhat less than 1 to weed out tight test cases. But maybe 300 is good enough? ------------- PR Comment: https://git.openjdk.org/jdk/pull/25122#issuecomment-2865742871 From lkorinth at openjdk.org Fri May 9 09:12:19 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Fri, 9 May 2025 09:12:19 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor In-Reply-To: <0AKC-4omm-W24u11ifhGm8Do8_5sqwPMJz6q3A71FNE=.f4209d38-51d6-4eda-b11e-d670e5ee5575@github.com> References: <0AKC-4omm-W24u11ifhGm8Do8_5sqwPMJz6q3A71FNE=.f4209d38-51d6-4eda-b11e-d670e5ee5575@github.com> Message-ID: <3-AQ92Sgr9tDJIWDO5OX43uBDLndiDN_3jyRj5t2z6Q=.af7cef0d-c447-4401-b4e0-e11a9bdba35b@github.com> On Fri, 9 May 2025 08:58:15 GMT, Leo Korinth wrote: >> test/jdk/java/awt/font/NumericShaper/MTTest.java >> >> - * @run main/timeout=300/othervm MTTest >> + * @run main/timeout=1200/othervm MTTest >> >> I'm puzzling over why you saw this test fail with timeout = 300 .. or perhaps you saw it fail with 0.7 ? Which would amount to 210 seconds .. that might just be enough to cause it to fail because if you look at the whole test you'll see it wants the core loops of the test to run for 180 seconds. >> >> https://openjdk.github.io/cr/?repo=jdk&pr=25122&range=00#new-144-test/jdk/java/awt/font/NumericShaper/MTTest.java >> >> So 300 was fine, and 1200 isn't needed. > >> test/jdk/java/awt/font/NumericShaper/MTTest.java >> >> * * @run main/timeout=300/othervm MTTest >> >> >> * * @run main/timeout=1200/othervm MTTest >> >> >> I'm puzzling over why you saw this test fail with timeout = 300 .. or perhaps you saw it fail with 0.7 ? Which would amount to 210 seconds .. that might just be enough to cause it to fail because if you look at the whole test you'll see it wants the core loops of the test to run for 180 seconds. >> >> https://openjdk.github.io/cr/?repo=jdk&pr=25122&range=00#new-144-test/jdk/java/awt/font/NumericShaper/MTTest.java >> >> So 300 was fine, and 1200 isn't needed. > > I started with a timeout factor less than `0.7` but I got hindered by CODETOOLS-7903937. That is probably the reason. Maybe I should change the timeout to 400? I think it is reasonable to handle a timeout factor somewhat less than 1 to weed out tight test cases. But maybe 300 is good enough? > @lkorinth Moving to a TIMEOUT_FACTOR of 1 seems a good goal. Would it be possible to expand a bit on what repeat testing was done to identify the tests to add /timeout ? If I read it correctly, any tests using /timeout=N have been to bumped to 4*N so no change if the scaling is adjusted in the future. Most tests don't use /timeout so I assume many runs were done to identify the tests that would timeout with if there was no scaling. Test machines vary, as does the test execution times when running concurrently with other tests, so I think it would help if you could say a bit more, even to confirm that it was many test runs. The code was run as it currently looks (with a timeout factor of `0.7`), what timeout factor do you think I should use to test, and for how many times? At the moment I am awaiting jtreg 7.6, I therefore guess the timeout factor change to `1` will happen after the fork. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25122#issuecomment-2865784064 From cstein at openjdk.org Fri May 9 09:15:51 2025 From: cstein at openjdk.org (Christian Stein) Date: Fri, 9 May 2025 09:15:51 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor In-Reply-To: <3-AQ92Sgr9tDJIWDO5OX43uBDLndiDN_3jyRj5t2z6Q=.af7cef0d-c447-4401-b4e0-e11a9bdba35b@github.com> References: <0AKC-4omm-W24u11ifhGm8Do8_5sqwPMJz6q3A71FNE=.f4209d38-51d6-4eda-b11e-d670e5ee5575@github.com> <3-AQ92Sgr9tDJIWDO5OX43uBDLndiDN_3jyRj5t2z6Q=.af7cef0d-c447-4401-b4e0-e11a9bdba35b@github.com> Message-ID: On Fri, 9 May 2025 09:09:34 GMT, Leo Korinth wrote: > At the moment I am awaiting jtreg 7.6, I therefore guess the timeout factor change to 1 will happen after the fork. Note, that I moved the timeout configuration feature to `jtreg` 7.5.2 - which will be released soon. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25122#issuecomment-2865793769 From lkorinth at openjdk.org Fri May 9 09:15:52 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Fri, 9 May 2025 09:15:52 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor In-Reply-To: <1Sa3h-gkyVwOLDdj_wJdFohAGYbhYhbAYIaqHCmW7oY=.3b58c23d-cf55-421b-aeec-e149809826f2@github.com> References: <1Sa3h-gkyVwOLDdj_wJdFohAGYbhYhbAYIaqHCmW7oY=.3b58c23d-cf55-421b-aeec-e149809826f2@github.com> Message-ID: On Fri, 9 May 2025 08:45:48 GMT, Stefan Karlsson wrote: > > My change of timeout factor to 0.7 is only temporal, as I said: it will be reverted to 4 before integration. > > Is really worth reverting back to 4 instead of trying to get jtreg released with CODETOOLS-7903961 and then integrate this change with a timeout factor of 1? I think it is worth doing in two steps. First I do not want to postpone these limited changes, and second if I would have problems with JDK-8260555, it would be nice if those changes would be smaller and easier to revert. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25122#issuecomment-2865794195 From stefank at openjdk.org Fri May 9 09:19:51 2025 From: stefank at openjdk.org (Stefan Karlsson) Date: Fri, 9 May 2025 09:19:51 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor In-Reply-To: References: <1Sa3h-gkyVwOLDdj_wJdFohAGYbhYhbAYIaqHCmW7oY=.3b58c23d-cf55-421b-aeec-e149809826f2@github.com> Message-ID: On Fri, 9 May 2025 09:13:41 GMT, Leo Korinth wrote: > > > My change of timeout factor to 0.7 is only temporal, as I said: it will be reverted to 4 before integration. > > > > > > Is really worth reverting back to 4 instead of trying to get jtreg released with CODETOOLS-7903961 and then integrate this change with a timeout factor of 1? > > I think it is worth doing in two steps. First I do not want to postpone these limited changes, and second if I would have problems with JDK-8260555, it would be nice if those changes would be smaller and easier to revert. I understand the risk of being blocked on JDK-8260555, but frankly, if someone wants to block the change from 4 to 1 I'm not sure this PR is worth doing. We have enough groups represented in this PR so let's ask here: is anyone is opposing the idea of JDK-8260555? ------------- PR Comment: https://git.openjdk.org/jdk/pull/25122#issuecomment-2865804474 From dfuchs at openjdk.org Fri May 9 09:33:52 2025 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Fri, 9 May 2025 09:33:52 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor In-Reply-To: References: Message-ID: On Fri, 9 May 2025 08:40:44 GMT, Leo Korinth wrote: > The whole idea of running with a timeout factor of `0.7` is to remove intermittent failures. (I had it close to 0.5 or maybe less to begin with until I found and reported CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE) Yes - I understand. My point is that there are probably more tests that will need an extended timeout than those that you have already modified. And we want to find out which before the actual change from 4 to 1.0. IMO if a test fails intermittently with 0.7, it's a good indication that it might continue failling intermittently with 1.0, and therefore it should be updated in this PR too. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25122#issuecomment-2865849069 From dholmes at openjdk.org Fri May 9 12:21:54 2025 From: dholmes at openjdk.org (David Holmes) Date: Fri, 9 May 2025 12:21:54 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor In-Reply-To: References: Message-ID: <3CKLh1TDhqMNxlWyINFVMAI6MGe_s2rJrgnfzXYpx2M=.ab9a5cb5-9671-4b90-ba81-83f65b82cd6d@github.com> On Thu, 8 May 2025 14:51:24 GMT, Leo Korinth wrote: > This change tries to add timeout to individual testcases so that I am able to run them with a timeout factor of 1 in the future (JDK-8260555). > > The first commit changes the timeout factor to 0.7, so that I can run tests and test the change (it will finally be changed to 1.0 in JDK-8260555). The next commit excludes some junit/testng tests where I can currently not change the timeout factor (CODETOOLS-7903961). Both these commits will be reverted before integrating the change. I will also apply copyright updates after the review. > > In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the java properties (I can not use the library function everywhere as jtreg does not allow me to add @library notations to non testcase files). > > My approach has been to run all test, and afterwards updating those that fails due to a timeout factor. The amount of updated testcases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed (thus the timeout will be the same after JDK-8260555 is implemented). In a few places I have added a bit more timeout so that it will work with the 0.7 timeout factor. > > These fixes have been created when I have plown through testcases: > JDK-8352719: Add an equals sign to the modules statement > JDK-8352709: Remove bad timing annotations from WhileOpTest.java > JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test > CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE > CODETOOLS-7903961: Make default timeout configurable > > Sometime in the future I will also fix: > 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 > > for which I am awaiting: > CODETOOLS-7903961 that is fixed in jtreg 7.6, but we are still running 7.5.1+1 > > *After the review I will revert the two first commits, and update the copyrights* I saw this PR as preparation for the change of the timeout factor so they could be reviewed distinctly and then integrated close together. So it is natural that people are querying how the proposed changes will work with that change - in particular if it will require explicit timeouts to be added to a lot of tests that don't presently have them. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25122#issuecomment-2866338479 From lkorinth at openjdk.org Fri May 9 12:51:52 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Fri, 9 May 2025 12:51:52 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor In-Reply-To: References: Message-ID: On Thu, 8 May 2025 14:51:24 GMT, Leo Korinth wrote: > This change tries to add timeout to individual testcases so that I am able to run them with a timeout factor of 1 in the future (JDK-8260555). > > The first commit changes the timeout factor to 0.7, so that I can run tests and test the change (it will finally be changed to 1.0 in JDK-8260555). The next commit excludes some junit/testng tests where I can currently not change the timeout factor (CODETOOLS-7903961). Both these commits will be reverted before integrating the change. I will also apply copyright updates after the review. > > In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the java properties (I can not use the library function everywhere as jtreg does not allow me to add @library notations to non testcase files). > > My approach has been to run all test, and afterwards updating those that fails due to a timeout factor. The amount of updated testcases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed (thus the timeout will be the same after JDK-8260555 is implemented). In a few places I have added a bit more timeout so that it will work with the 0.7 timeout factor. > > These fixes have been created when I have plown through testcases: > JDK-8352719: Add an equals sign to the modules statement > JDK-8352709: Remove bad timing annotations from WhileOpTest.java > JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test > CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE > CODETOOLS-7903961: Make default timeout configurable > > Sometime in the future I will also fix: > 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 > > for which I am awaiting: > CODETOOLS-7903961 that is fixed in jtreg 7.6, but we are still running 7.5.1+1 > > *After the review I will revert the two first commits, and update the copyrights* Every time I rerun the tests, some new testcase fails on timeouts. Even worse is that I get quite a few /totally unrelated/ test failures every time because I am running 8 tiers. I could probably change the timeout factor to 0.6 to weed out some more tests faster, but I can not use a timeout factor of 0.5 or less because of CODETOOLS-7903937. Every 0.1 percent corresponds to 12 seconds. So in absolute measurements I have a margin of 36 seconds now if I would go to a timeout factor of 1. I am also a bit afraid of having too big of a margin --- it will force me to convert possible huge amount of new test cases. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25122#issuecomment-2866421573 From lkorinth at openjdk.org Fri May 9 13:06:01 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Fri, 9 May 2025 13:06:01 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor In-Reply-To: References: Message-ID: On Thu, 8 May 2025 14:51:24 GMT, Leo Korinth wrote: > This change tries to add timeout to individual testcases so that I am able to run them with a timeout factor of 1 in the future (JDK-8260555). > > The first commit changes the timeout factor to 0.7, so that I can run tests and test the change (it will finally be changed to 1.0 in JDK-8260555). The next commit excludes some junit/testng tests where I can currently not change the timeout factor (CODETOOLS-7903961). Both these commits will be reverted before integrating the change. I will also apply copyright updates after the review. > > In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the java properties (I can not use the library function everywhere as jtreg does not allow me to add @library notations to non testcase files). > > My approach has been to run all test, and afterwards updating those that fails due to a timeout factor. The amount of updated testcases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed (thus the timeout will be the same after JDK-8260555 is implemented). In a few places I have added a bit more timeout so that it will work with the 0.7 timeout factor. > > These fixes have been created when I have plown through testcases: > JDK-8352719: Add an equals sign to the modules statement > JDK-8352709: Remove bad timing annotations from WhileOpTest.java > JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test > CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE > CODETOOLS-7903961: Make default timeout configurable > > Sometime in the future I will also fix: > 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 > > for which I am awaiting: > CODETOOLS-7903961 that is fixed in jtreg 7.6, but we are still running 7.5.1+1 > > *After the review I will revert the two first commits, and update the copyrights* Changing the timeout factor might be preferable to do after the fork. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25122#issuecomment-2866463008 From mullan at openjdk.org Fri May 9 16:45:08 2025 From: mullan at openjdk.org (Sean Mullan) Date: Fri, 9 May 2025 16:45:08 GMT Subject: RFR: 8353642: Deprecate URL::getPermission method and networking permission classes for removal [v4] In-Reply-To: References: Message-ID: On Thu, 8 May 2025 16:10:18 GMT, Daniel Fuchs wrote: >> Please find her a patch that deprecate networking permission classes for removal. The method `URL::getPermission` now serves little purpose and is also deprecated. That method was overridden in subclasses and specified to return some of the deprecated permissions. > > Daniel Fuchs 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 five additional commits since the last revision: > > - Merge branch 'master' into deprecate-net-perms-8353642 > - Revert changes to SocketPermission and CodeSource > - Review feedback. Deprecate getPermission for removal. > - Missing white spaces > - 8353642: Deprecate networking permission classes for removal src/java.base/share/classes/java/net/HttpURLConnection.java line 615: > 613: */ > 614: @Deprecated(since = "25", forRemoval = true) > 615: @SuppressWarnings("removal") Do you still need this annotation now that `SocketPermission` is not deprecated for removal? src/java.base/share/classes/sun/net/www/protocol/file/FileURLConnection.java line 214: > 212: */ > 213: @Override > 214: @Deprecated(since = "25", forRemoval = true) Is this annotation required or more as a reminder that the superclass method is deprecated? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24592#discussion_r2082086475 PR Review Comment: https://git.openjdk.org/jdk/pull/24592#discussion_r2082050913 From swen at openjdk.org Fri May 9 16:45:56 2025 From: swen at openjdk.org (Shaojin Wen) Date: Fri, 9 May 2025 16:45:56 GMT Subject: Integrated: 8356036: (fs) FileKey.hashCode and UnixFileStore.hashCode implementations can use Long.hashCode In-Reply-To: References: Message-ID: <3BgkAsv8a0Rg0v-TmvE05EVP_ASRPUZmmpvkYW_qJXE=.6f5e8419-a42c-4127-b623-cad0fee5cb8e@github.com> On Thu, 1 May 2025 14:41:09 GMT, Shaojin Wen wrote: > Similar to #24959 and #24971, sun.nio.ch.FileKey/sun.nio.fs.UnixFileKey/sun.nio.fs.UnixFileStore in java.base can also be simplified similarly. > > Replace manual bitwise operations in hashCode implementations of sun.nio.ch.FileKey/sun.nio.fs.UnixFileKey/sun.nio.fs.UnixFileStore with Long::hashCode. This pull request has now been integrated. Changeset: 2661f62c Author: Shaojin Wen URL: https://git.openjdk.org/jdk/commit/2661f62ca23f5589538d4ad50078d1f715ade342 Stats: 5 lines in 3 files changed: 0 ins; 2 del; 3 mod 8356036: (fs) FileKey.hashCode and UnixFileStore.hashCode implementations can use Long.hashCode Reviewed-by: liach, bpb ------------- PR: https://git.openjdk.org/jdk/pull/24987 From bpb at openjdk.org Fri May 9 16:46:09 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Fri, 9 May 2025 16:46:09 GMT Subject: RFR: 8356127: (fs) UnixFileSystemProvider.implDelete could save a syscall in some cases [v4] In-Reply-To: <__DpX8NhzRrLcm-Ev8Z7HovPQqJolMCEcWerlNYvyUg=.9e95dad9-640b-4ebb-9dae-977c216dc3ce@github.com> References: <__DpX8NhzRrLcm-Ev8Z7HovPQqJolMCEcWerlNYvyUg=.9e95dad9-640b-4ebb-9dae-977c216dc3ce@github.com> Message-ID: > Modify `UnixFileSystemProvider.implDelete` to attempt first to delete the file using `unlink` and, if that fails, fall back to using `rmdir` if the file is a directory. Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: 8356127: Fix logic of EISDIR handling ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25107/files - new: https://git.openjdk.org/jdk/pull/25107/files/3814a184..e1b8861b Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25107&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25107&range=02-03 Stats: 12 lines in 1 file changed: 3 ins; 5 del; 4 mod Patch: https://git.openjdk.org/jdk/pull/25107.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25107/head:pull/25107 PR: https://git.openjdk.org/jdk/pull/25107 From bpb at openjdk.org Fri May 9 16:46:09 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Fri, 9 May 2025 16:46:09 GMT Subject: RFR: 8356127: (fs) UnixFileSystemProvider.implDelete could save a syscall in some cases [v3] In-Reply-To: References: <__DpX8NhzRrLcm-Ev8Z7HovPQqJolMCEcWerlNYvyUg=.9e95dad9-640b-4ebb-9dae-977c216dc3ce@github.com> <_tmc-y1SKXOJbqGypPX5JNi6dzDvhrgv41VwpzxK_7A=.8c2dd1c1-aeb7-4771-a357-f093b84341ee@github.com> <8mOBk56Zaqo1KTinUbQm0QrLq-xL21mUjaf4O5AuSiE=.ef062a83-cd68-4137-9a72-c309fcf6f1bf@github.com> Message-ID: On Fri, 9 May 2025 06:41:19 GMT, Alan Bateman wrote: >> I think line 260 was an artifact of the previous commit. I will remove it tomorrow. > > It might be worth digging into how this works in NFS environments. If a program on Linux attempts to unlink a directory on a NFS mount, will this reliable get the EISDIR error? > If unlink fails (not EISDIR) then shouldn't we just throw the error? Fixed in e1b8861. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25107#discussion_r2082088363 From bpb at openjdk.org Fri May 9 16:46:09 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Fri, 9 May 2025 16:46:09 GMT Subject: RFR: 8356127: (fs) UnixFileSystemProvider.implDelete could save a syscall in some cases [v3] In-Reply-To: References: <__DpX8NhzRrLcm-Ev8Z7HovPQqJolMCEcWerlNYvyUg=.9e95dad9-640b-4ebb-9dae-977c216dc3ce@github.com> <_tmc-y1SKXOJbqGypPX5JNi6dzDvhrgv41VwpzxK_7A=.8c2dd1c1-aeb7-4771-a357-f093b84341ee@github.com> <8mOBk56Zaqo1KTinUbQm0QrLq-xL21mUjaf4O5AuSiE=.ef062a83-cd68-4137-9a72-c309fcf6f1bf@github.com> Message-ID: <_grJggFbxOgB93F8aKoWKNXJw_qyfIo5iqZXs37kLMY=.425b9fd3-b2f9-4701-82ba-7fada1b86e74@github.com> On Fri, 9 May 2025 16:43:06 GMT, Brian Burkhalter wrote: >> It might be worth digging into how this works in NFS environments. If a program on Linux attempts to unlink a directory on a NFS mount, will this reliable get the EISDIR error? > >> If unlink fails (not EISDIR) then shouldn't we just throw the error? > > Fixed in e1b8861. > It might be worth digging into how this works in NFS environments. I will try to assess this. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25107#discussion_r2082089544 From bpb at openjdk.org Fri May 9 16:56:09 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Fri, 9 May 2025 16:56:09 GMT Subject: RFR: 8356127: (fs) UnixFileSystemProvider.implDelete could save a syscall in some cases [v5] In-Reply-To: <__DpX8NhzRrLcm-Ev8Z7HovPQqJolMCEcWerlNYvyUg=.9e95dad9-640b-4ebb-9dae-977c216dc3ce@github.com> References: <__DpX8NhzRrLcm-Ev8Z7HovPQqJolMCEcWerlNYvyUg=.9e95dad9-640b-4ebb-9dae-977c216dc3ce@github.com> Message-ID: > Modify `UnixFileSystemProvider.implDelete` to attempt first to delete the file using `unlink` and, if that fails, fall back to using `rmdir` if the file is a directory. Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: 8356127: Tweak previous commit ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25107/files - new: https://git.openjdk.org/jdk/pull/25107/files/e1b8861b..6cb746b2 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25107&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25107&range=03-04 Stats: 4 lines in 1 file changed: 1 ins; 2 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/25107.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25107/head:pull/25107 PR: https://git.openjdk.org/jdk/pull/25107 From alanb at openjdk.org Fri May 9 17:03:55 2025 From: alanb at openjdk.org (Alan Bateman) Date: Fri, 9 May 2025 17:03:55 GMT Subject: RFR: 8356127: (fs) UnixFileSystemProvider.implDelete could save a syscall in some cases [v3] In-Reply-To: <_grJggFbxOgB93F8aKoWKNXJw_qyfIo5iqZXs37kLMY=.425b9fd3-b2f9-4701-82ba-7fada1b86e74@github.com> References: <__DpX8NhzRrLcm-Ev8Z7HovPQqJolMCEcWerlNYvyUg=.9e95dad9-640b-4ebb-9dae-977c216dc3ce@github.com> <_tmc-y1SKXOJbqGypPX5JNi6dzDvhrgv41VwpzxK_7A=.8c2dd1c1-aeb7-4771-a357-f093b84341ee@github.com> <8mOBk56Zaqo1KTinUbQm0QrLq-xL21mUjaf4O5AuSiE=.ef062a83-cd68-4137-9a72-c309fcf6f1bf@github.com> <_grJggFbxOgB93F8aKoWKNXJw_qyfIo5iqZXs37kLMY=.425b9fd3-b2f9-4701-82ba-7fada1b86e74@github.com> Message-ID: On Fri, 9 May 2025 16:43:32 GMT, Brian Burkhalter wrote: >>> If unlink fails (not EISDIR) then shouldn't we just throw the error? >> >> Fixed in e1b8861. > >> It might be worth digging into how this works in NFS environments. > > I will try to assess this. I have a vague memory that NFSv4 had changes in this area to allow the REMOVE RPC handle any file type. Getting an up to date summary on that would be helpful as it may be that the change here will only work on local file systems. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25107#discussion_r2082115478 From dfuchs at openjdk.org Fri May 9 19:21:56 2025 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Fri, 9 May 2025 19:21:56 GMT Subject: RFR: 8353642: Deprecate URL::getPermission method and networking permission classes for removal [v4] In-Reply-To: References: Message-ID: On Fri, 9 May 2025 16:42:31 GMT, Sean Mullan wrote: >> Daniel Fuchs 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 five additional commits since the last revision: >> >> - Merge branch 'master' into deprecate-net-perms-8353642 >> - Revert changes to SocketPermission and CodeSource >> - Review feedback. Deprecate getPermission for removal. >> - Missing white spaces >> - 8353642: Deprecate networking permission classes for removal > > src/java.base/share/classes/java/net/HttpURLConnection.java line 615: > >> 613: */ >> 614: @Deprecated(since = "25", forRemoval = true) >> 615: @SuppressWarnings("removal") > > Do you still need this annotation now that `SocketPermission` is not deprecated for removal? Ah - good point - I will double check. > src/java.base/share/classes/sun/net/www/protocol/file/FileURLConnection.java line 214: > >> 212: */ >> 213: @Override >> 214: @Deprecated(since = "25", forRemoval = true) > > Is this annotation required or more as a reminder that the superclass method is deprecated? I think it's needed because the superclass method is deprecated for removal. Will double check. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24592#discussion_r2082374190 PR Review Comment: https://git.openjdk.org/jdk/pull/24592#discussion_r2082374078 From prr at openjdk.org Fri May 9 19:24:53 2025 From: prr at openjdk.org (Phil Race) Date: Fri, 9 May 2025 19:24:53 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor In-Reply-To: <0AKC-4omm-W24u11ifhGm8Do8_5sqwPMJz6q3A71FNE=.f4209d38-51d6-4eda-b11e-d670e5ee5575@github.com> References: <0AKC-4omm-W24u11ifhGm8Do8_5sqwPMJz6q3A71FNE=.f4209d38-51d6-4eda-b11e-d670e5ee5575@github.com> Message-ID: On Fri, 9 May 2025 08:58:15 GMT, Leo Korinth wrote: > > test/jdk/java/awt/font/NumericShaper/MTTest.java > > ``` > > * * @run main/timeout=300/othervm MTTest > > > > > > * * @run main/timeout=1200/othervm MTTest > > ``` > > > > > > > > > > > > > > > > > > > > > > > > I'm puzzling over why you saw this test fail with timeout = 300 .. or perhaps you saw it fail with 0.7 ? Which would amount to 210 seconds .. that might just be enough to cause it to fail because if you look at the whole test you'll see it wants the core loops of the test to run for 180 seconds. > > https://openjdk.github.io/cr/?repo=jdk&pr=25122&range=00#new-144-test/jdk/java/awt/font/NumericShaper/MTTest.java > > So 300 was fine, and 1200 isn't needed. > > I started with a timeout factor less than `0.7` but I got hindered by CODETOOLS-7903937. That is probably the reason. Maybe I should change the timeout to 400? I think it is reasonable to handle a timeout factor somewhat less than 1 to weed out tight test cases. But maybe 300 is good enough? I think 300 is correct for this test. Setting the timeout factor to < 1 is an interesting experiment but I don't think tests that timeout in such a case are automatic candidates to have an increased time out and this one shows why. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25122#issuecomment-2867676176 From aturbanov at openjdk.org Fri May 9 20:41:11 2025 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Fri, 9 May 2025 20:41:11 GMT Subject: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v12] In-Reply-To: References: Message-ID: On Tue, 6 May 2025 20:52:34 GMT, Markus KARG wrote: >> This Pull Request proposes an implementation for [JDK-8343110](https://bugs.openjdk.org/browse/JDK-8343110): Adding the new method `public void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)` to the `CharSequence` interface, providing a **bulk-read** facility including a default implementation iterating over `charAt(int)`. >> >> In addition, this Pull Request proposes to replace the implementation of `Reader.of(CharSequence).read(char[] cbuf, int off, int len)` to invoke `CharSequence.getChars(next, next + n, cbuf, off)` instead of utilizing pattern matching for switch. Also, this PR proposes to implement `CharBuffer.getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)` as an alias for `CharBuffer.get(srcBegin, dst, dstBegin, srcEnd - srcBegin)`. >> >> To ensure quality... >> * ...the method signature and JavaDocs are adapted from `AbstractStringBuilder.getChars(...)`. >> * ...this PR relies upon the existing tests for `Reader.of(CharSequence)`, as these provide sufficient coverage of all changes introduced by this PR. > > Markus KARG has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 17 commits: > > - merge latest from master branch > - Applied proposal by Daniel: If there's no change to this file the copyright year update could be reverted? > - Applied workaround proposed by Joe: Using component @inheritDoc to enforce getChars section in JavaDocs > - Applied changes proposed by Joe and Jaikiran: Using @inheritDoc to get JavaDocs without @since. > - Applied changes proposed in response to Joe's CSR comments: 'understood for CharBuffer; I was thinking more of String, StringBuffer, and StringBuilder where there looks to be more textual similarities.' > - Applied changes requestes by Alan: Aligning unit test for CharBuffer.getChars() with unit test for CharBuffer.chars() > - Applied changes requested by Chen and Jaikiran: Unit tests for default implementation of CharSequence.getChars() and for CharBuffer.getChars() > - Applied changes requested by Chen: 'We might need to specify the IOOBE behavior - when an IOOBE is thrown, some characters may be already transferred (this is important for concurrent char sequences)' > - Applied changes requested by Alan: This sentence doesn't make sense, did something get deleted? > - Applied changes requested by Alan: Copies chars from this sequence into the given destination array > - ... and 7 more: https://git.openjdk.org/jdk/compare/b21b3a38...31537b7a src/java.base/share/classes/java/lang/CharSequence.java line 313: > 311: * at index {@code dstBegin} and ending at index: > 312: *

{@code
> 313:      * dstbegin + (srcEnd-srcBegin) - 1

Shouldn't it be dstBegin?

* dstBegin + (srcEnd-srcBegin) - 1

src/java.base/share/classes/java/lang/CharSequence.java line 329:

> 327:      *             {@code this.length()}.
> 328:      *             
  • {@code dstBegin+srcEnd-srcBegin} is greater than > 329: * {@code dst.length} I think we should have `.` at the end of each case. Now it's inconsistent ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21730#discussion_r2082456985 PR Review Comment: https://git.openjdk.org/jdk/pull/21730#discussion_r2082459665 From bpb at openjdk.org Fri May 9 22:32:50 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Fri, 9 May 2025 22:32:50 GMT Subject: RFR: 8356127: (fs) UnixFileSystemProvider.implDelete could save a syscall in some cases [v3] In-Reply-To: References: <__DpX8NhzRrLcm-Ev8Z7HovPQqJolMCEcWerlNYvyUg=.9e95dad9-640b-4ebb-9dae-977c216dc3ce@github.com> <_tmc-y1SKXOJbqGypPX5JNi6dzDvhrgv41VwpzxK_7A=.8c2dd1c1-aeb7-4771-a357-f093b84341ee@github.com> <8mOBk56Zaqo1KTinUbQm0QrLq-xL21mUjaf4O5AuSiE=.ef062a83-cd68-4137-9a72-c309fcf6f1bf@github.com> <_grJggFbxOgB93F8aKoWKNXJw_qyfIo5iqZXs37kLMY=.425b9fd3-b2f9-4701-82ba-7fada1b86e74@github.com> Message-ID: On Fri, 9 May 2025 17:01:09 GMT, Alan Bateman wrote: >>> It might be worth digging into how this works in NFS environments. >> >> I will try to assess this. > > I have a vague memory that NFSv4 had changes in this area to allow the REMOVE RPC handle any file type. Getting an up to date summary on that would be helpful as it may be that the change here will only work on local file systems. A safer approach would be to remove the capability check and not to rely on the value of `errno` at all. boolean isDirectory = false; try { try { // assume the common case that the file is a regular file unlink(file); } catch (UnixException e) { // check whether the file is a directory and, if so, // try rmdir, otherwise re-throw and let the exception // be handled below isDirectory = UnixFileAttributes.get(file, false).isDirectory(); if (isDirectory) { rmdir(file); } else { throw e; } } return true; } catch (UnixException x) { // .... handle the exception ... } Of course this would be at the expense of a `stat` if the `unlink` fails, but that would at least be avoided for the common case of deleting a regular file. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25107#discussion_r2082574592 From bpb at openjdk.org Fri May 9 22:49:27 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Fri, 9 May 2025 22:49:27 GMT Subject: RFR: 8351415: (fs) Path::toAbsolutePath should specify if an absolute path has a root component Message-ID: Add a sentence to the specification of `Path::toAbsolutePath` indicating that the root component of the absolute path derived from a `Path` associated with the default provider is non-`null`. ------------- Commit messages: - 8351415: (fs) Path::toAbsolutePath should specify if an absolute path has a root component Changes: https://git.openjdk.org/jdk/pull/25161/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25161&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8351415 Stats: 4 lines in 1 file changed: 2 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/25161.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25161/head:pull/25161 PR: https://git.openjdk.org/jdk/pull/25161 From bpb at openjdk.org Fri May 9 22:53:15 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Fri, 9 May 2025 22:53:15 GMT Subject: RFR: 8356606: PosixFileAttributes.permissions() implementations should return an EnumSet Message-ID: Drop-in replacement in `sun.nio.fs.UnixFileAttributes::permissions` of `HashSet` with `EnumSet` for hopefully improved efficiency. All tests containing `PosixFileAttributes` passed. ------------- Commit messages: - 8356606: PosixFileAttributes.permissions() implementations should return an EnumSet Changes: https://git.openjdk.org/jdk/pull/25162/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25162&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8356606 Stats: 3 lines in 1 file changed: 0 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/25162.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25162/head:pull/25162 PR: https://git.openjdk.org/jdk/pull/25162 From liach at openjdk.org Fri May 9 23:05:49 2025 From: liach at openjdk.org (Chen Liang) Date: Fri, 9 May 2025 23:05:49 GMT Subject: RFR: 8356606: (fs) PosixFileAttributes.permissions() implementations should return an EnumSet In-Reply-To: References: Message-ID: On Fri, 9 May 2025 22:48:11 GMT, Brian Burkhalter wrote: > Drop-in replacement in `sun.nio.fs.UnixFileAttributes::permissions` of `HashSet` with `EnumSet` for hopefully improved efficiency. All tests containing `PosixFileAttributes` passed. Makes sense. This rejects usages of adding null or invalid objects, but this still abides to the specs, that the returned set can be modified and passed to create new attributes. ------------- Marked as reviewed by liach (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/25162#pullrequestreview-2829850578 From alanb at openjdk.org Sat May 10 06:22:54 2025 From: alanb at openjdk.org (Alan Bateman) Date: Sat, 10 May 2025 06:22:54 GMT Subject: RFR: 8356606: (fs) PosixFileAttributes.permissions() implementations should return an EnumSet In-Reply-To: References: Message-ID: <7A00QvaDBh5e5xuvoysuQJCFPLgNW_7O7_55iOLREGU=.f99914f1-ff2f-4ce3-aa26-bec178fd9087@github.com> On Fri, 9 May 2025 22:48:11 GMT, Brian Burkhalter wrote: > Drop-in replacement in `sun.nio.fs.UnixFileAttributes::permissions` of `HashSet` with `EnumSet` for hopefully improved efficiency. All tests containing `PosixFileAttributes` passed. I assume reading POSIX file permissions is going to be dominated by stat/equivalent, it might be that the JBS issue was more of a suggestion from someone reading the code? In any case, it looks fine and I assume you'll run the jdk_nio tests. ------------- Marked as reviewed by alanb (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/25162#pullrequestreview-2830393769 From alanb at openjdk.org Sat May 10 08:07:51 2025 From: alanb at openjdk.org (Alan Bateman) Date: Sat, 10 May 2025 08:07:51 GMT Subject: RFR: 8356127: (fs) UnixFileSystemProvider.implDelete could save a syscall in some cases [v5] In-Reply-To: References: <__DpX8NhzRrLcm-Ev8Z7HovPQqJolMCEcWerlNYvyUg=.9e95dad9-640b-4ebb-9dae-977c216dc3ce@github.com> Message-ID: On Fri, 9 May 2025 16:56:09 GMT, Brian Burkhalter wrote: >> Modify `UnixFileSystemProvider.implDelete` to attempt first to delete the file using `unlink` and, if that fails, fall back to using `rmdir` if the file is a directory. > > Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: > > 8356127: Tweak previous commit I think we have to cautious and spend more time understanding the behavior of unlink with non-empty directories. I'm pretty sure that back in SunOS and UFS days that a non-empty directory could be unlinked, think cleanup when doing the next fsck. I understand that the proposal is do this on Linux only and it will work for local file systems. However, it is not clear to me that this is reliable with remote file systems. NFSv4 did make changes to support exactly what it is doing proposed but I worry there are other remote file systems where we might not get the ENOTEMPTY. Doing a statvfs to check the file system type would work but probably more expensive that the stat that we do now to check if the file is a directory. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25107#issuecomment-2868618444 From jpai at openjdk.org Mon May 12 01:20:07 2025 From: jpai at openjdk.org (Jaikiran Pai) Date: Mon, 12 May 2025 01:20:07 GMT Subject: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v12] In-Reply-To: References: Message-ID: On Fri, 9 May 2025 20:35:04 GMT, Andrey Turbanov wrote: >> Markus KARG has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 17 commits: >> >> - merge latest from master branch >> - Applied proposal by Daniel: If there's no change to this file the copyright year update could be reverted? >> - Applied workaround proposed by Joe: Using component @inheritDoc to enforce getChars section in JavaDocs >> - Applied changes proposed by Joe and Jaikiran: Using @inheritDoc to get JavaDocs without @since. >> - Applied changes proposed in response to Joe's CSR comments: 'understood for CharBuffer; I was thinking more of String, StringBuffer, and StringBuilder where there looks to be more textual similarities.' >> - Applied changes requestes by Alan: Aligning unit test for CharBuffer.getChars() with unit test for CharBuffer.chars() >> - Applied changes requested by Chen and Jaikiran: Unit tests for default implementation of CharSequence.getChars() and for CharBuffer.getChars() >> - Applied changes requested by Chen: 'We might need to specify the IOOBE behavior - when an IOOBE is thrown, some characters may be already transferred (this is important for concurrent char sequences)' >> - Applied changes requested by Alan: This sentence doesn't make sense, did something get deleted? >> - Applied changes requested by Alan: Copies chars from this sequence into the given destination array >> - ... and 7 more: https://git.openjdk.org/jdk/compare/b21b3a38...31537b7a > > src/java.base/share/classes/java/lang/CharSequence.java line 313: > >> 311: * at index {@code dstBegin} and ending at index: >> 312: *
    {@code
    >> 313:      * dstbegin + (srcEnd-srcBegin) - 1
    > 
    > Shouldn't it be dstBegin?
    > 
    > * dstBegin + (srcEnd-srcBegin) - 1
    
    Hello Andrey, what you note is right. This and the other change you have proposed to this text seems reasonable. Do you want to create a JBS issue and raise a PR proposing this change?
    
    -------------
    
    PR Review Comment: https://git.openjdk.org/jdk/pull/21730#discussion_r2083686557
    
    From alanb at openjdk.org  Mon May 12 07:35:52 2025
    From: alanb at openjdk.org (Alan Bateman)
    Date: Mon, 12 May 2025 07:35:52 GMT
    Subject: RFR: 8351415: (fs) Path::toAbsolutePath should specify if an
     absolute path has a root component
    In-Reply-To: 
    References: 
    Message-ID: 
    
    On Fri, 9 May 2025 22:44:04 GMT, Brian Burkhalter  wrote:
    
    > Add a sentence to the specification of `Path::toAbsolutePath` indicating that the root component of the absolute path derived from a `Path` associated with the default provider is non-`null`.
    
    I think it is okay.
    
    -------------
    
    Marked as reviewed by alanb (Reviewer).
    
    PR Review: https://git.openjdk.org/jdk/pull/25161#pullrequestreview-2832128143