commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1130671 - /commons/sandbox/digester3/trunk/src/examples/api/catalog/src/main/java/org/apache/commons/digester3/examples/api/catalog/Catalog.java
Date Thu, 02 Jun 2011 17:29:15 GMT
Author: simonetripodi
Date: Thu Jun  2 17:29:14 2011
New Revision: 1130671

URL: http://svn.apache.org/viewvc?rev=1130671&view=rev
Log:
added generic to collections

Modified:
    commons/sandbox/digester3/trunk/src/examples/api/catalog/src/main/java/org/apache/commons/digester3/examples/api/catalog/Catalog.java

Modified: commons/sandbox/digester3/trunk/src/examples/api/catalog/src/main/java/org/apache/commons/digester3/examples/api/catalog/Catalog.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/examples/api/catalog/src/main/java/org/apache/commons/digester3/examples/api/catalog/Catalog.java?rev=1130671&r1=1130670&r2=1130671&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/examples/api/catalog/src/main/java/org/apache/commons/digester3/examples/api/catalog/Catalog.java
(original)
+++ commons/sandbox/digester3/trunk/src/examples/api/catalog/src/main/java/org/apache/commons/digester3/examples/api/catalog/Catalog.java
Thu Jun  2 17:29:14 2011
@@ -26,7 +26,7 @@ import java.util.Iterator;
 public class Catalog
 {
 
-    LinkedList items = new LinkedList();
+    LinkedList<Item> items = new LinkedList<Item>();
 
     public void addItem( Item item )
     {
@@ -37,9 +37,9 @@ public class Catalog
     {
         System.out.println( "This catalog has " + items.size() + " items" );
 
-        for ( Iterator i = items.iterator(); i.hasNext(); )
+        for ( Iterator<Item> i = items.iterator(); i.hasNext(); )
         {
-            Item item = (Item) i.next();
+            Item item = i.next();
             item.print();
         }
     }



Mime
View raw message