code simplification
git-svn-id: https://svn.apache.org/repos/asf/maven/shared/trunk@1471478 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/main/java/org/apache/maven/shared/project/utils/ScmUtils.java b/src/main/java/org/apache/maven/shared/project/utils/ScmUtils.java
index 1234a80..7e9c1e4 100644
--- a/src/main/java/org/apache/maven/shared/project/utils/ScmUtils.java
+++ b/src/main/java/org/apache/maven/shared/project/utils/ScmUtils.java
@@ -35,12 +35,12 @@
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 @@
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 @@
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();
}
}