Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8257923

5.1.11: Eliminate references to wrapper class constructors

    XMLWordPrintable

Details

    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.)

      Attachments

        Issue Links

          Activity

            People

              dlsmith Dan Smith
              dlsmith Dan Smith
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: