6453837: PartialCompositeContext.allEmpty is buggy
authorxuelei
Mon, 13 Jul 2009 23:01:03 +0800
changeset 3227 a3484e08f2bc
parent 3226 b142b3d06bf5
child 3228 d7c00dbea781
6453837: PartialCompositeContext.allEmpty is buggy Reviewed-by: weijun
jdk/src/share/classes/com/sun/jndi/toolkit/ctx/PartialCompositeContext.java
--- a/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/PartialCompositeContext.java	Sat Jul 11 16:43:08 2009 +0100
+++ b/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/PartialCompositeContext.java	Mon Jul 13 23:01:03 2009 +0800
@@ -493,9 +493,9 @@
      * Tests whether a name contains a nonempty component.
      */
     protected static boolean allEmpty(Name name) {
-        Enumeration enum_ = name.getAll();
+        Enumeration<String> enum_ = name.getAll();
         while (enum_.hasMoreElements()) {
-            if (!enum_.equals("")) {
+            if (!enum_.nextElement().isEmpty()) {
                 return false;
             }
         }