The Java standard states that concatenation of the form a + b + c + d is to be treated as though it were of the form new StringBuffer() .append( a ) .append( b ) .append( c ) .append( d ) .toString() Since StringBuffer.append() is heavily overloaded, choosing the proper method at each call is nontrivial. Fortunately, the compiler's front end already incorporates the resolution facilities we need. Code generation, then, is accomplished by constructing a tree representing the append-based expression. Carefully selected calls to front end resolution routines perform just enough static analysis on the synthetic tree so that standard code generation can subsequently be achieved. The tree itself is strongly left skewed. The root is the final call to "toString()". The root's left child is the call to "append(d)". That node's left child is the call to "append(c)", and so on. The bottommost leftmost node is the StringBuffer allocation.