Program: 103482
Project: 103482
Buggy source:
/** 
 * Changes the current audio system. When javasound is selected we also change the capture device.
 * @param name the name of the audio system.
 * @param captureDevice the selected capture device, if is null we willchoose a default one. Param used when first time initing and extracting config.
 * @param save whether we will save this new option or not.
 */
public void setAudioSystem(String name,CaptureDeviceInfo captureDevice,boolean save){
  ConfigurationService config=NeomediaActivator.getConfigurationService();
  audioSystem=name;
  if (name.equals(AUDIO_SYSTEM_NONE)) {
    setAudioCaptureDevice(null,save);
    setAudioNotifyDevice(null,save);
    setAudioPlaybackDevice(null,save);
  }
 else   if (name.equals(AUDIO_SYSTEM_JAVASOUND)) {
    setAudioNotifyDevice(null,save);
    setAudioPlaybackDevice(null,save);
    if (captureDevice != null)     setAudioCaptureDevice(captureDevice,save);
 else {
      CaptureDeviceInfo[] audioCaptureDevices=getAvailableAudioCaptureDevices();
      for (      CaptureDeviceInfo captureDeviceInfo : audioCaptureDevices) {
        if (captureDeviceInfo.getLocator().getProtocol().equals("String_Node_Str")) {
          setAudioCaptureDevice(captureDeviceInfo,save);
          break;
        }
      }
    }
    if (audioCaptureDevice != null) {
      removePortAudioRenderer();
      initJavaSoundRenderer();
    }
  }
 else   if (name.equals(AUDIO_SYSTEM_PORTAUDIO)) {
    String audioNotifyDevName=config.getString(PROP_AUDIO_NOTIFY_DEVICE);
    String audioPlaybackDevName=config.getString(PROP_AUDIO_PLAYBACK_DEVICE);
    setAudioPlaybackDevice(PortAudioAuto.defaultPlaybackDevice,save);
    setAudioNotifyDevice(PortAudioAuto.defaultPlaybackDevice,save);
    if (captureDevice != null) {
      this.audioCaptureDevice=captureDevice;
      if (audioNotifyDevName != null) {
        for (        CaptureDeviceInfo captureDeviceInfo : PortAudioAuto.playbackDevices) {
          if (audioNotifyDevName.equals(captureDeviceInfo.getName())) {
            setAudioNotifyDevice(captureDeviceInfo,save);
            break;
          }
        }
      }
      if (audioPlaybackDevName != null) {
        for (        CaptureDeviceInfo captureDeviceInfo : PortAudioAuto.playbackDevices) {
          if (audioPlaybackDevName.equals(captureDeviceInfo.getName())) {
            setAudioPlaybackDevice(captureDeviceInfo,save);
            break;
          }
        }
      }
    }
 else     setAudioCaptureDevice(PortAudioAuto.defaultCaptureDevice,save);
    return;
  }
 else {
    logger.error("String_Node_Str" + name);
    audioSystem=null;
  }
  if (save) {
    config.setProperty(PROP_AUDIO_DEVICE_IS_DISABLED,audioCaptureDevice == null);
  }
}

Fixed version (ground truth):
/** 
 * Changes the current audio system. When javasound is selected we also change the capture device.
 * @param name the name of the audio system.
 * @param captureDevice the selected capture device, if is null we willchoose a default one. Param used when first time initing and extracting config.
 * @param save whether we will save this new option or not.
 */
public void setAudioSystem(String name,CaptureDeviceInfo captureDevice,boolean save){
  ConfigurationService config=NeomediaActivator.getConfigurationService();
  audioSystem=name;
  if (name.equals(AUDIO_SYSTEM_NONE)) {
    setAudioCaptureDevice(null,save);
    setAudioNotifyDevice(null,save);
    setAudioPlaybackDevice(null,save);
  }
 else   if (name.equals(AUDIO_SYSTEM_JAVASOUND)) {
    setAudioNotifyDevice(null,save);
    setAudioPlaybackDevice(null,save);
    if (captureDevice != null)     setAudioCaptureDevice(captureDevice,save);
 else {
      CaptureDeviceInfo[] audioCaptureDevices=getAvailableAudioCaptureDevices();
      for (      CaptureDeviceInfo captureDeviceInfo : audioCaptureDevices) {
        if (captureDeviceInfo.getLocator().getProtocol().equals("String_Node_Str")) {
          setAudioCaptureDevice(captureDeviceInfo,save);
          break;
        }
      }
    }
    if (audioCaptureDevice != null) {
      removePortAudioRenderer();
      initJavaSoundRenderer();
    }
  }
 else   if (name.equals(AUDIO_SYSTEM_PORTAUDIO)) {
    String audioNotifyDevName=config.getString(PROP_AUDIO_NOTIFY_DEVICE);
    String audioPlaybackDevName=config.getString(PROP_AUDIO_PLAYBACK_DEVICE);
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str" + audioNotifyDevName + "String_Node_Str");
      logger.debug("String_Node_Str" + audioPlaybackDevName + "String_Node_Str");
    }
    setAudioPlaybackDevice(PortAudioAuto.defaultPlaybackDevice,save);
    setAudioNotifyDevice(PortAudioAuto.defaultPlaybackDevice,save);
    if (captureDevice != null) {
      this.audioCaptureDevice=captureDevice;
    }
 else     setAudioCaptureDevice(PortAudioAuto.defaultCaptureDevice,save);
    if (audioNotifyDevName != null) {
      for (      CaptureDeviceInfo captureDeviceInfo : PortAudioAuto.playbackDevices) {
        if (audioNotifyDevName.equals(captureDeviceInfo.getName())) {
          setAudioNotifyDevice(captureDeviceInfo,save);
          break;
        }
      }
    }
    if (audioPlaybackDevName != null) {
      for (      CaptureDeviceInfo captureDeviceInfo : PortAudioAuto.playbackDevices) {
        if (audioPlaybackDevName.equals(captureDeviceInfo.getName())) {
          setAudioPlaybackDevice(captureDeviceInfo,save);
          break;
        }
      }
    }
    return;
  }
 else {
    logger.error("String_Node_Str" + name);
    audioSystem=null;
  }
  if (save) {
    config.setProperty(PROP_AUDIO_DEVICE_IS_DISABLED,audioCaptureDevice == null);
  }
}