String concatenation tweaks

Dawid Weiss dawid.weiss at
Thu Mar 12 08:03:10 UTC 2015

Hello. Very interesting discussion. I just wanted to observe that
while Alex's statement is an interesting theoretical debate with regard
to the specification:

> Unhappily, a call to append(..) can in general fail with OutOfMemoryError.

in reality if such a situation happens and you're running so close to
heap exhaustion then whether a method got called during string
concatenation or not is probably of small practical importance
(because the program is very likely to crash anyway, even when
concatenating/ formatting any further exception messages...). I am not
advocating to violate the spec, just trying to be realistic.


More information about the compiler-dev mailing list