Program: 115420
Project: 115420
Buggy source:
private void computeOffset() throws Exception {
  logger.info("String_Node_Str",currentPartition);
  logger.info("String_Node_Str",consumerConfig.startOffsetFrom,currentPartition);
  if (consumerConfig.startOffsetFrom.equalsIgnoreCase("String_Node_Str")) {
    if (consumerConfig.startOffset >= 0) {
      offsetForThisRound=consumerConfig.startOffset;
    }
 else {
      throw new Exception("String_Node_Str" + currentTopic + "String_Node_Str"+ currentPartition+ "String_Node_Str");
    }
  }
 else   if (consumerConfig.startOffsetFrom.equalsIgnoreCase("String_Node_Str")) {
    this.offsetForThisRound=kafkaConsumerClient.getEarliestOffset();
  }
 else   if (consumerConfig.startOffsetFrom.equalsIgnoreCase("String_Node_Str")) {
    offsetForThisRound=kafkaConsumerClient.getLastestOffset();
  }
 else   if (consumerConfig.startOffsetFrom.equalsIgnoreCase("String_Node_Str")) {
    logger.info("String_Node_Str",currentTopic,currentPartition);
    offsetForThisRound=kafkaConsumerClient.fetchCurrentOffsetFromKafka();
    if (offsetForThisRound == -1) {
      offsetForThisRound=kafkaConsumerClient.getEarliestOffset();
      logger.info("String_Node_Str",offsetForThisRound,currentPartition);
      try {
        kafkaConsumerClient.saveOffsetInKafka(offsetForThisRound,ErrorMapping.NoError());
      }
 catch (      Exception e) {
        logger.error("String_Node_Str",currentPartition,e);
        throw new Exception("String_Node_Str" + e.getMessage(),e);
      }
    }
 else {
      logger.info("String_Node_Str",offsetForThisRound,currentPartition);
    }
  }
  long earliestOffset=kafkaConsumerClient.getEarliestOffset();
  if (offsetForThisRound < earliestOffset) {
    logger.warn("String_Node_Str" + "String_Node_Str",offsetForThisRound,earliestOffset,currentPartition);
    offsetForThisRound=earliestOffset;
    try {
      kafkaConsumerClient.saveOffsetInKafka(offsetForThisRound,ErrorMapping.NoError());
    }
 catch (    Exception e) {
      logger.error("String_Node_Str",currentPartition,e);
      throw new Exception("String_Node_Str" + e.getMessage(),e);
    }
  }
  logger.info("String_Node_Str",offsetForThisRound,currentPartition);
}

Fixed version (ground truth):
private void computeOffset() throws Exception {
  logger.info("String_Node_Str",currentPartition);
  logger.info("String_Node_Str",consumerConfig.startOffsetFrom,currentPartition);
  if (consumerConfig.startOffsetFrom.equalsIgnoreCase("String_Node_Str")) {
    if (consumerConfig.startOffset >= 0) {
      offsetForThisRound=consumerConfig.startOffset;
    }
 else {
      throw new Exception("String_Node_Str" + currentTopic + "String_Node_Str"+ currentPartition+ "String_Node_Str");
    }
  }
 else   if (consumerConfig.startOffsetFrom.equalsIgnoreCase("String_Node_Str")) {
    this.offsetForThisRound=kafkaConsumerClient.getEarliestOffset();
  }
 else   if (consumerConfig.startOffsetFrom.equalsIgnoreCase("String_Node_Str")) {
    offsetForThisRound=kafkaConsumerClient.getLastestOffset();
  }
 else   if (consumerConfig.startOffsetFrom.equalsIgnoreCase("String_Node_Str")) {
    logger.info("String_Node_Str",currentTopic,currentPartition);
    offsetForThisRound=kafkaConsumerClient.fetchCurrentOffsetFromKafka();
    if (offsetForThisRound == -1) {
      offsetForThisRound=kafkaConsumerClient.getEarliestOffset();
      logger.info("String_Node_Str",offsetForThisRound,currentPartition);
      try {
        kafkaConsumerClient.saveOffsetInKafka(offsetForThisRound,ErrorMapping.NoError());
      }
 catch (      Exception e) {
        logger.error("String_Node_Str",currentPartition,e);
        throw new Exception("String_Node_Str" + e.getMessage(),e);
      }
    }
 else {
      logger.info("String_Node_Str",offsetForThisRound,currentPartition);
    }
  }
  long earliestOffset=kafkaConsumerClient.getEarliestOffset();
  logger.info("String_Node_Str",currentPartition,earliestOffset);
  if (offsetForThisRound < earliestOffset) {
    logger.warn("String_Node_Str" + "String_Node_Str",offsetForThisRound,earliestOffset,currentPartition);
    offsetForThisRound=earliestOffset;
    try {
      kafkaConsumerClient.saveOffsetInKafka(offsetForThisRound,ErrorMapping.NoError());
    }
 catch (    Exception e) {
      logger.error("String_Node_Str",currentPartition,e);
      throw new Exception("String_Node_Str" + e.getMessage(),e);
    }
  }
  logger.info("String_Node_Str",offsetForThisRound,currentPartition);
}