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

[TESTBUG] String concat tests should test toString() application order

    Details

      Backports

        Description

        This issue covers the potential issue with MH_* strategies in StringConcatFactory that may end up calling toString() on arguments in wrong order. Non MH-strategies appear fine. See the evidence in the wild here:
          https://www.guardsquare.com/en/blog/string-concatenation-java-9-conversion-confusion

        This issue adds the relevant test for String concatenation. JDK 10 fails this new test. JDK 11+ passes the test, because the actual bug is JDK-8194554, which is fixed. In other words, StringConcatFactory implementation is actually correct, and it expects filterArguments to run in the specified order. Selectively applying fix from JDK-8194554 to JDK 10 makes it pass.


          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  shade Aleksey Shipilev
                  Reporter:
                  shade Aleksey Shipilev
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: