Code (Pre-)Review for JEP 280: Indify String Concat

Andrej Golovnin andrej.golovnin at
Fri Nov 27 07:47:25 UTC 2015

Hi Aleksey,



The files do not have the copyright header.

And I have one stupid question to

The constants TAG_ARG and TAG_CONST are defined as Strings. From
performance standpoint of view, would it be not better to use char
instead of String?

I understand that:

if (a.contains(TAG_CONST) || a.contains(TAG_ARG))

is easier to read than:

if (a.indexOf(TAG_CONST) != -1 || a.indexOf(TAG_ARG) != -1)

But when you have a huge project to compile, maybe it can help to
reduce the compile time.

The line 330 in

330                 recipe.append("null");

Maybe it is better to rewrite it as:

330                 recipe.append((String) null);

The first one requires to copy byte values from the "null" String. The
second one ends up in the call to AsbtractStringBuilder.appendNull().

Best regards,
Andrej Golovnin

More information about the compiler-dev mailing list