RFR: 8254271: Development to deprecate wrapper class constructors for removal

Roger Riggs rriggs at openjdk.java.net
Mon Nov 2 21:20:06 UTC 2020

On Tue, 13 Oct 2020 21:40:09 GMT, Dan Smith <dlsmith at openjdk.org> wrote:

> Have you considered rephrasing the reference to constructors in the `valueOf` methods?:
> ```
>      * If a new {@code Byte} instance is not required, this method
>      * should generally be used in preference to the constructor
>      * {@link #Byte(byte)}
> ```
> The message now is "Don't use the constructors! Don't try to get a new instance!"

I think "if ... is not required" covers the case already. The behavior of Integer is not changing.
The valueOf() method is already the recommendation.


PR: https://git.openjdk.java.net/valhalla/pull/221

More information about the valhalla-dev mailing list