maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bentm...@apache.org
Subject svn commit: r931889 - /maven/maven-3/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/VersionRange.java
Date Thu, 08 Apr 2010 11:35:42 GMT
Author: bentmann
Date: Thu Apr  8 11:35:42 2010
New Revision: 931889

URL: http://svn.apache.org/viewvc?rev=931889&view=rev
Log:
o Added generics

Modified:
    maven/maven-3/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/VersionRange.java

Modified: maven/maven-3/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/VersionRange.java
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/VersionRange.java?rev=931889&r1=931888&r2=931889&view=diff
==============================================================================
--- maven/maven-3/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/VersionRange.java
(original)
+++ maven/maven-3/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/VersionRange.java
Thu Apr  8 11:35:42 2010
@@ -50,7 +50,7 @@ public class VersionRange
         return recommendedVersion;
     }
 
-    public List getRestrictions()
+    public List<Restriction> getRestrictions()
     {
         return restrictions;
     }
@@ -312,10 +312,10 @@ public class VersionRange
     private List<Restriction> intersection( List<Restriction> r1, List<Restriction>
r2 )
     {
         List<Restriction> restrictions = new ArrayList<Restriction>( r1.size()
+ r2.size() );
-        Iterator i1 = r1.iterator();
-        Iterator i2 = r2.iterator();
-        Restriction res1 = (Restriction) i1.next();
-        Restriction res2 = (Restriction) i2.next();
+        Iterator<Restriction> i1 = r1.iterator();
+        Iterator<Restriction> i2 = r2.iterator();
+        Restriction res1 = i1.next();
+        Restriction res2 = i2.next();
 
         boolean done = false;
         while ( !done )
@@ -505,9 +505,9 @@ public class VersionRange
         else
         {
             StringBuilder buf = new StringBuilder();
-            for ( Iterator i = restrictions.iterator(); i.hasNext(); )
+            for ( Iterator<Restriction> i = restrictions.iterator(); i.hasNext(); )
             {
-                Restriction r = (Restriction) i.next();
+                Restriction r = i.next();
 
                 buf.append( r.toString() );
 



Mime
View raw message