Use StringBuilder in java.util.Matcher
dmdabbs at gmail.com
Thu Jul 29 12:20:12 PDT 2010
Changing the signature to AbstractStringBuilder would make it compatible
abstract class: AbstractStringBuilder [javadoc | source]
Direct Known Subclasses:
From: nio-dev-bounces at openjdk.java.net
[mailto:nio-dev-bounces at openjdk.java.net] On Behalf Of ibrahim CHAEHOI
Sent: Thursday, July 29, 2010 1:50 PM
To: nio-dev at openjdk.java.net
Subject: Use StringBuilder in java.util.Matcher
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
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.
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.851 / Virus Database: 271.1.1/3035 - Release Date: 07/29/10
More information about the jdk7-dev