wrote:
>> Adds `HttpResponse::connectionLabel` method that provides an identifier for the connection.
>>
>> **Implementation note:** The feature is facilitated by `HttpConnection::label`, which should not be confused with `HttpConnection::id`. This distinction is explained in the JavaDoc of both properties.
>
> Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision:
>
> Apply review suggestions
src/java.net.http/share/classes/jdk/internal/net/http/HttpConnection.java line 100:
> 98: * {@link PlainHttpConnection} it wraps will share the same label. As a
> 99: * result, compared to {@link #id}, this label does not give a total order
> 100: * among instances.
Suggestion:
/**
* A label to identify the connection.
*
* This label helps with associating multiple components participating in a
* connection. For instance, an {@link AsyncSSLConnection} and the
* {@link PlainHttpConnection} it wraps will share the same label.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24154#discussion_r2024608425
From dfuchs at openjdk.org Wed Apr 2 11:14:59 2025
From: dfuchs at openjdk.org (Daniel Fuchs)
Date: Wed, 2 Apr 2025 11:14:59 GMT
Subject: RFR: 8350279: HttpClient: Add a new HttpResponse method to
identify connections [v4]
In-Reply-To:
References:
Message-ID:
On Wed, 2 Apr 2025 11:01:22 GMT, Jaikiran Pai wrote:
>> It was already a puzzler for me to figure out `id` cannot be used for `label`, and `label` cannot be used for `id` either. Both are due to the fact that `label` can be shared across instances, whereas `id` cannot. In short, I've found it very helpful to thoroughly document their these fields' properties and what they serve for. Unless you have a strong objection, I'd like to keep the current form of documentation.
>
> Hello Volkan, I think having the mention of ordering on the `id` field is OK. I still find it confusing to have this sentence on the `label`:
>
>>
>> As a result, compared to {@link #id}, this label does not give a total order among instances.
>
> To me, this feels odd because `label` being a `String` typically wouldn't have been considered to be playing a role in ordering. Plus, in isolation, it's not clear what ordering this talks about (Daniel did explain to me that the `id` field is used in ordering of open connections. I haven't yet looked deeper at that code to see where that happens).
>
> In any case, this is an internal class so if we do decide to use the current proposed text, that's OK with me.
I agree with Jaikiran: I would just remove the last sentence in this pargraph.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24154#discussion_r2024607986
From jpai at openjdk.org Wed Apr 2 11:15:01 2025
From: jpai at openjdk.org (Jaikiran Pai)
Date: Wed, 2 Apr 2025 11:15:01 GMT
Subject: RFR: 8350279: HttpClient: Add a new HttpResponse method to
identify connections [v5]
In-Reply-To:
References:
Message-ID:
On Tue, 1 Apr 2025 19:11:02 GMT, Volkan Yazici wrote:
>> Adds `HttpResponse::connectionLabel` method that provides an identifier for the connection.
>>
>> **Implementation note:** The feature is facilitated by `HttpConnection::label`, which should not be confused with `HttpConnection::id`. This distinction is explained in the JavaDoc of both properties.
>
> Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision:
>
> Apply review suggestions
test/jdk/java/net/httpclient/HttpResponseConnectionLabelTest.java line 68:
> 66: import static org.junit.jupiter.api.Assertions.assertTrue;
> 67:
> 68: @SuppressWarnings("OptionalGetWithoutIsPresent")
I haven't seen this `OptionalGetWithoutIsPresent` warning before and looking into the JDK repo I don't see it being used or recognized any place else. Is this meant for some specific IDEs?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24154#discussion_r2024611186
From jpai at openjdk.org Wed Apr 2 11:27:52 2025
From: jpai at openjdk.org (Jaikiran Pai)
Date: Wed, 2 Apr 2025 11:27:52 GMT
Subject: RFR: 8350279: HttpClient: Add a new HttpResponse method to
identify connections [v5]
In-Reply-To:
References:
Message-ID: <_aQVk4asCWzFDV_1H3-ZINSwT3NCWeZ0QoWQ7wGb838=.317526d9-369f-48f2-8186-93328c5bf8fe@github.com>
On Tue, 1 Apr 2025 19:11:02 GMT, Volkan Yazici wrote:
>> Adds `HttpResponse::connectionLabel` method that provides an identifier for the connection.
>>
>> **Implementation note:** The feature is facilitated by `HttpConnection::label`, which should not be confused with `HttpConnection::id`. This distinction is explained in the JavaDoc of both properties.
>
> Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision:
>
> Apply review suggestions
test/jdk/java/net/httpclient/HttpResponseConnectionLabelTest.java line 83:
> 81:
> 82: // Start with a fresh client having no connections in the pool
> 83: @AutoClose
I hadn't come across this JUnit Jupiter annotation before. Reading through https://junit.org/junit5/docs/current/user-guide/#writing-tests-built-in-extensions-AutoClose it appears to be a convenience mechanism for managing closing of the resources at the "right time". That doc states:
> Specifically, if the test class is configured with @TestInstance(Lifecycle.PER_METHOD) semantics, a non-static @AutoClose field will be closed after the execution of each test method, test factory method, or test template method. However, if the test class is configured with @TestInstance(Lifecycle.PER_CLASS) semantics, a non-static @AutoClose field will not be closed until the current test class instance is no longer needed
Do you know what test class lifecycle is configured for test classes like this one when launched through jtreg?
Typically, we just use very basic JUnit constructs in the tests in the JDK repo to make it simpler to follow these tests, even if it means a bit more verbose code like having a method annotated with `@BeforeEach`/`@AfterEach` to do construction/clean up like this.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24154#discussion_r2024629463
From jpai at openjdk.org Wed Apr 2 11:49:55 2025
From: jpai at openjdk.org (Jaikiran Pai)
Date: Wed, 2 Apr 2025 11:49:55 GMT
Subject: RFR: 8350279: HttpClient: Add a new HttpResponse method to
identify connections [v5]
In-Reply-To:
References:
Message-ID: <5ZtXn7Jo_a3Ru0StgJuR0NabpUNH-bcPeD-D5qWTHtY=.a0535a6e-b761-4f2e-ad68-62701ec69fa2@github.com>
On Tue, 1 Apr 2025 19:11:02 GMT, Volkan Yazici wrote:
>> Adds `HttpResponse::connectionLabel` method that provides an identifier for the connection.
>>
>> **Implementation note:** The feature is facilitated by `HttpConnection::label`, which should not be confused with `HttpConnection::id`. This distinction is explained in the JavaDoc of both properties.
>
> Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision:
>
> Apply review suggestions
test/jdk/java/net/httpclient/HttpResponseConnectionLabelTest.java line 156:
> 154: "Server[%s] is waiting for the latch... (connectionKey=%s, responseBody=%s)",
> 155: serverId, connectionKey, responseBody);
> 156: assertTrue(serverResponseLatchRef[0].await(2, TimeUnit.SECONDS));
We should avoid using any kind of timeouts here and in other places where we call this `await(...)` in this test. Given how varied the test execution environments are and our past experience with such timeouts, there's no right timeout to choose from. Instead, we should just do a `await()` without the timeout, so that if for whatever reason the latch isn't counted down, then the jtreg test execution timeout (which is controlled and configured externally to the test) will kick in and jtreg will do the necessary work of failing the test and also gathering detailed diagnostics through any failure handlers that are configured in that test execution environment.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24154#discussion_r2024659607
From alan.bateman at oracle.com Wed Apr 2 12:20:28 2025
From: alan.bateman at oracle.com (Alan Bateman)
Date: Wed, 2 Apr 2025 13:20:28 +0100
Subject: RFD: Query param discrepancy in unix/windows file
Handler:openConnection
In-Reply-To:
References:
Message-ID: <4ae7066b-31a1-4a11-b1cf-37cf025350f5@oracle.com>
On 01/04/2025 20:09, Eirik Bj?rsn?s wrote:
> :
>
> Looking at the Windows implementation of
> sun.net.protocol.www.file.Handler, it indeed uses URL::getFile when
> constructing the file path, while the unix implementation uses
> URL::getPath.
>
As a general point, neither method is correct when converting from a
file URL to a file path. Much of the code here goes back to JDK 1.2 so
we have to be careful with any changes.
-Alan
From rriggs at openjdk.org Wed Apr 2 15:24:54 2025
From: rriggs at openjdk.org (Roger Riggs)
Date: Wed, 2 Apr 2025 15:24:54 GMT
Subject: RFR: 8353453: URLDecoder should use HexFormat
In-Reply-To: <3rUvTcaueXMF405h6x1PGklsHrtFw1-w6bxGFYk-hFI=.70207421-1812-4379-b429-361e044f4c64@github.com>
References:
<8ceX3GH_4y6Sscj3FThghTPymDVvzraLGQPd_xk-lp4=.7647fa31-8fe8-479c-8f10-9afa2ad37f62@github.com>
<3rUvTcaueXMF405h6x1PGklsHrtFw1-w6bxGFYk-hFI=.70207421-1812-4379-b429-361e044f4c64@github.com>
Message-ID:
On Wed, 2 Apr 2025 10:03:17 GMT, Daniel Fuchs wrote:
>> They are both NumberFormatException that is immediately handled by an enclosing catch block. This change should only affect the exception message for inputs fragments like %-F.
>
> Right. And `NumberFormatException` is a subclass of `IllegalArgumentException` so that would remain compatible even if it were not caught and replaced by plain IAE.
I pointed it out to emphasize that exceptions and exception messages should be considered and reviewed when making a change.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24314#discussion_r2025073332
From eirbjo at gmail.com Wed Apr 2 20:01:09 2025
From: eirbjo at gmail.com (=?UTF-8?B?RWlyaWsgQmrDuHJzbsO4cw==?=)
Date: Wed, 2 Apr 2025 22:01:09 +0200
Subject: RFD: Query param discrepancy in unix/windows file
Handler:openConnection
In-Reply-To: <4ae7066b-31a1-4a11-b1cf-37cf025350f5@oracle.com>
References:
<4ae7066b-31a1-4a11-b1cf-37cf025350f5@oracle.com>
Message-ID:
On Wed, Apr 2, 2025 at 2:20?PM Alan Bateman wrote:
As a general point, neither method is correct when converting from a
> file URL to a file path. Much of the code here goes back to JDK 1.2 so
> we have to be careful with any changes.
>
Thanks Alan & Daniel.
Yes, I agree that the value of "fixing" this issue seems low.
The context for looking into this was that this is one of two things that
is behaviorally different between the Handler implementations, all other
differences are strictly code style and formatting noise.
Before implementing JDK-8353440 to disable FTP fallback by default I might
want to look into refactoring the handlers such that they are syntactically
similar and that the actual platform specific differences are easier to
spot and document. Currently, it's a bit of a head-twister to figure out
how exactly they differ in behavior vs syntax.
Thanks,
Eirik.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From duke at openjdk.org Wed Apr 2 22:58:48 2025
From: duke at openjdk.org (Patrick Strawderman)
Date: Wed, 2 Apr 2025 22:58:48 GMT
Subject: RFR: 8353453: URLDecoder should use HexFormat
In-Reply-To: <6iw-4ZtRyZk_pvlMk8rUnb1epsRZU5fw4kFGxpmyIY8=.fc212512-cc7e-4b51-b927-6573849e3682@github.com>
References:
<6iw-4ZtRyZk_pvlMk8rUnb1epsRZU5fw4kFGxpmyIY8=.fc212512-cc7e-4b51-b927-6573849e3682@github.com>
Message-ID:
On Tue, 1 Apr 2025 17:25:00 GMT, Daniel Fuchs wrote:
> Interesting. Please run tier2 tests.
I've run the tier 2 tests locally and they pass.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/24314#issuecomment-2773910295
From dfuchs at openjdk.org Thu Apr 3 10:14:58 2025
From: dfuchs at openjdk.org (Daniel Fuchs)
Date: Thu, 3 Apr 2025 10:14:58 GMT
Subject: RFR: 8353278: Consolidate local file URL checks in jar: and file:
URL schemes
In-Reply-To:
References:
Message-ID: <__TC9Mcsm5nlLW2FZQB8_vjn6LfDR1jB1mK8SODSGQ8=.384f0d9d-acbc-40cc-a329-62b7464505df@github.com>
On Mon, 31 Mar 2025 14:46:32 GMT, Eirik Bj?rsn?s wrote:
> Please help review this cleanup PR which consolidates 'local file' URL checks across the 'file:' and 'jar:' URL scheme implementations and defines this check in terms of RFC 8089, Section 2.
>
> This PR:
>
> * Moves `URLJarFile.isFileURL` to `sun.net.www.ParseUtil` where it is documented according to RFC 8089 and given the more suitable name `isLocalFileURL`
> * Updates `isLocalFileURL` to simplify an `if (x) return true;` statement to `return x;`
> * Updates `URLJarFile.getJarFile` and `JarFileFactory.getOrCreate` to use `isLocalFileURL`
> * Updates `JarFileFactory.urlFor` to use `isLocalFileURL` (while maintaining and documenting the historical and subtly different non-treatment of '~' as an alias for 'localhost')
> * Updates `sun.net.www.protocol.file.Handler.openConnection` to use `isLocalFileURL` in windows/unix implementations
>
> This is a pure cleanup / refactoring PR, no tests are updated here. Existing testing in this area seems sparse, so I have tried to limit the number of code tweaks to a minimium to make reviews easier.
>
> Testing: GHA runs green, as well as tier2 on MacOS.
My tests came back green - but it wouldn't hurt to have another reviewer/committer eyeball these changes before integrating. As far as I could tell - the code with the new changes is strictly equivalent to the old.
-------------
Marked as reviewed by dfuchs (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/24332#pullrequestreview-2739261233
From eirbjo at openjdk.org Thu Apr 3 10:49:53 2025
From: eirbjo at openjdk.org (Eirik =?UTF-8?B?QmrDuHJzbsO4cw==?=)
Date: Thu, 3 Apr 2025 10:49:53 GMT
Subject: RFR: 8353278: Consolidate local file URL checks in jar: and file:
URL schemes
In-Reply-To: <__TC9Mcsm5nlLW2FZQB8_vjn6LfDR1jB1mK8SODSGQ8=.384f0d9d-acbc-40cc-a329-62b7464505df@github.com>
References:
<__TC9Mcsm5nlLW2FZQB8_vjn6LfDR1jB1mK8SODSGQ8=.384f0d9d-acbc-40cc-a329-62b7464505df@github.com>
Message-ID:
On Thu, 3 Apr 2025 10:12:44 GMT, Daniel Fuchs wrote:
> My tests came back green - but it wouldn't hurt to have another reviewer/committer eyeball these changes before integrating. As far as I could tell - the code with the new changes is strictly equivalent to the old.
Thanks Daniel!
I've tried performing changes rather mechanically and step-by-step, leaning on safe IDE refactorings where possible. But yes, would be great with a second pair of eyes! (@jaikiran is known to have great eyes!)
The two parts which may need focus is:
* To verify that `ParseUtil::isLocalFileURL` is indeeed equivalient to the old/removed `URLJarFile::isFileURL`.
* That the logic in `JarFileFactory::urlFor` survived the accomodations to use `ParseUtil::isLocalFileURL` (flipping (!=) to !(||), etc)
The remaining changes are of a more trivial kind.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/24332#issuecomment-2775312586
From abarashev at openjdk.org Thu Apr 3 20:33:55 2025
From: abarashev at openjdk.org (Artur Barashev)
Date: Thu, 3 Apr 2025 20:33:55 GMT
Subject: RFR: 8325766: Review seclibs tests for cert expiry [v3]
In-Reply-To:
References: <4HflFT8pQ4MtxxF0QmyeIzPV8u3rBMdCGJaPx8UN5Dc=.20f68ae8-349a-4c1e-ba38-c27b3b1bbfee@github.com>
Message-ID:
On Tue, 18 Mar 2025 14:58:51 GMT, Matthew Donovan wrote:
>> This PR updates the CertificateBuilder with a new method that creates a new instance with common fields (subject name, public key, serial number, validity, and key uses) filled-in. One test, IPIdentities.java, is updated to show how the method can be used to create various certificates. I attached screenshots that compare the old hard-coded certificates (left) with the new generated certificates.
>>
>> 
>> 
>> 
>
> Matthew Donovan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains seven commits:
>
> - reversed order of DN strings when making certificates.
> - Merge branch 'master' into certbuilder
> - Merge branch 'master' into certbuilder
> - Merge branch 'master' into certbuilder
> - Merge branch 'master' into certbuilder
> - changed boolean array initialization
> - 8325766: Review seclibs tests for cert expiry
test/jdk/sun/net/www/protocol/https/HttpsURLConnection/IPIdentities.java line 243:
> 241: .addBasicConstraintsExt(false, false, -1)
> 242: .addExtension(CertificateBuilder.createIPSubjectAltNameExt(true, "127.0.0.1"))
> 243: .build(trustedCert, caKeys.getPrivate(), "MD5WithRSA");
MD5 algorithm is not allowed in TLSv1.3
test/jdk/sun/net/www/protocol/https/HttpsURLConnection/IPIdentities.java line 255:
> 253: .addExtension(CertificateBuilder.createIPSubjectAltNameExt(true, "127.0.0.1"))
> 254: .addBasicConstraintsExt(false, false, -1)
> 255: .build(trustedCert, caKeys.getPrivate(), "MD5WithRSA");
Same as above: MD5 algorithm is not allowed in TLSv1.3 certificates
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23700#discussion_r2027699283
PR Review Comment: https://git.openjdk.org/jdk/pull/23700#discussion_r2027699952
From eirbjo at openjdk.org Fri Apr 4 04:51:12 2025
From: eirbjo at openjdk.org (Eirik =?UTF-8?B?QmrDuHJzbsO4cw==?=)
Date: Fri, 4 Apr 2025 04:51:12 GMT
Subject: RFR: 8353662: Add test for non-local file URL fallback to FTP
Message-ID:
Please review this test-only PR which introduces testing of the unspecified but long-standing fallback to FTP for non-local files in the 'file' URL scheme.
This in preparation for the upcoming proposal to disable the feature by default in JDK-8353440.
Since we cannot reliably bind an FTP server to port 21, the test instead uses an HTTP proxy, binding to an ephemeral port. This menas we don't test non-proxy code paths. We still test that the FTP fallback is used, which is the key point here. (We aim to test file URL connections, not FTP URL connection internals)
An alternative here could be to just verify that the returned URLConnection is an instance of FtpURLConnection. However, I opted for an end-to-end test here, since the amount of extra code seems reasonable.
By temporarly moving this test to tier1, I was able to confirm this test runs green also on Windows GHA.
-------------
Commit messages:
- Add a test verifying non-local file: URL fallback to FTP
Changes: https://git.openjdk.org/jdk/pull/24418/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24418&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8353662
Stats: 141 lines in 1 file changed: 141 ins; 0 del; 0 mod
Patch: https://git.openjdk.org/jdk/pull/24418.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/24418/head:pull/24418
PR: https://git.openjdk.org/jdk/pull/24418
From duke at openjdk.org Fri Apr 4 06:27:24 2025
From: duke at openjdk.org (Tabata Daishi)
Date: Fri, 4 Apr 2025 06:27:24 GMT
Subject: RFR: 8353698: Output of Simple Web Server is garbled if the console's
encoding is not UTF-8
Message-ID:
The output?`jwebserver` and `java -m jdk.httpserver` uses UTF-8 encoding. Therefore, if the console encoding is not set to UTF-8 (for example, MS932 on Japanese Windows), garbled characters may appear.?
Since System.out?knows the console's encoding, there's no need to specify it again with?PrintWriter constructor.
The output?`jwebserver` and `java -m jdk.httpserver` is localized in Japanese, German, and Chinese. This bug only occurs in these localized languages, so I haven't added any tests.
I have confirmed that the output of the two commands is not garbled in the default command prompts of both Japanese Windows and English Windows.
I tested jdk/com/sun/net/httpserver/simpleserver on English Windows, and all tests passed. However, when running on Japanese Windows, some tests failed because they expected output only in English.
I modified the tests so that `jwebserver` and?`java -m jdk.httpserver`?within the tests are executed with an English locale. After this modification, all tests passed on Japanese Windows.
-------------
Commit messages:
- Update copyright
- Fix garbled characters in simple web server
Changes: https://git.openjdk.org/jdk/pull/24437/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24437&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8353698
Stats: 65 lines in 10 files changed: 9 ins; 3 del; 53 mod
Patch: https://git.openjdk.org/jdk/pull/24437.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/24437/head:pull/24437
PR: https://git.openjdk.org/jdk/pull/24437
From duke at openjdk.org Fri Apr 4 06:47:02 2025
From: duke at openjdk.org (Tabata Daishi)
Date: Fri, 4 Apr 2025 06:47:02 GMT
Subject: RFR: 8353698: Output of Simple Web Server is garbled if the
console's encoding is not UTF-8 [v2]
In-Reply-To:
References:
Message-ID:
> The output?`jwebserver` and `java -m jdk.httpserver` uses UTF-8 encoding. Therefore, if the console encoding is not set to UTF-8 (for example, MS932 on Japanese Windows), garbled characters may appear.?
> Since System.out?knows the console's encoding, there's no need to specify it again with?PrintWriter constructor.
>
> The output?`jwebserver` and `java -m jdk.httpserver` is localized in Japanese, German, and Chinese. This bug only occurs in these localized languages, so I haven't added any tests.
> I have confirmed that the output of the two commands is not garbled in the default command prompts of both Japanese Windows and English Windows.
>
> I tested jdk/com/sun/net/httpserver/simpleserver on English Windows, and all tests passed. However, when running on Japanese Windows, some tests failed because they expected output only in English.
> I modified the tests so that `jwebserver` and?`java -m jdk.httpserver`?within the tests are executed with an English locale. After this modification, all tests passed on Japanese Windows.
Tabata Daishi has updated the pull request incrementally with one additional commit since the last revision:
run jcheck
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/24437/files
- new: https://git.openjdk.org/jdk/pull/24437/files/7e149b6f..427cbe4b
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=24437&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=24437&range=00-01
Stats: 0 lines in 0 files changed: 0 ins; 0 del; 0 mod
Patch: https://git.openjdk.org/jdk/pull/24437.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/24437/head:pull/24437
PR: https://git.openjdk.org/jdk/pull/24437
From djelinski at openjdk.org Fri Apr 4 08:01:48 2025
From: djelinski at openjdk.org (Daniel =?UTF-8?B?SmVsacWEc2tp?=)
Date: Fri, 4 Apr 2025 08:01:48 GMT
Subject: RFR: 8353698: Output of Simple Web Server is garbled if the
console's encoding is not UTF-8 [v2]
In-Reply-To:
References:
Message-ID:
On Fri, 4 Apr 2025 06:47:02 GMT, Tabata Daishi wrote:
>> The output?`jwebserver` and `java -m jdk.httpserver` uses UTF-8 encoding. Therefore, if the console encoding is not set to UTF-8 (for example, MS932 on Japanese Windows), garbled characters may appear.?
>> Since System.out?knows the console's encoding, there's no need to specify it again with?PrintWriter constructor.
>>
>> The output?`jwebserver` and `java -m jdk.httpserver` is localized in Japanese, German, and Chinese. This bug only occurs in these localized languages, so I haven't added any tests.
>> I have confirmed that the output of the two commands is not garbled in the default command prompts of both Japanese Windows and English Windows.
>>
>> I tested jdk/com/sun/net/httpserver/simpleserver on English Windows, and all tests passed. However, when running on Japanese Windows, some tests failed because they expected output only in English.
>> I modified the tests so that `jwebserver` and?`java -m jdk.httpserver`?within the tests are executed with an English locale. After this modification, all tests passed on Japanese Windows.
>
> Tabata Daishi has updated the pull request incrementally with one additional commit since the last revision:
>
> run jcheck
LGTM. Thank you for addressing the issues!
-------------
Marked as reviewed by djelinski (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/24437#pullrequestreview-2742149689
From duke at openjdk.org Fri Apr 4 09:13:30 2025
From: duke at openjdk.org (Daishi Tabata)
Date: Fri, 4 Apr 2025 09:13:30 GMT
Subject: RFR: 8353698: Output of Simple Web Server is garbled if the
console's encoding is not UTF-8 [v3]
In-Reply-To:
References:
Message-ID:
> The output?`jwebserver` and `java -m jdk.httpserver` uses UTF-8 encoding. Therefore, if the console encoding is not set to UTF-8 (for example, MS932 on Japanese Windows), garbled characters may appear.?
> Since System.out?knows the console's encoding, there's no need to specify it again with?PrintWriter constructor.
>
> The output?`jwebserver` and `java -m jdk.httpserver` is localized in Japanese, German, and Chinese. This bug only occurs in these localized languages, so I haven't added any tests.
> I have confirmed that the output of the two commands is not garbled in the default command prompts of both Japanese Windows and English Windows.
>
> I tested jdk/com/sun/net/httpserver/simpleserver on English Windows, and all tests passed. However, when running on Japanese Windows, some tests failed because they expected output only in English.
> I modified the tests so that `jwebserver` and?`java -m jdk.httpserver`?within the tests are executed with an English locale. After this modification, all tests passed on Japanese Windows.
Daishi Tabata has updated the pull request incrementally with one additional commit since the last revision:
Update full name
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/24437/files
- new: https://git.openjdk.org/jdk/pull/24437/files/427cbe4b..0bc8e196
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=24437&range=02
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=24437&range=01-02
Stats: 0 lines in 0 files changed: 0 ins; 0 del; 0 mod
Patch: https://git.openjdk.org/jdk/pull/24437.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/24437/head:pull/24437
PR: https://git.openjdk.org/jdk/pull/24437
From eirbjo at openjdk.org Fri Apr 4 10:28:57 2025
From: eirbjo at openjdk.org (Eirik =?UTF-8?B?QmrDuHJzbsO4cw==?=)
Date: Fri, 4 Apr 2025 10:28:57 GMT
Subject: RFR: 8353662: Add test for non-local file URL fallback to FTP [v2]
In-Reply-To:
References:
Message-ID:
> Please review this test-only PR which introduces testing of the unspecified but long-standing fallback to FTP for non-local files in the 'file' URL scheme.
>
> This in preparation for the upcoming proposal to disable the feature by default in JDK-8353440.
>
> Since we cannot reliably bind an FTP server to port 21, the test instead uses an HTTP proxy, binding to an ephemeral port. This menas we don't test non-proxy code paths. We still test that the FTP fallback is used, which is the key point here. (We aim to test file URL connections, not FTP URL connection internals)
>
> An alternative here could be to just verify that the returned URLConnection is an instance of FtpURLConnection. However, I opted for an end-to-end test here, since the amount of extra code seems reasonable.
>
> By temporarly moving this test to tier1, I was able to confirm this test runs green also on Windows GHA.
Eirik Bj?rsn?s has updated the pull request incrementally with one additional commit since the last revision:
Do not assume that the loopback address is IPv4
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/24418/files
- new: https://git.openjdk.org/jdk/pull/24418/files/f235d79f..18b449de
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=24418&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=24418&range=00-01
Stats: 5 lines in 1 file changed: 4 ins; 0 del; 1 mod
Patch: https://git.openjdk.org/jdk/pull/24418.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/24418/head:pull/24418
PR: https://git.openjdk.org/jdk/pull/24418
From eirbjo at openjdk.org Fri Apr 4 10:28:59 2025
From: eirbjo at openjdk.org (Eirik =?UTF-8?B?QmrDuHJzbsO4cw==?=)
Date: Fri, 4 Apr 2025 10:28:59 GMT
Subject: RFR: 8353662: Add test for non-local file URL fallback to FTP [v2]
In-Reply-To:
References:
Message-ID:
On Fri, 4 Apr 2025 10:19:29 GMT, Daniel Fuchs wrote:
> The URL should not assume that the loopback is an IPv4 address. Or is this handled by the proxy?
Right. The following returns "127.0.0.1" for me, would that be the correct API to use?
`InetAddress.getLoopbackAddress().getHostAddress()`
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24418#discussion_r2028548480
From dfuchs at openjdk.org Fri Apr 4 10:28:59 2025
From: dfuchs at openjdk.org (Daniel Fuchs)
Date: Fri, 4 Apr 2025 10:28:59 GMT
Subject: RFR: 8353662: Add test for non-local file URL fallback to FTP [v2]
In-Reply-To:
References:
Message-ID:
On Fri, 4 Apr 2025 10:24:25 GMT, Eirik Bj?rsn?s wrote:
>> test/jdk/sun/net/www/protocol/file/NonLocalFtpFallback.java line 122:
>>
>>> 120: public void verifyNonLocalFtpFallback() throws Exception {
>>> 121: URL localURL = file.toUri().toURL();
>>> 122: URL nonLocalURL = new URL("file", "127.0.0.1", localURL.getFile());
>>
>> The URL should not assume that the loopback is an IPv4 address. Or is this handled by the proxy?
>
>> The URL should not assume that the loopback is an IPv4 address. Or is this handled by the proxy?
>
> Right. The following returns "127.0.0.1" for me, would that be the correct API to use?
>
> `InetAddress.getLoopbackAddress().getHostAddress()`
Ok - I see that 127.0.0.1 should not be directly used. Would it work if we replaced that with a fake host name then?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24418#discussion_r2028549245
From eirbjo at openjdk.org Fri Apr 4 10:33:48 2025
From: eirbjo at openjdk.org (Eirik =?UTF-8?B?QmrDuHJzbsO4cw==?=)
Date: Fri, 4 Apr 2025 10:33:48 GMT
Subject: RFR: 8353662: Add test for non-local file URL fallback to FTP [v2]
In-Reply-To:
References:
Message-ID:
On Fri, 4 Apr 2025 10:25:01 GMT, Daniel Fuchs wrote:
> Ok - I see that 127.0.0.1 should not be directly used. Would it work if we replaced that with a fake host name then?
Yeah, you're right, the FTP request never materializes (our proxy just swallows it). So we only use it to assert against what was requested from the proxy, we can use a fake host name.
Any preference/precedence for fake host names?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24418#discussion_r2028557214
From dfuchs at openjdk.org Fri Apr 4 10:28:58 2025
From: dfuchs at openjdk.org (Daniel Fuchs)
Date: Fri, 4 Apr 2025 10:28:58 GMT
Subject: RFR: 8353662: Add test for non-local file URL fallback to FTP [v2]
In-Reply-To:
References:
Message-ID:
On Fri, 4 Apr 2025 10:25:35 GMT, Eirik Bj?rsn?s wrote:
>> Please review this test-only PR which introduces testing of the unspecified but long-standing fallback to FTP for non-local files in the 'file' URL scheme.
>>
>> This in preparation for the upcoming proposal to disable the feature by default in JDK-8353440.
>>
>> Since we cannot reliably bind an FTP server to port 21, the test instead uses an HTTP proxy, binding to an ephemeral port. This menas we don't test non-proxy code paths. We still test that the FTP fallback is used, which is the key point here. (We aim to test file URL connections, not FTP URL connection internals)
>>
>> An alternative here could be to just verify that the returned URLConnection is an instance of FtpURLConnection. However, I opted for an end-to-end test here, since the amount of extra code seems reasonable.
>>
>> By temporarly moving this test to tier1, I was able to confirm this test runs green also on Windows GHA.
>
> Eirik Bj?rsn?s has updated the pull request incrementally with one additional commit since the last revision:
>
> Do not assume that the loopback address is IPv4
test/jdk/sun/net/www/protocol/file/NonLocalFtpFallback.java line 122:
> 120: public void verifyNonLocalFtpFallback() throws Exception {
> 121: URL localURL = file.toUri().toURL();
> 122: URL nonLocalURL = new URL("file", "127.0.0.1", localURL.getFile());
The URL should not assume that the loopback is an IPv4 address. Or is this handled by the proxy?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24418#discussion_r2028542481
From eirbjo at openjdk.org Fri Apr 4 10:37:58 2025
From: eirbjo at openjdk.org (Eirik =?UTF-8?B?QmrDuHJzbsO4cw==?=)
Date: Fri, 4 Apr 2025 10:37:58 GMT
Subject: RFR: 8353662: Add test for non-local file URL fallback to FTP [v3]
In-Reply-To:
References:
Message-ID: <6-DH9HLfhkXR0RazrHG_p668w9lsykybwNh_KrxELt8=.eab8b548-9025-4e4a-85bf-4590b50bd34d@github.com>
> Please review this test-only PR which introduces testing of the unspecified but long-standing fallback to FTP for non-local files in the 'file' URL scheme.
>
> This in preparation for the upcoming proposal to disable the feature by default in JDK-8353440.
>
> Since we cannot reliably bind an FTP server to port 21, the test instead uses an HTTP proxy, binding to an ephemeral port. This menas we don't test non-proxy code paths. We still test that the FTP fallback is used, which is the key point here. (We aim to test file URL connections, not FTP URL connection internals)
>
> An alternative here could be to just verify that the returned URLConnection is an instance of FtpURLConnection. However, I opted for an end-to-end test here, since the amount of extra code seems reasonable.
>
> By temporarly moving this test to tier1, I was able to confirm this test runs green also on Windows GHA.
Eirik Bj?rsn?s has updated the pull request incrementally with one additional commit since the last revision:
Use a fake host name since no actual FTP request will be attempted
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/24418/files
- new: https://git.openjdk.org/jdk/pull/24418/files/18b449de..049bb5fb
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=24418&range=02
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=24418&range=01-02
Stats: 4 lines in 1 file changed: 0 ins; 0 del; 4 mod
Patch: https://git.openjdk.org/jdk/pull/24418.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/24418/head:pull/24418
PR: https://git.openjdk.org/jdk/pull/24418
From dfuchs at openjdk.org Fri Apr 4 10:39:58 2025
From: dfuchs at openjdk.org (Daniel Fuchs)
Date: Fri, 4 Apr 2025 10:39:58 GMT
Subject: RFR: 8353698: Output of Simple Web Server is garbled if the
console's encoding is not UTF-8 [v3]
In-Reply-To:
References:
Message-ID:
On Fri, 4 Apr 2025 09:13:30 GMT, Daishi Tabata wrote:
>> The output?`jwebserver` and `java -m jdk.httpserver` uses UTF-8 encoding. Therefore, if the console encoding is not set to UTF-8 (for example, MS932 on Japanese Windows), garbled characters may appear.?
>> Since System.out?knows the console's encoding, there's no need to specify it again with?PrintWriter constructor.
>>
>> The output?`jwebserver` and `java -m jdk.httpserver` is localized in Japanese, German, and Chinese. This bug only occurs in these localized languages, so I haven't added any tests.
>> I have confirmed that the output of the two commands is not garbled in the default command prompts of both Japanese Windows and English Windows.
>>
>> I tested jdk/com/sun/net/httpserver/simpleserver on English Windows, and all tests passed. However, when running on Japanese Windows, some tests failed because they expected output only in English.
>> I modified the tests so that `jwebserver` and?`java -m jdk.httpserver`?within the tests are executed with an English locale. After this modification, all tests passed on Japanese Windows.
>
> Daishi Tabata has updated the pull request incrementally with one additional commit since the last revision:
>
> Update full name
Hi, it's not completely clear to me why `static final String LOCALE_OPT = "-Duser.language=en -Duser.country=US";` has now to be passed to every test that checks command line options. Is that a separate unrelated test fix?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/24437#issuecomment-2778274565
From eirbjo at openjdk.org Fri Apr 4 10:42:54 2025
From: eirbjo at openjdk.org (Eirik =?UTF-8?B?QmrDuHJzbsO4cw==?=)
Date: Fri, 4 Apr 2025 10:42:54 GMT
Subject: RFR: 8353662: Add test for non-local file URL fallback to FTP [v3]
In-Reply-To: <6-DH9HLfhkXR0RazrHG_p668w9lsykybwNh_KrxELt8=.eab8b548-9025-4e4a-85bf-4590b50bd34d@github.com>
References:
<6-DH9HLfhkXR0RazrHG_p668w9lsykybwNh_KrxELt8=.eab8b548-9025-4e4a-85bf-4590b50bd34d@github.com>
Message-ID:
On Fri, 4 Apr 2025 10:37:58 GMT, Eirik Bj?rsn?s wrote:
>> Please review this test-only PR which introduces testing of the unspecified but long-standing fallback to FTP for non-local files in the 'file' URL scheme.
>>
>> This in preparation for the upcoming proposal to disable the feature by default in JDK-8353440.
>>
>> Since we cannot reliably bind an FTP server to port 21, the test instead uses an HTTP proxy, binding to an ephemeral port. This menas we don't test non-proxy code paths. We still test that the FTP fallback is used, which is the key point here. (We aim to test file URL connections, not FTP URL connection internals)
>>
>> An alternative here could be to just verify that the returned URLConnection is an instance of FtpURLConnection. However, I opted for an end-to-end test here, since the amount of extra code seems reasonable.
>>
>> By temporarly moving this test to tier1, I was able to confirm this test runs green also on Windows GHA.
>
> Eirik Bj?rsn?s has updated the pull request incrementally with one additional commit since the last revision:
>
> Use a fake host name since no actual FTP request will be attempted
@dfuch Tagnential observation: `proxyServer.stop(2)` will always wait 2 seconds here. I was assuming it would only do that if there was an ongoing exchange.
Looking at the `ServerImpl` class, it looks like `finished` is never set to true. Specifically, `ServerImpl.Dispatcher::handleEvent` does not set it to true since that happens before `terminating` is set to true.
How is `HttpServer::stop` expected to work? Is something wrong with my expectations that this should return quickly with no inflight exchanges?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/24418#issuecomment-2778281722
From vyazici at openjdk.org Fri Apr 4 10:44:28 2025
From: vyazici at openjdk.org (Volkan Yazici)
Date: Fri, 4 Apr 2025 10:44:28 GMT
Subject: RFR: 8351339: WebSocket::sendBinary assume that user supplied
buffers are BIG_ENDIAN [v8]
In-Reply-To:
References:
Message-ID:
> Fixes endian handling `jdk.internal.net.http.websocket.Frame.Masker`.
>
> ### Implementation notes
>
> I deleted the `Frame` clone in tests, and rewired the test code depending on it to the actual `Frame`. To enable this, I relaxed the visibility of the actual `Frame`. I guess the `Frame` clone was introduced to have strict visibility in the actual `Frame`. Though this is not needed since the actual `Frame` is in an internal package. Plus, the fact that bug is in the `Frame` class hints in the direction that there should be one `Frame`.
Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision:
Use negative `byte` values in tests
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/24033/files
- new: https://git.openjdk.org/jdk/pull/24033/files/41b40436..e0981109
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=24033&range=07
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=24033&range=06-07
Stats: 34 lines in 1 file changed: 17 ins; 0 del; 17 mod
Patch: https://git.openjdk.org/jdk/pull/24033.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/24033/head:pull/24033
PR: https://git.openjdk.org/jdk/pull/24033
From dfuchs at openjdk.org Fri Apr 4 10:50:57 2025
From: dfuchs at openjdk.org (Daniel Fuchs)
Date: Fri, 4 Apr 2025 10:50:57 GMT
Subject: RFR: 8353662: Add test for non-local file URL fallback to FTP [v3]
In-Reply-To:
References:
Message-ID:
On Fri, 4 Apr 2025 10:31:08 GMT, Eirik Bj?rsn?s wrote:
>> Ok - I see that 127.0.0.1 should not be directly used. Would it work if we replaced that with a fake host name then?
>
>> Ok - I see that 127.0.0.1 should not be directly used. Would it work if we replaced that with a fake host name then?
>
> Yeah, you're right, the FTP request never materializes (our proxy just swallows it). So we only use it to assert against what was requested from the proxy, we can use a fake host name.
>
> Any preference/precedence for fake host names?
Generally looks good. "127.0.0.1" rings alarm bells because we're trying to make our tests independent of the IP versions supported by the machine they run on.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24418#discussion_r2028577797
From dfuchs at openjdk.org Fri Apr 4 11:02:15 2025
From: dfuchs at openjdk.org (Daniel Fuchs)
Date: Fri, 4 Apr 2025 11:02:15 GMT
Subject: RFR: 8353662: Add test for non-local file URL fallback to FTP [v3]
In-Reply-To:
References:
<6-DH9HLfhkXR0RazrHG_p668w9lsykybwNh_KrxELt8=.eab8b548-9025-4e4a-85bf-4590b50bd34d@github.com>
Message-ID: <1KacRQ9ZB8kBDOvYQTLoDBBInHWHYLC3xGYx12IWGWU=.ed72c5b3-96e2-415d-b254-8913f8faae7f@github.com>
On Fri, 4 Apr 2025 10:40:24 GMT, Eirik Bj?rsn?s wrote:
> @dfuch Tagnential observation: `proxyServer.stop(2)` will always wait 2 seconds here. I was assuming it would only do that if there was an ongoing exchange.
>
> Looking at the `ServerImpl` class, it looks like `finished` is never set to true. Specifically, `ServerImpl.Dispatcher::handleEvent` does not set it to true since that happens before `terminating` is set to true.
>
> How is `HttpServer::stop` expected to work? Is something wrong with my expectations that this should return quickly with no inflight exchanges?
Interesting. That looks like a bug to me. stop() should probably look at `exchangeCount` too - but that will require some thinking to get the asynchronous stops to work correctly. Should be worth logging a bug :-)
-------------
PR Comment: https://git.openjdk.org/jdk/pull/24418#issuecomment-2778350297
From eirbjo at openjdk.org Fri Apr 4 11:08:47 2025
From: eirbjo at openjdk.org (Eirik =?UTF-8?B?QmrDuHJzbsO4cw==?=)
Date: Fri, 4 Apr 2025 11:08:47 GMT
Subject: RFR: 8353662: Add test for non-local file URL fallback to FTP [v3]
In-Reply-To: <1KacRQ9ZB8kBDOvYQTLoDBBInHWHYLC3xGYx12IWGWU=.ed72c5b3-96e2-415d-b254-8913f8faae7f@github.com>
References:
<6-DH9HLfhkXR0RazrHG_p668w9lsykybwNh_KrxELt8=.eab8b548-9025-4e4a-85bf-4590b50bd34d@github.com>
<1KacRQ9ZB8kBDOvYQTLoDBBInHWHYLC3xGYx12IWGWU=.ed72c5b3-96e2-415d-b254-8913f8faae7f@github.com>
Message-ID:
On Fri, 4 Apr 2025 10:58:51 GMT, Daniel Fuchs wrote:
> Interesting. That looks like a bug to me. stop() should probably look at `exchangeCount` too - but that will require some thinking to get the asynchronous stops to work correctly. Should be worth logging a bug :-)
Let's see if this captures the essence:
https://bugs.openjdk.org/browse/JDK-8353720
-------------
PR Comment: https://git.openjdk.org/jdk/pull/24418#issuecomment-2778368216
From duke at openjdk.org Fri Apr 4 11:20:55 2025
From: duke at openjdk.org (Daishi Tabata)
Date: Fri, 4 Apr 2025 11:20:55 GMT
Subject: RFR: 8353698: Output of Simple Web Server is garbled if the
console's encoding is not UTF-8 [v3]
In-Reply-To:
References:
Message-ID: <38dt8yjyudQU_-Afy1xhqEzQXjEeEtn5-1w6qw0wB0o=.a7cb8662-f5da-46b7-a892-c2191b76f4d6@github.com>
On Fri, 4 Apr 2025 10:36:51 GMT, Daniel Fuchs wrote:
>> Daishi Tabata has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Update full name
>
> Hi, it's not completely clear to me why `static final String LOCALE_OPT = "-Duser.language=en -Duser.country=US";` has now to be passed to every test that checks command line options. Is that a separate unrelated test fix?
@dfuch Thank you for your comment.
> Is that a separate unrelated test fix?
No, it's related.
For example, after this modification, if you run `jwebserver --help` on Japanese Windows without specifying a locale, it will be output in Japanese as follows:
> jwebserver.exe --help
????: jwebserver [-b bind address] [-p port] [-d directory]
[-o none|info|verbose] [-h to show options]
[-version to show version information]
?????:
-b, --bind-address - ???????????????: 127.0.0.1 (??????)?
????????????"-b 0.0.0.0"???"-b ::"???????
-d, --directory - ????????????????: ??????????
-o, --output - ?????none|info|verbose??????: info?
-p, --port - ????????????????: 8000?
-h, -?, --help - ????????????????????
-version, --version - ??????????????????
????????????[Ctrl]+[C]??????
This is the same in jtreg tests, so if you test it on Japanese Windows, it will fail.
By specifying the English locale to `jwebserver` or `java -m jdk.httpserver`, you can get English output even on Japanese Windows, so the test will be Passed.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/24437#issuecomment-2778391933
From jpai at openjdk.org Fri Apr 4 11:22:59 2025
From: jpai at openjdk.org (Jaikiran Pai)
Date: Fri, 4 Apr 2025 11:22:59 GMT
Subject: RFR: 8353278: Consolidate local file URL checks in jar: and file:
URL schemes
In-Reply-To:
References:
Message-ID:
On Mon, 31 Mar 2025 14:46:32 GMT, Eirik Bj?rsn?s wrote:
> Please help review this cleanup PR which consolidates 'local file' URL checks across the 'file:' and 'jar:' URL scheme implementations and defines this check in terms of RFC 8089, Section 2.
>
> This PR:
>
> * Moves `URLJarFile.isFileURL` to `sun.net.www.ParseUtil` where it is documented according to RFC 8089 and given the more suitable name `isLocalFileURL`
> * Updates `isLocalFileURL` to simplify an `if (x) return true;` statement to `return x;`
> * Updates `URLJarFile.getJarFile` and `JarFileFactory.getOrCreate` to use `isLocalFileURL`
> * Updates `JarFileFactory.urlFor` to use `isLocalFileURL` (while maintaining and documenting the historical and subtly different non-treatment of '~' as an alias for 'localhost')
> * Updates `sun.net.www.protocol.file.Handler.openConnection` to use `isLocalFileURL` in windows/unix implementations
>
> This is a pure cleanup / refactoring PR, no tests are updated here. Existing testing in this area seems sparse, so I have tried to limit the number of code tweaks to a minimium to make reviews easier.
>
> Testing: GHA runs green, as well as tier2 on MacOS.
Hello Eirik, I'll take a look at the PR shortly.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/24332#issuecomment-2778394828
From duke at openjdk.org Fri Apr 4 11:30:49 2025
From: duke at openjdk.org (Daishi Tabata)
Date: Fri, 4 Apr 2025 11:30:49 GMT
Subject: RFR: 8353698: Output of Simple Web Server is garbled if the
console's encoding is not UTF-8 [v3]
In-Reply-To:
References:
Message-ID:
On Fri, 4 Apr 2025 09:13:30 GMT, Daishi Tabata wrote:
>> The output?`jwebserver` and `java -m jdk.httpserver` uses UTF-8 encoding. Therefore, if the console encoding is not set to UTF-8 (for example, MS932 on Japanese Windows), garbled characters may appear.?
>> Since System.out?knows the console's encoding, there's no need to specify it again with?PrintWriter constructor.
>>
>> The output?`jwebserver` and `java -m jdk.httpserver` is localized in Japanese, German, and Chinese. This bug only occurs in these localized languages, so I haven't added any tests.
>> I have confirmed that the output of the two commands is not garbled in the default command prompts of both Japanese Windows and English Windows.
>>
>> I tested jdk/com/sun/net/httpserver/simpleserver on English Windows, and all tests passed. However, when running on Japanese Windows, some tests failed because they expected output only in English.
>> I modified the tests so that `jwebserver` and?`java -m jdk.httpserver`?within the tests are executed with an English locale. After this modification, all tests passed on Japanese Windows.
>
> Daishi Tabata has updated the pull request incrementally with one additional commit since the last revision:
>
> Update full name
Upon reconsideration, these tests were failing on Japanese Windows even before the fix.
Should I issue a separate Bug ID?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/24437#issuecomment-2778421156
From vyazici at openjdk.org Fri Apr 4 12:04:01 2025
From: vyazici at openjdk.org (Volkan Yazici)
Date: Fri, 4 Apr 2025 12:04:01 GMT
Subject: RFR: 8351339: WebSocket::sendBinary assume that user supplied
buffers are BIG_ENDIAN [v4]
In-Reply-To:
References:
Message-ID:
On Thu, 20 Mar 2025 13:55:11 GMT, Michael McMahon wrote:
>> Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Apply review feedback on naming in `Masker`
>>
>> `reset` -> `setMask`
>> `initGallopingMask` -> `initVectorMask`
>> `applyGallopingMask` -> `applyVectorMask`
>
>> Hi, original filer here. I don't know how you handle such things here, but 24 files changed seems somewhat excessive to me for this bug.
>>
>> I do not know how effective the long-optimization realy is because/when data is not 8-byte-aligned. But if one wants to implement it, be sure to apply _native_ endianess for the mask-long, the input (eg. via a slice) and the buffer. If one uses the java default big endian (aaargh...), and "happens" to run on a little endian machine, the "optimization" would have to do a byte swap to native endian on read, do the masking and byteswap again on the way out. (same is true when choosing little endian and running on big endian hardware, although i would like the chances there much better ;-))
>
> I don't think alignment is an issue here at all. `ByteBuffer.getLong()` does not have any alignment constraints on the underlying memory. There's no way to know if it is 8-byte aligned afaict. The first 8 bytes (and every subsequent 8 bytes) can be read as a long (subject to this byte ordering issue). The final chunk of up to 7 bytes is then handled byte at a time.
>
> To add to that; it's probably still true that the optimization would not be very effective if the buffers are not 8 (or at least 4) byte aligned, but there's no way to guarantee it.
>
> I'm not sure what (if any) difference the platform's native byte order has either for that matter.
@Michael-Mc-Mahon, after having a conversation with @dfuch, I've expanded the tests to cover cases where negative `byte` values are present both in the mask and the in the input buffer to be masked. I'd appreciate your final review, and if you don't have any objections, approval, please.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/24033#issuecomment-2778488190
From dfuchs at openjdk.org Fri Apr 4 12:33:07 2025
From: dfuchs at openjdk.org (Daniel Fuchs)
Date: Fri, 4 Apr 2025 12:33:07 GMT
Subject: RFR: 8353698: Output of Simple Web Server is garbled if the
console's encoding is not UTF-8 [v3]
In-Reply-To:
References:
Message-ID: <4PGdYvXE5L7RORupCk5_lD5YsEARVWiWEUI7R18-UmU=.50993aee-6e05-4226-874a-ae7e73d8e943@github.com>
On Fri, 4 Apr 2025 09:13:30 GMT, Daishi Tabata wrote:
>> The output?`jwebserver` and `java -m jdk.httpserver` uses UTF-8 encoding. Therefore, if the console encoding is not set to UTF-8 (for example, MS932 on Japanese Windows), garbled characters may appear.?
>> Since System.out?knows the console's encoding, there's no need to specify it again with?PrintWriter constructor.
>>
>> The output?`jwebserver` and `java -m jdk.httpserver` is localized in Japanese, German, and Chinese. This bug only occurs in these localized languages, so I haven't added any tests.
>> I have confirmed that the output of the two commands is not garbled in the default command prompts of both Japanese Windows and English Windows.
>>
>> I tested jdk/com/sun/net/httpserver/simpleserver on English Windows, and all tests passed. However, when running on Japanese Windows, some tests failed because they expected output only in English.
>> I modified the tests so that `jwebserver` and?`java -m jdk.httpserver`?within the tests are executed with an English locale. After this modification, all tests passed on Japanese Windows.
>
> Daishi Tabata has updated the pull request incrementally with one additional commit since the last revision:
>
> Update full name
> Upon reconsideration, these tests were failing on Japanese Windows even before the fix.
> Should I issue a separate Bug ID?
That's what I suspected. I just wanted to make sure that needing the locale was not a side effect of your changes.
That said - I believe our tests are typically expecting the CI system (or make)? to set Locale.ENGLISH before running the tests.
I'm good with the changes you're proposing. Please hold on integrating for a bit - I would like to verify that there no regression in our CI.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/24437#issuecomment-2778586005
From rriggs at openjdk.org Fri Apr 4 12:44:03 2025
From: rriggs at openjdk.org (Roger Riggs)
Date: Fri, 4 Apr 2025 12:44:03 GMT
Subject: RFR: 8353641: Deprecate core library permission classes for removal
Message-ID:
Now that the Security Manager is permanently disabled, the following permission classes in the core libraries area can be deprecated for removal as they are no longer useful: FilePermission, LinkPermission, LoggingPermission, PropertyPermission, ReflectPermission, RuntimePermission, and SerializablePermission
@Deprecated(forRemoval = true, since="25")
Is added to each class and the existing @apiNote is converted to @deprected
-------------
Commit messages:
- 8353641: Deprecate core library permission classes for removal
Changes: https://git.openjdk.org/jdk/pull/24444/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24444&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8353641
Stats: 47 lines in 15 files changed: 28 ins; 0 del; 19 mod
Patch: https://git.openjdk.org/jdk/pull/24444.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/24444/head:pull/24444
PR: https://git.openjdk.org/jdk/pull/24444
From vyazici at openjdk.org Fri Apr 4 12:47:19 2025
From: vyazici at openjdk.org (Volkan Yazici)
Date: Fri, 4 Apr 2025 12:47:19 GMT
Subject: RFR: 8350279: HttpClient: Add a new HttpResponse method to
identify connections [v5]
In-Reply-To:
References:
Message-ID: <1YpYh04Ig0EhdbBRaC2rslSP24t6SLtE_bIHrGKYo1U=.70f2cac0-24b5-45ef-9a6d-9ccba8546def@github.com>
On Wed, 2 Apr 2025 11:10:40 GMT, Daniel Fuchs wrote:
>> Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Apply review suggestions
>
> src/java.net.http/share/classes/jdk/internal/net/http/HttpConnection.java line 100:
>
>> 98: * {@link PlainHttpConnection} it wraps will share the same label. As a
>> 99: * result, compared to {@link #id}, this label does not give a total order
>> 100: * among instances.
>
> Suggestion:
>
> /**
> * A label to identify the connection.
> *
> * This label helps with associating multiple components participating in a
> * connection. For instance, an {@link AsyncSSLConnection} and the
> * {@link PlainHttpConnection} it wraps will share the same label.
Implemented in 42ff0fc4a83cd33f1a35e4a2b3e7ce5c25ea39cc.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24154#discussion_r2028746945
From vyazici at openjdk.org Fri Apr 4 12:47:19 2025
From: vyazici at openjdk.org (Volkan Yazici)
Date: Fri, 4 Apr 2025 12:47:19 GMT
Subject: RFR: 8350279: HttpClient: Add a new HttpResponse method to
identify connections [v6]
In-Reply-To:
References:
Message-ID:
> Adds `HttpResponse::connectionLabel` method that provides an identifier for the connection.
>
> **Implementation note:** The feature is facilitated by `HttpConnection::label`, which should not be confused with `HttpConnection::id`. This distinction is explained in the JavaDoc of both properties.
Volkan Yazici has updated the pull request incrementally with five additional commits since the last revision:
- Remove timeout from `CountDownLatch::await` calls
- Replace `@AutoClose` with a corresponding `@AfterEach` method
- Remove IDE-specific `OptionalGetWithoutIsPresent` warning suppression
- Improve `HttpConnection::label` JavaDoc
- Start from 1 while labeling connections
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/24154/files
- new: https://git.openjdk.org/jdk/pull/24154/files/883135d8..5b418fd7
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=24154&range=05
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=24154&range=04-05
Stats: 16 lines in 2 files changed: 6 ins; 4 del; 6 mod
Patch: https://git.openjdk.org/jdk/pull/24154.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/24154/head:pull/24154
PR: https://git.openjdk.org/jdk/pull/24154
From vyazici at openjdk.org Fri Apr 4 12:47:19 2025
From: vyazici at openjdk.org (Volkan Yazici)
Date: Fri, 4 Apr 2025 12:47:19 GMT
Subject: RFR: 8350279: HttpClient: Add a new HttpResponse method to
identify connections [v4]
In-Reply-To:
References:
Message-ID:
On Wed, 2 Apr 2025 11:10:19 GMT, Daniel Fuchs wrote:
>> Hello Volkan, I think having the mention of ordering on the `id` field is OK. I still find it confusing to have this sentence on the `label`:
>>
>>>
>>> As a result, compared to {@link #id}, this label does not give a total order among instances.
>>
>> To me, this feels odd because `label` being a `String` typically wouldn't have been considered to be playing a role in ordering. Plus, in isolation, it's not clear what ordering this talks about (Daniel did explain to me that the `id` field is used in ordering of open connections. I haven't yet looked deeper at that code to see where that happens).
>>
>> In any case, this is an internal class so if we do decide to use the current proposed text, that's OK with me.
>
> I agree with Jaikiran: I would just remove the last sentence in this pargraph.
Implemented in 42ff0fc4a83cd33f1a35e4a2b3e7ce5c25ea39cc.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24154#discussion_r2028747158
From vyazici at openjdk.org Fri Apr 4 12:47:20 2025
From: vyazici at openjdk.org (Volkan Yazici)
Date: Fri, 4 Apr 2025 12:47:20 GMT
Subject: RFR: 8350279: HttpClient: Add a new HttpResponse method to
identify connections [v5]
In-Reply-To: <85yHuJ0fSjBVwvPmVyacNvYTLRa-bsADIuaawD4Vj5k=.cdb5ec21-1954-40c3-a7cc-433c132ee746@github.com>
References:
<85yHuJ0fSjBVwvPmVyacNvYTLRa-bsADIuaawD4Vj5k=.cdb5ec21-1954-40c3-a7cc-433c132ee746@github.com>
Message-ID:
On Wed, 2 Apr 2025 11:08:38 GMT, Jaikiran Pai wrote:
>> Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Apply review suggestions
>
> src/java.net.http/share/classes/jdk/internal/net/http/HttpConnection.java line 114:
>
>> 112:
>> 113: private static String nextLabel() {
>> 114: return "" + LABEL_COUNTER.getAndIncrement();
>
> The first label that this will generate will be `0`. It might be OK, but I think it would be better if we start it as `1`. So maybe consider using `LABEL_COUNTER.incrementAndGet()` instead?
Implemented in d64a901cf508ed7feeb0290733c61628d2ef9837.
> test/jdk/java/net/httpclient/HttpResponseConnectionLabelTest.java line 68:
>
>> 66: import static org.junit.jupiter.api.Assertions.assertTrue;
>> 67:
>> 68: @SuppressWarnings("OptionalGetWithoutIsPresent")
>
> I haven't seen this `OptionalGetWithoutIsPresent` warning before and looking into the JDK repo I don't see it being used or recognized any place else. Is this meant for some specific IDEs?
Removed in bcf106b27063e886167a29ecc92a3073a4334c55.
> test/jdk/java/net/httpclient/HttpResponseConnectionLabelTest.java line 83:
>
>> 81:
>> 82: // Start with a fresh client having no connections in the pool
>> 83: @AutoClose
>
> I hadn't come across this JUnit Jupiter annotation before. Reading through https://junit.org/junit5/docs/current/user-guide/#writing-tests-built-in-extensions-AutoClose it appears to be a convenience mechanism for managing closing of the resources at the "right time". That doc states:
>
>> Specifically, if the test class is configured with @TestInstance(Lifecycle.PER_METHOD) semantics, a non-static @AutoClose field will be closed after the execution of each test method, test factory method, or test template method. However, if the test class is configured with @TestInstance(Lifecycle.PER_CLASS) semantics, a non-static @AutoClose field will not be closed until the current test class instance is no longer needed
>
> Do you know what test class lifecycle is configured for test classes like this one when launched through jtreg?
>
> Typically, we just use very basic JUnit constructs in the tests in the JDK repo to make it simpler to follow these tests, even if it means a bit more verbose code like having a method annotated with `@BeforeEach`/`@AfterEach` to do construction/clean up like this.
Replaced with `@AfterEach` in e32a48409478764ff5ab921c61be49f8ecffcff6.
> test/jdk/java/net/httpclient/HttpResponseConnectionLabelTest.java line 156:
>
>> 154: "Server[%s] is waiting for the latch... (connectionKey=%s, responseBody=%s)",
>> 155: serverId, connectionKey, responseBody);
>> 156: assertTrue(serverResponseLatchRef[0].await(2, TimeUnit.SECONDS));
>
> We should avoid using any kind of timeouts here and in other places where we call this `await(...)` in this test. Given how varied the test execution environments are and our past experience with such timeouts, there's no right timeout to choose from. Instead, we should just do a `await()` without the timeout, so that if for whatever reason the latch isn't counted down, then the jtreg test execution timeout (which is controlled and configured externally to the test) will kick in and jtreg will do the necessary work of failing the test and also gathering detailed diagnostics through any failure handlers that are configured in that test execution environment.
Removed timeouts in 5b418fd7a9f4cfc3da940611ae3ba9d43e57aa91.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24154#discussion_r2028746855
PR Review Comment: https://git.openjdk.org/jdk/pull/24154#discussion_r2028746699
PR Review Comment: https://git.openjdk.org/jdk/pull/24154#discussion_r2028746544
PR Review Comment: https://git.openjdk.org/jdk/pull/24154#discussion_r2028746361
From dfuchs at openjdk.org Fri Apr 4 12:56:03 2025
From: dfuchs at openjdk.org (Daniel Fuchs)
Date: Fri, 4 Apr 2025 12:56:03 GMT
Subject: RFR: 8353641: Deprecate core library permission classes for
removal
In-Reply-To:
References:
Message-ID:
On Fri, 4 Apr 2025 12:37:32 GMT, Roger Riggs wrote:
> Now that the Security Manager is permanently disabled, the following permission classes in the core libraries area can be deprecated for removal as they are no longer useful: FilePermission, LinkPermission, LoggingPermission, PropertyPermission, ReflectPermission, RuntimePermission, and SerializablePermission
>
> @Deprecated(forRemoval = true, since="25")
> Is added to each class and the existing @apiNote is converted to @deprected
Looks reasonable to me. Changes to LoggingPermission look good. Out of curiosity I also looked at all usages of RuntimePermission in the JDK - I believe you caught them all - including the unexpected use in XSLT.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/24444#issuecomment-2778654645
From dfuchs at openjdk.org Fri Apr 4 12:58:06 2025
From: dfuchs at openjdk.org (Daniel Fuchs)
Date: Fri, 4 Apr 2025 12:58:06 GMT
Subject: RFR: 8350279: HttpClient: Add a new HttpResponse method to
identify connections [v6]
In-Reply-To:
References:
Message-ID:
On Fri, 4 Apr 2025 12:47:19 GMT, Volkan Yazici wrote:
>> Adds `HttpResponse::connectionLabel` method that provides an identifier for the connection.
>>
>> **Implementation note:** The feature is facilitated by `HttpConnection::label`, which should not be confused with `HttpConnection::id`. This distinction is explained in the JavaDoc of both properties.
>
> Volkan Yazici has updated the pull request incrementally with five additional commits since the last revision:
>
> - Remove timeout from `CountDownLatch::await` calls
> - Replace `@AutoClose` with a corresponding `@AfterEach` method
> - Remove IDE-specific `OptionalGetWithoutIsPresent` warning suppression
> - Improve `HttpConnection::label` JavaDoc
> - Start from 1 while labeling connections
New changes look good to me.
-------------
Marked as reviewed by dfuchs (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/24154#pullrequestreview-2742914834
From mullan at openjdk.org Fri Apr 4 13:12:50 2025
From: mullan at openjdk.org (Sean Mullan)
Date: Fri, 4 Apr 2025 13:12:50 GMT
Subject: RFR: 8348967: Deprecate security permission classes for removal
Message-ID:
Please review this change to terminally deprecate the following security related permission classes: `java.security.AllPermission`, `java.security.UnresolvedPermission`, `javax.net.ssl.SSLPermission`, `javax.security.auth.AuthPermission`, `javax.security.auth.PrivateCredentialPermission`, `javax.security.auth.kerberos.DelegationPermission`, `javax.security.auth.kerberos.ServicePermission`, `com.sun.security.jgss.InquireSecContextPermission`. These classes were only useful in conjunction with the Security Manager, which is no longer supported.
The current API note in these classes was reused as the deprecation text.
Release Note: https://bugs.openjdk.org/browse/JDK-8353680
-------------
Commit messages:
- Remove trailing whitespace.
- Initial revision.
Changes: https://git.openjdk.org/jdk/pull/24445/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24445&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8348967
Stats: 53 lines in 15 files changed: 34 ins; 0 del; 19 mod
Patch: https://git.openjdk.org/jdk/pull/24445.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/24445/head:pull/24445
PR: https://git.openjdk.org/jdk/pull/24445
From vyazici at openjdk.org Fri Apr 4 13:13:58 2025
From: vyazici at openjdk.org (Volkan Yazici)
Date: Fri, 4 Apr 2025 13:13:58 GMT
Subject: RFR: 8350279: HttpClient: Add a new HttpResponse method to
identify connections [v4]
In-Reply-To:
References:
Message-ID:
On Tue, 1 Apr 2025 19:18:18 GMT, Volkan Yazici wrote:
>> src/java.net.http/share/classes/jdk/internal/net/http/HttpConnection.java line 81:
>>
>>> 79: = Comparator.comparing(HttpConnection::id);
>>> 80:
>>> 81: private static final AtomicLong LABEL_COUNTER = new AtomicLong();
>>
>> In the API documentation on `HttpResponse.connectionLabel()` we talk about the connection label being unique within a `HttpClient` scope. i.e. two different `HttpClient` instances could have the same connectionLabel for a connection. I think that's the right scoping.
>>
>> So given that, having a `static` field on a `HttpConnection` which keeps track of a connection label, may not be the right place to keep track of that state. In this proposed form, no two connections in two different HttpClient instances will ever have the same connectionLabel. I think this counter should probably be present on the `HttpClientImpl` as an instance field.
>
> @jaikiran, what you're suggesting makes sense. I'm still exploring the interplay between the connection label and HTTP/3 server pushes. I will return back to your suggestion soon.
> In this proposed form, no two connections in two different HttpClient instances will ever have the same `connectionLabel`.
Yes, but this is neither required by the connection label contract. That is, the contract doesn't say that they must have overlapping connection labels. It only states connection labels are unique-per-client. Our implementation is more stricter than that: unique-per-VM, but that is just an implementation detail.
> I think this counter should probably be present on the `HttpClientImpl` as an instance field.
I've given this approach an attempt. Though I find it difficult to reason about in the code that a counter _only_ `HttpConnection` uses is situated in `HttpClientImpl`, just to make two `HttpConnection`s from different `HttpClientImpl`s share the connection label.
I also agree with @dfuch that having a unique-per-VM connection label helps with troubleshooting too.
@jaikiran, unless you're strongly opinionated about this, I prefer to leave the connection label counter in `HttpConnection`. How shall we proceed?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24154#discussion_r2028788343
From duke at openjdk.org Fri Apr 4 13:53:57 2025
From: duke at openjdk.org (David M. Lloyd)
Date: Fri, 4 Apr 2025 13:53:57 GMT
Subject: RFR: 8348967: Deprecate security permission classes for removal
In-Reply-To:
References:
Message-ID:
On Fri, 4 Apr 2025 12:42:36 GMT, Sean Mullan wrote:
> Please review this change to terminally deprecate the following security related permission classes: `java.security.AllPermission`, `java.security.UnresolvedPermission`, `javax.net.ssl.SSLPermission`, `javax.security.auth.AuthPermission`, `javax.security.auth.PrivateCredentialPermission`, `javax.security.auth.kerberos.DelegationPermission`, `javax.security.auth.kerberos.ServicePermission`, `com.sun.security.jgss.InquireSecContextPermission`. These classes were only useful in conjunction with the Security Manager, which is no longer supported.
I agree with most of these, however the permissions infrastructure *itself* is still used for user-level authorization (at least in WildFly/JBoss middleware, and I would assume other places as well). Part of this infrastructure does rely on `AllPermission` and its `PermissionCollection`. I don't see a reason to deprecate `AllPermission` before deprecating `Permission` itself.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/24445#issuecomment-2778791218
From mullan at openjdk.org Fri Apr 4 14:15:48 2025
From: mullan at openjdk.org (Sean Mullan)
Date: Fri, 4 Apr 2025 14:15:48 GMT
Subject: RFR: 8348967: Deprecate security permission classes for removal
In-Reply-To:
References:
Message-ID: <9F3RrRIQCRygi1beKlVOjCKbHaF-rDFh63UG1leNDq8=.24f6dca0-e6f6-4fed-ac9a-1355bb73c8be@github.com>
On Fri, 4 Apr 2025 12:42:36 GMT, Sean Mullan wrote:
> Please review this change to terminally deprecate the following security related permission classes: `java.security.AllPermission`, `java.security.UnresolvedPermission`, `javax.net.ssl.SSLPermission`, `javax.security.auth.AuthPermission`, `javax.security.auth.PrivateCredentialPermission`, `javax.security.auth.kerberos.DelegationPermission`, `javax.security.auth.kerberos.ServicePermission`, `com.sun.security.jgss.InquireSecContextPermission`. These classes were only useful in conjunction with the Security Manager, which is no longer supported.
>
> The current API note in these classes was reused as the deprecation text.
>
> Release Note: https://bugs.openjdk.org/browse/JDK-8353680
> > Please review this change to terminally deprecate the following security related permission classes: `java.security.AllPermission`, `java.security.UnresolvedPermission`, `javax.net.ssl.SSLPermission`, `javax.security.auth.AuthPermission`, `javax.security.auth.PrivateCredentialPermission`, `javax.security.auth.kerberos.DelegationPermission`, `javax.security.auth.kerberos.ServicePermission`, `com.sun.security.jgss.InquireSecContextPermission`. These classes were only useful in conjunction with the Security Manager, which is no longer supported.
>
> I agree with most of these, however the permissions infrastructure _itself_ is still used for user-level authorization (at least in WildFly/JBoss middleware, and I would assume other places as well). Part of this infrastructure does rely on `AllPermission` and its `PermissionCollection`. I don't see a reason to deprecate `AllPermission` before deprecating `Permission` itself.
Can you elaborate or give an example/pointer to code on how it uses `AllPermission` w/o the corresponding SM APIs and infrastructure (policy files, `AccessController`, etc)?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/24445#issuecomment-2778846121
From jpai at openjdk.org Fri Apr 4 14:51:08 2025
From: jpai at openjdk.org (Jaikiran Pai)
Date: Fri, 4 Apr 2025 14:51:08 GMT
Subject: RFR: 8350279: HttpClient: Add a new HttpResponse method to
identify connections [v6]
In-Reply-To:
References:
Message-ID:
On Fri, 4 Apr 2025 12:47:19 GMT, Volkan Yazici wrote:
>> Adds `HttpResponse::connectionLabel` method that provides an identifier for the connection.
>>
>> **Implementation note:** The feature is facilitated by `HttpConnection::label`, which should not be confused with `HttpConnection::id`. This distinction is explained in the JavaDoc of both properties.
>
> Volkan Yazici has updated the pull request incrementally with five additional commits since the last revision:
>
> - Remove timeout from `CountDownLatch::await` calls
> - Replace `@AutoClose` with a corresponding `@AfterEach` method
> - Remove IDE-specific `OptionalGetWithoutIsPresent` warning suppression
> - Improve `HttpConnection::label` JavaDoc
> - Start from 1 while labeling connections
test/jdk/java/net/httpclient/HttpResponseConnectionLabelTest.java line 190:
> 188: private static HttpTestServer createServer(Version version, SSLContext sslContext) {
> 189: try {
> 190: return HttpTestServer.create(version, sslContext, ForkJoinPool.commonPool());
The HTTP/2 test server in the JDK shuts down the `Executor` that is passed to that server (like this one), when the server is stopped. I had a look at the specification and implementation of `ForkJoinPool.commonPool()` - it is specified to not close/shutdown the common pool. So I think it is OK to use the `commonPool()` as the `Executor` for these servers.
Although, since this test is agentvm test, we never known what state the commonPool() executor is in due to some previously run test(s). Maybe we should consider having a test specific Executor in this test, like we do in some other tests within the httpclient tests.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24154#discussion_r2028968733
From duke at openjdk.org Fri Apr 4 14:51:58 2025
From: duke at openjdk.org (David M. Lloyd)
Date: Fri, 4 Apr 2025 14:51:58 GMT
Subject: RFR: 8348967: Deprecate security permission classes for removal
In-Reply-To: <9F3RrRIQCRygi1beKlVOjCKbHaF-rDFh63UG1leNDq8=.24f6dca0-e6f6-4fed-ac9a-1355bb73c8be@github.com>
References:
<9F3RrRIQCRygi1beKlVOjCKbHaF-rDFh63UG1leNDq8=.24f6dca0-e6f6-4fed-ac9a-1355bb73c8be@github.com>
Message-ID:
On Fri, 4 Apr 2025 14:12:55 GMT, Sean Mullan wrote:
> > > Please review this change to terminally deprecate the following security related permission classes: `java.security.AllPermission`, `java.security.UnresolvedPermission`, `javax.net.ssl.SSLPermission`, `javax.security.auth.AuthPermission`, `javax.security.auth.PrivateCredentialPermission`, `javax.security.auth.kerberos.DelegationPermission`, `javax.security.auth.kerberos.ServicePermission`, `com.sun.security.jgss.InquireSecContextPermission`. These classes were only useful in conjunction with the Security Manager, which is no longer supported.
> >
> >
> > I agree with most of these, however the permissions infrastructure _itself_ is still used for user-level authorization (at least in WildFly/JBoss middleware, and I would assume other places as well). Part of this infrastructure does rely on `AllPermission` and its `PermissionCollection`. I don't see a reason to deprecate `AllPermission` before deprecating `Permission` itself.
>
> Can you elaborate or give an example/pointer to code on how it uses `AllPermission` w/o the corresponding SM APIs and infrastructure (policy files, `AccessController`, etc)?
The [`wildfly-elytron`](https://github.com/wildfly-security/wildfly-elytron) project uses `Permission` and `PermissionCollection` as a standalone basic API to represent user authorization permissions. Some examples include `LoginPermission` and `RunAsPrincipalPermission`, and a special `NoPermission` class which is useful in certain situations.
The user authorization mechanism does not use policy files, security manager APIs, `AccessController` or any other JAAS-adjacent API for this purpose.
Security contexts are managed completely separately from the JDK using thread local scoping (planned to move to `ScopedValue` someday if/when it becomes available). Permissions are checked against the user security context (`org.wildfly.security.auth.server.SecurityIdentity`) by authorization-sensitive operations in both server and user code.
The `AllPermission` class is used for "superuser" authorization situations, and cases where the deployer opts out of authorization checks for whatever reason (for example, testing). We use it for role-based access control of the application server itself when access control checks pass, as well for superuser authorization cases, and probably other cases I'm forgetting about (it's one of those things that we always assumed would stick around forever, so we used it without a second thought).
`AllPermission` is an integral concept of permission sets, and thus we would be obliged to create our own if the JDK one disappeared, causing compatibility problems due to the class moving to a new package from the point of view of consumers. Its destiny should be tied to that of `Permission` itself in my opinion, because it is pretty fundamental.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/24445#issuecomment-2778956492
From dfuchs at openjdk.org Fri Apr 4 14:58:14 2025
From: dfuchs at openjdk.org (Daniel Fuchs)
Date: Fri, 4 Apr 2025 14:58:14 GMT
Subject: RFR: 8350279: HttpClient: Add a new HttpResponse method to
identify connections [v6]
In-Reply-To:
References:
Message-ID:
On Fri, 4 Apr 2025 14:48:16 GMT, Jaikiran Pai wrote:
>> Volkan Yazici has updated the pull request incrementally with five additional commits since the last revision:
>>
>> - Remove timeout from `CountDownLatch::await` calls
>> - Replace `@AutoClose` with a corresponding `@AfterEach` method
>> - Remove IDE-specific `OptionalGetWithoutIsPresent` warning suppression
>> - Improve `HttpConnection::label` JavaDoc
>> - Start from 1 while labeling connections
>
> test/jdk/java/net/httpclient/HttpResponseConnectionLabelTest.java line 190:
>
>> 188: private static HttpTestServer createServer(Version version, SSLContext sslContext) {
>> 189: try {
>> 190: return HttpTestServer.create(version, sslContext, ForkJoinPool.commonPool());
>
> The HTTP/2 test server in the JDK shuts down the `Executor` that is passed to that server (like this one), when the server is stopped. I had a look at the specification and implementation of `ForkJoinPool.commonPool()` - it is specified to not close/shutdown the common pool. So I think it is OK to use the `commonPool()` as the `Executor` for these servers.
>
> Although, since this test is agentvm test, we never known what state the commonPool() executor is in due to some previously run test(s). Maybe we should consider having a test specific Executor in this test, like we do in some other tests within the httpclient tests.
Another possibility is to run in /othervm mode - then we don't care...
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24154#discussion_r2028979965
From duke at openjdk.org Fri Apr 4 15:02:23 2025
From: duke at openjdk.org (robert engels)
Date: Fri, 4 Apr 2025 15:02:23 GMT
Subject: RFR: 8348967: Deprecate security permission classes for removal
In-Reply-To: