Author: carlos
Date: Wed Nov 28 23:53:25 2007
New Revision: 599317
URL: http://svn.apache.org/viewvc?rev=599317&view=rev
Log:
[MRRESOURCES-26] Fix NPE
Modified:
maven/plugins/trunk/maven-remote-resources-plugin/src/main/java/org/apache/maven/plugin/resources/remote/ProcessRemoteResourcesMojo.java
Modified:
maven/plugins/trunk/maven-remote-resources-plugin/src/main/java/org/apache/maven/plugin/resources/remote/ProcessRemoteResourcesMojo.java
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/src/main/java/org/apache/maven/plugin/resources/remote/ProcessRemoteResourcesMojo.java?rev=599317&r1=599316&r2=599317&view=diff
==============================================================================
---
maven/plugins/trunk/maven-remote-resources-plugin/src/main/java/org/apache/maven/plugin/resources/remote/ProcessRemoteResourcesMojo.java
(original)
+++
maven/plugins/trunk/maven-remote-resources-plugin/src/main/java/org/apache/maven/plugin/resources/remote/ProcessRemoteResourcesMojo.java
Wed Nov 28 23:53:25 2007
@@ -66,7 +66,6 @@
import java.net.URLConnection;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
@@ -78,14 +77,18 @@
import java.util.TreeMap;
/**
+ * <p>
* Pull down resourceBundles containing remote resources and process the
resources contained
* inside the artifact.
- * <p/>
+ * </p>
+ * <p>
* Resources that end in ".vm" are treated as velocity templates. For those,
the ".vm" is
* stripped off for the final artifact name and it's fed through velocity to
have properties
* expanded, conditions processed, etc...
- * <p/>
+ * </p>
+ * <p>
* Resources that don't end in ".vm" are copied "as is".
+ * </p>
*
* @goal process
* @requiresDependencyResolution runtime
@@ -412,9 +415,11 @@
{
Map organizations = new TreeMap( new OrganizationComparator() );
List unknownOrganization = new ArrayList();
+
for ( Iterator i = projects.iterator(); i.hasNext(); )
{
MavenProject p = (MavenProject) i.next();
+
if ( p.getOrganization() != null && StringUtils.isNotEmpty(
p.getOrganization().getName() ) )
{
List sortedProjects = (List) organizations.get(
p.getOrganization() );
@@ -855,6 +860,10 @@
else if ( s1 == null && s2 != null )
{
return 1;
+ }
+ else if ( s1 != null && s2 == null )
+ {
+ return -1;
}
return s1.compareToIgnoreCase( s2 );