Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8273914 Indy string concat changes order of operations
  3. JDK-8279866

Release Note: Indy String Concat Changes Order of Operations

    XMLWordPrintable

Details

    • Sub-task
    • Resolution: Delivered
    • P3
    • 19
    • 19
    • tools

    Description

      String concatenation has been changed to evaluate each argument and eagerly convert it to a string, in left-to-right order. This fixes a bug in the invokedynamic-based string concatentation strategies introduced in [JEP 280](http://openjdk.java.net/jeps/280).

      For example, the following now prints `"foofoobar"`, not `"foobarfoobar"`:

      ```
          StringBuilder builder = new StringBuilder("foo");
          System.err.println("" + builder + builder.append("bar"));
      ```

      Attachments

        Activity

          People

            cushon Liam Miller-Cushon
            cushon Liam Miller-Cushon
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: