String id = ( String ) list.next();
return; }
    public static void preventRdnChangeOnModifyRemove( Name name, int mod, Attributes attributes )        throws NamingException    {        if ( mod != DirContext.REMOVE_ATTRIBUTE )        {            return;        }        Set rdnAttributes = getRdnAttributes( name );        NamingEnumeration list = attributes.getIDs();        while ( list.hasMore() )        {            String id = ( String ) list.next();            if ( rdnAttributes.contains( id ) )            {                // if the attribute values to delete are not specified then all values                // for the attribute are to be deleted in which case we must just throw                // a schema violation exception with the notAllowedOnRdn result code                if ( attributes.get( id ).size() == 0 )                {                    String msg = "Modify operation attempts to delete RDN attribute ";                    msg += id + " on entry " + name + " violates schema constraints";                    if ( log.isInfoEnabled() )                    {                        log.info( msg + ". SchemaChecker is throwing a schema violation exception." );                    }                    throw new LdapSchemaViolationException( msg, ResultCodeEnum.NOTALLOWEDONRDN );                }                // from here on the modify operation only deletes specific values                // of the Rdn attribute so we must check if one of those values                // are used by the Rdn attribute value pair for the name of the entry                String rdnValue = getRdnValue( id, name );                Attribute rdnAttr = attributes.get( id );                for ( int ii = 0; ii < rdnAttr.size(); ii++ )                {                    if ( rdnValue.equals( rdnAttr.get( ii ) ) )                    {                        String msg = "Modify operation attempts to delete RDN attribute values in use for ";                        msg += id + " on entry " + name + " and violates schema constraints";                        if ( log.isInfoEnabled() )                        {                            log.info( msg + ". SchemaChecker is throwing a schema violation exception." );                        }                        throw new LdapSchemaViolationException( msg, ResultCodeEnum.NOTALLOWEDONRDN );                    }                }            }        }    }