hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Owen O'Malley <owen.omal...@gmail.com>
Subject Re: clearing o.a.h.io.Text
Date Fri, 01 Jan 2010 17:34:22 GMT
On Jan 1, 2010, at 2:39 AM, Kay Kay <kaykay.unique@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.


Is very clear what your intent is.

-- Owen

View raw message