continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r918314 - /continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
Date Wed, 03 Mar 2010 03:30:15 GMT
Author: brett
Date: Wed Mar  3 03:30:15 2010
New Revision: 918314

URL: http://svn.apache.org/viewvc?rev=918314&view=rev
Log:
[CONTINUUM-2475] NullPointerException while adding a Maven 2 project if there is already an
Ant project in the group

Modified:
    continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=918314&r1=918313&r2=918314&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
(original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
Wed Mar  3 03:30:15 2010
@@ -3744,12 +3744,12 @@
             return;
         }
 
-        for ( Project project : (List<Project>) projectGroup.getProjects() )
+        for ( Project project : projectGroup.getProjects() )
         {
-
-            if ( project.getGroupId().equals( projectToCheck.getGroupId() ) &&
-                project.getArtifactId().equals( projectToCheck.getArtifactId() ) &&
-                project.getVersion().equals( projectToCheck.getVersion() ) )
+            // projectToCheck is first in the equals check, as projectToCheck must be a Maven
project and will have
+            // non-null values for each. project may be an Ant or Shell project and have
null values.
+            if ( projectToCheck.getGroupId().equals( project.getGroupId() ) && projectToCheck.getArtifactId().equals(
+                project.getArtifactId() ) && projectToCheck.getVersion().equals(
project.getVersion() ) )
             {
                 result.addError( ContinuumProjectBuildingResult.ERROR_DUPLICATE_PROJECTS
);
                 return;



Mime
View raw message