On Thu, 12 May 2022 10:08:23 GMT, Daniel Fuchs <dfu...@openjdk.org> 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 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.

Readers should always consider as much of the context as practical; but I like 
your solution.

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

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

Reply via email to