mirror of
https://github.com/apache/archiva.git
synced 2025-02-22 01:44:47 +00:00
prefer StringBuilder to StringBuffer
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1134712 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
2cd4113c6d
commit
cd0f9ad6a7
@ -307,7 +307,7 @@ public String downloadStatisticsReport()
|
||||
selectedRepositories = parseSelectedRepositories();
|
||||
List<RepositoryStatistics> repositoryStatistics = new ArrayList<RepositoryStatistics>();
|
||||
|
||||
StringBuffer input;
|
||||
StringBuilder input;
|
||||
RepositorySession repositorySession = repositorySessionFactory.createSession();
|
||||
try
|
||||
{
|
||||
@ -331,7 +331,7 @@ public String downloadStatisticsReport()
|
||||
return INPUT;
|
||||
}
|
||||
|
||||
input = new StringBuffer(
|
||||
input = new StringBuilder(
|
||||
"Repository,Total File Count,Total Size,Artifact Count,Group Count,Project Count,Plugins,Archetypes,"
|
||||
+ "Jars,Wars\n" );
|
||||
|
||||
@ -404,7 +404,7 @@ else if ( selectedRepositories.size() == 1 )
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
input = new StringBuffer(
|
||||
input = new StringBuilder(
|
||||
"Date of Scan,Total File Count,Total Size,Artifact Count,Group Count,Project Count,Plugins,"
|
||||
+ "Archetypes,Jars,Wars\n" );
|
||||
|
||||
|
@ -189,7 +189,7 @@ else if ( ACTION_SHOW_ARTIFACT_DEPENDENCY_TREE.equals( actionMapping.getName() )
|
||||
|
||||
private String toUri( Map<String, Object> params, boolean artifactId, boolean version, String method )
|
||||
{
|
||||
StringBuffer buf = new StringBuffer();
|
||||
StringBuilder buf = new StringBuilder();
|
||||
|
||||
buf.append( BROWSE_PREFIX );
|
||||
buf.append( '/' );
|
||||
|
@ -39,7 +39,7 @@ public static String encode( String raw )
|
||||
// Canonicalize line ends to make them easier to process
|
||||
raw = raw.replace("\r\n", "\n").replace("\r", "\n");
|
||||
|
||||
StringBuffer encoded = new StringBuffer();
|
||||
StringBuilder encoded = new StringBuilder();
|
||||
int rawlen = raw.length();
|
||||
|
||||
for ( int i = 0; i < rawlen; i++ )
|
||||
@ -109,7 +109,7 @@ else if ( i < raw.length() - 1 )
|
||||
|
||||
public static String decode( String encoded )
|
||||
{
|
||||
StringBuffer decoded = new StringBuffer();
|
||||
StringBuilder decoded = new StringBuilder();
|
||||
int enlen = encoded.length();
|
||||
for ( int i = 0; i < enlen; i++ )
|
||||
{
|
||||
@ -192,7 +192,7 @@ public static String injectVersion( String text, String version )
|
||||
{
|
||||
Pattern pat = Pattern.compile( "#{2,}" );
|
||||
Matcher mat = pat.matcher( text );
|
||||
StringBuffer ret = new StringBuffer();
|
||||
StringBuilder ret = new StringBuilder();
|
||||
int off = 0;
|
||||
|
||||
while ( mat.find( off ) )
|
||||
|
@ -205,7 +205,7 @@ private void executeEnvironmentChecks()
|
||||
|
||||
if ( CollectionUtils.isNotEmpty( violations ) )
|
||||
{
|
||||
StringBuffer msg = new StringBuffer();
|
||||
StringBuilder msg = new StringBuilder();
|
||||
msg.append( "EnvironmentCheck Failure.\n" );
|
||||
msg.append( "======================================================================\n" );
|
||||
msg.append( " ENVIRONMENT FAILURE !! \n" );
|
||||
|
@ -61,9 +61,9 @@ public void release()
|
||||
public int doEndTag()
|
||||
throws JspException
|
||||
{
|
||||
StringBuffer prefix = new StringBuffer();
|
||||
StringBuffer buf = new StringBuffer();
|
||||
StringBuffer suffix = new StringBuffer();
|
||||
StringBuilder prefix = new StringBuilder();
|
||||
StringBuilder buf = new StringBuilder();
|
||||
StringBuilder suffix = new StringBuilder();
|
||||
|
||||
if ( object == null )
|
||||
{
|
||||
@ -122,7 +122,7 @@ public void setWrapper( String wrapper )
|
||||
this.wrapper = wrapper;
|
||||
}
|
||||
|
||||
private void createSnippet( StringBuffer snippet, ManagedRepositoryConfiguration repo, PageContext pageContext )
|
||||
private void createSnippet( StringBuilder snippet, ManagedRepositoryConfiguration repo, PageContext pageContext )
|
||||
{
|
||||
snippet.append( "<project>\n" );
|
||||
snippet.append( " ...\n" );
|
||||
|
@ -66,7 +66,7 @@ public GroupIdLink( ValueStack stack, HttpServletRequest req, HttpServletRespons
|
||||
@Override
|
||||
public boolean end( Writer writer, String body )
|
||||
{
|
||||
StringBuffer sb = new StringBuffer();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( "<span class=\"groupId\">" );
|
||||
|
||||
|
@ -76,7 +76,7 @@ public static String getBaseURL( PageContext pageContext, String resource )
|
||||
*/
|
||||
public static String getBaseURL( HttpServletRequest request, String resource )
|
||||
{
|
||||
StringBuffer baseUrl = new StringBuffer();
|
||||
StringBuilder baseUrl = new StringBuilder();
|
||||
|
||||
baseUrl.append( request.getScheme() ).append( "://" );
|
||||
baseUrl.append( getServerName( request ) );
|
||||
|
Loading…
x
Reference in New Issue
Block a user