/[Apache-SVN]
ViewVC logotype

Revision 1153490


Jump to revision: Previous Next
Author: ggregory
Date: Wed Aug 3 13:53:35 2011 UTC (13 years, 3 months ago)
Changed paths: 13
Log Message:
Use internal Java's Number caches instead creating new objects:

- Use more efficient Integer cache: Use "Integer.valueOf(int)" instead of "new Integer(int)".
- Use more efficient Long cache: Use "Long.valueOf(int)" instead of "new Long(long)".
- Use more efficient Short cache: Use "Short.valueOf(int)" instead of "new Short(short)".

In Java version 1.6.0_24 (vendor: Sun Microsystems Inc.), Float and Double do not implement caches, but I've made the same changes for consistency and future proofing.

- Use "Double.valueOf(int)" instead of "new Double(double)".
- Use "Float.valueOf(int)" instead of "new Float(float)".

Changed paths

Path Details
Directorycommons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ArrayUtils.java modified , text changed
Directorycommons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/Validate.java modified , text changed
Directorycommons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/math/NumberUtils.java modified , text changed
Directorycommons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/mutable/MutableDouble.java modified , text changed
Directorycommons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/mutable/MutableFloat.java modified , text changed
Directorycommons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ArrayUtilsAddTest.java modified , text changed
Directorycommons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ArrayUtilsTest.java modified , text changed
Directorycommons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java modified , text changed
Directorycommons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/mutable/MutableDoubleTest.java modified , text changed
Directorycommons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/mutable/MutableFloatTest.java modified , text changed
Directorycommons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/mutable/MutableObjectTest.java modified , text changed
Directorycommons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/FieldUtilsTest.java modified , text changed
Directorycommons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/text/ExtendedMessageFormatTest.java modified , text changed

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26