Javac string folding implemented in the parser could use some improvements. Currently, given a concat of the kind:
String1 + String2 + String3 ..... + StringN
This is either left untouched (if there's an X such that StringX is not a literal) or it is all folded into a single StringRes.
A better implementation would be to generalize this to have folding to return:
StringRes1 + StringRes2 + .... StringResM
Where some of the expressions in the result are the concatenation of some of the original input strings, while some other expressions are left alone (i.e. the ones that are not ident). In chronic cases like the one in this bug, this should allow for quite a big boost (as the identifiers are only used once and in close proximity).