Permalink
Browse files

use StringBuilder rather than StringBuffer

git-svn-id: https://svn.apache.org/repos/asf/maven/doxia/doxia-tools/trunk@1438393 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
1 parent 941729d commit 57bdf7e8f4d7f56cd185de68980729f6f6484650 @olamy olamy committed Jan 25, 2013
@@ -281,7 +281,7 @@ protected String getOutputEncoding()
*/
private String formatResult( ValidationResult result )
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
if ( result.getErrors().size() > 0 )
{
@@ -577,7 +577,7 @@ private static String autoDetectEncoding( File f )
IOUtil.close( is );
}
- StringBuffer msg = new StringBuffer();
+ StringBuilder msg = new StringBuilder();
msg.append( "Could not detect the encoding for file: " );
msg.append( f.getAbsolutePath() );
msg.append( "\n Specify explicitly the encoding." );
@@ -654,7 +654,7 @@ else if ( firstTag.equals( "html" )
}
}
- StringBuffer msg = new StringBuffer();
+ StringBuilder msg = new StringBuilder();
msg.append( "Could not detect the Doxia format for file: " );
msg.append( f.getAbsolutePath() );
msg.append( "\n Specify explicitly the Doxia format." );
@@ -163,7 +163,7 @@ private static String getSupportedEncoding()
{
List cleaned = new ArrayList();
- StringBuffer currentArg = null;
+ StringBuilder currentArg = null;
for ( int i = 0; i < args.length; i++ )
{
@@ -181,7 +181,7 @@ private static String getSupportedEncoding()
}
// start building an argument here.
- currentArg = new StringBuffer( arg.substring( 1 ) );
+ currentArg = new StringBuilder( arg.substring( 1 ) );
addedToBuffer = true;
}
@@ -74,7 +74,7 @@
if ( StringUtils.isNotEmpty( encoding ) && !encoding.equalsIgnoreCase( encoding )
&& !validateEncoding( encoding ) )
{
- StringBuffer msg = new StringBuffer();
+ StringBuilder msg = new StringBuilder();
msg.append( "The encoding '" + encoding + "' is not a valid one. The supported charsets are: " );
msg.append( StringUtils.join( CharsetDetector.getAllDetectableCharsets(), ", " ) );
throw new UnsupportedEncodingException( msg.toString() );
@@ -176,7 +176,7 @@ public int hashCode()
/** {@inheritDoc} */
public java.lang.String toString()
{
- StringBuffer buf = new StringBuffer( super.toString() + "\n" );
+ StringBuilder buf = new StringBuilder( super.toString() + "\n" );
buf.append( "file= '" );
buf.append( getFile() + "'" );
return buf.toString();
@@ -117,7 +117,7 @@ public int hashCode()
/** {@inheritDoc} */
public java.lang.String toString()
{
- StringBuffer buf = new StringBuffer();
+ StringBuilder buf = new StringBuilder();
buf.append( "format = '" );
buf.append( getFormat() + "'" );
return buf.toString();
@@ -83,7 +83,7 @@ public int getHttpStatusCode()
/** {@inheritDoc} */
public String toString()
{
- StringBuffer sb = new StringBuffer( super.toString() );
+ StringBuilder sb = new StringBuilder( super.toString() );
sb.append( '\n' );
sb.append( "httpStatusCode=" ).append( this.httpStatusCode );
@@ -96,7 +96,7 @@ public LinkValidationResult( int stat, boolean persistent, String message )
/** {@inheritDoc} */
public String toString()
{
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
sb.append( "persistent=" ).append( this.persistent ).append( '\n' );
sb.append( "status=" ).append( this.status ).append( '\n' );

0 comments on commit 57bdf7e

Please sign in to comment.