Re: [External] : Re: Re: New candidate JEP: 408: Simple Web Server
Hi Zheka, On 05/04/2021 16:09, Zheka Kozlov wrote: > Can we put at least new classes to some java.* package (SimpleFileServer, > HttpHandlers, Request)? For example, java.net.httpserver. The new classes extend/implement/build upon the existing abstractions in jdk.httpserver, they have a clear API relationship and cannot be easily separated out. Indeed, separating them out would make things much more confusing, given they are a logical extension of the existing classes. Where would we cut ties exactly? Old vs. new API points would be a misleading distinction here and we would end up with a partial and incomplete package that cannot stand on its own feet. If the HTTP Server API were ever to be standardized (moved to the java. namespace), it should be considered as a whole - with all the additional considerations this would bring. And as said before, the java. vs. jdk. namespace question is bigger than this JEP and will not be addressed in this work. Regards, Julia
Integrated: 8264048: Fix caching in Jar URL connections when an entry is missing
On Tue, 30 Mar 2021 11:30:48 GMT, Aleksei Efimov wrote: > Current fix tries to tackle an issue with URL connection referencing > non-existing Jar file entries: > If an entry that doesn't exist is specified in an URL connection the > underlying Jar file is still cached even if an exception is thrown after > that. Such behavior prevents the caller, for instance, a `URLClassLoader`, > from closing a Jar file. > > The proposed fix checks if entry exists before caching a Jar file (only for > cases with enabled caching): > - If entry exists - jar file is cached if it wasn't cached before > - If entry doesn't exist and jar file wasn't cached before - jar file is > closed and exception is thrown > - If entry doesn't exist and jar file was cached before - jar file is kept > cached and exception is thrown > > > The following tests have been used to verify the fix: > - New regression tests > - ``:jdk_core:`` tests > - `api/java_util`,`api/java_net` JCK tests This pull request has now been integrated. Changeset: a611c462 Author:Aleksei Efimov URL: https://git.openjdk.java.net/jdk/commit/a611c462 Stats: 372 lines in 6 files changed: 346 ins; 2 del; 24 mod 8264048: Fix caching in Jar URL connections when an entry is missing Co-authored-by: Daniel Fuchs Reviewed-by: bchristi, dfuchs - PR: https://git.openjdk.java.net/jdk/pull/3263
Re: [External] : Re: Re: New candidate JEP: 408: Simple Web Server
On 06/04/2021 11:25, Julia Boes wrote: : The new classes extend/implement/build upon the existing abstractions in jdk.httpserver, they have a clear API relationship and cannot be easily separated out. Indeed, separating them out would make things much more confusing, given they are a logical extension of the existing classes. Where would we cut ties exactly? Old vs. new API points would be a misleading distinction here and we would end up with a partial and incomplete package that cannot stand on its own feet. If the HTTP Server API were ever to be standardized (moved to the java. namespace), it should be considered as a whole - with all the additional considerations this would bring. And as said before, the java. vs. jdk. namespace question is bigger than this JEP and will not be addressed in this work. Right, and the effort to do that should not be under estimated as it would be very difficult to agreement on the scope. Also just to mention that the original proposal for the web services stack in Java SE 6 (web services callbacks were the the original motive for the http server API) did have the http server API in the javax.* name space. JSR 270 (the umbrella JSR for Java SE 6) had some concerns so it had to be introduced as a JDK-specific API instead. -Alan
Re: RFR: 8263506: Make sun.net.httpserver.UnmodifiableHeaders unmodifiable [v4]
> The fix makes the map in sun.net.httpserver.UnmodifiableHeaders unmodifiable > by wrapping it in an unmodifiable view. Julia Boes 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 10 additional commits since the last revision: - Account for null values and change type in constructor - Merge branch 'master' into 8263506 - Merge branch 'master' into 8263506 - move constructor call in ExchangeImpl and fix indentation - wrap List with unmodifiable map and update test - remove map wrapping - fix imports - Merge branch 'master' into 8263506 - fix UnmodifiableHeaders impl - add initial test - Changes: - all: https://git.openjdk.java.net/jdk/pull/3032/files - new: https://git.openjdk.java.net/jdk/pull/3032/files/8981b444..ee8da732 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=3032&range=03 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=3032&range=02-03 Stats: 41260 lines in 1991 files changed: 23607 ins; 9211 del; 8442 mod Patch: https://git.openjdk.java.net/jdk/pull/3032.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/3032/head:pull/3032 PR: https://git.openjdk.java.net/jdk/pull/3032
Re: RFR: 8263506: Make sun.net.httpserver.UnmodifiableHeaders unmodifiable [v3]
On Thu, 1 Apr 2021 14:08:47 GMT, Michael McMahon wrote: >> Julia Boes has updated the pull request incrementally with one additional >> commit since the last revision: >> >> move constructor call in ExchangeImpl and fix indentation > > LGTM I included a null check in the constructor to account for null values of `List`, which `Headers` allows. Fixed the indentation. Testing: Tier 1-3 all clear. - PR: https://git.openjdk.java.net/jdk/pull/3032
Re: RFR: 8263506: Make sun.net.httpserver.UnmodifiableHeaders unmodifiable [v4]
On Tue, 6 Apr 2021 13:10:59 GMT, Julia Boes wrote: >> The fix makes the map in sun.net.httpserver.UnmodifiableHeaders unmodifiable >> by wrapping it in an unmodifiable view. > > Julia Boes 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 10 additional commits since > the last revision: > > - Account for null values and change type in constructor > - Merge branch 'master' into 8263506 > - Merge branch 'master' into 8263506 > - move constructor call in ExchangeImpl and fix indentation > - wrap List with unmodifiable map and update test > - remove map wrapping > - fix imports > - Merge branch 'master' into 8263506 > - fix UnmodifiableHeaders impl > - add initial test src/jdk.httpserver/share/classes/sun/net/httpserver/UnmodifiableHeaders.java line 41: > 39: var unmodHeaders = new Headers(); > 40: h.forEach((k, v) -> { > 41: List l = v == null ? List.of() : > Collections.unmodifiableList(v); If v is `null` it should be mapped to `null` - not to `List.of()`, to preserve map equality. test/jdk/com/sun/net/httpserver/UnmodifiableHeadersTest.java line 89: > 87: } > 88: > 89: static void assertUnmodifiableList(Headers headers) { Maybe the test should be extended to double check that: var headers = ... var unmodifiableHeaders = new UnmodifiableHeaders(headers); assertEquals(unmodifiableHeaders, headers); assertEquals(unmodifiableHeaders.hashCode(), headers.hashCode()); - PR: https://git.openjdk.java.net/jdk/pull/3032
RFR: 8262898: com/sun/net/httpserver/bugs/8199849/ParamTest.java times out
Hi, Could I get the following small test fix reviewed please? The test is timing out on Mac probably because it is running on a system with a proxy that is not bypassed for loopback connections. The test already sets NO_PROXY explicitly for one part of the test. It needs to do the equivalent for the second part. Thanks, Michael - Commit messages: - Fix for test Changes: https://git.openjdk.java.net/jdk/pull/3358/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=3358&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8262898 Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 mod Patch: https://git.openjdk.java.net/jdk/pull/3358.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/3358/head:pull/3358 PR: https://git.openjdk.java.net/jdk/pull/3358
Re: RFR: 8262898: com/sun/net/httpserver/bugs/8199849/ParamTest.java times out
On Tue, 6 Apr 2021 15:17:53 GMT, Michael McMahon wrote: > Hi, > > Could I get the following small test fix reviewed please? The test is timing > out on Mac probably because it is running on a system with a proxy that is > not bypassed for loopback connections. The test already sets NO_PROXY > explicitly for one part of the test. It needs to do the equivalent for the > second part. > > Thanks, > Michael LGTM - Marked as reviewed by dfuchs (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/3358
Integrated: 8262898: com/sun/net/httpserver/bugs/8199849/ParamTest.java times out
On Tue, 6 Apr 2021 15:17:53 GMT, Michael McMahon wrote: > Hi, > > Could I get the following small test fix reviewed please? The test is timing > out on Mac probably because it is running on a system with a proxy that is > not bypassed for loopback connections. The test already sets NO_PROXY > explicitly for one part of the test. It needs to do the equivalent for the > second part. > > Thanks, > Michael This pull request has now been integrated. Changeset: 4bb80f37 Author:Michael McMahon URL: https://git.openjdk.java.net/jdk/commit/4bb80f37 Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 mod 8262898: com/sun/net/httpserver/bugs/8199849/ParamTest.java times out Reviewed-by: dfuchs - PR: https://git.openjdk.java.net/jdk/pull/3358