myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jak...@apache.org
Subject svn commit: r955768 - /myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/NullIterator.java
Date Thu, 17 Jun 2010 22:24:24 GMT
Author: jakobk
Date: Thu Jun 17 22:24:24 2010
New Revision: 955768

URL: http://svn.apache.org/viewvc?rev=955768&view=rev
Log:
Add generics to NullIterator

Modified:
    myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/NullIterator.java

Modified: myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/NullIterator.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/NullIterator.java?rev=955768&r1=955767&r2=955768&view=diff
==============================================================================
--- myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/NullIterator.java
(original)
+++ myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/NullIterator.java
Thu Jun 17 22:24:24 2010
@@ -21,24 +21,24 @@ package org.apache.myfaces.shared.util;
 import java.util.Iterator;
 import java.util.NoSuchElementException;
 
-
 /**
  * Iterator without elements
  *
  * @author Anton Koinov (latest modification by $Author$)
  * @version $Revision$ $Date$
  */
-public final class NullIterator implements Iterator
+public final class NullIterator<T> implements Iterator<T>
 {
     //~ Static fields/initializers -----------------------------------------------------------------
 
-    private static final NullIterator INSTANCE = new NullIterator();
+    private static final NullIterator<?> INSTANCE = new NullIterator<Object>();
 
     //~ Methods ------------------------------------------------------------------------------------
 
-    public static final Iterator instance()
+    @SuppressWarnings("unchecked")
+    public static final <T> Iterator<T> instance()
     {
-        return INSTANCE;
+        return (Iterator<T>) INSTANCE;
     }
 
     public boolean hasNext()
@@ -46,7 +46,7 @@ public final class NullIterator implemen
         return false;
     }
 
-    public Object next()
+    public T next()
     {
         throw new NoSuchElementException();
     }



Mime
View raw message