test/jdk/java/lang/String/concat/ImplicitStringConcatShapes-head.template
author shade
Mon, 26 Mar 2018 20:20:45 +0200
changeset 49422 b64cd942ac7a
parent 47216 71c04702a3d5
permissions -rw-r--r--
8200241: [TESTBUG] java/lang/String/concat/ tests should not force source/target = 9 anymore Reviewed-by: redestad, psandoz
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
35388
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
     1
/*
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
     2
 * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
     4
 *
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
     7
 * published by the Free Software Foundation.
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
     8
 *
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    13
 * accompanied this code).
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    14
 *
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    18
 *
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    21
 * questions.
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    22
 */
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    23
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    24
/**
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    25
 * @test
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    26
 * @summary Test implicit String concatenations, multiple shapes.
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    27
 *
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    28
 * @compile ImplicitStringConcatShapes.java
35639
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    29
 * @run main/othervm -Xverify:all ImplicitStringConcatShapes
35388
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    30
 *
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    31
 * @compile -XDstringConcat=inline ImplicitStringConcatShapes.java
35639
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    32
 * @run main/othervm -Xverify:all ImplicitStringConcatShapes
35388
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    33
 *
49422
b64cd942ac7a 8200241: [TESTBUG] java/lang/String/concat/ tests should not force source/target = 9 anymore
shade
parents: 47216
diff changeset
    34
 * @compile -XDstringConcat=indy ImplicitStringConcatShapes.java
35388
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    35
 *
35639
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    36
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB                                                              ImplicitStringConcatShapes
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    37
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED                                                        ImplicitStringConcatShapes
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    38
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED                                                        ImplicitStringConcatShapes
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    39
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT                                                  ImplicitStringConcatShapes
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    40
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT                                                  ImplicitStringConcatShapes
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    41
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT                                              ImplicitStringConcatShapes
35388
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    42
 *
35639
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    43
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB                  -Djava.lang.invoke.stringConcat.debug=true  ImplicitStringConcatShapes
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    44
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED            -Djava.lang.invoke.stringConcat.debug=true  ImplicitStringConcatShapes
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    45
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED            -Djava.lang.invoke.stringConcat.debug=true  ImplicitStringConcatShapes
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    46
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT      -Djava.lang.invoke.stringConcat.debug=true  ImplicitStringConcatShapes
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    47
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT      -Djava.lang.invoke.stringConcat.debug=true  ImplicitStringConcatShapes
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    48
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT  -Djava.lang.invoke.stringConcat.debug=true  ImplicitStringConcatShapes
35388
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    49
 *
35639
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    50
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB                                                              -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatShapes
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    51
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED                                                        -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatShapes
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    52
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED                                                        -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatShapes
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    53
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT                                                  -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatShapes
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    54
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT                                                  -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatShapes
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    55
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT                                              -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatShapes
35388
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    56
35639
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    57
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB                  -Djava.lang.invoke.stringConcat.debug=true  -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatShapes
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    58
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED            -Djava.lang.invoke.stringConcat.debug=true  -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatShapes
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    59
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED            -Djava.lang.invoke.stringConcat.debug=true  -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatShapes
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    60
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT      -Djava.lang.invoke.stringConcat.debug=true  -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatShapes
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    61
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT      -Djava.lang.invoke.stringConcat.debug=true  -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatShapes
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    62
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT  -Djava.lang.invoke.stringConcat.debug=true  -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatShapes
35388
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    63
 *
49422
b64cd942ac7a 8200241: [TESTBUG] java/lang/String/concat/ tests should not force source/target = 9 anymore
shade
parents: 47216
diff changeset
    64
 * @compile -XDstringConcat=indyWithConstants ImplicitStringConcatShapes.java
35388
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    65
 *
35639
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    66
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB                                                              ImplicitStringConcatShapes
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    67
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED                                                        ImplicitStringConcatShapes
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    68
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED                                                        ImplicitStringConcatShapes
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    69
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT                                                  ImplicitStringConcatShapes
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    70
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT                                                  ImplicitStringConcatShapes
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    71
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT                                              ImplicitStringConcatShapes
35388
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    72
 *
35639
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    73
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB                  -Djava.lang.invoke.stringConcat.debug=true  ImplicitStringConcatShapes
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    74
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED            -Djava.lang.invoke.stringConcat.debug=true  ImplicitStringConcatShapes
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    75
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED            -Djava.lang.invoke.stringConcat.debug=true  ImplicitStringConcatShapes
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    76
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT      -Djava.lang.invoke.stringConcat.debug=true  ImplicitStringConcatShapes
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    77
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT      -Djava.lang.invoke.stringConcat.debug=true  ImplicitStringConcatShapes
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    78
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT  -Djava.lang.invoke.stringConcat.debug=true  ImplicitStringConcatShapes
35388
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    79
 *
35639
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    80
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB                                                              -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatShapes
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    81
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED                                                        -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatShapes
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    82
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED                                                        -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatShapes
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    83
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT                                                  -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatShapes
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    84
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT                                                  -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatShapes
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    85
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT                                              -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatShapes
35388
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    86
 *
35639
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    87
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB                  -Djava.lang.invoke.stringConcat.debug=true  -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatShapes
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    88
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED            -Djava.lang.invoke.stringConcat.debug=true  -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatShapes
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    89
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED            -Djava.lang.invoke.stringConcat.debug=true  -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatShapes
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    90
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT      -Djava.lang.invoke.stringConcat.debug=true  -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatShapes
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    91
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT      -Djava.lang.invoke.stringConcat.debug=true  -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatShapes
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    92
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT  -Djava.lang.invoke.stringConcat.debug=true  -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatShapes
35388
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    93
*/
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    94
public class ImplicitStringConcatShapes {
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    95
    public static void test(String expected, String actual) {
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    96
        // Fingers crossed: String concat should work.
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    97
        if (!expected.equals(actual)) {
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    98
            StringBuilder sb = new StringBuilder();
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    99
            sb.append("Expected = ");
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   100
            sb.append(expected);
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   101
            sb.append(", actual = ");
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   102
            sb.append(actual);
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   103
            throw new IllegalStateException(sb.toString());
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   104
        }
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   105
    }
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   106
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   107
    static class MyClass {
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   108
        private final int i;
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   109
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   110
        public MyClass(int i) {
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   111
            this.i = i;
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   112
        }
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   113
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   114
        public String toString() {
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   115
            return new StringBuilder("C(").append(i).append(")").toString();
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   116
        }
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   117
    }
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   118
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   119
    static class MyClassNullToString {
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   120
        public String toString() {
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   121
            return null;
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   122
        }
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   123
    }
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   124
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   125
    public static void main(String[] args) throws Exception {
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   126
        new ImplicitStringConcatShapes().run();
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   127
    }