I don't understand something: > stringCache = sc = layoutChars(true); How does this assign an uninitialized String to stringCache? I thought String is immutable and the String object is fully calculated at assignment? Where is the StringBuilder used when stringCache and sc are objects of type "String?" Shouldn't the "problem" be that two threads might call layoutChars at the same time, leading to some extra CPU cycle…
1. https://docs.oracle.com/javase/specs/jls/se7/html/jls-17.htm...