Hi Peter,

thanks for looking at this!

On 2019-04-26 11:08, Peter Levart wrote:
Hi Claes,

I wonder if it is even possible to create a test that would do something like the following:

         String s = ...
         String s2 = s + "const1" + "const2" + s;

...since javac concatenates consecutive constants into a single constant. So this actually becomes:

         String s2 = s + "const1const2" + s;

...in bytecode.
<snip>
So what do you think? Is it important to test this or is it "obviously" correct?

Adding an explicit sanity test for this seems reasonable to me, since it's a case allowable by the StringConcatFactory that is not expressible
via javac:

http://cr.openjdk.java.net/~redestad/8222852/open.02/

Also cleaned up a few unused imports etc.

Thanks!

/Claes

Reply via email to