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

Daniel Fuchs dfuchs at openjdk.java.net
Thu May 12 10:12:09 UTC 2022


On Thu, 12 May 2022 09:15:19 GMT, Pavel Rappo <prappo at openjdk.org> 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:
> 
>> 289: 
>> 290:         HeaderWriter noMask() {
>> 291:             // The negation "~" sets the high order bits
> 
> Rubber-stamping this in front of every of the four closely sitting casts seems excessive:
> 
>                 // The negation "~" sets the high order bits
>                 // so the value is more than 16 bits and the
>                 // compiler will emit a warning if not cast

I don't disagree. I had the same feeling. But I don't necessarily read a file from top to bottom - and someone just glancing at one of these methods might wonder why one line has the cast and the other hasn't.

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

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


More information about the net-dev mailing list