maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bentm...@apache.org
Subject svn commit: r1039332 - in /maven/maven-3/trunk: maven-artifact/src/main/java/org/apache/maven/artifact/versioning/ maven-compat/src/main/java/org/apache/maven/repository/legacy/resolver/conflict/
Date Fri, 26 Nov 2010 12:37:38 GMT
Author: bentmann
Date: Fri Nov 26 12:37:37 2010
New Revision: 1039332

URL: http://svn.apache.org/viewvc?rev=1039332&view=rev
Log:
[MNG-4912] Use of raw type should be Comparable<ArtifactVersion>
Submitted by: Jesse Glick

Modified:
    maven/maven-3/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/ArtifactVersion.java
    maven/maven-3/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/DefaultArtifactVersion.java
    maven/maven-3/trunk/maven-compat/src/main/java/org/apache/maven/repository/legacy/resolver/conflict/NewestConflictResolver.java
    maven/maven-3/trunk/maven-compat/src/main/java/org/apache/maven/repository/legacy/resolver/conflict/OldestConflictResolver.java

Modified: maven/maven-3/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/ArtifactVersion.java
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/ArtifactVersion.java?rev=1039332&r1=1039331&r2=1039332&view=diff
==============================================================================
--- maven/maven-3/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/ArtifactVersion.java
(original)
+++ maven/maven-3/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/ArtifactVersion.java
Fri Nov 26 12:37:37 2010
@@ -27,7 +27,7 @@ package org.apache.maven.artifact.versio
  * @version $Id$
  */
 public interface ArtifactVersion
-    extends Comparable
+    extends Comparable<ArtifactVersion>
 {
     int getMajorVersion();
 

Modified: maven/maven-3/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/DefaultArtifactVersion.java
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/DefaultArtifactVersion.java?rev=1039332&r1=1039331&r2=1039332&view=diff
==============================================================================
--- maven/maven-3/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/DefaultArtifactVersion.java
(original)
+++ maven/maven-3/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/DefaultArtifactVersion.java
Fri Nov 26 12:37:37 2010
@@ -66,13 +66,19 @@ public class DefaultArtifactVersion
             return false;
         }
 
-        return compareTo( other ) == 0;
+        return compareTo( (ArtifactVersion) other ) == 0;
     }
 
-    public int compareTo( Object o )
+    public int compareTo( ArtifactVersion otherVersion )
     {
-        DefaultArtifactVersion otherVersion = (DefaultArtifactVersion) o;
-        return this.comparable.compareTo( otherVersion.comparable );
+        if ( otherVersion instanceof DefaultArtifactVersion )
+        {
+            return this.comparable.compareTo( ( (DefaultArtifactVersion) otherVersion).comparable
);
+        }
+        else
+        {
+            return compareTo( new DefaultArtifactVersion( otherVersion.toString() ) );
+        }
     }
 
     public int getMajorVersion()

Modified: maven/maven-3/trunk/maven-compat/src/main/java/org/apache/maven/repository/legacy/resolver/conflict/NewestConflictResolver.java
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-compat/src/main/java/org/apache/maven/repository/legacy/resolver/conflict/NewestConflictResolver.java?rev=1039332&r1=1039331&r2=1039332&view=diff
==============================================================================
--- maven/maven-3/trunk/maven-compat/src/main/java/org/apache/maven/repository/legacy/resolver/conflict/NewestConflictResolver.java
(original)
+++ maven/maven-3/trunk/maven-compat/src/main/java/org/apache/maven/repository/legacy/resolver/conflict/NewestConflictResolver.java
Fri Nov 26 12:37:37 2010
@@ -30,7 +30,7 @@ import org.codehaus.plexus.component.ann
  *
  * @author <a href="mailto:markhobson@gmail.com">Mark Hobson</a>
  * @version $Id$
- * @see ArtifactVersion#compareTo(Object)
+ * @see ArtifactVersion#compareTo
  * @since 3.0
  */
 @Component( role = ConflictResolver.class, hint = "newest" )

Modified: maven/maven-3/trunk/maven-compat/src/main/java/org/apache/maven/repository/legacy/resolver/conflict/OldestConflictResolver.java
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-compat/src/main/java/org/apache/maven/repository/legacy/resolver/conflict/OldestConflictResolver.java?rev=1039332&r1=1039331&r2=1039332&view=diff
==============================================================================
--- maven/maven-3/trunk/maven-compat/src/main/java/org/apache/maven/repository/legacy/resolver/conflict/OldestConflictResolver.java
(original)
+++ maven/maven-3/trunk/maven-compat/src/main/java/org/apache/maven/repository/legacy/resolver/conflict/OldestConflictResolver.java
Fri Nov 26 12:37:37 2010
@@ -30,7 +30,7 @@ import org.codehaus.plexus.component.ann
  *
  * @author <a href="mailto:markhobson@gmail.com">Mark Hobson</a>
  * @version $Id$
- * @see ArtifactVersion#compareTo(Object)
+ * @see ArtifactVersion#compareTo
  * @since 3.0
  */
 @Component( role = ConflictResolver.class, hint = "oldest" )



Mime
View raw message