From dathompson at gmail.com Sun Mar 2 22:41:50 2025 From: dathompson at gmail.com (Adam Thompson) Date: Sun, 2 Mar 2025 18:41:50 -0400 Subject: Primitive wrapper constructors in JLS Message-ID: 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(). From gavin.bierman at oracle.com Fri Mar 7 09:45:30 2025 From: gavin.bierman at oracle.com (Gavin Bierman) Date: Fri, 7 Mar 2025 09:45:30 +0000 Subject: Primitive wrapper constructors in JLS In-Reply-To: References: Message-ID: <474C15D4-0771-4D8B-AA62-DEF7564E470C@oracle.com> 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 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().