JDK 17 | JDK 19 | JDK 8 |
---|---|---|
17.0.14-oracleResolved | 19Resolved | 8u441-perfResolved |
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")); ```