JDK 9 RFR of JDK-8067289 (XS): Fix deprecation warnings in java.base module - CRC32C

Staffan Friberg staffan.friberg at oracle.com
Fri Dec 12 01:25:24 UTC 2014


Hi Joe,

Good point. Updated webrev, 
http://cr.openjdk.java.net/~sfriberg/JDK-8067289/webrev.01

Regards,
Staffan

On 12/11/2014 11:23 AM, joe darcy wrote:
> Hi Staffan,
>
> I haven't examined the code for possible integer overflow cases, but 
> it would be fundamentally safer if the values were promoted to long 
> *before* the arithmetic rather than after. In other words, instead of
>
>     (long)(Unsafe.ARRAY_BYTE_BASE_OFFSET + off) // Overflow 
> theoretically possible
>
> use
>
>     (long)Unsafe.ARRAY_BYTE_BASE_OFFSET + off // No overflow worries 
> with int inputs
>
> -Joe
>
> On 12/11/2014 11:19 AM, Staffan Friberg wrote:
>> Hi,
>>
>> Here is a small fix that avoids calling deprecated sun.misc.Unsafe 
>> methods, which allows the @SuppressWarnings to be removed.
>>
>> Bug: https://bugs.openjdk.java.net/browse/JDK-8067289
>> Webrev: http://cr.openjdk.java.net/~sfriberg/JDK-8067289/webrev.00
>>
>> Regards,
>> Staffan
>




More information about the core-libs-dev mailing list