]> source.dussan.org Git - archiva.git/commitdiff
prefer StringBuilder to StringBuffer
authorOlivier Lamy <olamy@apache.org>
Sat, 11 Jun 2011 17:55:03 +0000 (17:55 +0000)
committerOlivier Lamy <olamy@apache.org>
Sat, 11 Jun 2011 17:55:03 +0000 (17:55 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1134712 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/reports/GenerateReportAction.java
archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/mapper/RepositoryActionMapper.java
archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/Banner.java
archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/SecuritySynchronization.java
archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/CopyPasteSnippetTag.java
archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/GroupIdLink.java
archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/util/ContextUtils.java

index 7c4f8cd8e0c55a5c2eb73e3086c955dba6ccadf9..bb6f305996e78cee85953a9d1867f550300c7b62 100644 (file)
@@ -307,7 +307,7 @@ public class GenerateReportAction
         selectedRepositories = parseSelectedRepositories();
         List<RepositoryStatistics> repositoryStatistics = new ArrayList<RepositoryStatistics>();
 
-        StringBuffer input;
+        StringBuilder input;
         RepositorySession repositorySession = repositorySessionFactory.createSession();
         try
         {
@@ -331,7 +331,7 @@ public class GenerateReportAction
                     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 @@ public class GenerateReportAction
                         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" );
 
index 9bc28f28a28c9158e54fad4d29aeaedd41b55977..64f9225d406305fd41c064362214a8b80e9dd4cd 100644 (file)
@@ -189,7 +189,7 @@ public class RepositoryActionMapper
 
     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( '/' );
index 87bd73a06df8ca10f6a8c3ecfe3c6350b8ae6f7d..8e1c20e6cd10217592a58e2f14bb37d725d99286 100644 (file)
@@ -39,7 +39,7 @@ public class Banner
         // 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 @@ public class Banner
 
     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 class Banner
     {
         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 ) )
index df510e80e5e178a826f4b22160c14c5d7e323332..957b526d4cf06867737a536c3b7f95800ff513a6 100644 (file)
@@ -205,7 +205,7 @@ public class SecuritySynchronization
 
         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" );
index 3e92f144841a05961d84f3c5fe806efa422f0bea..96eb6bbf57d39e2a497a848e810f51ac03ba2218 100644 (file)
@@ -61,9 +61,9 @@ public class CopyPasteSnippetTag
     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 class CopyPasteSnippetTag
         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" );
index 8664313812d02fcb8c04c906025dbf1141bb996b..05638a2d905930b2379e8835eb5e24a18114a4f8 100644 (file)
@@ -66,7 +66,7 @@ public class GroupIdLink
     @Override
     public boolean end( Writer writer, String body )
     {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
 
         sb.append( "<span class=\"groupId\">" );
 
index f1b689cea9d5311830a52021b89e6dfb9feac232..319d0a0880833c3a34f23ff57c5ae158618b3ab5 100644 (file)
@@ -76,7 +76,7 @@ public class ContextUtils
      */
     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 ) );