src/share/classes/com/sun/jndi/toolkit/dir/ContextEnumerator.java

Print this page
rev 10430 : imported patch typos


 165             if(debug) {System.out.println("hasMoreDescendants returning " +
 166                                           (currentChild != null) ); }
 167             return currentChild != null;
 168         } else if (currentChildExpanded && currentChildEnum.hasMore()) {
 169 
 170             if(debug) {System.out.println("hasMoreDescendants returning " +
 171                 "true");}
 172 
 173             return true;
 174         } else {
 175             if(debug) {System.out.println("hasMoreDescendants returning " +
 176                 "hasMoreChildren");}
 177             return hasMoreChildren();
 178         }
 179     }
 180 
 181     private Binding getNextDescendant() throws NamingException {
 182 
 183         if (!currentReturned) {
 184             // returning parent
 185             if(debug) {System.out.println("getNextDescedant: simple case");}
 186 
 187             currentReturned = true;
 188             return currentChild;
 189 
 190         } else if (currentChildExpanded && currentChildEnum.hasMore()) {
 191 
 192             if(debug) {System.out.println("getNextDescedant: expanded case");}
 193 
 194             // if the current child is expanded, use it's enumerator
 195             return currentChildEnum.next();
 196 
 197         } else {
 198 
 199             // Ready to go onto next child
 200             if(debug) {System.out.println("getNextDescedant: next case");}
 201 
 202             prepNextChild();
 203             return getNextDescendant();
 204         }
 205     }
 206 
 207     private void prepNextChild() throws NamingException {
 208         if(hasMoreChildren()) {
 209             try {
 210                 currentChild = getNextChild();
 211                 currentReturned = false;
 212             } catch (NamingException e){
 213                 if (debug) System.out.println(e);
 214                 if (debug) e.printStackTrace();
 215             }
 216         } else {
 217             currentChild = null;
 218             return;
 219         }
 220 


 165             if(debug) {System.out.println("hasMoreDescendants returning " +
 166                                           (currentChild != null) ); }
 167             return currentChild != null;
 168         } else if (currentChildExpanded && currentChildEnum.hasMore()) {
 169 
 170             if(debug) {System.out.println("hasMoreDescendants returning " +
 171                 "true");}
 172 
 173             return true;
 174         } else {
 175             if(debug) {System.out.println("hasMoreDescendants returning " +
 176                 "hasMoreChildren");}
 177             return hasMoreChildren();
 178         }
 179     }
 180 
 181     private Binding getNextDescendant() throws NamingException {
 182 
 183         if (!currentReturned) {
 184             // returning parent
 185             if(debug) {System.out.println("getNextDescendant: simple case");}
 186 
 187             currentReturned = true;
 188             return currentChild;
 189 
 190         } else if (currentChildExpanded && currentChildEnum.hasMore()) {
 191 
 192             if(debug) {System.out.println("getNextDescendant: expanded case");}
 193 
 194             // if the current child is expanded, use it's enumerator
 195             return currentChildEnum.next();
 196 
 197         } else {
 198 
 199             // Ready to go onto next child
 200             if(debug) {System.out.println("getNextDescendant: next case");}
 201 
 202             prepNextChild();
 203             return getNextDescendant();
 204         }
 205     }
 206 
 207     private void prepNextChild() throws NamingException {
 208         if(hasMoreChildren()) {
 209             try {
 210                 currentChild = getNextChild();
 211                 currentReturned = false;
 212             } catch (NamingException e){
 213                 if (debug) System.out.println(e);
 214                 if (debug) e.printStackTrace();
 215             }
 216         } else {
 217             currentChild = null;
 218             return;
 219         }
 220