Affects Version/s: 10.14.2.0
Fix Version/s: None
Component/s: Network Server
As was discussed on the derby-dev list here: http://mail-archives.apache.org/mod_mbox/db-derby-dev/201802.mbox/%3CCANi-yg8ru8BLNVxW0v6TT_ndPa8Y7_MD6zpgjiyQ6MQoT4Ca9g%40mail.gmail.com%3E
it seems like there is some confusing shifting-and-masking code in NetworkServerControlImpl that could be improved:
I'm not quite sure what this code is doing.
It seems to be mixing some combination of 8-bit shifting
and 4-bit value masking.
I think it might actually be losing/destroying 4 bits of
the 16-bit value (the high 4 bytes in the low byte of
For example if you call writeShort(23), it emits 0x00, 0x07,
when I think it should emit 0x00,0x17.
I suspect the code should read:
or some such, but really I don't understand it at all.
And, very close to this code is a very similar method:
which I think might be damaged for any value in the
range 17-255? It seems like it should probably be:
or maybe just: