jdk/src/share/classes/javax/swing/text/NumberFormatter.java
changeset 438 2ae294e4518c
parent 2 90ce3da70b43
child 1287 a04aca99c77a
child 715 f16baef3a20e
--- a/jdk/src/share/classes/javax/swing/text/NumberFormatter.java	Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/javax/swing/text/NumberFormatter.java	Mon Apr 07 14:53:51 2008 +0400
@@ -173,23 +173,24 @@
      */
     private Object convertValueToValueClass(Object value, Class valueClass) {
         if (valueClass != null && (value instanceof Number)) {
+            Number numberValue = (Number)value;
             if (valueClass == Integer.class) {
-                return new Integer(((Number)value).intValue());
+                return Integer.valueOf(numberValue.intValue());
             }
             else if (valueClass == Long.class) {
-                return new Long(((Number)value).longValue());
+                return Long.valueOf(numberValue.longValue());
             }
             else if (valueClass == Float.class) {
-                return new Float(((Number)value).floatValue());
+                return Float.valueOf(numberValue.floatValue());
             }
             else if (valueClass == Double.class) {
-                return new Double(((Number)value).doubleValue());
+                return Double.valueOf(numberValue.doubleValue());
             }
             else if (valueClass == Byte.class) {
-                return new Byte(((Number)value).byteValue());
+                return Byte.valueOf(numberValue.byteValue());
             }
             else if (valueClass == Short.class) {
-                return new Short(((Number)value).shortValue());
+                return Short.valueOf(numberValue.shortValue());
             }
         }
         return value;