Program: 103996
Project: 103996
Buggy source:
/** 
 * initialize the form.
 */
public void initForm(){
  updateTimer.setValue(30);
  MaskFormatter maskFormatter=new MaskFormatter();
  try {
    maskFormatter.setMask("String_Node_Str");
  }
 catch (  ParseException ex) {
    ex.printStackTrace();
  }
  maskFormatter.setAllowsInvalid(false);
  portField=new JFormattedTextField(maskFormatter);
  portField.setValue(22);
  userNameField.setEnabled(false);
  passwordField.setEditable(false);
  portField.setEnabled(false);
  terminalTypeField.setEnabled(false);
  updateTimer.setEnabled(false);
  mainPanel.setLayout(new BoxLayout(mainPanel,BoxLayout.Y_AXIS));
  machinePanel.setLayout(new BoxLayout(machinePanel,BoxLayout.X_AXIS));
  detailNamesPanel.setLayout(new BoxLayout(detailNamesPanel,BoxLayout.Y_AXIS));
  detailFieldsPanel.setLayout(new BoxLayout(detailFieldsPanel,BoxLayout.Y_AXIS));
  detailsPanel.setLayout(new BoxLayout(detailsPanel,BoxLayout.X_AXIS));
  machinePanel.add(machineID);
  machinePanel.add(machineIDField);
  detailNamesPanel.add(userName);
  detailNamesPanel.add(emptyPanel1);
  detailNamesPanel.add(password);
  detailNamesPanel.add(emptyPanel2);
  detailNamesPanel.add(port);
  detailNamesPanel.add(emptyPanel3);
  detailNamesPanel.add(statusUpdate);
  detailNamesPanel.add(emptyPanel4);
  detailNamesPanel.add(terminalType);
  detailFieldsPanel.add(userNameField);
  detailFieldsPanel.add(emptyPanel5);
  detailFieldsPanel.add(passwordField);
  detailFieldsPanel.add(emptyPanel6);
  detailFieldsPanel.add(portField);
  detailFieldsPanel.add(emptyPanel7);
  detailFieldsPanel.add(updateTimer);
  detailFieldsPanel.add(emptyPanel8);
  detailFieldsPanel.add(terminalTypeField);
  detailsPanel.add(detailNamesPanel);
  detailsPanel.add(detailFieldsPanel);
  detailsPanel.setBorder(BorderFactory.createTitledBorder("String_Node_Str"));
  mainPanel.add(emptyPanel9);
  mainPanel.add(machinePanel);
  mainPanel.add(addDetailsCheckBox);
  mainPanel.add(detailsPanel);
  mainPanel.add(emptyPanel10);
  mainPanel.add(doneButton);
  mainPanel.add(emptyPanel11);
  addDetailsCheckBox.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent event){
      addDetailsCheckBox.setEnabled(false);
      userNameField.setEnabled(true);
      passwordField.setEditable(true);
      portField.setEnabled(true);
      terminalTypeField.setEnabled(true);
      updateTimer.setEnabled(true);
      userNameField.grabFocus();
    }
  }
);
  doneButton.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent event){
      if (machineIDField.getText().equals("String_Node_Str")) {
        machineIDField.setText("String_Node_Str");
        return;
      }
      sshContact.savePersistentDetails();
      setVisible(false);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * initialize the form.
 */
public void initForm(){
  updateTimer.setValue(30);
  MaskFormatter maskFormatter=new MaskFormatter();
  try {
    maskFormatter.setMask("String_Node_Str");
  }
 catch (  ParseException ex) {
    ex.printStackTrace();
  }
  maskFormatter.setAllowsInvalid(false);
  portField=new JFormattedTextField(maskFormatter);
  portField.setValue(22);
  userNameField.setEnabled(false);
  passwordField.setEditable(false);
  portField.setEnabled(false);
  terminalTypeField.setEnabled(false);
  updateTimer.setEnabled(false);
  mainPanel.setLayout(new BoxLayout(mainPanel,BoxLayout.Y_AXIS));
  machinePanel.setLayout(new BoxLayout(machinePanel,BoxLayout.X_AXIS));
  detailNamesPanel.setLayout(new BoxLayout(detailNamesPanel,BoxLayout.Y_AXIS));
  detailFieldsPanel.setLayout(new BoxLayout(detailFieldsPanel,BoxLayout.Y_AXIS));
  detailsPanel.setLayout(new BoxLayout(detailsPanel,BoxLayout.X_AXIS));
  machinePanel.add(machineID);
  machinePanel.add(machineIDField);
  detailNamesPanel.add(userName);
  detailNamesPanel.add(emptyPanel1);
  detailNamesPanel.add(password);
  detailNamesPanel.add(emptyPanel2);
  detailNamesPanel.add(port);
  detailNamesPanel.add(emptyPanel3);
  detailNamesPanel.add(statusUpdate);
  detailNamesPanel.add(emptyPanel4);
  detailNamesPanel.add(terminalType);
  detailFieldsPanel.add(userNameField);
  detailFieldsPanel.add(emptyPanel5);
  detailFieldsPanel.add(passwordField);
  detailFieldsPanel.add(emptyPanel6);
  detailFieldsPanel.add(portField);
  detailFieldsPanel.add(emptyPanel7);
  detailFieldsPanel.add(updateTimer);
  detailFieldsPanel.add(emptyPanel8);
  detailFieldsPanel.add(terminalTypeField);
  detailsPanel.add(detailNamesPanel);
  detailsPanel.add(detailFieldsPanel);
  detailsPanel.setBorder(BorderFactory.createTitledBorder("String_Node_Str"));
  mainPanel.add(emptyPanel9);
  mainPanel.add(machinePanel);
  mainPanel.add(addDetailsCheckBox);
  mainPanel.add(detailsPanel);
  mainPanel.add(emptyPanel10);
  mainPanel.add(doneButton);
  mainPanel.add(emptyPanel11);
  addDetailsCheckBox.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent event){
      addDetailsCheckBox.setEnabled(false);
      userNameField.setEnabled(true);
      passwordField.setEditable(true);
      portField.setEnabled(true);
      terminalTypeField.setEnabled(true);
      updateTimer.setEnabled(true);
      userNameField.grabFocus();
    }
  }
);
  doneButton.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent event){
      if (machineIDField.getText().equals("String_Node_Str")) {
        machineIDField.setText("String_Node_Str");
        return;
      }
      sshContact.savePersistentDetails();
      ((OperationSetPersistentPresenceSSHImpl)sshContact.getParentPresenceOperationSet()).addContactToList(sshContact.getParentContactGroup(),sshContact);
      setVisible(false);
    }
  }
);
}