You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Antonio Sanso (JIRA)" <ji...@apache.org> on 2015/02/10 15:06:11 UTC

[jira] [Commented] (SLING-4399) Regression in the SlingAuthenticator

    [ https://issues.apache.org/jira/browse/SLING-4399?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14314199#comment-14314199 ] 

Antonio Sanso commented on SLING-4399:
--------------------------------------

proposed patch

{code}
--- src/main/java/org/apache/sling/auth/core/impl/SlingAuthenticator.java	(revision 1658714)
+++ src/main/java/org/apache/sling/auth/core/impl/SlingAuthenticator.java	(working copy)
@@ -24,6 +24,7 @@
 import java.util.Dictionary;
 import java.util.HashMap;
 import java.util.Hashtable;
+import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
@@ -526,8 +527,10 @@
         boolean done = false;
         for (int m = 0; !done && m < holdersArray.length; m++) {
             final Collection<AbstractAuthenticationHandlerHolder> holderList = holdersArray[m];
-            if ( holderList != null ) {
-                for (AbstractAuthenticationHandlerHolder holder : holderList) {
+            if ( holderList != null ) {      
+                Iterator <AbstractAuthenticationHandlerHolder> holderListIterator = holderList.iterator();
+                while (holderListIterator.hasNext() && !done) {                 
+                    final AbstractAuthenticationHandlerHolder holder = holderListIterator.next();
                     if (path.startsWith(holder.path)) {
                         log.debug("login: requesting authentication using handler: {}",
                             holder);
{code}

[~rombert] since you committed SLING-3936 may you quickly review my proposed patch?

> Regression in the SlingAuthenticator
> ------------------------------------
>
>                 Key: SLING-4399
>                 URL: https://issues.apache.org/jira/browse/SLING-4399
>             Project: Sling
>          Issue Type: Bug
>          Components: Authentication
>            Reporter: Antonio Sanso
>            Assignee: Antonio Sanso
>
> SLING-3936 introduced a regression.
> Obseving the diff
> {code}
> - for (int i = 0; !done && i < holderList.size(); i++) {
> - final AbstractAuthenticationHandlerHolder holder = holderList.get(i);
> + for (AbstractAuthenticationHandlerHolder holder : holderList) {
> {code}
> it is clear that {{!done}} has been lost in translation



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)