Author: remy.maucherat(a)jboss.com
Date: 2010-04-26 10:00:51 -0400 (Mon, 26 Apr 2010)
New Revision: 1451
Modified:
trunk/java/org/apache/naming/resources/ProxyDirContext.java
Log:
- Problem was list throws a NamingException when not found. So move the code blocks inside
the try/catch.
Modified: trunk/java/org/apache/naming/resources/ProxyDirContext.java
===================================================================
--- trunk/java/org/apache/naming/resources/ProxyDirContext.java 2010-04-26 13:45:57 UTC
(rev 1450)
+++ trunk/java/org/apache/naming/resources/ProxyDirContext.java 2010-04-26 14:00:51 UTC
(rev 1451)
@@ -519,26 +519,26 @@
NamingEnumeration<NameClassPair> overlay = null;
try {
overlay = overlays[i].list(parseName(name));
- } catch (NamingException e) {
- // Ignore
- }
- if (main == null) {
- main = overlay;
- } else {
- // Merge that into the merged set
- if (merged == null) {
- merged = new HashMap<String, NameClassPair>();
- while (main.hasMore()) {
- NameClassPair pair = main.next();
- merged.put(pair.getName(), pair);
+ if (main == null) {
+ main = overlay;
+ } else {
+ // Merge that into the merged set
+ if (merged == null) {
+ merged = new HashMap<String, NameClassPair>();
+ while (main.hasMore()) {
+ NameClassPair pair = main.next();
+ merged.put(pair.getName(), pair);
+ }
}
- }
- while (overlay.hasMore()) {
- NameClassPair pair = overlay.next();
- if (merged.get(pair.getName()) == null) {
- merged.put(pair.getName(), pair);
+ while (overlay.hasMore()) {
+ NameClassPair pair = overlay.next();
+ if (merged.get(pair.getName()) == null) {
+ merged.put(pair.getName(), pair);
+ }
}
}
+ } catch (NamingException e) {
+ // Ignore
}
}
if (main == null && merged == null) {
@@ -578,26 +578,26 @@
NamingEnumeration<NameClassPair> overlay = null;
try {
overlay = overlays[i].list(parseName(name));
- } catch (NamingException e) {
- // Ignore
- }
- if (main == null) {
- main = overlay;
- } else {
- // Merge that into the merged set
- if (merged == null) {
- merged = new HashMap<String, NameClassPair>();
- while (main.hasMore()) {
- NameClassPair pair = main.next();
- merged.put(pair.getName(), pair);
+ if (main == null) {
+ main = overlay;
+ } else {
+ // Merge that into the merged set
+ if (merged == null) {
+ merged = new HashMap<String, NameClassPair>();
+ while (main.hasMore()) {
+ NameClassPair pair = main.next();
+ merged.put(pair.getName(), pair);
+ }
}
- }
- while (overlay.hasMore()) {
- NameClassPair pair = overlay.next();
- if (merged.get(pair.getName()) == null) {
- merged.put(pair.getName(), pair);
+ while (overlay.hasMore()) {
+ NameClassPair pair = overlay.next();
+ if (merged.get(pair.getName()) == null) {
+ merged.put(pair.getName(), pair);
+ }
}
}
+ } catch (NamingException e) {
+ // Ignore
}
}
if (main == null && merged == null) {
@@ -641,26 +641,26 @@
NamingEnumeration<Binding> overlay = null;
try {
overlay = overlays[i].listBindings(parseName(name));
- } catch (NamingException e) {
- // Ignore
- }
- if (main == null) {
- main = overlay;
- } else {
- // Merge that into the merged set
- if (merged == null) {
- merged = new HashMap<String, Binding>();
- while (main.hasMore()) {
- Binding pair = main.next();
- merged.put(pair.getName(), pair);
+ if (main == null) {
+ main = overlay;
+ } else {
+ // Merge that into the merged set
+ if (merged == null) {
+ merged = new HashMap<String, Binding>();
+ while (main.hasMore()) {
+ Binding pair = main.next();
+ merged.put(pair.getName(), pair);
+ }
}
- }
- while (overlay.hasMore()) {
- Binding pair = overlay.next();
- if (merged.get(pair.getName()) == null) {
- merged.put(pair.getName(), pair);
+ while (overlay.hasMore()) {
+ Binding pair = overlay.next();
+ if (merged.get(pair.getName()) == null) {
+ merged.put(pair.getName(), pair);
+ }
}
}
+ } catch (NamingException e) {
+ // Ignore
}
}
if (main == null && merged == null) {
@@ -700,26 +700,26 @@
NamingEnumeration<Binding> overlay = null;
try {
overlay = overlays[i].listBindings(parseName(name));
- } catch (NamingException e) {
- // Ignore
- }
- if (main == null) {
- main = overlay;
- } else {
- // Merge that into the merged set
- if (merged == null) {
- merged = new HashMap<String, Binding>();
- while (main.hasMore()) {
- Binding pair = main.next();
- merged.put(pair.getName(), pair);
+ if (main == null) {
+ main = overlay;
+ } else {
+ // Merge that into the merged set
+ if (merged == null) {
+ merged = new HashMap<String, Binding>();
+ while (main.hasMore()) {
+ Binding pair = main.next();
+ merged.put(pair.getName(), pair);
+ }
}
- }
- while (overlay.hasMore()) {
- Binding pair = overlay.next();
- if (merged.get(pair.getName()) == null) {
- merged.put(pair.getName(), pair);
+ while (overlay.hasMore()) {
+ Binding pair = overlay.next();
+ if (merged.get(pair.getName()) == null) {
+ merged.put(pair.getName(), pair);
+ }
}
}
+ } catch (NamingException e) {
+ // Ignore
}
}
if (main == null && merged == null) {
Show replies by date