Program: 102376
Project: 102376
Buggy source:
/** 
 * Change the worspace by adding or removing items from it.
 * @param notification Notification for adding and removing items to workspace
 * @throws CoreException
 */
private boolean changeWorkspace(final ModelWorkspaceNotification notification) throws CoreException {
  final IResource resource=(IResource)notification.getNotifier();
  final IProject iProject=resource.getProject();
  if (iProject.exists())   if (iProject.isOpen() && !ModelerCore.hasModelNature(iProject))   return false;
  if (resource.getType() == IResource.FILE) {
    if (!ModelUtil.isModelFile(resource,false) && !ModelUtil.isVdbArchiveFile(resource))     return false;
    this.setIndexType(ModelResource.NOT_INDEXED);
  }
 else   if (resource.getType() != IResource.PROJECT && resource.getType() != IResource.FOLDER)   return false;
  ModelProjectImpl project=(ModelProjectImpl)this.modelWorkspace.findModelProject(resource);
  final int eventType=((ModelWorkspaceNotificationImpl)notification).getEventType();
switch (eventType) {
case Notification.ADD:
    add(resource,project);
  break;
case Notification.REMOVE:
try {
  TransactionUtil.executeNonUndoable(new IOperation(){
    public void execute() throws CoreException {
      remove(resource);
    }
  }
,this);
}
 catch (final CoreException err) {
  throw err;
}
catch (final Exception err) {
  ModelerCore.Util.log(err);
}
break;
case Notification.MOVE:
break;
case Notification.SET:
final IPath oldPath=notification.getDelta().getMovedFromPath();
final ModelWorkspaceItem oldItem=this.modelWorkspace.getWorkspaceItem(oldPath,resource.getType());
if (oldItem != null && oldItem.getResource() != null) {
remove(oldItem.getResource());
add(resource,project);
}
break;
case ModelWorkspaceNotification.CHANGE:
if (resource.getType() == IResource.FILE) {
final ModelWorkspaceItem resourceItem=this.modelWorkspace.getWorkspaceItem(resource.getFullPath(),resource.getType());
if (resourceItem != null && resourceItem instanceof ModelResourceImpl) {
final ModelResourceImpl model=(ModelResourceImpl)resourceItem;
return model.processContentsChange(notification);
}
}
break;
case ModelWorkspaceNotification.OPEN:
if (resource instanceof IProject) {
if (project == null) {
project=new ModelProjectImpl((IProject)resource,this.modelWorkspace);
final ModelWorkspaceItemInfo parentInfo=(ModelWorkspaceItemInfo)getInfo(this.modelWorkspace);
if (parentInfo != null) parentInfo.addChild(project);
}
project.open(null);
}
break;
default :
throw new ModelerCoreException(ModelerCore.Util.getString("String_Node_Str") + eventType);
}
return false;
}

Fixed version (ground truth):
/** 
 * Change the worspace by adding or removing items from it.
 * @param notification Notification for adding and removing items to workspace
 * @throws CoreException
 */
private boolean changeWorkspace(final ModelWorkspaceNotification notification) throws CoreException {
  final IResource resource=(IResource)notification.getNotifier();
  final IProject iProject=resource.getProject();
  if (iProject.exists())   if (iProject.isOpen() && !ModelerCore.hasModelNature(iProject))   return false;
  if (resource.getType() == IResource.FILE) {
    if (!ModelUtil.isModelFile(resource,false) && !ModelUtil.isVdbArchiveFile(resource))     return false;
    this.setIndexType(ModelResource.NOT_INDEXED);
  }
 else   if (resource.getType() != IResource.PROJECT && resource.getType() != IResource.FOLDER)   return false;
  ModelProjectImpl project=(ModelProjectImpl)this.modelWorkspace.findModelProject(resource);
  final int eventType=((ModelWorkspaceNotificationImpl)notification).getEventType();
switch (eventType) {
case Notification.ADD:
    add(resource,project);
  break;
case Notification.REMOVE:
try {
  TransactionUtil.executeNonUndoable(new IOperation(){
    public void execute() throws CoreException {
      remove(resource);
    }
  }
,this);
}
 catch (final CoreException err) {
  throw err;
}
catch (final Exception err) {
  ModelerCore.Util.log(err);
}
break;
case Notification.MOVE:
break;
case Notification.SET:
final IPath oldPath=notification.getDelta().getMovedFromPath();
final ModelWorkspaceItem oldItem=this.modelWorkspace.getWorkspaceItem(oldPath,resource.getType());
if (oldItem != null && oldItem.getResource() != null) {
remove(oldItem.getResource());
add(resource,project);
}
break;
case ModelWorkspaceNotification.CHANGE:
if (resource.getType() == IResource.FILE) {
final ModelWorkspaceItem resourceItem=this.modelWorkspace.getWorkspaceItem(resource.getFullPath(),resource.getType());
if (resourceItem != null && resourceItem instanceof ModelResourceImpl && !ModelUtil.isVdbArchiveFile(resourceItem.getCorrespondingResource())) {
final ModelResourceImpl model=(ModelResourceImpl)resourceItem;
return model.processContentsChange(notification);
}
}
break;
case ModelWorkspaceNotification.OPEN:
if (resource instanceof IProject) {
if (project == null) {
project=new ModelProjectImpl((IProject)resource,this.modelWorkspace);
final ModelWorkspaceItemInfo parentInfo=(ModelWorkspaceItemInfo)getInfo(this.modelWorkspace);
if (parentInfo != null) parentInfo.addChild(project);
}
project.open(null);
}
break;
default :
throw new ModelerCoreException(ModelerCore.Util.getString("String_Node_Str") + eventType);
}
return false;
}