Primitive wrapper constructors in JLS

Adam Thompson dathompson at gmail.com
Sun Mar 2 22:41:50 UTC 2025


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