maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aherit...@apache.org
Subject git commit: Revert "Code cleanup - It's better (for perfs) to use a chain of append() calls than a unique append with several Strings concatenations"
Date Fri, 14 Jun 2013 08:30:12 GMT
Updated Branches:
  refs/heads/master 456268af6 -> 21907a74e


Revert "Code cleanup - It's better (for perfs) to use a chain of append() calls than a unique
append with several Strings concatenations"

This reverts commit c8e94a5b085b1cb1543861d40db7a7a108bef499.

Decreases too much the code readibility


Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/21907a74
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/21907a74
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/21907a74

Branch: refs/heads/master
Commit: 21907a74e7aa802ab19e0ab68ca1116f847776b4
Parents: 456268a
Author: Arnaud Héritier <aheritier@apache.org>
Authored: Fri Jun 14 10:28:27 2013 +0200
Committer: Arnaud Héritier <aheritier@apache.org>
Committed: Fri Jun 14 10:29:43 2013 +0200

----------------------------------------------------------------------
 .../AbstractArtifactResolutionException.java         |  5 ++---
 .../project/validation/ModelValidationResult.java    |  3 +--
 .../repository/metadata/ClasspathContainer.java      |  4 ++--
 .../maven/repository/metadata/MetadataGraph.java     |  6 +++---
 .../repository/metadata/MetadataGraphVertex.java     |  8 ++++----
 .../maven/plugin/PluginParameterException.java       |  4 ++--
 .../java/org/apache/maven/cli/CLIReportingUtils.java | 15 +++++++--------
 .../java/org/apache/maven/cli/CLIManagerTest.java    |  2 +-
 8 files changed, 22 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/21907a74/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/AbstractArtifactResolutionException.java
