maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From car...@apache.org
Subject svn commit: r568258 - /maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/shared/dependency/tree/DependencyNode.java
Date Tue, 21 Aug 2007 20:29:52 GMT
Author: carlos
Date: Tue Aug 21 13:29:51 2007
New Revision: 568258

URL: http://svn.apache.org/viewvc?rev=568258&view=rev
Log:
Solve problem when artifact has version range

Modified:
    maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/shared/dependency/tree/DependencyNode.java

Modified: maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/shared/dependency/tree/DependencyNode.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/shared/dependency/tree/DependencyNode.java?rev=568258&r1=568257&r2=568258&view=diff
==============================================================================
--- maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/shared/dependency/tree/DependencyNode.java
(original)
+++ maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/shared/dependency/tree/DependencyNode.java
Tue Aug 21 13:29:51 2007
@@ -552,7 +552,20 @@
 
         this.relatedArtifact = relatedArtifact;
 
-        boolean duplicate = getArtifact().getVersion().equals( relatedArtifact.getVersion()
);
+        boolean duplicate = false;
+        if ( getArtifact().getVersion() != null )
+        {
+            duplicate = getArtifact().getVersion().equals( relatedArtifact.getVersion() );
+        }
+        else if ( getArtifact().getVersionRange() != null )
+        {
+            duplicate = getArtifact().getVersionRange().equals( relatedArtifact.getVersionRange()
);
+        }
+        else
+        {
+            throw new RuntimeException( "Artifact version and version range is null: " +
getArtifact() );
+        }
+
         state = duplicate ? OMITTED_FOR_DUPLICATE : OMITTED_FOR_CONFLICT;
 
         removeAllChildren();



Mime
View raw message