maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From csta...@apache.org
Subject svn commit: r1372377 - in /maven/indexer/trunk: indexer-artifact/src/main/java/org/apache/maven/index/artifact/ indexer-core/src/main/java/org/apache/maven/index/treeview/
Date Mon, 13 Aug 2012 12:08:27 GMT
Author: cstamas
Date: Mon Aug 13 12:08:27 2012
New Revision: 1372377

URL: http://svn.apache.org/viewvc?rev=1372377&view=rev
Log:
Get rid of StringBuffer and replace it with StringBuilder.

They are used in methods invoked on high frequency, but thread
safety is not needed where they were used.

Modified:
    maven/indexer/trunk/indexer-artifact/src/main/java/org/apache/maven/index/artifact/M1GavCalculator.java
    maven/indexer/trunk/indexer-artifact/src/main/java/org/apache/maven/index/artifact/M2GavCalculator.java
    maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/treeview/DefaultTreeNodeFactory.java

Modified: maven/indexer/trunk/indexer-artifact/src/main/java/org/apache/maven/index/artifact/M1GavCalculator.java
URL: http://svn.apache.org/viewvc/maven/indexer/trunk/indexer-artifact/src/main/java/org/apache/maven/index/artifact/M1GavCalculator.java?rev=1372377&r1=1372376&r2=1372377&view=diff
==============================================================================
--- maven/indexer/trunk/indexer-artifact/src/main/java/org/apache/maven/index/artifact/M1GavCalculator.java
(original)
+++ maven/indexer/trunk/indexer-artifact/src/main/java/org/apache/maven/index/artifact/M1GavCalculator.java
Mon Aug 13 12:08:27 2012
@@ -152,7 +152,7 @@ public class M1GavCalculator
      */
     public String gavToPath( Gav gav )
     {
-        StringBuffer path = new StringBuffer( "/" );
+        StringBuilder path = new StringBuilder( "/" );
 
         path.append( gav.getGroupId() );
 

Modified: maven/indexer/trunk/indexer-artifact/src/main/java/org/apache/maven/index/artifact/M2GavCalculator.java
URL: http://svn.apache.org/viewvc/maven/indexer/trunk/indexer-artifact/src/main/java/org/apache/maven/index/artifact/M2GavCalculator.java?rev=1372377&r1=1372376&r2=1372377&view=diff
==============================================================================
--- maven/indexer/trunk/indexer-artifact/src/main/java/org/apache/maven/index/artifact/M2GavCalculator.java
(original)
+++ maven/indexer/trunk/indexer-artifact/src/main/java/org/apache/maven/index/artifact/M2GavCalculator.java
Mon Aug 13 12:08:27 2012
@@ -186,7 +186,7 @@ public class M2GavCalculator
         }
         else
         {
-            StringBuffer sb = new StringBuffer( vSnapshot );
+            StringBuilder sb = new StringBuilder( vSnapshot );
             sb.append( s.substring( vSnapshotStart + sb.length(), vSnapshotStart + sb.length()
+ 8 ) );
 
             try
@@ -199,7 +199,7 @@ public class M2GavCalculator
             }
 
             int buildNumberPos = vSnapshotStart + sb.length();
-            StringBuffer bnr = new StringBuffer();
+            StringBuilder bnr = new StringBuilder();
             while ( s.charAt( buildNumberPos ) >= '0' && s.charAt( buildNumberPos
) <= '9' )
             {
                 sb.append( s.charAt( buildNumberPos ) );
@@ -234,7 +234,7 @@ public class M2GavCalculator
 
     public String gavToPath( Gav gav )
     {
-        StringBuffer path = new StringBuffer( "/" );
+        StringBuilder path = new StringBuilder( "/" );
 
         path.append( gav.getGroupId().replaceAll( "(?m)(.)\\.", "$1/" ) ); // replace all
'.' except the first char
 
@@ -261,7 +261,7 @@ public class M2GavCalculator
         }
         else
         {
-            StringBuffer path = new StringBuffer( gav.getArtifactId() );
+            StringBuilder path = new StringBuilder( gav.getArtifactId() );
 
             path.append( "-" );
 

Modified: maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/treeview/DefaultTreeNodeFactory.java
URL: http://svn.apache.org/viewvc/maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/treeview/DefaultTreeNodeFactory.java?rev=1372377&r1=1372376&r2=1372377&view=diff
==============================================================================
--- maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/treeview/DefaultTreeNodeFactory.java
(original)
+++ maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/treeview/DefaultTreeNodeFactory.java
Mon Aug 13 12:08:27 2012
@@ -93,7 +93,7 @@ public class DefaultTreeNodeFactory
 
     public TreeNode createArtifactNode( IndexTreeView tview, TreeViewRequest req, ArtifactInfo
ai, String path )
     {
-        StringBuffer sb = new StringBuffer( ai.artifactId ).append( "-" ).append( ai.version
);
+        StringBuilder sb = new StringBuilder( ai.artifactId ).append( "-" ).append( ai.version
);
 
         if ( ai.classifier != null )
         {



Mime
View raw message