You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by en...@apache.org on 2020/10/11 18:40:01 UTC

[sling-org-apache-sling-jcr-jackrabbit-usermanager] branch master updated: AuthorizableResourceProvider.ChildrenIterator#next should throw NoSuchElementException when there is no next item

This is an automated email from the ASF dual-hosted git repository.

enorman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-jackrabbit-usermanager.git


The following commit(s) were added to refs/heads/master by this push:
     new 84fe1e5  AuthorizableResourceProvider.ChildrenIterator#next should throw NoSuchElementException when there is no next item
84fe1e5 is described below

commit 84fe1e5967b5a416801c6a1da342223522e777cc
Author: Eric Norman <en...@apache.org>
AuthorDate: Sun Oct 11 11:39:53 2020 -0700

    AuthorizableResourceProvider.ChildrenIterator#next should throw
    NoSuchElementException when there is no next item
---
 .../usermanager/impl/resource/AuthorizableResourceProvider.java      | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/resource/AuthorizableResourceProvider.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/resource/AuthorizableResourceProvider.java
index fb75210..214bbf7 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/resource/AuthorizableResourceProvider.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/resource/AuthorizableResourceProvider.java
@@ -21,6 +21,7 @@ import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.NoSuchElementException;
 
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
@@ -274,6 +275,10 @@ public class AuthorizableResourceProvider extends ResourceProvider<Object> imple
         }
 
         public Resource next() {
+            if (!hasNext()) {
+                throw new NoSuchElementException();
+            }
+
             Principal nextPrincipal = principals.nextPrincipal();
             try {
                 ResourceResolver resourceResolver = parent.getResourceResolver();