extensionList = new BasicEList();
extensionList.add(notification.getOldValue());
}
for (Iterator iter = extensionList.iterator(); iter.hasNext();) {
Extension extension = (Extension) iter.next();
EObject extendedObject = extension.getExtendedObject();
// if the exended EObject had an adapter, remove it.
if(extendedObject != null){
EList adapters = extendedObject.eAdapters();
EList removeAdapterList = new BasicEList();
for (Iterator iter2 = adapters.iterator();iter2.hasNext();) {
Adapter adapter = (Adapter) iter2.next();
if((adapter instanceof ExtendedObjectUserAdapter && ((ExtendedObjectUserAdapter)adapter).getNamespace().equals(((ExtensionMap)getTarget()).getNamespace()))||
adapter instanceof ExtendedObjectAdapter && ((ExtendedObjectAdapter)adapter).getNamespace().equals(((ExtensionMap)getTarget()).getNamespace())){
removeAdapterList.add(adapter);
}
}
for (Iterator iter2 = removeAdapterList.iterator(); iter2.hasNext();) {
Adapter adapter = (Adapter) iter2.next();
try{
((ExtendedObjectAdapter)adapter).setExtension(null);
}catch(ClassCastException e){}
extendedObject.eAdapters().remove(adapter);
}
}
// Set the Extension attributes to null.
if (!(notification.getNotifier() instanceof Extension)){
if(extension.getExtendedObject() != null)
extension.setExtendedObject(null);
if(extension.getExtensionObject() != null)
extension.setExtensionObject(null);
}
}
break;