You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by kh...@apache.org on 2016/04/30 23:42:56 UTC

svn commit: r1741819 - /maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/AbstractInvokerMojo.java

Author: khmarbaise
Date: Sat Apr 30 21:42:56 2016
New Revision: 1741819

URL: http://svn.apache.org/viewvc?rev=1741819&view=rev
Log:
Refactored Code
 o Don't use negative logic.

Modified:
    maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/AbstractInvokerMojo.java

Modified: maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/AbstractInvokerMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/AbstractInvokerMojo.java?rev=1741819&r1=1741818&r2=1741819&view=diff
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/AbstractInvokerMojo.java (original)
+++ maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/AbstractInvokerMojo.java Sat Apr 30 21:42:56 2016
@@ -617,36 +617,33 @@ public abstract class AbstractInvokerMoj
             reportsDirectory.mkdirs();
         }
 
-        // CHECKSTYLE_OFF: LineLength
-
         BuildJob[] buildJobs;
-        if ( pom != null )
+        if ( pom == null )
         {
             try
             {
-                projectsDirectory = pom.getCanonicalFile().getParentFile();
+                buildJobs = getBuildJobs();
             }
-            catch ( IOException e )
+            catch ( final IOException e )
             {
-                throw new MojoExecutionException( "Failed to discover projectsDirectory from pom File parameter. Reason: "
-                    + e.getMessage(), e );
+                throw new MojoExecutionException( "Error retrieving POM list from includes, "
+                    + "excludes, and projects directory. Reason: " + e.getMessage(), e );
             }
-
-            buildJobs = new BuildJob[] { new BuildJob( pom.getName(), BuildJob.Type.NORMAL ) };
         }
         else
         {
             try
             {
-                buildJobs = getBuildJobs();
+                projectsDirectory = pom.getCanonicalFile().getParentFile();
             }
-            catch ( final IOException e )
+            catch ( IOException e )
             {
-                throw new MojoExecutionException( "Error retrieving POM list from includes, excludes, and projects directory. Reason: "
-                    + e.getMessage(), e );
+                throw new MojoExecutionException( "Failed to discover projectsDirectory from "
+                    + "pom File parameter. Reason: " + e.getMessage(), e );
             }
+
+            buildJobs = new BuildJob[] { new BuildJob( pom.getName(), BuildJob.Type.NORMAL ) };
         }
-        // CHECKSTYLE_ON: LineLength
 
         if ( ( buildJobs == null ) || ( buildJobs.length < 1 ) )
         {