<AWT Dev> RFR 8154213: clean up uses of boxed primitive constructors in the java.desktop module

Phil Race philip.race at oracle.com
Fri Apr 22 18:06:40 UTC 2016

Bug: https://bugs.openjdk.java.net/browse/JDK-8154213
Webrev: http://cr.openjdk.java.net/~prr/8154213/

https://bugs.openjdk.java.net/browse/JDK-8145468 has caused
the following constructors usages to be deprecated :
new Long(long) and new Integer(String)
new Integer(int) and new Integer(String)
new Float(int) and new Float(String)
new Double(int) and new Double(String)
new Character(char)

The deprecations warnings were suppressed for the java.desktop module.

This fix changes all uses in the java.desktop module to use Foo.valueOf(..)
or in a few cases where we directly assign to a variable use auto-boxing.

Additionally doc comments that use constructors were updated.

Finally the deprecation suppression was removed.

JPRT has been used to verify the build and I have run through the
various affected Swing L&Fs using SwingSet as a sanity check.

I do not have any information on the performance difference (benefits or 
of this change but I did not see any usage in java.desktop that appears 
to be
remotely performance critical.


More information about the awt-dev mailing list