RFR: JDK-8273914: Indy string concat changes order of operations.

Rémi Forax forax at openjdk.java.net
Wed Oct 6 21:42:06 UTC 2021


On Wed, 6 Oct 2021 21:00:04 GMT, Liam Miller-Cushon <cushon at openjdk.org> wrote:

> This change makes string concatenation call `toString` on the arguments eagerly, to preserve the correct evaluation order of the arguments and the calls to `toString`.

src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/StringConcat.java line 313:

> 311:          * possible side-effects.
> 312:          */
> 313:         protected boolean shouldConvertToStringEagerly(Type argType) {

For me the implementation should be neither a primitive type nor a final class of java.lang. I think that at least the wrappers should not be converted eagerly

-------------

PR: https://git.openjdk.java.net/jdk/pull/5844


More information about the hotspot-runtime-dev mailing list