< prev index next >
src/java.base/share/classes/java/lang/Long.java
Print this page
rev 14117 : 8145468: update java.lang APIs with new deprecations
Reviewed-by: XXX
*** 1338,1348 ****
--- 1338,1354 ----
* Constructs a newly allocated {@code Long} object that
* represents the specified {@code long} argument.
*
* @param value the value to be represented by the
* {@code Long} object.
+ *
+ * @deprecated
+ * It is rarely appropriate to use this constructor. The static factory
+ * {@link #valueOf(long)} is generally a better choice, as it is
+ * likely to yield significantly better space and time performance.
*/
+ @Deprecated(since="9")
public Long(long value) {
this.value = value;
}
/**
*** 1354,1365 ****
*
* @param s the {@code String} to be converted to a
* {@code Long}.
* @throws NumberFormatException if the {@code String} does not
* contain a parsable {@code long}.
! * @see java.lang.Long#parseLong(java.lang.String, int)
*/
public Long(String s) throws NumberFormatException {
this.value = parseLong(s, 10);
}
/**
--- 1360,1377 ----
*
* @param s the {@code String} to be converted to a
* {@code Long}.
* @throws NumberFormatException if the {@code String} does not
* contain a parsable {@code long}.
! *
! * @deprecated
! * It is rarely appropriate to use this constructor.
! * Use {@link #parseLong(String)} to convert a string to a
! * {@code long} primitive, or use {@link #valueOf(String)}
! * to convert a string to a {@code Long} object.
*/
+ @Deprecated(since="9")
public Long(String s) throws NumberFormatException {
this.value = parseLong(s, 10);
}
/**
< prev index next >