Apr
29th
Wed
29th
Java Concurrency and Volatile - all that jazz
Seems like bad semantics to me. A mutable object should not be copied and become immutable without an instruction to do so. This is an optimisation and thus shouldn’t be the default.
The variable str(which is a copy in the new thread) would be existing in a scope that it hasn’t been declared for. wtf?