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)".
|