Code review request [JDK 9] 8042449 Issue for negative byte major record version

Xuelei Fan xuelei.fan at oracle.com
Tue May 6 12:00:10 UTC 2014


On 5/6/2014 7:41 PM, Florian Weimer wrote:
> On 05/06/2014 12:10 PM, Xuelei Fan wrote:
> 
>> Please review this simple but interesting fix:
>>    http://cr.openjdk.java.net/~xuelei/8042449/webrev.00/
> 
> It's strange that the code caches the major/minor version components as
> fields of ProtocolVersion, but these fields cannot be used directly and
> still need shifting and masking.
> 
> Maybe it's better to store the components as ints, or remove the fields
> completely and use accessors that extract the components from the
> version field as needed?
> 
We need to convert the byte and int type back-and-forth.  Store as ints
is convenient for comparing.  Store as bytes is convenient for assigning
to a new generated record.

Storing both int version and major/minor byte versions is a little bit
redundancy.  The update is significant.  I will focus on the signed byte
issue in this fix.

Thanks for the comment!

Xuelei



More information about the security-dev mailing list