----------------------------------------------------------------------
diff --git a/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/AbstractArtifactResolutionException.java
b/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/AbstractArtifactResolutionException.java
index 393e028..9cfc36b 100644
--- a/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/AbstractArtifactResolutionException.java
+++ b/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/AbstractArtifactResolutionException.java
@@ -199,14 +199,13 @@ public class AbstractArtifactResolutionException
         if ( message == null || !message.contains( "from the specified remote repositories:"
) )
         {
             sb.append( LS );
-            sb.append( "  " ).append( groupId ).append( ":" ).append( artifactId ).append(
":" ).append( type ).append(
-                ":" ).append( version );
+            sb.append( "  " + groupId + ":" + artifactId + ":" + type + ":" + version );
             sb.append( LS );
             if ( remoteRepositories != null )
             {
                 sb.append( LS );
                 sb.append( "from the specified remote repositories:" );
-                sb.append( LS ).append( "  " );
+                sb.append( LS + "  " );
 
                 if ( remoteRepositories.isEmpty() )
                 {

http://git-wip-us.apache.org/repos/asf/maven/blob/21907a74/maven-compat/src/main/java/org/apache/maven/project/validation/ModelValidationResult.java
----------------------------------------------------------------------
diff --git a/maven-compat/src/main/java/org/apache/maven/project/validation/ModelValidationResult.java
b/maven-compat/src/main/java/org/apache/maven/project/validation/ModelValidationResult.java
index cb8c601..12ead7e 100644
--- a/maven-compat/src/main/java/org/apache/maven/project/validation/ModelValidationResult.java
+++ b/maven-compat/src/main/java/org/apache/maven/project/validation/ModelValidationResult.java
@@ -85,8 +85,7 @@ public class ModelValidationResult
 //
         for ( int i = 0; i < messages.size(); i++ )
         {
-            message.append( indentation ).append( "[" ).append( i ).append( "]  " ).append(
messages.get( i ) ).append(
-                NEWLINE );
+            message.append( indentation + "[" + i + "]  " + messages.get( i ) + NEWLINE );
         }
 
         return message.toString();

http://git-wip-us.apache.org/repos/asf/maven/blob/21907a74/maven-compat/src/main/java/org/apache/maven/repository/metadata/ClasspathContainer.java
----------------------------------------------------------------------
diff --git a/maven-compat/src/main/java/org/apache/maven/repository/metadata/ClasspathContainer.java
b/maven-compat/src/main/java/org/apache/maven/repository/metadata/ClasspathContainer.java
index cdf28f6..593daac 100644
--- a/maven-compat/src/main/java/org/apache/maven/repository/metadata/ClasspathContainer.java
+++ b/maven-compat/src/main/java/org/apache/maven/repository/metadata/ClasspathContainer.java
@@ -129,12 +129,12 @@ implements Iterable<ArtifactMetadata>
     public String toString()
     {
         StringBuilder sb = new StringBuilder( 256 );
-        sb.append( "[scope=" ).append( scope.getScope() );
+        sb.append( "[scope=" + scope.getScope() );
         if ( classpath != null )
         {
             for ( ArtifactMetadata md : classpath )
             {
-                sb.append( ": " ).append( md.toString() ).append( '{' ).append( md.getArtifactUri()
).append( '}' );
+                sb.append( ": " + md.toString() + '{' + md.getArtifactUri() + '}' );
             }
         }
         sb.append( ']' );

http://git-wip-us.apache.org/repos/asf/maven/blob/21907a74/maven-compat/src/main/java/org/apache/maven/repository/metadata/MetadataGraph.java
----------------------------------------------------------------------
diff --git a/maven-compat/src/main/java/org/apache/maven/repository/metadata/MetadataGraph.java
b/maven-compat/src/main/java/org/apache/maven/repository/metadata/MetadataGraph.java
index 55b0250..b116c69 100644
--- a/maven-compat/src/main/java/org/apache/maven/repository/metadata/MetadataGraph.java
+++ b/maven-compat/src/main/java/org/apache/maven/repository/metadata/MetadataGraph.java
@@ -485,13 +485,13 @@ public class MetadataGraph
         }
         for ( MetadataGraphVertex v : vertices )
         {
-            sb.append( "Vertex:  " ).append( v.getMd().toString() ).append( "\n" );
+            sb.append( "Vertex:  " + v.getMd().toString() + "\n" );
             List<MetadataGraphEdge> ins = getIncidentEdges( v );
             if ( ins != null )
             {
                 for ( MetadataGraphEdge e : ins )
                 {
-                    sb.append( "       from :  " ).append( e.toString() ).append( "\n" );
+                    sb.append( "       from :  " + e.toString() + "\n" );
                 }
             }
             else
@@ -504,7 +504,7 @@ public class MetadataGraph
             {
                 for ( MetadataGraphEdge e : outs )
                 {
-                    sb.append( "        to :  " ).append( e.toString() ).append( "\n" );
+                    sb.append( "        to :  " + e.toString() + "\n" );
                 }
             }
             else

http://git-wip-us.apache.org/repos/asf/maven/blob/21907a74/maven-compat/src/main/java/org/apache/maven/repository/metadata/MetadataGraphVertex.java
----------------------------------------------------------------------
diff --git a/maven-compat/src/main/java/org/apache/maven/repository/metadata/MetadataGraphVertex.java
b/maven-compat/src/main/java/org/apache/maven/repository/metadata/MetadataGraphVertex.java
index 202a01f..87ff70b 100644
--- a/maven-compat/src/main/java/org/apache/maven/repository/metadata/MetadataGraphVertex.java
+++ b/maven-compat/src/main/java/org/apache/maven/repository/metadata/MetadataGraphVertex.java
@@ -192,17 +192,17 @@ public class MetadataGraphVertex
             return super.hashCode();
         }
         StringBuilder hashString = new StringBuilder( 128 );
-        hashString.append( md.groupId ).append( "|" );
-        hashString.append( md.artifactId ).append( "|" );
+        hashString.append( md.groupId + "|" );
+        hashString.append( md.artifactId + "|" );
 
         if ( compareVersion )
         {
-            hashString.append( md.version ).append( "|" );
+            hashString.append( md.version + "|" );
         }
 
         if ( compareScope )
         {
-            hashString.append( md.getArtifactScope() ).append( "|" );
+            hashString.append( md.getArtifactScope() + "|" );
         }
 
         return hashString.toString().hashCode();

http://git-wip-us.apache.org/repos/asf/maven/blob/21907a74/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterException.java
----------------------------------------------------------------------
diff --git a/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterException.java
b/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterException.java
index dfdd432..f14bfc0 100644
--- a/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterException.java
+++ b/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterException.java
@@ -144,8 +144,8 @@ public class PluginParameterException
             String alias = param.getAlias();
             if ( StringUtils.isNotEmpty( alias ) && !alias.equals( param.getName()
) )
             {
-                messageBuffer.append( "\n\n-OR-\n\n<configuration>\n  ...\n  <"
).append( alias ).append(
-                    ">VALUE</" ).append( alias ).append( ">\n</configuration>\n"
);
+                messageBuffer.append(
+                    "\n\n-OR-\n\n<configuration>\n  ...\n  <" + alias + ">VALUE</"
+ alias + ">\n</configuration>\n" );
             }
         }
 

http://git-wip-us.apache.org/repos/asf/maven/blob/21907a74/maven-embedder/src/main/java/org/apache/maven/cli/CLIReportingUtils.java
----------------------------------------------------------------------
diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/CLIReportingUtils.java b/maven-embedder/src/main/java/org/apache/maven/cli/CLIReportingUtils.java
index 186f937..0ed30dc 100644
--- a/maven-embedder/src/main/java/org/apache/maven/cli/CLIReportingUtils.java
+++ b/maven-embedder/src/main/java/org/apache/maven/cli/CLIReportingUtils.java
@@ -55,14 +55,13 @@ public final class CLIReportingUtils
         version.append( createMavenVersionString( properties ) ).append( LS );
         version.append( reduce( properties.getProperty( "distributionShortName" ) + " home:
"
                             + System.getProperty( "maven.home", "<unknown maven home>"
) ) ).append( LS );
-        version.append( "Java version: " ).append(
-            System.getProperty( "java.version", "<unknown java version>" ) ).append(
", vendor: " ).append(
-            System.getProperty( "java.vendor", "<unknown vendor>" ) ).append( LS );
-        version.append( "Java home: " ).append( System.getProperty( "java.home", "<unknown
java home>" ) ).append( LS );
-        version.append( "Default locale: " ).append( Locale.getDefault() ).append( ", platform
encoding: " ).append(
-            System.getProperty( "file.encoding", "<unknown encoding>" ) ).append( LS
);
-        version.append( "OS name: \"" ).append( Os.OS_NAME ).append( "\", version: \"" ).append(
Os.OS_VERSION ).append(
-            "\", arch: \"" ).append( Os.OS_ARCH ).append( "\", family: \"" ).append( Os.OS_FAMILY
).append( "\"" );
+        version.append( "Java version: " + System.getProperty( "java.version", "<unknown
java version>" )
+                            + ", vendor: " + System.getProperty( "java.vendor", "<unknown
vendor>" ) ).append( LS );
+        version.append( "Java home: " + System.getProperty( "java.home", "<unknown java
home>" ) ).append( LS );
+        version.append( "Default locale: " + Locale.getDefault() + ", platform encoding:
"
+                            + System.getProperty( "file.encoding", "<unknown encoding>"
) ).append( LS );
+        version.append( "OS name: \"" + Os.OS_NAME + "\", version: \"" + Os.OS_VERSION +
"\", arch: \"" + Os.OS_ARCH
+            + "\", family: \"" + Os.OS_FAMILY + "\"" );
         return version.toString();
     }
 

http://git-wip-us.apache.org/repos/asf/maven/blob/21907a74/maven-embedder/src/test/java/org/apache/maven/cli/CLIManagerTest.java
----------------------------------------------------------------------
diff --git a/maven-embedder/src/test/java/org/apache/maven/cli/CLIManagerTest.java b/maven-embedder/src/test/java/org/apache/maven/cli/CLIManagerTest.java
index 9df1768..716127b 100644
--- a/maven-embedder/src/test/java/org/apache/maven/cli/CLIManagerTest.java
+++ b/maven-embedder/src/test/java/org/apache/maven/cli/CLIManagerTest.java
@@ -70,7 +70,7 @@ public class CLIManagerTest
         for ( Option option : new CLIManagerExtension().getOptions() )
         {
             a = !a;
-            sb.append( "<tr class='" ).append( a ? 'a' : 'b' ).append( "'><td><code>-<a
name='" );
+            sb.append( "<tr class='" + ( a ? 'a' : 'b' ) + "'><td><code>-<a
name='" );
             sb.append( option.getOpt() );
             sb.append( "'>" );
             sb.append( option.getOpt() );


Mime
View raw message