String oldRdnValue = NamespaceTools.getRdnAttribute( oldRdn );
String oldRdnValue = NamespaceTools.getRdnValue( oldRdn );
    public void modifyRdn( Name dn, String newRdn, boolean deleteOldRdn )        throws NamingException    {        String newRdnAttr = NamespaceTools.getRdnAttribute( newRdn );        String newRdnValue = NamespaceTools.getRdnValue( newRdn );        BigInteger id = getEntryId( dn.toString() );        Attributes entry = lookup( id );        Name updn = new LdapName( getEntryUpdn( id ) );        /*          * H A N D L E   N E W   R D N         * ====================================================================         * Add the new Rdn attribute to the entry.  If an index exists on the          * new Rdn attribute we add the index for this attribute value pair.         * Also we make sure that the existance index shows the existance of the         * new Rdn attribute within this entry.         */                entry.put( newRdnAttr, newRdnValue );                if ( hasUserIndexOn( newRdnAttr ) )        {            Index idx = getUserIndex( newRdnAttr );            idx.add( newRdnValue, id );                        // Make sure the altered entry shows the existance of the new attrib            if ( ! existanceIdx.hasValue( newRdnAttr, id ) )            {                existanceIdx.add( newRdnAttr, id );            }        }        /*         * H A N D L E   O L D   R D N         * ====================================================================         * If the old Rdn is to be removed we need to get the attribute and          * value for it.  Keep in mind the old Rdn need not be based on the          * same Rdn as the new one.  We remove the Rdn value from the entry         * and remove the value/id tuple from the index on the old Rdn attr         * if any.  We also test if the delete of the old Rdn index tuple          * removed all the attribute values of the old Rdn using a reverse         * lookup.  If so that means we blew away the last value of the old          * Rdn attribute.  In this case we need to remove the attrName/id          * tuple from the existance index.         */        if ( deleteOldRdn )        {            String oldRdn = updn.get( updn.size() - 1 );            String oldRdnAttr = NamespaceTools.getRdnAttribute( oldRdn );            String oldRdnValue = NamespaceTools.getRdnAttribute( oldRdn );                        entry.get( oldRdnAttr ).remove( oldRdnValue );            if ( hasUserIndexOn( oldRdnAttr ) )            {                Index idx = getUserIndex( oldRdnAttr );                idx.drop( oldRdnValue, id );                                /*                 * If there is no value for id in this index due to our                 * drop above we remove the oldRdnAttr from the existance idx                 */                if ( null == idx.reverseLookup( id ) )                {                    existanceIdx.drop( oldRdnAttr, id );                }            }        }                /*         * H A N D L E   D N   C H A N G E         * ====================================================================         * 1) Build the new user defined distinguished name         *      - clone / copy old updn         *      - remove old upRdn from copy         *      - add the new upRdn to the copy         * 2) Make call to recursive modifyDn method to change the names of the         *    entry and its descendants         */        Name newUpdn = ( Name ) updn.clone();      // copy da old updn        newUpdn.remove( newUpdn.size() - 1 );      // remove old upRdn        newUpdn.add( newUpdn.size(), newRdn );   // add da new upRdn        modifyDn( id, newUpdn, false );            // propagate dn changes    }