Program: 102153
Project: 102153
Buggy source:
/** 
 * @see org.teiid.core.designer.event.EventObjectListener#processEvent(java.util.EventObject)
 * @since 4.2
 */
@Override public void processEvent(EventObject obj){
  ModelResourceEvent event=(ModelResourceEvent)obj;
  if (ModelIdentifier.isFunctionModel(event.getModelResource())) {
    try {
      IFile file=(IFile)event.getModelResource().getCorrespondingResource();
      final IPath path=ModelUtil.getLocation(file);
      if (path != null) {
        if (event.getType() == ModelResourceEvent.RELOADED || event.getType() == ModelResourceEvent.ADDED) {
          if (!event.getModelResource().isOpen()) {
            event.getModelResource().open(new NullProgressMonitor());
          }
          registerFunctionModel(event.getModelResource(),false);
        }
 else         if (event.getType() == ModelResourceEvent.REMOVED) {
          registerFunctionModel(event.getModelResource(),true);
        }
 else         if (event.getType() == ModelResourceEvent.CHANGED) {
          registerFunctionModel(event.getModelResource(),true);
          registerFunctionModel(event.getModelResource(),false);
        }
      }
 else {
        UdfUiPlugin.UTIL.log(IStatus.ERROR,"String_Node_Str" + event.getModelResource().getItemName());
      }
    }
 catch (    Exception ex) {
      UdfUiPlugin.UTIL.log(ex);
    }
  }
 else   if (ModelIdentifier.isRelationalSourceModel(event.getModelResource())) {
    try {
      IFile file=(IFile)event.getModelResource().getCorrespondingResource();
      final IPath path=ModelUtil.getLocation(file);
      if (path != null) {
        if (event.getType() == ModelResourceEvent.RELOADED || event.getType() == ModelResourceEvent.ADDED) {
          if (!event.getModelResource().isOpen()) {
            event.getModelResource().open(new NullProgressMonitor());
          }
          notifySourceModelChanged(event.getModelResource(),false);
        }
 else         if (event.getType() == ModelResourceEvent.REMOVED) {
          notifySourceModelChanged(event.getModelResource(),true);
        }
 else         if (event.getType() == ModelResourceEvent.CHANGED) {
          notifySourceModelChanged(event.getModelResource(),false);
        }
      }
 else {
        UdfUiPlugin.UTIL.log(IStatus.ERROR,"String_Node_Str" + event.getModelResource().getItemName());
      }
    }
 catch (    Exception ex) {
      UdfUiPlugin.UTIL.log(ex);
    }
  }
}

Fixed version (ground truth):
/** 
 * @see org.teiid.core.designer.event.EventObjectListener#processEvent(java.util.EventObject)
 * @since 4.2
 */
@Override public void processEvent(EventObject obj){
  ModelResourceEvent event=(ModelResourceEvent)obj;
  if (ModelIdentifier.isFunctionModel(event.getModelResource())) {
    try {
      IFile file=(IFile)event.getModelResource().getCorrespondingResource();
      final IPath path=ModelUtil.getLocation(file);
      if (path != null) {
        if (event.getType() == ModelResourceEvent.RELOADED || event.getType() == ModelResourceEvent.ADDED) {
          if (!event.getModelResource().isOpen()) {
            event.getModelResource().open(new NullProgressMonitor());
          }
          registerFunctionModel(event.getModelResource(),false);
        }
 else         if (event.getType() == ModelResourceEvent.REMOVED) {
          registerFunctionModel(event.getModelResource(),true);
        }
 else         if (event.getType() == ModelResourceEvent.CHANGED) {
          registerFunctionModel(event.getModelResource(),true);
          registerFunctionModel(event.getModelResource(),false);
        }
      }
 else {
        UdfUiPlugin.UTIL.log(IStatus.ERROR,"String_Node_Str" + event.getModelResource().getItemName());
      }
    }
 catch (    Exception ex) {
      UdfUiPlugin.UTIL.log(ex);
    }
  }
 else   if (ModelIdentifier.isRelationalSourceModel(event.getModelResource()) || ModelIdentifier.isRelationalViewModel(event.getModelResource())) {
    try {
      IFile file=(IFile)event.getModelResource().getCorrespondingResource();
      final IPath path=ModelUtil.getLocation(file);
      if (path != null) {
        if (event.getType() == ModelResourceEvent.RELOADED || event.getType() == ModelResourceEvent.ADDED) {
          if (!event.getModelResource().isOpen()) {
            event.getModelResource().open(new NullProgressMonitor());
          }
          notifySourceModelChanged(event.getModelResource(),false);
        }
 else         if (event.getType() == ModelResourceEvent.REMOVED) {
          notifySourceModelChanged(event.getModelResource(),true);
        }
 else         if (event.getType() == ModelResourceEvent.CHANGED) {
          notifySourceModelChanged(event.getModelResource(),false);
        }
      }
 else {
        UdfUiPlugin.UTIL.log(IStatus.ERROR,"String_Node_Str" + event.getModelResource().getItemName());
      }
    }
 catch (    Exception ex) {
      UdfUiPlugin.UTIL.log(ex);
    }
  }
}