jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r312638 - /incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/SessionItemStateManager.java
Date Mon, 10 Oct 2005 13:02:09 GMT
Author: stefan
Date: Mon Oct 10 06:01:55 2005
New Revision: 312638

URL: http://svn.apache.org/viewcvs?rev=312638&view=rev
Log:
do not return IteratorChain with empty chain to avoid issue with older 
IteratorChain implementations (pre Commons Collections 3.1)
see http://thread.gmane.org/gmane.comp.apache.jackrabbit.devel/3909

Modified:
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/SessionItemStateManager.java

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/SessionItemStateManager.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/SessionItemStateManager.java?rev=312638&r1=312637&r2=312638&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/SessionItemStateManager.java
(original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/SessionItemStateManager.java
Mon Oct 10 06:01:55 2005
@@ -464,6 +464,16 @@
                 resultIter.addIterator(list.iterator());
             }
         }
+        /**
+         * if the resulting iterator chain is empty return
+         * EMPTY_LIST.iterator() instead because older versions
+         * of IteratorChain (pre Commons Collections 3.1)
+         * would throw UnsupportedOperationException in this
+         * situation
+         */
+        if (resultIter.getIterators().isEmpty()) {
+            return Collections.EMPTY_LIST.iterator();
+        }
         return resultIter;
     }
 
@@ -562,6 +572,16 @@
             if (list != null) {
                 resultIter.addIterator(list.iterator());
             }
+        }
+        /**
+         * if the resulting iterator chain is empty return
+         * EMPTY_LIST.iterator() instead because older versions
+         * of IteratorChain (pre Commons Collections 3.1)
+         * would throw UnsupportedOperationException in this
+         * situation
+         */
+        if (resultIter.getIterators().isEmpty()) {
+            return Collections.EMPTY_LIST.iterator();
         }
         return resultIter;
     }



Mime
View raw message