On Jan 1, 2010, at 2:39 AM, Kay Kay <kaykay.uni...@gmail.com> wrote:
I believe that behavior would be surprising to the user if they were
expecting the object resources to be released entirely, by calling the
clear() method.
I disagree. Clear only promises to reset to the empty string. It
doesn't imply freeing resources.
May be - clear() can reset the internal byte buffer and another method
provided - called reset() / rewind() that can reuse the existing
internal
buffer while resetting the length variable only.
Changing semantics of Text methods is very difficult. Clear is exactly
the right verb for what it does. A patch that makes the Javadoc clear
would be appriciated.
Once we have setCapacity, a lot of these issues go away.
txt.setCapacity(0)
Is very clear what your intent is.
-- Owen