Re: RFR: 8286386: Address possibly lossy conversions in java.net.http [v5]

2022-05-12 Thread Daniel Fuchs
On Wed, 11 May 2022 20:31:00 GMT, Michael McMahon wrote: >> I believe the method returns an "unsigned int" - having the method return an >> int would then potentially cause `bufferLen + len <= 64` to yield true when >> it shouldn't. Hopefully @pavelrappo will comment. > > codeLengthOf() returns

Re: RFR: 8286386: Address possibly lossy conversions in java.net.http [v5]

2022-05-12 Thread Pavel Rappo
On Thu, 12 May 2022 08:56:26 GMT, Daniel Fuchs wrote: >> No because the int returned could be negative, while the long will not. >> Assuming bufferLen is 0 and codeLengthOf() returns some value that has the >> 32th bit set to 1 then when codeLengthOf() returns long, bufferLen + >> codeLengthOf

Re: RFR: 8286386: Address possibly lossy conversions in java.net.http [v5]

2022-05-12 Thread Daniel Fuchs
On Thu, 12 May 2022 08:42:39 GMT, Daniel Fuchs wrote: >> codeLengthOf() returns long. It could be changed to return int with a cast >> internally and then you could avoid the two new casts. > > No because the int returned could be negative, while the long will not. > Assuming bufferLen is 0 and

Re: RFR: 8286386: Address possibly lossy conversions in java.net.http [v5]

