use StringBuilder rather than StringBuffer

git-svn-id: https://svn.apache.org/repos/asf/maven/plugin-tools/trunk@1338289 13f79535-47bb-0310-9956-ffa450edef68
master
Olivier Lamy 2012-05-14 16:53:36 +00:00
parent a500a70267
commit 5dd3ecc698
5 changed files with 14 additions and 14 deletions

View File

@ -531,7 +531,7 @@ public class PluginReport
text( getBundle( locale ).getString( "report.plugin.usage.intro" ) ); text( getBundle( locale ).getString( "report.plugin.usage.intro" ) );
sink.paragraph_(); sink.paragraph_();
StringBuffer sb = new StringBuffer(); StringBuilder sb = new StringBuilder();
sb.append( "<project>" ).append( '\n' ); sb.append( "<project>" ).append( '\n' );
sb.append( " ..." ).append( '\n' ); sb.append( " ..." ).append( '\n' );
sb.append( " <build>" ).append( '\n' ); sb.append( " <build>" ).append( '\n' );

View File

@ -155,7 +155,7 @@ public final class GeneratorUtils
return s; return s;
} }
StringBuffer sb = new StringBuffer(); StringBuilder sb = new StringBuilder();
for ( int i = 0; i < s.length(); i++ ) for ( int i = 0; i < s.length(); i++ )
{ {
char c = s.charAt( i ); char c = s.charAt( i );
@ -326,7 +326,7 @@ public final class GeneratorUtils
return ""; return "";
} }
final StringBuffer sb = new StringBuffer(); final StringBuilder sb = new StringBuilder();
HTMLEditorKit.Parser parser = new ParserDelegator(); HTMLEditorKit.Parser parser = new ParserDelegator();
HTMLEditorKit.ParserCallback htmlCallback = new MojoParserCallback( sb ); HTMLEditorKit.ParserCallback htmlCallback = new MojoParserCallback( sb );
@ -393,12 +393,12 @@ public final class GeneratorUtils
/** /**
* The current buffer. * The current buffer.
*/ */
private final StringBuffer sb; private final StringBuilder sb;
/** /**
* @param sb not null * @param sb not null
*/ */
public MojoParserCallback( StringBuffer sb ) public MojoParserCallback( StringBuilder sb )
{ {
this.sb = sb; this.sb = sb;
} }

View File

@ -125,7 +125,7 @@ public class HelpMojo
// FIXME encoding as parameter // FIXME encoding as parameter
Xpp3Dom pluginElement = build(); Xpp3Dom pluginElement = build();
StringBuffer sb = new StringBuffer(); StringBuilder sb = new StringBuilder();
/** /**
* <groupId>org.apache.maven.plugins</groupId> * <groupId>org.apache.maven.plugins</groupId>
* <artifactId>maven-plugin-plugin</artifactId> * <artifactId>maven-plugin-plugin</artifactId>
@ -214,7 +214,7 @@ public class HelpMojo
*/ */
private static String repeat( String str, int repeat ) private static String repeat( String str, int repeat )
{ {
StringBuffer buffer = new StringBuffer( repeat * str.length() ); StringBuilder buffer = new StringBuilder( repeat * str.length() );
for ( int i = 0; i < repeat; i++ ) for ( int i = 0; i < repeat; i++ )
{ {
@ -232,7 +232,7 @@ public class HelpMojo
* @param description The description, not <code>null</code>. * @param description The description, not <code>null</code>.
* @param indent The base indentation level of each line, must not be negative. * @param indent The base indentation level of each line, must not be negative.
*/ */
private void append( StringBuffer sb, String description, int indent ) private void append( StringBuilder sb, String description, int indent )
{ {
for ( Iterator it = toLines( description, indent, indentSize, lineLength ).iterator(); it.hasNext(); ) for ( Iterator it = toLines( description, indent, indentSize, lineLength ).iterator(); it.hasNext(); )
{ {
@ -275,7 +275,7 @@ public class HelpMojo
private static void toLines( List<String> lines, String line, int indentSize, int lineLength ) private static void toLines( List<String> lines, String line, int indentSize, int lineLength )
{ {
int lineIndent = getIndentLevel( line ); int lineIndent = getIndentLevel( line );
StringBuffer buf = new StringBuffer( 256 ); StringBuilder buf = new StringBuilder( 256 );
String[] tokens = line.split( " +" ); String[] tokens = line.split( " +" );
for ( int i = 0; i < tokens.length; i++ ) for ( int i = 0; i < tokens.length; i++ )
{ {

View File

@ -481,7 +481,7 @@ public class JavaMojoDescriptorExtractor
} }
else else
{ {
StringBuffer value = new StringBuffer( type.getValue() ); StringBuilder value = new StringBuilder( type.getValue() );
int remaining = type.getDimensions(); int remaining = type.getDimensions();

View File

@ -60,7 +60,7 @@ public abstract class AbstractMojoTaglet
String tagValue = getTagValue( tag ); String tagValue = getTagValue( tag );
MutableAttributeSet tagAttributes = getTagAttributes( tag ); MutableAttributeSet tagAttributes = getTagAttributes( tag );
StringBuffer sb = new StringBuffer(); StringBuilder sb = new StringBuilder();
appendTag( sb, tag, tagAttributes, tagValue ); appendTag( sb, tag, tagAttributes, tagValue );
@ -75,7 +75,7 @@ public abstract class AbstractMojoTaglet
return null; return null;
} }
StringBuffer sb = new StringBuffer(); StringBuilder sb = new StringBuilder();
for ( int i = 0; i < tags.length; i++ ) for ( int i = 0; i < tags.length; i++ )
{ {
String tagValue = getTagValue( tags[i] ); String tagValue = getTagValue( tags[i] );
@ -218,7 +218,7 @@ public abstract class AbstractMojoTaglet
* @param tagAttributes not null * @param tagAttributes not null
* @param tagValue not null * @param tagValue not null
*/ */
private void appendTag( StringBuffer sb, Tag tag, MutableAttributeSet tagAttributes, String tagValue ) private void appendTag( StringBuilder sb, Tag tag, MutableAttributeSet tagAttributes, String tagValue )
{ {
if ( !hasAnnotationParameters() ) if ( !hasAnnotationParameters() )
{ {
@ -343,7 +343,7 @@ public abstract class AbstractMojoTaglet
* @param sb not null * @param sb not null
* @param att not null * @param att not null
*/ */
private static void appendAnnotationParameters( StringBuffer sb, MutableAttributeSet att ) private static void appendAnnotationParameters( StringBuilder sb, MutableAttributeSet att )
{ {
sb.append( "<DL>" ); sb.append( "<DL>" );