src/share/classes/java/lang/Short.java

Print this page

        

@@ -168,11 +168,11 @@
      * @throws          NumberFormatException If the {@code String} does
      *                  not contain a parsable {@code short}.
      */
     public static Short valueOf(String s, int radix)
         throws NumberFormatException {
-        return new Short(parseShort(s, radix));
+        return valueOf(parseShort(s, radix));
     }
 
     /**
      * Returns a {@code Short} object holding the
      * value given by the specified {@code String}. The argument

@@ -280,11 +280,11 @@
     public static Short decode(String nm) throws NumberFormatException {
         int i = Integer.decode(nm);
         if (i < MIN_VALUE || i > MAX_VALUE)
             throw new NumberFormatException(
                     "Value " + i + " out of range from input " + nm);
-        return (short)i;
+        return valueOf((short)i);
     }
 
     /**
      * The value of the {@code Short}.
      *

@@ -377,11 +377,11 @@
      *
      * @return  a string representation of the value of this object in
      *          base&nbsp;10.
      */
     public String toString() {
-        return String.valueOf((int)value);
+        return Integer.toString((int)value);
     }
 
     /**
      * Returns a hash code for this {@code Short}; equal to the result
      * of invoking {@code intValue()}.