A DESCRIPTION OF THE REQUEST :
AbstractBuilder is an excellent basis for an efficient growable String class, but it is package-private.
Please either:
a) make AbstractStringBuilder public, OR
b) provide a concrete sub-class of AbstractStringBuilder that provides a char[] getCharArray() method that allows direct access to the char[] array (clearly StringBuffer cannot fulfill this need as it would violate it's contract)
Option a) requires no work, does not break any contracts within the JDK and allows developers who need performance to leverage it.
JUSTIFICATION :
Java's core value classes are justly careful about synchronization and state protection, but there should be efficient alternatives.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Need a means to use or create a sub-class of AbstractStringBuilder that provides access to it's internal char[] value.
CUSTOMER SUBMITTED WORKAROUND :
Violate Sun's copyright and duplicate the source code of AbstractStringBuilder (not viable).
AbstractBuilder is an excellent basis for an efficient growable String class, but it is package-private.
Please either:
a) make AbstractStringBuilder public, OR
b) provide a concrete sub-class of AbstractStringBuilder that provides a char[] getCharArray() method that allows direct access to the char[] array (clearly StringBuffer cannot fulfill this need as it would violate it's contract)
Option a) requires no work, does not break any contracts within the JDK and allows developers who need performance to leverage it.
JUSTIFICATION :
Java's core value classes are justly careful about synchronization and state protection, but there should be efficient alternatives.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Need a means to use or create a sub-class of AbstractStringBuilder that provides access to it's internal char[] value.
CUSTOMER SUBMITTED WORKAROUND :
Violate Sun's copyright and duplicate the source code of AbstractStringBuilder (not viable).