svn commit: r169306 - /maven/components/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/metadata/ReleaseArtifactMetadata.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r169306 - /maven/components/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/metadata/ReleaseArtifactMetadata.java

brettporter
Administrator
Author: brett
Date: Mon May  9 05:42:04 2005
New Revision: 169306

URL: http://svn.apache.org/viewcvs?rev=169306&view=rev
Log:
fix bug in compareTo when metadata.version is null

Modified:
    maven/components/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/metadata/ReleaseArtifactMetadata.java

Modified: maven/components/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/metadata/ReleaseArtifactMetadata.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/metadata/ReleaseArtifactMetadata.java?rev=169306&r1=169305&r2=169306&view=diff
==============================================================================
--- maven/components/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/metadata/ReleaseArtifactMetadata.java (original)
+++ maven/components/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/metadata/ReleaseArtifactMetadata.java Mon May  9 05:42:04 2005
@@ -47,6 +47,7 @@
     {
         ReleaseArtifactMetadata metadata = (ReleaseArtifactMetadata) o;
 
+        // TODO: we need some more complicated version comparison
         if ( version == null )
         {
             if ( metadata.version == null )
@@ -58,9 +59,17 @@
                 return -1;
             }
         }
-
-        // TODO: we need some more complicated version comparison
-        return version.compareTo( metadata.version );
+        else
+        {
+            if ( metadata.version == null )
+            {
+                return 1;
+            }
+            else
+            {
+                return version.compareTo( metadata.version );
+            }
+        }
     }
 
     public boolean newerThanFile( File file )



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]