Program: 35893
Project: 35893
Buggy source:
private void waitForLogPatterns(Id id,List<LogPattern> logPatterns){
  if (logPatterns == null || logPatterns.isEmpty()) {
    return;
  }
  final Container container;
  try {
    container=findContainer(id);
  }
 catch (  DockerException e) {
    throw new OrchestrationException(e);
  }
  if (container == null) {
    logger.warn(String.format("String_Node_Str",id));
    return;
  }
  final StopWatch watch=new StopWatch();
  final List<LogPattern> pending=sortedLogPatterns(logPatterns);
  watch.start();
  logger.info("String_Node_Str",logPatternsToString(pending));
  try (final FrameReader reader=new FrameReader(logContainerCmd.exec())){
    Frame frame;
    while ((frame=reader.readFrame()) != null) {
      String line=new String(frame.getPayload()).trim();
      for (Iterator<LogPattern> iterator=pending.iterator(); iterator.hasNext(); ) {
        LogPattern logPattern=iterator.next();
        if (logPattern.getPattern().matcher(line).find()) {
          logger.info("String_Node_Str",watch,logPattern.getPattern().toString());
          iterator.remove();
        }
      }
      if (pending.isEmpty()) {
        watch.stop();
        return;
      }
      for (      LogPattern logPattern : pending) {
        if (watch.getTime() >= logPattern.getTimeout()) {
          throw new OrchestrationException(String.format("String_Node_Str",logPattern.getTimeout(),logPattern.getPattern(),id));
        }
      }
    }
  }
 catch (  IOException e) {
    if (!e.getMessage().equals("String_Node_Str")) {
      throw new OrchestrationException(e);
    }
  }
  throw new OrchestrationException(String.format("String_Node_Str",id,logPatternsToString(pending)));
}

Fixed version (ground truth):
private void waitForLogPatterns(Id id,List<LogPattern> logPatterns){
  if (logPatterns == null || logPatterns.isEmpty()) {
    return;
  }
  final Container container;
  try {
    container=findContainer(id);
  }
 catch (  DockerException e) {
    throw new OrchestrationException(e);
  }
  if (container == null) {
    logger.warn(String.format("String_Node_Str",id));
    return;
  }
  final StopWatch watch=new StopWatch();
  final List<LogPattern> pending=sortedLogPatterns(logPatterns);
  watch.start();
  logger.info("String_Node_Str",logPatternsToString(pending));
  final LogContainerCmd logContainerCmd=docker.logContainerCmd(container.getId()).withStdErr().withStdOut().withTailAll().withFollowStream();
  try (final FrameReader reader=new FrameReader(logContainerCmd.exec())){
    Frame frame;
    while ((frame=reader.readFrame()) != null) {
      logger.debug("String_Node_Str",frame);
      String line=new String(frame.getPayload()).trim();
      for (Iterator<LogPattern> iterator=pending.iterator(); iterator.hasNext(); ) {
        LogPattern logPattern=iterator.next();
        if (logPattern.getPattern().matcher(line).find()) {
          logger.info("String_Node_Str",watch,logPattern.getPattern().toString());
          iterator.remove();
        }
      }
      if (pending.isEmpty()) {
        watch.stop();
        return;
      }
      for (      LogPattern logPattern : pending) {
        if (watch.getTime() >= logPattern.getTimeout()) {
          throw new OrchestrationException(String.format("String_Node_Str",logPattern.getTimeout(),logPattern.getPattern(),id));
        }
      }
    }
  }
 catch (  IOException e) {
    if (!e.getMessage().equals("String_Node_Str")) {
      throw new OrchestrationException(e);
    }
  }
  throw new OrchestrationException(String.format("String_Node_Str",id,logPatternsToString(pending)));
}