Use StringBuilder in java.util.Matcher
ibrahim CHAEHOI
ichaehoi at gmail.com
Thu Jul 29 11:49:44 PDT 2010
Hi all,
I'm not sure if it's the right mailing list to post this question,
if it's not the case please let me know what is the proper mailing
list to post this question.
I just would like to know if there is any reason why the
appendReplacement method in java.util.Matcher API is only using
StringBuffer.
Would it be possible to add 2 new methods appendReplacement and
appendTail which use a StringBuilder instead of a StringBuffer?
public Matcher appendReplacement(StringBuilder sb, String replacement);
public StringBuilder appendTail(StringBuilder sb, String replacement);
The StringBuilder was introduce in Java 5 as an optimized version of
the StringBuffer, when the synchronization is not necessary,
and I'm a bit surprised that the Matcher API doesn't provide a method
which use a StringBuilder.
Cheers,
More information about the nio-dev
mailing list