Program: 73693
Project: 73693
Buggy source:
private void _commitSave(boolean isNew,String id) throws Exception {
  _updateDisplayedModel();
  if (isNew || id == null) {
    if (_modelToSave.getAttribute(XMLDBModel.DB_MODEL_ID_ATTR) != null) {
      _modelToSave.getAttribute(XMLDBModel.DB_MODEL_ID_ATTR).setContainer(null);
      try {
        MoMLChangeRequest change=new MoMLChangeRequest(this,null,_modelToSave.exportMoML());
        change.setUndoable(true);
        _modelToSave.requestChange(change);
      }
 catch (      Exception e) {
        throw e;
      }
    }
  }
  xmlModel=new XMLDBModel(_modelToSave.getName());
  xmlModel.setModel(_modelToSave.exportMoML());
  xmlModel.setIsNew(isNew);
  xmlModel.setModelId(id);
  SaveModelManager saveModelManager=new SaveModelManager();
  try {
    String modelId=saveModelManager.save(xmlModel);
    if (modelId != null) {
      JOptionPane.showMessageDialog(this,"String_Node_Str","String_Node_Str",JOptionPane.INFORMATION_MESSAGE,null);
      if (_modelToSave.getAttribute(XMLDBModel.DB_MODEL_ID_ATTR) == null) {
        StringConstantParameter dbModelParam=new StringConstantParameter(_modelToSave,XMLDBModel.DB_MODEL_ID_ATTR);
        dbModelParam.setExpression(modelId);
        dbModelParam.setContainer(_modelToSave);
      }
 else       if (!((StringParameter)_modelToSave.getAttribute(XMLDBModel.DB_MODEL_ID_ATTR)).getExpression().equals(modelId)) {
        ((StringParameter)_modelToSave.getAttribute(XMLDBModel.DB_MODEL_ID_ATTR)).setExpression(modelId);
      }
      try {
        MoMLChangeRequest change=new MoMLChangeRequest(this,null,_modelToSave.exportMoML());
        change.setUndoable(true);
        _modelToSave.requestChange(change);
      }
 catch (      Exception e) {
        throw e;
      }
      setVisible(false);
    }
 else {
      JOptionPane.showMessageDialog(this,"String_Node_Str","String_Node_Str",JOptionPane.INFORMATION_MESSAGE,null);
    }
  }
 catch (  DBConnectionException exception) {
    throw exception;
  }
catch (  DBExecutionException exception) {
    throw exception;
  }
catch (  IllegalArgumentException exception) {
    throw exception;
  }
catch (  ModelAlreadyExistException exception) {
    Object[] options={"String_Node_Str","String_Node_Str","String_Node_Str"};
    int n=JOptionPane.showOptionDialog(this,"String_Node_Str" + "String_Node_Str" + "String_Node_Str","String_Node_Str",JOptionPane.YES_NO_CANCEL_OPTION,JOptionPane.QUESTION_MESSAGE,null,options,options[2]);
    if (n == JOptionPane.YES_OPTION) {
      saveModelManager=null;
      _commitSave(false,null);
    }
 else {
      _rollbackModel();
    }
  }
}

Fixed version (ground truth):
private void _commitSave(boolean isNew,String id) throws Exception {
  _updateDisplayedModel();
  if (isNew || id == null) {
    if (_modelToSave.getAttribute(XMLDBModel.DB_MODEL_ID_ATTR) != null) {
      _modelToSave.getAttribute(XMLDBModel.DB_MODEL_ID_ATTR).setContainer(null);
      try {
        MoMLChangeRequest change=new MoMLChangeRequest(this,null,_modelToSave.exportMoML());
        change.setUndoable(true);
        _modelToSave.requestChange(change);
      }
 catch (      Exception e) {
        throw e;
      }
    }
  }
  xmlModel=new XMLDBModel(_modelToSave.getName());
  xmlModel.setModel(_modelToSave.exportMoML());
  xmlModel.setIsNew(isNew);
  xmlModel.setModelId(id);
  SaveModelManager saveModelManager=new SaveModelManager();
  try {
    String modelId=saveModelManager.save(xmlModel);
    if (modelId != null) {
      JOptionPane.showMessageDialog(this,"String_Node_Str","String_Node_Str",JOptionPane.INFORMATION_MESSAGE,null);
      if (_modelToSave.getAttribute(XMLDBModel.DB_MODEL_ID_ATTR) == null) {
        StringConstantParameter dbModelParam=new StringConstantParameter(_modelToSave,XMLDBModel.DB_MODEL_ID_ATTR);
        dbModelParam.setExpression(modelId);
        dbModelParam.setContainer(_modelToSave);
      }
 else       if (!((StringConstantParameter)_modelToSave.getAttribute(XMLDBModel.DB_MODEL_ID_ATTR)).getExpression().equals(modelId)) {
        ((StringConstantParameter)_modelToSave.getAttribute(XMLDBModel.DB_MODEL_ID_ATTR)).setExpression(modelId);
      }
      try {
        MoMLChangeRequest change=new MoMLChangeRequest(this,null,_modelToSave.exportMoML());
        change.setUndoable(true);
        _modelToSave.requestChange(change);
      }
 catch (      Exception e) {
        throw e;
      }
      setVisible(false);
    }
 else {
      JOptionPane.showMessageDialog(this,"String_Node_Str","String_Node_Str",JOptionPane.INFORMATION_MESSAGE,null);
    }
  }
 catch (  DBConnectionException exception) {
    throw exception;
  }
catch (  DBExecutionException exception) {
    throw exception;
  }
catch (  IllegalArgumentException exception) {
    throw exception;
  }
catch (  ModelAlreadyExistException exception) {
    Object[] options={"String_Node_Str","String_Node_Str","String_Node_Str"};
    int n=JOptionPane.showOptionDialog(this,"String_Node_Str" + "String_Node_Str" + "String_Node_Str","String_Node_Str",JOptionPane.YES_NO_CANCEL_OPTION,JOptionPane.QUESTION_MESSAGE,null,options,options[2]);
    if (n == JOptionPane.YES_OPTION) {
      saveModelManager=null;
      _commitSave(false,null);
    }
 else {
      _rollbackModel();
    }
  }
}