Index: modules/jndi/src/main/java/javax/naming/CompoundName.java =================================================================== --- modules/jndi/src/main/java/javax/naming/CompoundName.java (revision 489974) +++ modules/jndi/src/main/java/javax/naming/CompoundName.java (working copy) @@ -631,6 +631,10 @@ // jndi.09={0} is not a compound name. throw new InvalidNameException(Messages.getString("jndi.09", name.toString())); //$NON-NLS-1$ } + if (FLAT.equals(direction)) { + // jndi.8B=FLAT Compound name can only have one component + throw new InvalidNameException(Messages.getString("jndi.8B")); //$NON-NLS-1$ + } validateIndex(index, true); Enumeration enumeration = name.getAll(); while (enumeration.hasMoreElements()) { Index: modules/jndi/src/main/java/org/apache/harmony/jndi/internal/nls/messages.properties =================================================================== --- modules/jndi/src/main/java/org/apache/harmony/jndi/internal/nls/messages.properties (revision 489974) +++ modules/jndi/src/main/java/org/apache/harmony/jndi/internal/nls/messages.properties (working copy) @@ -154,5 +154,6 @@ jndi.88=Interface hash mismatch, expected: {0}, received: {1} jndi.89=Error marshalling return jndi.8A=Invalid method number: {0} +jndi.8B=FLAT Compound name can only have one component jndi.err.00=. The stack trace of the root exception is: