--- old/src/java.naming/share/classes/com/sun/jndi/toolkit/dir/ContextEnumerator.java 2018-12-06 14:53:33.564026110 -0500 +++ new/src/java.naming/share/classes/com/sun/jndi/toolkit/dir/ContextEnumerator.java 2018-12-06 14:53:33.392025257 -0500 @@ -138,7 +138,7 @@ // if the name is relative, we need to add it to the name of this // context to keep it relative w.r.t. the root context we are // enumerating - if(oldBinding.isRelative() && !contextName.equals("")) { + if(oldBinding.isRelative() && !contextName.isEmpty()) { NameParser parser = root.getNameParser(""); Name newName = parser.parse(contextName); newName.add(oldBinding.getName());