Program: 103629
Project: 103629
Buggy source:
/** 
 * Creates the ui controls for portaudio.
 * @param portAudioPanel the panel
 */
private static void createPortAudioControls(JPanel portAudioPanel){
  GridBagConstraints constraints=new GridBagConstraints();
  constraints.fill=GridBagConstraints.HORIZONTAL;
  constraints.anchor=GridBagConstraints.NORTHWEST;
  constraints.gridx=0;
  constraints.weightx=0;
  constraints.weighty=0;
  constraints.gridy=0;
  portAudioPanel.add(new JLabel(getLabelText(DeviceConfigurationComboBoxModel.AUDIO_CAPTURE)),constraints);
  constraints.gridy=1;
  portAudioPanel.add(new JLabel(getLabelText(DeviceConfigurationComboBoxModel.AUDIO_PLAYBACK)),constraints);
  constraints.gridy=2;
  portAudioPanel.add(new JLabel(getLabelText(DeviceConfigurationComboBoxModel.AUDIO_NOTIFY)),constraints);
  constraints.weightx=1;
  constraints.gridx=1;
  constraints.gridy=0;
  JComboBox captureCombo=new JComboBox();
  captureCombo.setEditable(false);
  captureCombo.setModel(new DeviceConfigurationComboBoxModel(mediaService.getDeviceConfiguration(),DeviceConfigurationComboBoxModel.AUDIO_CAPTURE));
  portAudioPanel.add(captureCombo,constraints);
  constraints.gridy=1;
  JComboBox playbackCombo=new JComboBox();
  playbackCombo.setEditable(false);
  playbackCombo.setModel(new DeviceConfigurationComboBoxModel(mediaService.getDeviceConfiguration(),DeviceConfigurationComboBoxModel.AUDIO_PLAYBACK));
  portAudioPanel.add(playbackCombo,constraints);
  constraints.gridy=2;
  JComboBox notifyCombo=new JComboBox();
  notifyCombo.setEditable(false);
  notifyCombo.setModel(new DeviceConfigurationComboBoxModel(mediaService.getDeviceConfiguration(),DeviceConfigurationComboBoxModel.AUDIO_NOTIFY));
  portAudioPanel.add(notifyCombo,constraints);
  constraints.gridy=3;
  constraints.insets=new Insets(10,0,0,0);
  final SIPCommCheckBox echoCancelCheckBox=new SIPCommCheckBox(NeomediaActivator.getResources().getI18NString("String_Node_Str"));
  echoCancelCheckBox.setSelected(mediaService.getDeviceConfiguration().isEchoCancelEnabled());
  echoCancelCheckBox.addItemListener(new ItemListener(){
    public void itemStateChanged(    ItemEvent e){
      mediaService.getDeviceConfiguration().setEchoCancel(echoCancelCheckBox.isSelected(),true);
    }
  }
);
  portAudioPanel.add(echoCancelCheckBox,constraints);
  constraints.gridy=4;
  constraints.insets=new Insets(0,0,0,0);
  final SIPCommCheckBox denoiseCheckBox=new SIPCommCheckBox(NeomediaActivator.getResources().getI18NString("String_Node_Str"));
  denoiseCheckBox.setSelected(mediaService.getDeviceConfiguration().isDenoiseEnabled());
  denoiseCheckBox.addItemListener(new ItemListener(){
    public void itemStateChanged(    ItemEvent e){
      mediaService.getDeviceConfiguration().setDenoise(denoiseCheckBox.isSelected(),true);
    }
  }
);
  portAudioPanel.add(denoiseCheckBox,constraints);
  portAudioPanel.setBorder(BorderFactory.createTitledBorder(NeomediaActivator.getResources().getI18NString("String_Node_Str")));
  if (portAudioPanel.isVisible()) {
    portAudioPanel.validate();
    portAudioPanel.repaint();
  }
}

Fixed version (ground truth):
/** 
 * Creates the ui controls for portaudio.
 * @param portAudioPanel the panel
 */
private static void createPortAudioControls(JPanel portAudioPanel){
  GridBagConstraints constraints=new GridBagConstraints();
  constraints.fill=GridBagConstraints.HORIZONTAL;
  constraints.anchor=GridBagConstraints.NORTHWEST;
  constraints.gridx=0;
  constraints.weightx=0;
  constraints.weighty=0;
  constraints.gridy=0;
  portAudioPanel.add(new JLabel(getLabelText(DeviceConfigurationComboBoxModel.AUDIO_CAPTURE)),constraints);
  constraints.gridy=1;
  portAudioPanel.add(new JLabel(getLabelText(DeviceConfigurationComboBoxModel.AUDIO_PLAYBACK)),constraints);
  constraints.gridy=2;
  portAudioPanel.add(new JLabel(getLabelText(DeviceConfigurationComboBoxModel.AUDIO_NOTIFY)),constraints);
  constraints.weightx=1;
  constraints.gridx=1;
  constraints.gridy=0;
  JComboBox captureCombo=new JComboBox();
  captureCombo.setEditable(false);
  captureCombo.setModel(new DeviceConfigurationComboBoxModel(mediaService.getDeviceConfiguration(),DeviceConfigurationComboBoxModel.AUDIO_CAPTURE));
  portAudioPanel.add(captureCombo,constraints);
  constraints.gridy=1;
  JComboBox playbackCombo=new JComboBox();
  playbackCombo.setEditable(false);
  playbackCombo.setModel(new DeviceConfigurationComboBoxModel(mediaService.getDeviceConfiguration(),DeviceConfigurationComboBoxModel.AUDIO_PLAYBACK));
  portAudioPanel.add(playbackCombo,constraints);
  constraints.gridy=2;
  JComboBox notifyCombo=new JComboBox();
  notifyCombo.setEditable(false);
  notifyCombo.setModel(new DeviceConfigurationComboBoxModel(mediaService.getDeviceConfiguration(),DeviceConfigurationComboBoxModel.AUDIO_NOTIFY));
  portAudioPanel.add(notifyCombo,constraints);
  constraints.gridy=3;
  constraints.insets=new Insets(10,0,0,0);
  final SIPCommCheckBox echoCancelCheckBox=new SIPCommCheckBox(NeomediaActivator.getResources().getI18NString("String_Node_Str"));
  echoCancelCheckBox.setSelected(mediaService.getDeviceConfiguration().isEchoCancelEnabled());
  echoCancelCheckBox.addItemListener(new ItemListener(){
    public void itemStateChanged(    ItemEvent e){
      mediaService.getDeviceConfiguration().setEchoCancel(echoCancelCheckBox.isSelected(),true);
    }
  }
);
  portAudioPanel.add(echoCancelCheckBox,constraints);
  constraints.gridy=4;
  constraints.insets=new Insets(0,0,0,0);
  final SIPCommCheckBox denoiseCheckBox=new SIPCommCheckBox(NeomediaActivator.getResources().getI18NString("String_Node_Str"));
  denoiseCheckBox.setSelected(mediaService.getDeviceConfiguration().isDenoiseEnabled());
  denoiseCheckBox.addItemListener(new ItemListener(){
    public void itemStateChanged(    ItemEvent e){
      mediaService.getDeviceConfiguration().setDenoise(denoiseCheckBox.isSelected(),true);
    }
  }
);
  portAudioPanel.add(denoiseCheckBox,constraints);
  portAudioPanel.setBorder(BorderFactory.createTitledBorder(NeomediaActivator.getResources().getI18NString("String_Node_Str")));
}