Program: 7435
Project: 7435
Buggy source:
private <T>ProcessMethodCallback processMethodCallback(final BlockingQueue<FlowletProcessEntry<?>> processQueue,final FlowletProcessEntry<T> processEntry,final InputDatum<T> input){
  final int processedCount=processEntry.getProcessSpec().getProcessMethod().needsInput() ? input.size() : 1;
  return new ProcessMethodCallback(){
    @Override public void onSuccess(    Object object,    InputContext inputContext){
      try {
        gaugeEventProcessed(input.getQueueName());
        txCallback.onSuccess(object,inputContext);
      }
 catch (      Throwable t) {
        LOG.error("String_Node_Str",flowletContext,t);
      }
 finally {
        enqueueEntry();
        inflight.decrementAndGet();
      }
    }
    @Override public void onFailure(    Object inputObject,    InputContext inputContext,    FailureReason reason,    InputAcknowledger inputAcknowledger){
      LOG.warn("String_Node_Str",flowletContext,reason.getMessage(),input,reason.getCause());
      FailurePolicy failurePolicy;
      try {
        flowletContext.getProgramMetrics().increment("String_Node_Str",1);
        failurePolicy=txCallback.onFailure(inputObject,inputContext,reason);
        if (failurePolicy == null) {
          failurePolicy=FailurePolicy.RETRY;
          LOG.info("String_Node_Str",failurePolicy);
        }
      }
 catch (      Throwable t) {
        LOG.error("String_Node_Str",flowletContext,t);
        failurePolicy=FailurePolicy.RETRY;
      }
      if (input.getRetry() >= processEntry.getProcessSpec().getProcessMethod().getMaxRetries()) {
        LOG.info("String_Node_Str",input);
        failurePolicy=FailurePolicy.IGNORE;
      }
      if (failurePolicy == FailurePolicy.RETRY) {
        FlowletProcessEntry retryEntry=processEntry.isRetry() ? processEntry : FlowletProcessEntry.create(processEntry.getProcessSpec(),new ProcessSpecification<T>(new SingleItemQueueReader<T>(input),processEntry.getProcessSpec().getProcessMethod(),null));
        processQueue.offer(retryEntry);
      }
 else       if (failurePolicy == FailurePolicy.IGNORE) {
        try {
          gaugeEventProcessed(input.getQueueName());
          inputAcknowledger.ack();
        }
 catch (        Throwable t) {
          LOG.error("String_Node_Str",flowletContext,t);
        }
 finally {
          enqueueEntry();
          inflight.decrementAndGet();
        }
      }
    }
    private void enqueueEntry(){
      processQueue.offer(processEntry.resetRetry());
    }
    private void gaugeEventProcessed(    QueueName inputQueueName){
      if (processEntry.isTick()) {
        flowletContext.getProgramMetrics().increment("String_Node_Str",processedCount);
      }
 else       if (inputQueueName == null) {
        flowletContext.getProgramMetrics().increment("String_Node_Str",processedCount);
      }
 else {
        String tag="String_Node_Str" + inputQueueName.toString();
        flowletContext.getProgramMetrics().increment("String_Node_Str",processedCount,tag);
      }
    }
  }
;
}

Fixed version (ground truth):
private <T>ProcessMethodCallback processMethodCallback(final PriorityQueue<FlowletProcessEntry<?>> processQueue,final FlowletProcessEntry<T> processEntry,final InputDatum<T> input){
  final int processedCount=processEntry.getProcessSpec().getProcessMethod().needsInput() ? input.size() : 1;
  return new ProcessMethodCallback(){
    @Override public void onSuccess(    Object object,    InputContext inputContext){
      try {
        gaugeEventProcessed(input.getQueueName());
        txCallback.onSuccess(object,inputContext);
      }
 catch (      Throwable t) {
        LOG.error("String_Node_Str",flowletContext,t);
      }
 finally {
        enqueueEntry();
      }
    }
    @Override public void onFailure(    Object inputObject,    InputContext inputContext,    FailureReason reason,    InputAcknowledger inputAcknowledger){
      LOG.warn("String_Node_Str",flowletContext,reason.getMessage(),input,reason.getCause());
      FailurePolicy failurePolicy;
      try {
        flowletContext.getProgramMetrics().increment("String_Node_Str",1);
        failurePolicy=txCallback.onFailure(inputObject,inputContext,reason);
        if (failurePolicy == null) {
          failurePolicy=FailurePolicy.RETRY;
          LOG.info("String_Node_Str",failurePolicy);
        }
      }
 catch (      Throwable t) {
        LOG.error("String_Node_Str",flowletContext,t);
        failurePolicy=FailurePolicy.RETRY;
      }
      if (input.getRetry() >= processEntry.getProcessSpec().getProcessMethod().getMaxRetries()) {
        LOG.info("String_Node_Str",input);
        failurePolicy=FailurePolicy.IGNORE;
      }
      if (failurePolicy == FailurePolicy.RETRY) {
        FlowletProcessEntry retryEntry=processEntry.isRetry() ? processEntry : FlowletProcessEntry.create(processEntry.getProcessSpec(),new ProcessSpecification<T>(new SingleItemQueueReader<T>(input),processEntry.getProcessSpec().getProcessMethod(),null));
        processQueue.offer(retryEntry);
      }
 else       if (failurePolicy == FailurePolicy.IGNORE) {
        try {
          gaugeEventProcessed(input.getQueueName());
          inputAcknowledger.ack();
        }
 catch (        Throwable t) {
          LOG.error("String_Node_Str",flowletContext,t);
        }
 finally {
          enqueueEntry();
        }
      }
    }
    private void enqueueEntry(){
      processQueue.offer(processEntry.resetRetry());
    }
    private void gaugeEventProcessed(    QueueName inputQueueName){
      if (processEntry.isTick()) {
        flowletContext.getProgramMetrics().increment("String_Node_Str",processedCount);
      }
 else       if (inputQueueName == null) {
        flowletContext.getProgramMetrics().increment("String_Node_Str",processedCount);
      }
 else {
        String tag="String_Node_Str" + inputQueueName.toString();
        flowletContext.getProgramMetrics().increment("String_Node_Str",processedCount,tag);
      }
    }
  }
;
}