You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2013/04/24 17:21:57 UTC

svn commit: r1471478 - /maven/shared/trunk/maven-project-utils/src/main/java/org/apache/maven/shared/project/utils/ScmUtils.java

Author: hboutemy
Date: Wed Apr 24 15:21:57 2013
New Revision: 1471478

URL: http://svn.apache.org/r1471478
Log:
code simplification

Modified:
    maven/shared/trunk/maven-project-utils/src/main/java/org/apache/maven/shared/project/utils/ScmUtils.java

Modified: maven/shared/trunk/maven-project-utils/src/main/java/org/apache/maven/shared/project/utils/ScmUtils.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-project-utils/src/main/java/org/apache/maven/shared/project/utils/ScmUtils.java?rev=1471478&r1=1471477&r2=1471478&view=diff
==============================================================================
--- maven/shared/trunk/maven-project-utils/src/main/java/org/apache/maven/shared/project/utils/ScmUtils.java (original)
+++ maven/shared/trunk/maven-project-utils/src/main/java/org/apache/maven/shared/project/utils/ScmUtils.java Wed Apr 24 15:21:57 2013
@@ -35,12 +35,12 @@ public final class ScmUtils
         if ( scmConnection == null )
         {
             // prevent null-value
-            scmConnection = "" + getScmConnection( project );
+            scmConnection = String.valueOf( getScmConnection( project ) );
             
             if ( !ProjectUtils.isRootProject( project ) )
             {
                 // assuming that folder matches the moduleName
-                scmConnection += "/" + project.getFile().getParentFile().getName();
+                scmConnection += '/' + project.getFile().getParentFile().getName();
             }
         }
         return scmConnection;
@@ -53,12 +53,12 @@ public final class ScmUtils
         if ( siteUrl == null )
         {
             // prevent null-value
-            siteUrl = "" + getScmDeveloperConnection( project );
+            siteUrl = String.valueOf( getScmDeveloperConnection( project ) );
             
             if ( !ProjectUtils.isRootProject( project ) )
             {
                 // assuming that folder matches the moduleName
-                siteUrl += "/" + project.getFile().getParentFile().getName();
+                siteUrl += '/' + project.getFile().getParentFile().getName();
             }
         }
         return siteUrl;
@@ -66,50 +66,38 @@ public final class ScmUtils
 
     protected static String getScmConnection( Model model )
     {
-        if ( model.getScm() != null )
-        {
-            return model.getScm().getConnection();
-        }
-        else
+        if ( model.getScm() == null )
         {
             return null;
         }
+        return model.getScm().getConnection();
     }
 
     protected static String getScmConnection( MavenProject project )
     {
-        if ( project.getScm() != null )
-        {
-            return project.getScm().getConnection();
-        }
-        else
+        if ( project.getScm() == null )
         {
             return null;
         }
+        return project.getScm().getConnection();
     }
 
     protected static String getScmDeveloperConnection( Model model )
     {
-        if ( model.getScm() != null )
-        {
-            return model.getScm().getDeveloperConnection();
-        }
-        else
+        if ( model.getScm() == null )
         {
             return null;
         }
+        return model.getScm().getDeveloperConnection();
     }
 
     protected static String getScmDeveloperConnection( MavenProject project )
     {
-        if ( project.getScm() != null )
-        {
-            return project.getScm().getDeveloperConnection();
-        }
-        else
+        if ( project.getScm() == null )
         {
             return null;
         }
+        return project.getScm().getDeveloperConnection();
     }
 
 }