8145468: update java.lang APIs with new deprecations

Reviewed-by: alanb, psandoz, lancea, forax, scolebourne, chegar, martin
This commit is contained in:
Stuart Marks 2016-04-18 14:10:14 -07:00
parent 78ca5988bc
commit ba908a9037
32 changed files with 211 additions and 106 deletions

View file

@ -502,7 +502,13 @@ public final class Float extends Number implements Comparable<Float> {
* represents the primitive {@code float} argument.
*
* @param value the value to be represented by the {@code Float}.
*
* @deprecated
* It is rarely appropriate to use this constructor. The static factory
* {@link #valueOf(float)} is generally a better choice, as it is
* likely to yield significantly better space and time performance.
*/
@Deprecated(since="9")
public Float(float value) {
this.value = value;
}
@ -512,7 +518,13 @@ public final class Float extends Number implements Comparable<Float> {
* represents the argument converted to type {@code float}.
*
* @param value the value to be represented by the {@code Float}.
*
* @deprecated
* It is rarely appropriate to use this constructor. Instead, use the
* static factory method {@link #valueOf(float)} method as follows:
* {@code Float.valueOf((float)value)}.
*/
@Deprecated(since="9")
public Float(double value) {
this.value = (float)value;
}
@ -523,11 +535,17 @@ public final class Float extends Number implements Comparable<Float> {
* represented by the string. The string is converted to a
* {@code float} value as if by the {@code valueOf} method.
*
* @param s a string to be converted to a {@code Float}.
* @throws NumberFormatException if the string does not contain a
* parsable number.
* @see java.lang.Float#valueOf(java.lang.String)
* @param s a string to be converted to a {@code Float}.
* @throws NumberFormatException if the string does not contain a
* parsable number.
*
* @deprecated
* It is rarely appropriate to use this constructor.
* Use {@link #parseFloat(String)} to convert a string to a
* {@code float} primitive, or use {@link #valueOf(String)}
* to convert a string to a {@code Float} object.
*/
@Deprecated(since="9")
public Float(String s) throws NumberFormatException {
value = parseFloat(s);
}