jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1335040 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak: kernel/KernelNodeState.java util/Iterators.java
Date Mon, 07 May 2012 14:36:34 GMT
Author: mduerig
Date: Mon May  7 14:36:33 2012
New Revision: 1335040

URL: http://svn.apache.org/viewvc?rev=1335040&view=rev
Log:
OAK-81: Remove offset and count parameters from NodeState.getChildNodeEntries()
tighten return type of Iterators.flatten in order to get correct type when called with heterogeneous
iterators in input

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeState.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/util/Iterators.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeState.java?rev=1335040&r1=1335039&r2=1335040&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeState.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeState.java
Mon May  7 14:36:33 2012
@@ -150,21 +150,20 @@ class KernelNodeState extends AbstractNo
         return child;
     }
 
-    @SuppressWarnings("unchecked")
     @Override
     public Iterable<? extends ChildNodeEntry> getChildNodeEntries() {
-        return new Iterable() {  // Java's type system is too weak to express the exact type
here
+        return (new Iterable<ChildNodeEntry>() {
             @Override
-            public Iterator<? extends ChildNodeEntry> iterator() {
+            public Iterator<ChildNodeEntry> iterator() {
                 return Iterators.flatten(
                     new PagedIterator<ChildNodeEntry>(MAX_CHILD_NODE_NAMES) {
                         @Override
                         protected Iterator<? extends ChildNodeEntry> getPage(long pos,
int size) {
                             return getChildNodeEntries(pos, size);
                         }
-                    });
+                });
             }
-        };
+        });
     }
 
     //------------------------------------------------------------< internal >---

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/util/Iterators.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/util/Iterators.java?rev=1335040&r1=1335039&r2=1335040&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/util/Iterators.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/util/Iterators.java
Mon May  7 14:36:33 2012
@@ -191,7 +191,7 @@ public final class Iterators {
      * @param <T>
      * @return
      */
-    public static <T> Iterator<? extends T> flatten(final Iterator<Iterator<?
extends T>> iterators) {
+    public static <T> Iterator<T> flatten(final Iterator<Iterator<? extends
T>> iterators) {
         return new Iterator<T>() {
             private Iterator<? extends T> current;
 



Mime
View raw message