RFR (S): 8050114: Expose Integer/Long formatUnsigned methods internally

Mike Duigou mike.duigou at oracle.com
Fri Jul 18 21:39:28 UTC 2014


Looks good. I will complete some additional testing and push this changeset for you.

On Jul 18 2014, at 14:14 , Claes Redestad <claes.redestad at oracle.com> wrote:

> Hi,
> 
> Mike Duigou suggested some simplifications to the formatUnsigned methods. Shows a slight speed-upon some micros as well:
> 
> http://cr.openjdk.java.net/~redestad/8050114/webrev.2/
> 
> /Claes
> 
> On 2014-07-13 00:26, Claes Redestad wrote:
>> Hi,
>> 
>> please review this patch to expose formatUnsignedInt/-Long through JavaLangAccess.
>> 
>> webrev: http://cr.openjdk.java.net/~redestad/8050114/webrev.1/
>> bug: https://bugs.openjdk.java.net/browse/JDK-8050114
>> 
>> The behavior of the methods have been adjusted to be zero-padding in case the number formatted is shorter than the specified length, since that simplifies use cases for which this utility is exposed internally, e.g., JDK-8006627 <https://bugs.openjdk.java.net/browse/JDK-8006627>. Microbenchmarks show that this does not adversely affect performance of current uses through toHexString, toOctalString etc.

All of the existing users of this method pre-size their char buffer and use a zero offset so there are no changes in behaviour. (In case anyone was wondering)

Mike


More information about the core-libs-dev mailing list