creadur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pottlin...@apache.org
Subject svn commit: r1617162 - /creadur/rat/trunk/apache-rat-plugin/src/main/java/org/apache/rat/mp/RatReportMojo.java
Date Sun, 10 Aug 2014 21:15:56 GMT
Author: pottlinger
Date: Sun Aug 10 21:15:56 2014
New Revision: 1617162

URL: http://svn.apache.org/r1617162
Log:
0.11: NPE-fix

Always ensuring that a list of repositories is existing in case its null.
Possibly this is a change in the API induced by dependency updates.

Stacktrace was:
Caused by: java.lang.NullPointerException
    at org.apache.rat.mp.RatReportMojo.getSkinArtifactFile(RatReportMojo.java:114)
    at org.apache.rat.mp.RatReportMojo.execute(RatReportMojo.java:204)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)


Modified:
    creadur/rat/trunk/apache-rat-plugin/src/main/java/org/apache/rat/mp/RatReportMojo.java

Modified: creadur/rat/trunk/apache-rat-plugin/src/main/java/org/apache/rat/mp/RatReportMojo.java
URL: http://svn.apache.org/viewvc/creadur/rat/trunk/apache-rat-plugin/src/main/java/org/apache/rat/mp/RatReportMojo.java?rev=1617162&r1=1617161&r2=1617162&view=diff
==============================================================================
--- creadur/rat/trunk/apache-rat-plugin/src/main/java/org/apache/rat/mp/RatReportMojo.java
(original)
+++ creadur/rat/trunk/apache-rat-plugin/src/main/java/org/apache/rat/mp/RatReportMojo.java
Sun Aug 10 21:15:56 2014
@@ -52,8 +52,10 @@ import java.io.IOException;
 import java.io.PrintWriter;
 import java.io.StringWriter;
 import java.io.Writer;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Locale;
 import java.util.Map;
 import java.util.ResourceBundle;
@@ -111,7 +113,15 @@ public class RatReportMojo extends Abstr
                 factory.createDependencyArtifact( skin.getGroupId(), skin.getArtifactId(),
versionSpec, "jar", null,
                                                   null );
 
-            resolver.resolve( artifact, getProject().getRemoteArtifactRepositories(), localRepository
);
+            // FIXME Try to avoid NPE / found during 0.11-build checks
+            // API is so old/without type information
+			@SuppressWarnings("unchecked")
+			List<ArtifactRepository> remoteArtifactRepositories = getProject().getRemoteArtifactRepositories();
+            if(remoteArtifactRepositories == null) {
+            	remoteArtifactRepositories = Collections.emptyList();
+            }
+            
+			resolver.resolve( artifact, remoteArtifactRepositories, localRepository );
         }
         catch ( InvalidVersionSpecificationException e )
         {



Mime
View raw message