Program: 8095
Project: 8095
Buggy source:
/** 
 * �����Ƿ���Ҫ���������Ĵ���
 * @param request
 * @param it
 * @param listener
 * @param partition
 * @return
 */
private boolean processReceiveMessage(final FetchRequest request,final MessageIterator it,final MessageListener listener,final ConsumerMessageFilter filter,final Partition partition,final String group){
  int count=0;
  List<Long> inTransactionMsgIds=new ArrayList<Long>();
  while (it.hasNext()) {
    final int prevOffset=it.getOffset();
    try {
      final Message msg=it.next();
      if (this.isProcessed(msg)) {
        continue;
      }
      MessageAccessor.setPartition(msg,partition);
      boolean accept=this.isAcceptable(request,filter,group,msg);
      if (accept) {
        currentTopicRegInfo.set(request.getTopicPartitionRegInfo().clone(it));
        try {
          listener.recieveMessages(msg);
        }
  finally {
          currentTopicRegInfo.remove();
        }
      }
      if (MessageAccessor.isRollbackOnly(msg)) {
        it.setOffset(prevOffset);
        break;
      }
      if (partition.isAutoAck()) {
        count++;
        this.markProcessed(msg.getId());
      }
 else {
        if (partition.isAcked()) {
          count++;
          for (          Long msgId : inTransactionMsgIds) {
            this.markProcessed(msgId);
          }
          this.markProcessed(msg.getId());
          break;
        }
 else         if (partition.isRollback()) {
          break;
        }
 else {
          inTransactionMsgIds.add(msg.getId());
          count++;
        }
      }
    }
 catch (    InterruptedException e) {
      it.setOffset(prevOffset);
      log.error("String_Node_Str" + request.getTopic() + "String_Node_Str"+ request.getPartition(),e);
      break;
    }
catch (    final InvalidMessageException e) {
      MetaStatLog.addStat(null,StatConstants.INVALID_MSG_STAT,request.getTopic());
      this.getOffsetAddRequest(request,e);
      return true;
    }
catch (    final Throwable e) {
      it.setOffset(prevOffset);
      log.error("String_Node_Str" + request.getTopic() + "String_Node_Str"+ request.getPartition(),e);
      break;
    }
  }
  MetaStatLog.addStatValue2(null,StatConstants.GET_MSG_COUNT_STAT,request.getTopic(),count);
  return false;
}

Fixed version (ground truth):
/** 
 * �����Ƿ���Ҫ���������Ĵ���
 * @param request
 * @param it
 * @param listener
 * @param partition
 * @return
 */
private boolean processReceiveMessage(final FetchRequest request,final MessageIterator it,final MessageListener listener,final ConsumerMessageFilter filter,final Partition partition,final String group){
  int count=0;
  List<Long> inTransactionMsgIds=new ArrayList<Long>();
  while (it.hasNext()) {
    final int prevOffset=it.getOffset();
    try {
      final Message msg=it.next();
      if (this.isProcessed(msg.getId(),group)) {
        continue;
      }
      MessageAccessor.setPartition(msg,partition);
      boolean accept=this.isAcceptable(request,filter,group,msg);
      if (accept) {
        currentTopicRegInfo.set(request.getTopicPartitionRegInfo().clone(it));
        try {
          listener.recieveMessages(msg);
        }
  finally {
          currentTopicRegInfo.remove();
        }
      }
      if (MessageAccessor.isRollbackOnly(msg)) {
        it.setOffset(prevOffset);
        break;
      }
      if (partition.isAutoAck()) {
        count++;
        this.markProcessed(msg.getId(),group);
      }
 else {
        if (partition.isAcked()) {
          count++;
          for (          Long msgId : inTransactionMsgIds) {
            this.markProcessed(msgId,group);
          }
          this.markProcessed(msg.getId(),group);
          break;
        }
 else         if (partition.isRollback()) {
          break;
        }
 else {
          inTransactionMsgIds.add(msg.getId());
          count++;
        }
      }
    }
 catch (    InterruptedException e) {
      it.setOffset(prevOffset);
      log.error("String_Node_Str" + request.getTopic() + "String_Node_Str"+ request.getPartition(),e);
      break;
    }
catch (    final InvalidMessageException e) {
      MetaStatLog.addStat(null,StatConstants.INVALID_MSG_STAT,request.getTopic());
      this.getOffsetAddRequest(request,e);
      return true;
    }
catch (    final Throwable e) {
      it.setOffset(prevOffset);
      log.error("String_Node_Str" + request.getTopic() + "String_Node_Str"+ request.getPartition(),e);
      break;
    }
  }
  MetaStatLog.addStatValue2(null,StatConstants.GET_MSG_COUNT_STAT,request.getTopic(),count);
  return false;
}