On Tue, 10 Jan 2023 18:02:22 GMT, Justin Lu <d...@openjdk.org> wrote:
>> The javadocs of the following methods used deprecated constructors of the >> primitive wrapper classes: >> >> java.lang.ArrayStoreException >> java.lang.ClassCastException >> java.lang.Double.compare(double, double) >> java.lang.Float.compare(float, float) >> java.lang.Integer.getInteger(String, int) >> java.lang.Integer.valueOf(String) >> java.lang.Integer.valueOf(String, int) >> java.lang.Long.getLong(String, long) >> java.lang.Long.valueOf(String) >> java.lang.Long.valueOf(String, int) >> java.lang.Short.valueOf(String) >> java.lang.Short.valueOf(String, int) >> >> This change replaces the constructors with .valueOf() methods except >> java.lang.ClassCastException which was already fixed in JDK-8289730 > > Justin Lu has updated the pull request incrementally with one additional > commit since the last revision: > > Include Byte in changes The code is used to show for example `getInteger(String nm, int val)` is equivalent to calling `getInteger(nm, Integer.valueOf(val))`. I agree with Justin that it's clearer to use the `valueOf` methods. In fact, `getInteger(String nam, int val)` example can't be represented with autoboxing. ------------- PR: https://git.openjdk.org/jdk/pull/11912