I don't think the compiler is awesome at this, unfortunately. In Effective Java 2nd Edition [Joshua Bloch](http://en.wikipedia.org/wiki/Joshua_Bloch) specifically calls this out as [Item 51: Beware the performance of string concatenation](http://my.safaribooksonline.com/book/programming/java/9780137150021/general-programming/ch08lev1sec7). Bloch writes, "To achieve acceptable performance, use a StringBuilder in place of a String to store the statement under construction... don’t use the string concatenation operator to combine more than a few strings unless performance is irrelevant. Use StringBuilder’s append method instead. Alternatively, use a character array, or process the strings one at a time instead of combining them."

That being said, we probably don't need to optimize this particular bit of code.