Program: 115417
Project: 115417
Buggy source:
public void processBatch() throws Exception {
  long jobStartTime=0l;
  if (consumerConfig.isPerfReportingEnabled)   jobStartTime=System.currentTimeMillis();
  if (!isStartingFirstTime) {
    offsetForThisRound=nextOffsetToProcess;
  }
 else {
    try {
      computeOffset();
    }
 catch (    Exception e) {
      logger.error("String_Node_Str",currentPartition,e);
      reInitKafka();
      return;
    }
    isStartingFirstTime=false;
    nextOffsetToProcess=offsetForThisRound;
  }
  indexerJobStatus.setLastCommittedOffset(offsetForThisRound);
  try {
    fetchResponse=kafkaConsumerClient.getMessagesFromKafka(offsetForThisRound);
  }
 catch (  Exception e) {
    reInitKafka();
    return;
  }
  if (consumerConfig.isPerfReportingEnabled) {
    long timeAfterKafaFetch=System.currentTimeMillis();
    logger.debug("String_Node_Str",(timeAfterKafaFetch - jobStartTime),currentPartition);
  }
  if (fetchResponse.hasError()) {
    handleError();
    return;
  }
  byteBufferMsgSet=kafkaConsumerClient.fetchMessageSet(fetchResponse);
  if (consumerConfig.isPerfReportingEnabled) {
    long timeAfterKafkaFetch=System.currentTimeMillis();
    logger.debug("String_Node_Str",(timeAfterKafkaFetch - jobStartTime),currentPartition);
  }
  if (byteBufferMsgSet.validBytes() <= 0) {
    logger.warn("String_Node_Str",currentPartition);
    long latestOffset=kafkaConsumerClient.getLastestOffset();
    if (latestOffset != offsetForThisRound) {
      logger.warn("String_Node_Str" + "String_Node_Str",latestOffset,offsetForThisRound,currentPartition);
      try {
        kafkaConsumerClient.saveOffsetInKafka(latestOffset,fetchResponse.errorCode(consumerConfig.topic,currentPartition));
      }
 catch (      Exception e) {
        logger.error("String_Node_Str",currentPartition,e);
        throw e;
      }
    }
    return;
  }
  logger.debug("String_Node_Str",currentPartition);
  nextOffsetToProcess=msgHandler.prepareForPostToElasticSearch(byteBufferMsgSet.iterator());
  if (consumerConfig.isPerfReportingEnabled) {
    long timeAtPrepareES=System.currentTimeMillis();
    logger.debug("String_Node_Str",(timeAtPrepareES - jobStartTime),currentPartition);
  }
  if (isDryRun) {
    logger.info("String_Node_Str",currentPartition);
    return;
  }
  this.indexIntoESWithRetries();
  if (consumerConfig.isPerfReportingEnabled) {
    long timeAftEsPost=System.currentTimeMillis();
    logger.debug("String_Node_Str",(timeAftEsPost - jobStartTime),currentPartition);
  }
  logger.info("String_Node_Str",nextOffsetToProcess,currentPartition);
  try {
    kafkaConsumerClient.saveOffsetInKafka(nextOffsetToProcess,fetchResponse.errorCode(consumerConfig.topic,currentPartition));
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",currentPartition,e);
    logger.info("String_Node_Str",currentPartition);
    try {
      reInitKafka();
      logger.info("String_Node_Str");
      kafkaConsumerClient.saveOffsetInKafka(nextOffsetToProcess,fetchResponse.errorCode(consumerConfig.topic,currentPartition));
    }
 catch (    Exception e2) {
      logger.error("String_Node_Str",currentPartition,e2);
      throw e2;
    }
  }
  if (consumerConfig.isPerfReportingEnabled) {
    long timeAtEndOfJob=System.currentTimeMillis();
    logger.info("String_Node_Str",(timeAtEndOfJob - jobStartTime),currentPartition);
  }
  logger.info("String_Node_Str",offsetForThisRound,nextOffsetToProcess,currentPartition);
  this.byteBufferMsgSet=null;
  this.fetchResponse=null;
}

Fixed version (ground truth):
public void processBatch() throws Exception {
  long jobStartTime=0l;
  if (consumerConfig.isPerfReportingEnabled)   jobStartTime=System.currentTimeMillis();
  if (!isStartingFirstTime) {
    offsetForThisRound=nextOffsetToProcess;
  }
 else {
    try {
      computeOffset();
    }
 catch (    Exception e) {
      logger.error("String_Node_Str",currentPartition,e);
      reInitKafka();
      return;
    }
    isStartingFirstTime=false;
    nextOffsetToProcess=offsetForThisRound;
  }
  indexerJobStatus.setLastCommittedOffset(offsetForThisRound);
  try {
    fetchResponse=kafkaConsumerClient.getMessagesFromKafka(offsetForThisRound);
  }
 catch (  Exception e) {
    reInitKafka();
    return;
  }
  if (consumerConfig.isPerfReportingEnabled) {
    long timeAfterKafaFetch=System.currentTimeMillis();
    logger.debug("String_Node_Str",(timeAfterKafaFetch - jobStartTime),currentPartition);
  }
  if (fetchResponse.hasError()) {
    handleError();
    return;
  }
  byteBufferMsgSet=fetchResponse.messageSet(currentTopic,currentPartition);
  if (consumerConfig.isPerfReportingEnabled) {
    long timeAfterKafkaFetch=System.currentTimeMillis();
    logger.debug("String_Node_Str",(timeAfterKafkaFetch - jobStartTime),currentPartition);
  }
  if (byteBufferMsgSet.validBytes() <= 0) {
    logger.debug("String_Node_Str",currentPartition);
    long latestOffset=kafkaConsumerClient.getLastestOffset();
    if (latestOffset != offsetForThisRound) {
      logger.warn("String_Node_Str" + "String_Node_Str",latestOffset,offsetForThisRound,currentPartition);
      try {
        kafkaConsumerClient.saveOffsetInKafka(latestOffset,fetchResponse.errorCode(consumerConfig.topic,currentPartition));
      }
 catch (      Exception e) {
        logger.error("String_Node_Str",currentPartition,e);
        throw e;
      }
    }
    return;
  }
  logger.debug("String_Node_Str",currentPartition);
  nextOffsetToProcess=msgHandler.prepareForPostToElasticSearch(byteBufferMsgSet.iterator());
  if (consumerConfig.isPerfReportingEnabled) {
    long timeAtPrepareES=System.currentTimeMillis();
    logger.debug("String_Node_Str",(timeAtPrepareES - jobStartTime),currentPartition);
  }
  if (isDryRun) {
    logger.info("String_Node_Str",currentPartition);
    return;
  }
  this.indexIntoESWithRetries();
  if (consumerConfig.isPerfReportingEnabled) {
    long timeAftEsPost=System.currentTimeMillis();
    logger.debug("String_Node_Str",(timeAftEsPost - jobStartTime),currentPartition);
  }
  logger.info("String_Node_Str",nextOffsetToProcess,currentPartition);
  try {
    kafkaConsumerClient.saveOffsetInKafka(nextOffsetToProcess,fetchResponse.errorCode(consumerConfig.topic,currentPartition));
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",currentPartition,e);
    logger.info("String_Node_Str",currentPartition);
    try {
      reInitKafka();
      logger.info("String_Node_Str");
      kafkaConsumerClient.saveOffsetInKafka(nextOffsetToProcess,fetchResponse.errorCode(consumerConfig.topic,currentPartition));
    }
 catch (    Exception e2) {
      logger.error("String_Node_Str",currentPartition,e2);
      throw e2;
    }
  }
  if (consumerConfig.isPerfReportingEnabled) {
    long timeAtEndOfJob=System.currentTimeMillis();
    logger.info("String_Node_Str",(timeAtEndOfJob - jobStartTime),currentPartition);
  }
  logger.info("String_Node_Str",offsetForThisRound,nextOffsetToProcess,currentPartition);
  this.byteBufferMsgSet=null;
  this.fetchResponse=null;
}