maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hbout...@apache.org
Subject svn commit: r1471479 - /maven/shared/trunk/maven-project-utils/src/main/java/org/apache/maven/shared/project/utils/SiteUtils.java
Date Wed, 24 Apr 2013 15:23:44 GMT
Author: hboutemy
Date: Wed Apr 24 15:23:44 2013
New Revision: 1471479

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

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

Modified: maven/shared/trunk/maven-project-utils/src/main/java/org/apache/maven/shared/project/utils/SiteUtils.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-project-utils/src/main/java/org/apache/maven/shared/project/utils/SiteUtils.java?rev=1471479&r1=1471478&r2=1471479&view=diff
==============================================================================
--- maven/shared/trunk/maven-project-utils/src/main/java/org/apache/maven/shared/project/utils/SiteUtils.java
(original)
+++ maven/shared/trunk/maven-project-utils/src/main/java/org/apache/maven/shared/project/utils/SiteUtils.java
Wed Apr 24 15:23:44 2013
@@ -31,16 +31,16 @@ public final class SiteUtils
     
     public static String resolveDistributionManagementSiteUrl( MavenProject project )
     {
-        String siteUrl = getDistributionManagementSiteUrl( project.getModel() ); 
-        
-        if( siteUrl == null  )
+        String siteUrl = getDistributionManagementSiteUrl( project.getModel() );
+
+        if ( siteUrl == null )
         {
             // prevent null-value
-            siteUrl = "" + getDistributionManagementSiteUrl( project );
-            if( !ProjectUtils.isRootProject( project ) )
+            siteUrl = String.valueOf( getDistributionManagementSiteUrl( project ) );
+            if ( !ProjectUtils.isRootProject( project ) )
             {
                 // assuming that folder matches the moduleName
-                siteUrl += "/" + project.getFile().getParentFile().getName(); 
+                siteUrl += '/' + project.getFile().getParentFile().getName();
             }
         }
         return siteUrl;
@@ -53,26 +53,20 @@ public final class SiteUtils
      */
     protected static final String getDistributionManagementSiteUrl( Model model )
     {
-        if( model.getDistributionManagement() != null && model.getDistributionManagement().getSite()
!= null )
-        {
-            return model.getDistributionManagement().getSite().getUrl();
-        }
-        else
+        if ( model.getDistributionManagement() == null || model.getDistributionManagement().getSite()
== null )
         {
             return null;
         }
+        return model.getDistributionManagement().getSite().getUrl();
     }
 
     protected static final String getDistributionManagementSiteUrl( MavenProject project
)
     {
-        if( project.getDistributionManagement() != null && project.getDistributionManagement().getSite()
!= null )
-        {
-            return project.getDistributionManagement().getSite().getUrl();
-        }
-        else
+        if ( project.getDistributionManagement() == null || project.getDistributionManagement().getSite()
== null )
         {
             return null;
         }
+        return project.getDistributionManagement().getSite().getUrl();
     }
 
 }



Mime
View raw message