Program: 148300
Project: 148300
Buggy source:
protected void okPressed(){
  boolean isExist=false;
  if (descriptionText.getText().trim().length() == 0) {
    MessageDialog.openWarning(null,"String_Node_Str","String_Node_Str");
    descriptionText.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(descriptionText.getText()) && !def.getUrl().equals(endpointsCombo.getCombo().getText())) {
      MessageDialog.openWarning(null,"String_Node_Str","String_Node_Str");
      descriptionText.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;
  }
  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);
}