if ( operational == null ) { operational.add( newName.toString() ); } else { operational.remove( oldName.toString() ); operational.add( newName.toString() ); }
    private ModificationItem[] getOperationalModsForReplace( Name oldName, Name newName, Attribute administrativeRole,                                                             Attributes entry ) throws NamingException    {        List modList = new ArrayList();        NamingEnumeration roles = administrativeRole.getAll();        while ( roles.hasMore() )        {            Attribute operational = null;            String role = ( String ) roles.next();            if ( role.equalsIgnoreCase( AUTONOUMOUS_AREA ) )            {                operational = ( Attribute ) entry.get( AUTONOUMOUS_AREA_SUBENTRY ).clone();            }            else if ( role.equalsIgnoreCase( AC_AREA ) )            {                operational = ( Attribute ) entry.get( AC_AREA_SUBENTRY ).clone();            }            else if ( role.equalsIgnoreCase( AC_INNERAREA ) )            {                operational = ( Attribute ) entry.get( AC_INNERAREA_SUBENTRY ).clone();            }            else if ( role.equalsIgnoreCase( SCHEMA_AREA ) )            {                operational = ( Attribute ) entry.get( SCHEMA_AREA_SUBENTRY ).clone();            }            else if ( role.equalsIgnoreCase( COLLECTIVE_AREA ) )            {                operational = ( Attribute ) entry.get( COLLECTIVE_AREA_SUBENTRY ).clone();            }            else if ( role.equalsIgnoreCase( COLLECTIVE_INNERAREA ) )            {                operational = ( Attribute ) entry.get( COLLECTIVE_AREA_SUBENTRY ).clone();            }            else            {                throw new LdapInvalidAttributeValueException( "Encountered invalid administrativeRole '"                        + role + "' in administrative point of subentry " + oldName + ". The values of this attribute"                        + " are constrained to autonomousArea, accessControlSpecificArea, accessControlInnerArea,"                        + " subschemaAdminSpecificArea, collectiveAttributeSpecificArea, and"                        + " collectiveAttributeInnerArea.", ResultCodeEnum.CONSTRAINTVIOLATION );            }            if ( operational == null )            {                operational.add( newName.toString() );            }            else            {                operational.remove( oldName.toString() );                operational.add( newName.toString() );            }            modList.add( new ModificationItem( DirContext.REPLACE_ATTRIBUTE, operational ) );        }        ModificationItem[] mods = new ModificationItem[modList.size()];        return ( ModificationItem[] ) modList.toArray( mods );    }