JDK-8257923 : 5.1.11: Eliminate references to wrapper class constructors
  • Type: Bug
  • Component: specification
  • Sub-Component: language
  • Affected Version: 16
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2020-12-08
  • Updated: 2021-05-28
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbd_majorUnresolved
Related Reports
Relates :  
Description
5.1.11 defines _string conversion_ for primitive types in terms of a wrapper class constructor call followed by a 'toString' call.

The wrapper class constructors are now deprecated for removal, and JLS should not depend on them. Note that their use is incidental: the behavior of string conversion does not depend on the identities of its intermediate results, and `javac` does not, in fact, call them. (It used to use specialized StringBuilder.append methods; now it uses StringConcatFactory.makeConcatWithConstants with a specialized descriptor.)

Suggested alternative: define string conversions (5.1.11) only for reference types; then allow string contexts (5.4) to apply boxing conversion before string conversion. (Why not include boxing in 5.1.11? Well, that's not really the intent of 5.1, which defines a number of independent small operations that can be combined in different contexts.)