Skip to content

Commit 0c2ef39

Browse files
author
Roger Riggs
committed
8254271: Development to deprecate wrapper class constructors for removal
Reviewed-by: mchung
1 parent 2ac97b2 commit 0c2ef39

File tree

21 files changed

+115
-49
lines changed

21 files changed

+115
-49
lines changed

src/java.base/share/classes/java/lang/Boolean.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public final class Boolean implements java.io.Serializable,
9999
* Also consider using the final fields {@link #TRUE} and {@link #FALSE}
100100
* if possible.
101101
*/
102-
@Deprecated(since="9")
102+
@Deprecated(since="9", forRemoval = true)
103103
public Boolean(boolean value) {
104104
this.value = value;
105105
}
@@ -119,7 +119,7 @@ public Boolean(boolean value) {
119119
* {@code boolean} primitive, or use {@link #valueOf(String)}
120120
* to convert a string to a {@code Boolean} object.
121121
*/
122-
@Deprecated(since="9")
122+
@Deprecated(since="9", forRemoval = true)
123123
public Boolean(String s) {
124124
this(parseBoolean(s));
125125
}

src/java.base/share/classes/java/lang/Byte.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ public static Byte decode(String nm) throws NumberFormatException {
338338
* {@link #valueOf(byte)} is generally a better choice, as it is
339339
* likely to yield significantly better space and time performance.
340340
*/
341-
@Deprecated(since="9")
341+
@Deprecated(since="9", forRemoval = true)
342342
public Byte(byte value) {
343343
this.value = value;
344344
}
@@ -361,7 +361,7 @@ public Byte(byte value) {
361361
* {@code byte} primitive, or use {@link #valueOf(String)}
362362
* to convert a string to a {@code Byte} object.
363363
*/
364-
@Deprecated(since="9")
364+
@Deprecated(since="9", forRemoval = true)
365365
public Byte(String s) throws NumberFormatException {
366366
this.value = parseByte(s, 10);
367367
}

src/java.base/share/classes/java/lang/Character.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8502,7 +8502,7 @@ public static final UnicodeScript forName(String scriptName) {
85028502
* {@link #valueOf(char)} is generally a better choice, as it is
85038503
* likely to yield significantly better space and time performance.
85048504
*/
8505-
@Deprecated(since="9")
8505+
@Deprecated(since="9", forRemoval = true)
85068506
public Character(char value) {
85078507
this.value = value;
85088508
}

src/java.base/share/classes/java/lang/Double.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ public static boolean isFinite(double d) {
606606
* {@link #valueOf(double)} is generally a better choice, as it is
607607
* likely to yield significantly better space and time performance.
608608
*/
609-
@Deprecated(since="9")
609+
@Deprecated(since="9", forRemoval = true)
610610
public Double(double value) {
611611
this.value = value;
612612
}
@@ -627,7 +627,7 @@ public Double(double value) {
627627
* {@code double} primitive, or use {@link #valueOf(String)}
628628
* to convert a string to a {@code Double} object.
629629
*/
630-
@Deprecated(since="9")
630+
@Deprecated(since="9", forRemoval = true)
631631
public Double(String s) throws NumberFormatException {
632632
value = parseDouble(s);
633633
}

src/java.base/share/classes/java/lang/Float.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ public static boolean isFinite(float f) {
519519
* {@link #valueOf(float)} is generally a better choice, as it is
520520
* likely to yield significantly better space and time performance.
521521
*/
522-
@Deprecated(since="9")
522+
@Deprecated(since="9", forRemoval = true)
523523
public Float(float value) {
524524
this.value = value;
525525
}
@@ -535,7 +535,7 @@ public Float(float value) {
535535
* static factory method {@link #valueOf(float)} method as follows:
536536
* {@code Float.valueOf((float)value)}.
537537
*/
538-
@Deprecated(since="9")
538+
@Deprecated(since="9", forRemoval = true)
539539
public Float(double value) {
540540
this.value = (float)value;
541541
}
@@ -556,7 +556,7 @@ public Float(double value) {
556556
* {@code float} primitive, or use {@link #valueOf(String)}
557557
* to convert a string to a {@code Float} object.
558558
*/
559-
@Deprecated(since="9")
559+
@Deprecated(since="9", forRemoval = true)
560560
public Float(String s) throws NumberFormatException {
561561
value = parseFloat(s);
562562
}

src/java.base/share/classes/java/lang/Integer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,7 +1086,7 @@ public static Integer valueOf(int i) {
10861086
* {@link #valueOf(int)} is generally a better choice, as it is
10871087
* likely to yield significantly better space and time performance.
10881088
*/
1089-
@Deprecated(since="9")
1089+
@Deprecated(since="9", forRemoval = true)
10901090
public Integer(int value) {
10911091
this.value = value;
10921092
}
@@ -1108,7 +1108,7 @@ public Integer(int value) {
11081108
* {@code int} primitive, or use {@link #valueOf(String)}
11091109
* to convert a string to an {@code Integer} object.
11101110
*/
1111-
@Deprecated(since="9")
1111+
@Deprecated(since="9", forRemoval = true)
11121112
public Integer(String s) throws NumberFormatException {
11131113
this.value = parseInt(s, 10);
11141114
}

src/java.base/share/classes/java/lang/Long.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1317,7 +1317,7 @@ else if (nm.startsWith("0", index) && nm.length() > 1 + index) {
13171317
* {@link #valueOf(long)} is generally a better choice, as it is
13181318
* likely to yield significantly better space and time performance.
13191319
*/
1320-
@Deprecated(since="9")
1320+
@Deprecated(since="9", forRemoval = true)
13211321
public Long(long value) {
13221322
this.value = value;
13231323
}
@@ -1340,7 +1340,7 @@ public Long(long value) {
13401340
* {@code long} primitive, or use {@link #valueOf(String)}
13411341
* to convert a string to a {@code Long} object.
13421342
*/
1343-
@Deprecated(since="9")
1343+
@Deprecated(since="9", forRemoval = true)
13441344
public Long(String s) throws NumberFormatException {
13451345
this.value = parseLong(s, 10);
13461346
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ public static Short decode(String nm) throws NumberFormatException {
343343
* {@link #valueOf(short)} is generally a better choice, as it is
344344
* likely to yield significantly better space and time performance.
345345
*/
346-
@Deprecated(since="9")
346+
@Deprecated(since="9", forRemoval = true)
347347
public Short(short value) {
348348
this.value = value;
349349
}
@@ -366,7 +366,7 @@ public Short(short value) {
366366
* {@code short} primitive, or use {@link #valueOf(String)}
367367
* to convert a string to a {@code Short} object.
368368
*/
369-
@Deprecated(since="9")
369+
@Deprecated(since="9", forRemoval = true)
370370
public Short(String s) throws NumberFormatException {
371371
this.value = parseShort(s, 10);
372372
}

src/java.base/share/classes/java/lang/invoke/MemberName.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ public MemberName getDefinition() {
773773
}
774774

775775
@Override
776-
@SuppressWarnings("deprecation")
776+
@SuppressWarnings({"deprecation", "removal"})
777777
public int hashCode() {
778778
// Avoid autoboxing getReferenceKind(), since this is used early and will force
779779
// early initialization of Byte$ByteCache

src/java.management.rmi/share/classes/javax/management/remote/rmi/RMIConnectionImpl_Stub.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,10 @@ public javax.management.ObjectInstance createMBean(java.lang.String $param_Strin
258258
public javax.management.remote.NotificationResult fetchNotifications(long $param_long_1, int $param_int_2, long $param_long_3)
259259
throws java.io.IOException {
260260
try {
261-
Object $result = ref.invoke(this, $method_fetchNotifications_7, new java.lang.Object[]{new java.lang.Long($param_long_1), new java.lang.Integer($param_int_2), new java.lang.Long($param_long_3)}, -5037523307973544478L);
261+
Object $result = ref.invoke(this, $method_fetchNotifications_7,
262+
new java.lang.Object[]{java.lang.Long.valueOf($param_long_1),
263+
java.lang.Integer.valueOf($param_int_2),
264+
java.lang.Long.valueOf($param_long_3)}, -5037523307973544478L);
262265
return ((javax.management.remote.NotificationResult) $result);
263266
} catch (java.lang.RuntimeException e) {
264267
throw e;

0 commit comments

Comments
 (0)