RFR: 8286386: Address possibly lossy conversions in java.net.http [v6]
Pavel Rappo
prappo at openjdk.java.net
Thu May 12 11:34:56 UTC 2022
On Thu, 12 May 2022 10:51:04 GMT, Daniel Fuchs <dfuchs at openjdk.org> 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 additional commit since the last revision:
>
> lengthOfCode() returns int; Removed excessive comments
src/java.net.http/share/classes/jdk/internal/net/http/hpack/QuickHuffman.java line 736:
> 734: }
> 735: int len = codeLengthOf(c);
> 736: assert len >= 0;
This `assert` could be better if placed into `codeLengthOf`, which is called from one more place.
src/java.net.http/share/classes/jdk/internal/net/http/websocket/Frame.java line 220:
> 218: // Explicit cast required:
> 219: // The negation "~" sets the high order bits
> 220: // so the value is more than 16 bits and the
Consider using: the value *becomes longer* than 16 bits
src/java.net.http/share/classes/jdk/internal/net/http/websocket/Frame.java line 287:
> 285: HeaderWriter noMask() {
> 286: // The negation "~" sets the high order bits
> 287: // so the value is more than 16 bits and the
Again, consider: *becomes longer*
-------------
PR: https://git.openjdk.java.net/jdk/pull/8656
More information about the net-dev
mailing list