commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1125950 - in /incubator/ognl/trunk/src/main/java/org/apache/commons/ognl: CollectionElementsAccessor.java IteratorElementsAccessor.java IteratorEnumeration.java MapElementsAccessor.java
Date Sun, 22 May 2011 13:08:38 GMT
Author: simonetripodi
Date: Sun May 22 13:08:38 2011
New Revision: 1125950

URL: http://svn.apache.org/viewvc?rev=1125950&view=rev
Log:
fixed Iterator<T> wrapper raw type

Modified:
    incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/CollectionElementsAccessor.java
    incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/IteratorElementsAccessor.java
    incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/IteratorEnumeration.java
    incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/MapElementsAccessor.java

Modified: incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/CollectionElementsAccessor.java
URL: http://svn.apache.org/viewvc/incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/CollectionElementsAccessor.java?rev=1125950&r1=1125949&r2=1125950&view=diff
==============================================================================
--- incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/CollectionElementsAccessor.java
(original)
+++ incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/CollectionElementsAccessor.java
Sun May 22 13:08:38 2011
@@ -19,6 +19,8 @@ package org.apache.commons.ognl;
  * under the License.
  */
 
+import static org.apache.commons.ognl.IteratorEnumeration.newEnumeration;
+
 import java.util.Collection;
 import java.util.Enumeration;
 
@@ -36,6 +38,7 @@ public class CollectionElementsAccessor
      */
     public Enumeration<?> getElements( Object target )
     {
-        return new IteratorEnumeration( ( (Collection<?>) target ).iterator() );
+        return newEnumeration( ( (Collection<?>) target ).iterator() );
     }
+
 }

Modified: incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/IteratorElementsAccessor.java
URL: http://svn.apache.org/viewvc/incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/IteratorElementsAccessor.java?rev=1125950&r1=1125949&r2=1125950&view=diff
==============================================================================
--- incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/IteratorElementsAccessor.java
(original)
+++ incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/IteratorElementsAccessor.java
Sun May 22 13:08:38 2011
@@ -19,6 +19,8 @@ package org.apache.commons.ognl;
  * under the License.
  */
 
+import static org.apache.commons.ognl.IteratorEnumeration.newEnumeration;
+
 import java.util.Enumeration;
 import java.util.Iterator;
 
@@ -36,6 +38,6 @@ public class IteratorElementsAccessor
      */
     public Enumeration<?> getElements( Object target )
     {
-        return new IteratorEnumeration( (Iterator<?>) target );
+        return newEnumeration( (Iterator<?>) target );
     }
 }

Modified: incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/IteratorEnumeration.java
URL: http://svn.apache.org/viewvc/incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/IteratorEnumeration.java?rev=1125950&r1=1125949&r2=1125950&view=diff
==============================================================================
--- incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/IteratorEnumeration.java (original)
+++ incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/IteratorEnumeration.java Sun
May 22 13:08:38 2011
@@ -31,9 +31,15 @@ import java.util.Iterator;
 public class IteratorEnumeration<T>
     implements Enumeration<T>
 {
+
+    public static <E> Enumeration<E> newEnumeration( Iterator<E> iterator
)
+    {
+        return new IteratorEnumeration<E>( iterator );
+    }
+
     private Iterator<T> it;
 
-    public IteratorEnumeration( Iterator<T> it )
+    private IteratorEnumeration( Iterator<T> it )
     {
         this.it = it;
     }

Modified: incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/MapElementsAccessor.java
URL: http://svn.apache.org/viewvc/incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/MapElementsAccessor.java?rev=1125950&r1=1125949&r2=1125950&view=diff
==============================================================================
--- incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/MapElementsAccessor.java (original)
+++ incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/MapElementsAccessor.java Sun
May 22 13:08:38 2011
@@ -19,6 +19,8 @@ package org.apache.commons.ognl;
  * under the License.
  */
 
+import static org.apache.commons.ognl.IteratorEnumeration.newEnumeration;
+
 import java.util.Enumeration;
 import java.util.Map;
 
@@ -36,6 +38,6 @@ public class MapElementsAccessor
      */
     public Enumeration<?> getElements( Object target )
     {
-        return new IteratorEnumeration( ( (Map<?, ?>) target ).values().iterator()
);
+        return newEnumeration( ( (Map<?, ?>) target ).values().iterator() );
     }
 }



Mime
View raw message