Primitive wrapper constructors in JLS

Gavin Bierman gavin.bierman at oracle.com
Fri Mar 7 09:45:30 UTC 2025


Hi Adam,

Yes, good spot. I’ll action that. The 24 editions are already delivered, so this won’t appear until the 25 edition I’m afraid.

Many thanks for your interest in the specs!

Gavin

> On 2 Mar 2025, at 22:41, Adam Thompson <dathompson at gmail.com> wrote:
> 
> I've noticed that the JLS is still using the constructors of primitive
> wrappers in a few places. As these are deprecated for removal, I think
> they should be removed from the JLS.
> 
> 5.1.1.1 String conversion
> Uses wrapper constructors to define how primitives are converted into
> strings. "class instance creation expression" is the term for
> constructors, so just changing the code expressions to valueOf() is
> not enough.
> 
> 8.1.2
> Uses Integer and Double constructors in examples. Easy to change to valueOf().



More information about the jls-jvms-spec-comments mailing list