Program: 103534
Project: 103534
Buggy source:
/** 
 * Gets the <tt>SourceStream</tt>s (in the form of <tt>InputStreamDesc</tt>) of a specific <tt>DataSource</tt> (provided in the form of <tt>InputDataSourceDesc</tt>) which produce data in a specific <tt>AudioFormat</tt> (or a matching one).
 * @param inputDataSourceDesc the <tt>DataSource</tt> (in the form of <tt>InputDataSourceDesc</tt>) which is to be examined for <tt>SourceStreams</tt> producing data in the specified <tt>AudioFormat</tt>
 * @param outputFormat the <tt>AudioFormat</tt> in which the collected <tt>SourceStream</tt>s are to produce data
 * @param existingInputStreams
 * @param inputStreams the <tt>List</tt> of <tt>InputStreamDesc</tt> in which the discovered <tt>SourceStream</tt>s are to be returned
 * @return <tt>true</tt> if <tt>SourceStream</tt>s produced by thespecified input <tt>DataSource</tt> and outputting data in the specified <tt>AudioFormat</tt> were discovered and reported in <tt>inputStreams</tt>; otherwise, <tt>false</tt>
 */
private boolean getInputStreamsFromInputDataSource(InputDataSourceDesc inputDataSourceDesc,AudioFormat outputFormat,InputStreamDesc[] existingInputStreams,List<InputStreamDesc> inputStreams){
  SourceStream[] inputDataSourceStreams=inputDataSourceDesc.getStreams();
  if (inputDataSourceStreams != null) {
    boolean added=false;
    for (    SourceStream inputStream : inputDataSourceStreams) {
      Format inputFormat=getFormat(inputStream);
      if ((inputFormat != null) && matches(inputFormat,outputFormat)) {
        InputStreamDesc inputStreamDesc=getExistingInputStreamDesc(inputStream,existingInputStreams);
        if (inputStreamDesc == null)         inputStreamDesc=createInputStreamDesc(inputStream,inputDataSourceDesc);
        if (inputStreams.add(inputStreamDesc))         added=true;
      }
    }
    return added;
  }
  DataSource inputDataSource=inputDataSourceDesc.getEffectiveInputDataSource();
  if (inputDataSource == null)   return false;
  Format inputFormat=getFormat(inputDataSource);
  if ((inputFormat != null) && !matches(inputFormat,outputFormat)) {
    if (inputDataSource instanceof PushDataSource) {
      for (      PushSourceStream inputStream : ((PushDataSource)inputDataSource).getStreams()) {
        InputStreamDesc inputStreamDesc=getExistingInputStreamDesc(inputStream,existingInputStreams);
        if (inputStreamDesc == null)         inputStreamDesc=createInputStreamDesc(new PushBufferStreamAdapter(inputStream,inputFormat),inputDataSourceDesc);
        inputStreams.add(inputStreamDesc);
      }
      return true;
    }
    if (inputDataSource instanceof PullDataSource) {
      for (      PullSourceStream inputStream : ((PullDataSource)inputDataSource).getStreams()) {
        InputStreamDesc inputStreamDesc=getExistingInputStreamDesc(inputStream,existingInputStreams);
        if (inputStreamDesc == null)         inputStreamDesc=createInputStreamDesc(new PullBufferStreamAdapter(inputStream,inputFormat),inputDataSourceDesc);
        inputStreams.add(inputStreamDesc);
      }
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Gets the <tt>SourceStream</tt>s (in the form of <tt>InputStreamDesc</tt>) of a specific <tt>DataSource</tt> (provided in the form of <tt>InputDataSourceDesc</tt>) which produce data in a specific <tt>AudioFormat</tt> (or a matching one).
 * @param inputDataSourceDesc the <tt>DataSource</tt> (in the form of<tt>InputDataSourceDesc</tt>) which is to be examined for <tt>SourceStreams</tt> producing data in the specified <tt>AudioFormat</tt>
 * @param outputFormat the <tt>AudioFormat</tt> in which the collected<tt>SourceStream</tt>s are to produce data
 * @param existingInputStreams the <tt>InputStreamDesc</tt> instances whichalready exist and which are used to avoid creating multiple <tt>InputStreamDesc</tt>s for input <tt>SourceStream</tt>s which already have ones
 * @param inputStreams the <tt>List</tt> of <tt>InputStreamDesc</tt> inwhich the discovered <tt>SourceStream</tt>s are to be returned
 * @return <tt>true</tt> if <tt>SourceStream</tt>s produced by the specifiedinput <tt>DataSource</tt> and outputting data in the specified <tt>AudioFormat</tt> were discovered and reported in <tt>inputStreams</tt>; otherwise, <tt>false</tt>
 */
private boolean getInputStreamsFromInputDataSource(InputDataSourceDesc inputDataSourceDesc,AudioFormat outputFormat,InputStreamDesc[] existingInputStreams,List<InputStreamDesc> inputStreams){
  SourceStream[] inputDataSourceStreams=inputDataSourceDesc.getStreams();
  if (inputDataSourceStreams != null) {
    boolean added=false;
    for (    SourceStream inputStream : inputDataSourceStreams) {
      Format inputFormat=getFormat(inputStream);
      if ((inputFormat != null) && matches(inputFormat,outputFormat)) {
        InputStreamDesc inputStreamDesc=getExistingInputStreamDesc(inputStream,existingInputStreams);
        if (inputStreamDesc == null)         inputStreamDesc=createInputStreamDesc(inputStream,inputDataSourceDesc);
        if (inputStreams.add(inputStreamDesc))         added=true;
      }
    }
    return added;
  }
  DataSource inputDataSource=inputDataSourceDesc.getEffectiveInputDataSource();
  if (inputDataSource == null)   return false;
  Format inputFormat=getFormat(inputDataSource);
  if ((inputFormat != null) && !matches(inputFormat,outputFormat)) {
    if (inputDataSource instanceof PushDataSource) {
      for (      PushSourceStream inputStream : ((PushDataSource)inputDataSource).getStreams()) {
        InputStreamDesc inputStreamDesc=getExistingInputStreamDesc(inputStream,existingInputStreams);
        if (inputStreamDesc == null)         inputStreamDesc=createInputStreamDesc(new PushBufferStreamAdapter(inputStream,inputFormat),inputDataSourceDesc);
        inputStreams.add(inputStreamDesc);
      }
      return true;
    }
    if (inputDataSource instanceof PullDataSource) {
      for (      PullSourceStream inputStream : ((PullDataSource)inputDataSource).getStreams()) {
        InputStreamDesc inputStreamDesc=getExistingInputStreamDesc(inputStream,existingInputStreams);
        if (inputStreamDesc == null)         inputStreamDesc=createInputStreamDesc(new PullBufferStreamAdapter(inputStream,inputFormat),inputDataSourceDesc);
        inputStreams.add(inputStreamDesc);
      }
      return true;
    }
  }
  return false;
}