src/share/classes/java/lang/Short.java
Print this page
*** 168,178 ****
* @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));
}
/**
* Returns a {@code Short} object holding the
* value given by the specified {@code String}. The argument
--- 168,178 ----
* @throws NumberFormatException If the {@code String} does
* not contain a parsable {@code short}.
*/
public static Short valueOf(String s, int radix)
throws NumberFormatException {
! return valueOf(parseShort(s, radix));
}
/**
* Returns a {@code Short} object holding the
* value given by the specified {@code String}. The argument
*** 280,290 ****
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;
}
/**
* The value of the {@code Short}.
*
--- 280,290 ----
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 valueOf((short)i);
}
/**
* The value of the {@code Short}.
*
*** 377,387 ****
*
* @return a string representation of the value of this object in
* base 10.
*/
public String toString() {
! return String.valueOf((int)value);
}
/**
* Returns a hash code for this {@code Short}; equal to the result
* of invoking {@code intValue()}.
--- 377,387 ----
*
* @return a string representation of the value of this object in
* base 10.
*/
public String toString() {
! return Integer.toString((int)value);
}
/**
* Returns a hash code for this {@code Short}; equal to the result
* of invoking {@code intValue()}.