RFR [8042990] Optimize conversion to hex string

Ivan Gerasimov ivan.gerasimov at oracle.com
Sat Jun 14 21:00:49 UTC 2014


There is a method Integer.toHexString(int), which produce a string with 
no extra leading zeroes.
I found a couple of places in jdk, where it would be useful to have a 
variant of the method which pads the result with the required amount of 

Would you please take at the webrev?

It includes implementations of Integer.toHexString(int, int) and 
Long.toHexString(long, int) with the second argument standing for the 
minimum width of the produced string.
It also contains a few replacements of the same behaving code with calls 
to these new methods.

Sincerely yours,

More information about the core-libs-dev mailing list