mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8145468: update java.lang APIs with new deprecations
Reviewed-by: alanb, psandoz, lancea, forax, scolebourne, chegar, martin
This commit is contained in:
parent
78ca5988bc
commit
ba908a9037
32 changed files with 211 additions and 106 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue