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

Daniel Fuchs dfuchs at openjdk.java.net
Thu May 12 14:19:36 UTC 2022


On Thu, 12 May 2022 11:41:04 GMT, Pavel Rappo <prappo at openjdk.org> 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 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 of `code` elements. Maybe you can improve it somehow or carry over that specific part about the length into `codeLengthOf`. Alternatively, you can always slap `assert` in `codeLengthOf`.

Did I understand correctly that the lower 32 bits is expected to contain a length coded on 5 bits - which is expected to be a value in (5..30)?

-------------

PR: https://git.openjdk.java.net/jdk/pull/8656


More information about the net-dev mailing list