if (obj == null)
{
if (allowNulls == false)
{
throw new JDOUserException(I18NHelper.getMessage(messages,
"sco.nulls_not_allowed")); // NOI18N
}
// It is actualy remove
this.removeElementAt(index);
}
if (elementType == null || elementType.isAssignableFrom(obj.getClass()))
{
// Mark the field as dirty
StateManager stateManager = this.makeDirty();
Object o = super.elementAt(index);
super.setElementAt(obj, index);
if (added.remove(o) == false)
removed.add(o);
if (removed.remove(obj) == false)
added.add(obj);
// Apply updates
this.applyUpdates(stateManager, true);
} else {
throw new JDOUserException(I18NHelper.getMessage(messages,
"sco.classcastexception", elementType.getName()), // NOI18N
new ClassCastException(), new Object[] {obj});
}
}