public void removeAttribute(String name)
{
// make sure we are updating and using the clone now
setupForUpdate();
Entry entry = getEntry();
// I am assuming that we only allow one parameter per name
Iterator params = entry.getParameterIterator();
int index = -1;
int count = 0;
while (params.hasNext())
{
Parameter param = (Parameter) params.next();
if (param.getName().equalsIgnoreCase(name))
{
index = count;
break;
}
count++;
}
// We have to wait until we are outside the loop to remove
// or else we throw a ConcurrentModificationException
if (index != -1)
{
entry.removeParameter(index);
}
}