Program: 148277
Project: 148277
Buggy source:
protected void okPressed(){
  boolean isExist=false;
  if (descCombo.getCombo().getText().trim().length() == 0) {
    MessageDialog.openWarning(null,"String_Node_Str","String_Node_Str");
    descCombo.getCombo().setFocus();
    isOK=false;
    return;
  }
  if (userText.getText().trim().length() == 0) {
    MessageDialog.openWarning(null,"String_Node_Str","String_Node_Str");
    userText.setFocus();
    isOK=false;
    return;
  }
  if (passwordText.getText().trim().length() == 0) {
    MessageDialog.openWarning(null,"String_Node_Str","String_Node_Str");
    passwordText.setFocus();
    isOK=false;
    return;
  }
  for (  MDMServerDef def : PreferenceMDMServerExtractor.getInstence().getMDMServerDefinitions()) {
    if (def.getDesc().equals(descCombo.getCombo().getText()) && !def.getUrl().equals(urlText.getText())) {
      MessageDialog.openWarning(null,"String_Node_Str","String_Node_Str");
      descCombo.getCombo().setFocus();
      isOK=false;
      return;
    }
  }
  isOK=true;
  SAXReader reader=new SAXReader();
  Element root=null;
  if (new File(f).exists()) {
    try {
      logininfoDocument=reader.read(new File(f));
    }
 catch (    DocumentException e) {
      log.error(e.getMessage(),e);
    }
    root=logininfoDocument.getRootElement();
    isExist=checkServer(root);
  }
 else {
    logininfoDocument=DocumentHelper.createDocument();
    root=logininfoDocument.addElement("String_Node_Str");
  }
  if (!isExist) {
    addServer(root);
    updateServerListInPreference();
  }
  XMLWriter writer;
  try {
    writer=new XMLWriter(new FileWriter(f));
    writer.write(logininfoDocument);
    writer.close();
  }
 catch (  IOException e) {
    log.error(e.getMessage(),e);
  }
  setReturnCode(OK);
}

Fixed version (ground truth):
protected void okPressed(){
  boolean isExist=false;
  if (descCombo.getCombo().getText().trim().length() == 0) {
    MessageDialog.openWarning(null,"String_Node_Str","String_Node_Str");
    descCombo.getCombo().setFocus();
    isOK=false;
    return;
  }
  if (userText.getText().trim().length() == 0) {
    MessageDialog.openWarning(null,"String_Node_Str","String_Node_Str");
    userText.setFocus();
    isOK=false;
    return;
  }
  if (passwordText.getText().trim().length() == 0) {
    MessageDialog.openWarning(null,"String_Node_Str","String_Node_Str");
    passwordText.setFocus();
    isOK=false;
    return;
  }
  isOK=true;
  SAXReader reader=new SAXReader();
  Element root=null;
  if (new File(f).exists()) {
    try {
      logininfoDocument=reader.read(new File(f));
    }
 catch (    DocumentException e) {
      log.error(e.getMessage(),e);
    }
    root=logininfoDocument.getRootElement();
    isExist=checkServer(root);
  }
 else {
    logininfoDocument=DocumentHelper.createDocument();
    root=logininfoDocument.addElement("String_Node_Str");
  }
  Element descEl=checkServerDesc(root);
  if (descEl != null && !urlText.getText().equals(descEl.element("String_Node_Str").getText())) {
    MessageDialog.openWarning(null,"String_Node_Str","String_Node_Str");
    descCombo.getCombo().setFocus();
    isOK=false;
    return;
  }
  isOK=true;
  if (!isExist) {
    addServer(root);
  }
  XMLWriter writer;
  try {
    writer=new XMLWriter(new FileWriter(f));
    writer.write(logininfoDocument);
    writer.close();
  }
 catch (  IOException e) {
    log.error(e.getMessage(),e);
  }
  setReturnCode(OK);
}