CVSROOT: /sources/classpath Module name: classpath Changes by: Ian Rogers <irogers> 08/04/18 21:00:12
Modified files: . : ChangeLog java/lang : Byte.java Character.java Double.java Float.java Integer.java Long.java Short.java Log message: 2008-04-18 Ian Rogers <[EMAIL PROTECTED]> * java/lang/Byte.java (static): initialize byteCache. (valueOf(String,int)): use valueOf(byte) rather than new. (valueOf(String)): likewise. (valueOf(byte)): Switch from lazy initialization of cached values to initialization at class initialization time. This removes the need for synchronization in the common case. (decode): use valueOf(byte) rather than new. * java/lang/Character.java (static): initialize charCache. (valueOf): Switch from lazy initialization of cached values to initialization at class initialization time. This removes the need for synchronization in the common case. * java/lang/Double.java (ZERO): new private field. (ONE): likewise. (valueOf(double)): don't create new doubles for the case of 0 and 1. (valueOf(String)): use valueOf(double) rather than new. (equals): use raw bits for comparison to avoid division. * java/lang/Float.java (ZERO): new private field. (ONE): likewise. (valueOf(float)): don't create new floats for the case of 0 and 1. (valueOf(String)): use valueOf(float) rather than new. (equals): use raw bits for comparison to avoid division. * java/lang/Integer.java (static): initialize intCache. (stringSize): new private method to estimate size of string for an int. (toString): reuse digits for single character strings, for multiple character strings estimate their length using string size method. (valueOf(String,int)): use valueOf(int) rather than new. (valueOf(String)): likewise. (valueOf(int)): Switch from lazy initialization of cached values to initialization at class initialization time. This removes the need for synchronization in the common case. (getInteger): use valueOf(int) rather than new. (decode): use valueOf(int) rather than new. (signum): use shift and subtract to compute value. (toUnsignedString): calculate string size rather than using 32 chars. * java/lang/Long.java (longCache): new private field. (stringSize): new private method to estimate size of string for a long. (toString): reuse digits for single character strings, for multiple character strings estimate their length using string size method. (valueOf(String,int)): use valueOf(long) rather than new. (valueOf(String)): likewise. (valueOf(long)): use cache of values. (decode): use valueOf(long) rather than new. (signum): use shift and subtract to compute value. (toUnsignedString): calculate string size rather than using 64 chars. * java/lang/Short.java (static): initialize shortCache. (valueOf(String,int)): use valueOf(short) rather than new. (valueOf(String)): likewise. (valueOf(short)): Switch from lazy initialization of cached values to initialization at class initialization time. This removes the need for synchronization in the common case. (decode): use valueOf(short) rather than new. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpath&r1=1.9577&r2=1.9578 http://cvs.savannah.gnu.org/viewcvs/classpath/java/lang/Byte.java?cvsroot=classpath&r1=1.26&r2=1.27 http://cvs.savannah.gnu.org/viewcvs/classpath/java/lang/Character.java?cvsroot=classpath&r1=1.48&r2=1.49 http://cvs.savannah.gnu.org/viewcvs/classpath/java/lang/Double.java?cvsroot=classpath&r1=1.45&r2=1.46 http://cvs.savannah.gnu.org/viewcvs/classpath/java/lang/Float.java?cvsroot=classpath&r1=1.39&r2=1.40 http://cvs.savannah.gnu.org/viewcvs/classpath/java/lang/Integer.java?cvsroot=classpath&r1=1.36&r2=1.37 http://cvs.savannah.gnu.org/viewcvs/classpath/java/lang/Long.java?cvsroot=classpath&r1=1.25&r2=1.26 http://cvs.savannah.gnu.org/viewcvs/classpath/java/lang/Short.java?cvsroot=classpath&r1=1.20&r2=1.21