I've been working with StringBuffers a lot and have found some pretty scary stuff.
Don't know if these are bugs or now.
Apparently, the "pointer" inside the StringBuffer which holds the actually text field can go out of scope and disappear, even though the StringBuffer is still around. The interpreter reassigns the internal memory to null, and you lose your contents when you return to the caller.
Ugly! You have to use functions like replace to avoid the problem.
Is this a bug? Me thinks so...
Glen Austin