}
if ( newAttributeDescription != null && !"".equals( newAttributeDescription ) //$NON-NLS-1$
&& !newAttributeDescription.equals( oldValues[0].getAttribute().getDescription() ) )
{
ValueRenamedEvent event = null;
try
{
EventRegistry.suspendEventFiringInCurrentThread();
for ( IValue oldValue : oldValues )
{
if ( !newAttributeDescription.equals( oldValue.getAttribute().getDescription() ) )
{
IAttribute oldAttribute = oldValue.getAttribute();
IEntry entry = oldAttribute.getEntry();
IValue newValue = null;
// delete old value
oldAttribute.deleteValue( oldValue );
if ( oldAttribute.getValueSize() == 0 )
{
entry.deleteAttribute( oldAttribute );
}
// add new value
IAttribute attribute = entry.getAttribute( newAttributeDescription );
if ( attribute == null )
{
attribute = new Attribute( entry, newAttributeDescription );
entry.addAttribute( attribute );
}
newValue = new Value( attribute, oldValue.getRawValue() );
attribute.addValue( newValue );
// prepare event
if ( event == null )
{
event = new ValueRenamedEvent( entry.getBrowserConnection(), entry, oldValue, newValue );
}
}
}
}
finally