2022-05-12 Thread Pavel Rappo
On Wed, 11 May 2022 18:42:46 GMT, Daniel Fuchs wrote: >> In relation to >> [JDK-8244681](https://bugs.openjdk.java.net/browse/JDK-8244681), please find >> here a patch that addresses possibly lossy conversions in java.net.http > > Daniel Fuchs has updated the pull request incrementally with one

Re: RFR: 8286386: Address possibly lossy conversions in java.net.http [v5]

2022-05-12 Thread Daniel Fuchs
On Thu, 12 May 2022 09:00:37 GMT, Pavel Rappo wrote: >> This is what I mean: >> >> jshell> long codeLengthOf = (long)Integer.MAX_VALUE + 1 >> codeLengthOf ==> 2147483648 >> >> jshell> int bufferLen = 0 >> bufferLen ==> 0 >> >> jshell> bufferLen + codeLengthOf <= 64 >> $3 ==> false >> >> jshel

Re: RFR: 8286386: Address possibly lossy conversions in java.net.http [v5]

2022-05-12 Thread Daniel Fuchs
On Thu, 12 May 2022 09:15:19 GMT, Pavel Rappo wrote: >> Daniel Fuchs has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Revert adding char constants > > src/java.net.http/share/classes/jdk/internal/net/http/websocket/Frame.java > line 291:

Re: RFR: 8286386: Address possibly lossy conversions in java.net.http [v6]

2022-05-12 Thread Daniel Fuchs
> In relation to > [JDK-8244681](https://bugs.openjdk.java.net/browse/JDK-8244681), please find > here a patch that addresses possibly lossy conversions in java.net.http Daniel Fuchs has updated the pull request incrementally with one additional commit since the last revision: lengthOfCode()

Re: RFR: 8286386: Address possibly lossy conversions in java.net.http [v6]

2022-05-12 Thread Pavel Rappo
On Thu, 12 May 2022 10:51:04 GMT, Daniel Fuchs wrote: >> In relation to >> [JDK-8244681](https://bugs.openjdk.java.net/browse/JDK-8244681), please find >> here a patch that addresses possibly lossy conversions in java.net.http > > Daniel Fuchs has updated the pull request incrementally with one

Re: RFR: 8286386: Address possibly lossy conversions in java.net.http [v5]

2022-05-12 Thread Pavel Rappo
On Thu, 12 May 2022 10:08:23 GMT, Daniel Fuchs wrote: >> src/java.net.http/share/classes/jdk/internal/net/http/websocket/Frame.java >> line 291: >> >>> 289: >>> 290: HeaderWriter noMask() { >>> 291: // The negation "~" sets the high order bits >> >> Rubber-stamping this in

Re: RFR: 8286386: Address possibly lossy conversions in java.net.http [v6]

2022-05-12 Thread Pavel Rappo
On Thu, 12 May 2022 10:05:14 GMT, Daniel Fuchs wrote: > OK - I will change codeLengthOf as suggested. It was not immediately obvious > to me that the values would fit in the first 31 bits. In fact, it would even fit into the first 30 bits. There's a top-level comment that explains the layout o

Re: RFR: 8284585: PushPromiseContinuation test fails intermittently in timeout [v3]

2022-05-12 Thread Conor Cleary
> **Issue** > A recent fix for > [JDK-8263031](https://bugs.openjdk.java.net/browse/JDK-8263031), which > addressed the httpclient being unable to properly process Http/2 PushPromise > frames followed by continuations caused intermittent failures of the test. > This was cause by two seperate pr

Re: RFR: 8284585: PushPromiseContinuation test fails intermittently in timeout [v2]

2022-05-12 Thread Conor Cleary
On Thu, 5 May 2022 13:37:08 GMT, Conor Cleary wrote: >> **Issue** >> A recent fix for >> [JDK-8263031](https://bugs.openjdk.java.net/browse/JDK-8263031), which >> addressed the httpclient being unable to properly process Http/2 PushPromise >> frames followed by continuations caused intermitten

Re: RFR: 8283544: HttpClient GET method adds Content-Length: 0 header [v7]

2022-05-12 Thread Conor Cleary
On Fri, 6 May 2022 13:46:41 GMT, Conor Cleary wrote: >> **Issue** >> When using the `HttpClient.send()` to send a GET request created using the >> `HttpRequest.newBuilder()`, a `Content-length: 0` header is set. This >> behaviour causes issues with many services as a body related header is >>

Re: RFR: 8286386: Address possibly lossy conversions in java.net.http [v6]

2022-05-12 Thread Michael McMahon
On Thu, 12 May 2022 10:51:04 GMT, Daniel Fuchs wrote: >> In relation to >> [JDK-8244681](https://bugs.openjdk.java.net/browse/JDK-8244681), please find >> here a patch that addresses possibly lossy conversions in java.net.http > > Daniel Fuchs has updated the pull request incrementally with one

Re: RFR: 8283544: HttpClient GET method adds Content-Length: 0 header [v7]

2022-05-12 Thread Jaikiran Pai
On Thu, 12 May 2022 12:01:23 GMT, Conor Cleary wrote: > Will await further review for a short while and then integrate if approved. Hello Conor, looking at the latest state of the PR, I think you might have missed Daniel's review comment https://github.com/openjdk/jdk/pull/8017#discussion_r866

Re: RFR: 8286386: Address possibly lossy conversions in java.net.http [v7]

2022-05-12 Thread Daniel Fuchs
> In relation to > [JDK-8244681](https://bugs.openjdk.java.net/browse/JDK-8244681), please find > here a patch that addresses possibly lossy conversions in java.net.http Daniel Fuchs has updated the pull request incrementally with one additional commit since the last revision: Pavel's feedba

Re: RFR: 8286386: Address possibly lossy conversions in java.net.http [v7]

2022-05-12 Thread Daniel Fuchs
On Thu, 12 May 2022 11:41:04 GMT, Pavel Rappo wrote: >> OK - I will change codeLengthOf as suggested. It was not immediately >> obvious to me that the values would fit in the first 31 bits. > >> OK - I will change codeLengthOf as suggested. It was not immediately obvious >> to me that the valu

Re: RFR: 8286386: Address possibly lossy conversions in java.net.http [v8]

2022-05-12 Thread Daniel Fuchs
> In relation to > [JDK-8244681](https://bugs.openjdk.java.net/browse/JDK-8244681), please find > here a patch that addresses possibly lossy conversions in java.net.http Daniel Fuchs has updated the pull request incrementally with one additional commit since the last revision: Move assert -

Re: RFR: 8286386: Address possibly lossy conversions in java.net.http [v8]

2022-05-12 Thread Roger Riggs
On Thu, 12 May 2022 14:25:44 GMT, Daniel Fuchs wrote: >> In relation to >> [JDK-8244681](https://bugs.openjdk.java.net/browse/JDK-8244681), please find >> here a patch that addresses possibly lossy conversions in java.net.http > > Daniel Fuchs has updated the pull request incrementally with one

Re: RFR: 8286386: Address possibly lossy conversions in java.net.http [v9]

2022-05-12 Thread Daniel Fuchs
> In relation to > [JDK-8244681](https://bugs.openjdk.java.net/browse/JDK-8244681), please find > here a patch that addresses possibly lossy conversions in java.net.http Daniel Fuchs has updated the pull request incrementally with one additional commit since the last revision: Typo

Re: RFR: 8284585: PushPromiseContinuation test fails intermittently in timeout [v3]

2022-05-12 Thread Daniel Fuchs
On Thu, 12 May 2022 11:54:55 GMT, Conor Cleary wrote: >> **Issue** >> A recent fix for >> [JDK-8263031](https://bugs.openjdk.java.net/browse/JDK-8263031), which >> addressed the httpclient being unable to properly process Http/2 PushPromise >> frames followed by continuations caused intermitte

Re: RFR: 8283544: HttpClient GET method adds Content-Length: 0 header [v7]

2022-05-12 Thread Daniel Fuchs
On Fri, 6 May 2022 13:46:41 GMT, Conor Cleary wrote: >> **Issue** >> When using the `HttpClient.send()` to send a GET request created using the >> `HttpRequest.newBuilder()`, a `Content-length: 0` header is set. This >> behaviour causes issues with many services as a body related header is >>

Integrated: 8286378: Address possibly lossy conversions in java.base

2022-05-12 Thread Roger Riggs
On Tue, 10 May 2022 21:32:10 GMT, Roger Riggs wrote: > PR#8599 8244681: proposes to add compiler warnings for possible lossy > conversions > From the CSR: > > "If the type of the right-hand operand of a compound assignment is not > assignment compatible with the type of the variable, a cast is

Re: RFR: 8286386: Address possibly lossy conversions in java.net.http [v9]

2022-05-12 Thread Pavel Rappo
On Thu, 12 May 2022 14:15:43 GMT, Daniel Fuchs wrote: >>> OK - I will change codeLengthOf as suggested. It was not immediately >>> obvious to me that the values would fit in the first 31 bits. >> >> In fact, it would even fit into the first 30 bits. There's a top-level >> comment that explains

Re: RFR: 8286386: Address possibly lossy conversions in java.net.http [v9]

2022-05-12 Thread Pavel Rappo
On Thu, 12 May 2022 14:56:47 GMT, Daniel Fuchs wrote: >> In relation to >> [JDK-8244681](https://bugs.openjdk.java.net/browse/JDK-8244681), please find >> here a patch that addresses possibly lossy conversions in java.net.http > > Daniel Fuchs has updated the pull request incrementally with one

Integrated: 8286386: Address possibly lossy conversions in java.net.http

2022-05-12 Thread Daniel Fuchs
On Wed, 11 May 2022 15:42:25 GMT, Daniel Fuchs wrote: > In relation to > [JDK-8244681](https://bugs.openjdk.java.net/browse/JDK-8244681), please find > here a patch that addresses possibly lossy conversions in java.net.http This pull request has now been integrated. Changeset: 5ff1d227 Author

Re: RFR: 8283577: SSLEngine.unwrap on read-only input ByteBuffer

2022-05-12 Thread Bradford Wetmore
On Wed, 11 May 2022 22:25:43 GMT, Anthony Scarpino wrote: >> test/jdk/javax/net/ssl/SSLSession/ReadOnlyEngine.java line 1: >> >>> 1: /* >> >> Wondering why this is in javax/net/ssl/SSLSession instead of >> sun/security/ssl/SSLCipher. > > I can move it.. I created it from another test which ha

Re: RFR: 8283577: SSLEngine.unwrap on read-only input ByteBuffer

2022-05-12 Thread Bradford Wetmore
On Wed, 11 May 2022 23:03:27 GMT, Anthony Scarpino wrote: >> test/jdk/javax/net/ssl/SSLSession/ReadOnlyEngine.java line 172: >> >>> 170: out.clear(); >>> 171: String testString = "ASDF"; >>> 172: in.put(testString.getBytes()).flip(); >> >> If you're going to convert bac

Re: RFR: 8283577: SSLEngine.unwrap on read-only input ByteBuffer

2022-05-12 Thread Bradford Wetmore
On Wed, 11 May 2022 22:38:04 GMT, Anthony Scarpino wrote: >> test/jdk/javax/net/ssl/SSLSession/ReadOnlyEngine.java line 162: >> >>> 160: statusServer != HandshakeStatus.NOT_HANDSHAKING); >>> 161: >>> 162: // Read NST >> >> What is NST? > > New Session Ticket Duh, of cours

Re: RFR: 8286378: Address possibly lossy conversions in java.base [v3]

2022-05-12 Thread ExE Boss
On Wed, 11 May 2022 16:30:41 GMT, Roger Riggs wrote: >> PR#8599 8244681: proposes to add compiler warnings for possible lossy >> conversions >> From the CSR: >> >> "If the type of the right-hand operand of a compound assignment is not >> assignment compatible with the type of the variable, a c

Re: RFR: 8286378: Address possibly lossy conversions in java.base [v3]

2022-05-12 Thread Alan Bateman
On Fri, 13 May 2022 04:41:03 GMT, ExE Boss wrote: >> Roger Riggs has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Updated copyrights >> Fixed cast style to add a space after cast, (where consistent with file >> style) >> Improved cod