maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rfscho...@apache.org
Subject svn commit: r1400107 - /maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/PurgeLocalRepositoryMojo.java
Date Fri, 19 Oct 2012 14:20:16 GMT
Author: rfscholte
Date: Fri Oct 19 14:20:16 2012
New Revision: 1400107

URL: http://svn.apache.org/viewvc?rev=1400107&view=rev
Log:
Small code-optimizations

Modified:
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/PurgeLocalRepositoryMojo.java

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/PurgeLocalRepositoryMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/PurgeLocalRepositoryMojo.java?rev=1400107&r1=1400106&r2=1400107&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/PurgeLocalRepositoryMojo.java
(original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/PurgeLocalRepositoryMojo.java
Fri Oct 19 14:20:16 2012
@@ -39,6 +39,7 @@ import org.apache.maven.plugins.annotati
 import org.apache.maven.plugins.annotations.Parameter;
 import org.apache.maven.project.MavenProject;
 import org.codehaus.plexus.util.FileUtils;
+import org.codehaus.plexus.util.StringUtils;
 
 import java.io.File;
 import java.io.IOException;
@@ -264,12 +265,12 @@ public class PurgeLocalRepositoryMojo
     {
         for ( String pattern : inclusionPatterns )
         {
-            if ( pattern.equals( "" ) )
+            if ( StringUtils.isEmpty( pattern ) )
             {
                 throw new MojoExecutionException( "The groupId:artifactId for manualIncludes
cannot be empty" );
             }
             String relativePath = gaStringtoPath( pattern );
-            File purgeDir = new File( localRepository.getBasedir() + "/" + relativePath );
+            File purgeDir = new File( localRepository.getBasedir(), relativePath );
             if ( purgeDir.exists() )
             {
                 try
@@ -336,7 +337,7 @@ public class PurgeLocalRepositoryMojo
 
         for ( Dependency dependency : dependencies )
         {
-            if ( dependency.getScope() != null && dependency.getScope().equals( Artifact.SCOPE_SYSTEM
) )
+            if ( Artifact.SCOPE_SYSTEM.equals( dependency.getScope() ))
             {
                 // Don't try to purge system dependencies
                 continue;



Mime
View raw message