Program: 8126
Project: 8126
Buggy source:
/** 
 * Processes the message received by the collection server.
 * @param session
 * @param message
 * @throws Exception
 */
@Override public void messageReceived(final IoSession session,final Object message) throws Exception {
  if (message instanceof MetricRequest) {
    final MetricRequest request=(MetricRequest)message;
    if (request.getValid()) {
      Future<MetricResponse.Status> future=null;
      for (      final ImmutablePair<MetricType,MetricsProcessor> processor : processors) {
        if (request.getMetricType() == processor.getFirst()) {
          if (future == null) {
            future=processor.getSecond().process(request);
          }
 else {
            future=future.zip(processor.getSecond().process(request)).map(new Mapper<Tuple2<MetricResponse.Status,MetricResponse.Status>,MetricResponse.Status>(){
              @Override public MetricResponse.Status apply(              Tuple2<MetricResponse.Status,MetricResponse.Status> zipped){
                if (zipped._1() != MetricResponse.Status.SUCCESS || zipped._2() != MetricResponse.Status.SUCCESS) {
                  return MetricResponse.Status.FAILED;
                }
                return MetricResponse.Status.SUCCESS;
              }
            }
);
          }
        }
      }
      if (future != null) {
        future.onComplete(new OnComplete<MetricResponse.Status>(){
          @Override public void onComplete(          Throwable failure,          MetricResponse.Status status){
            if (failure != null) {
              writeIfConnected(session,new MetricResponse(MetricResponse.Status.FAILED));
            }
 else {
              writeIfConnected(session,new MetricResponse(status));
            }
          }
        }
);
        futureList.add(future);
        return;
      }
    }
  }
 else {
    writeIfConnected(session,new MetricResponse(MetricResponse.Status.INVALID));
  }
}

Fixed version (ground truth):
/** 
 * Processes the message received by the collection server.
 * @param session
 * @param message
 * @throws Exception
 */
@Override public void messageReceived(final IoSession session,final Object message) throws Exception {
  if (message instanceof MetricRequest) {
    final MetricRequest request=(MetricRequest)message;
    if (request.getValid()) {
      Future<MetricResponse.Status> future=null;
      for (      final ImmutablePair<MetricType,MetricsProcessor> processor : processors) {
        if (request.getMetricType() == processor.getFirst()) {
          if (future == null) {
            future=processor.getSecond().process(request);
          }
 else {
            future=future.zip(processor.getSecond().process(request)).map(new Mapper<Tuple2<MetricResponse.Status,MetricResponse.Status>,MetricResponse.Status>(){
              @Override public MetricResponse.Status apply(              Tuple2<MetricResponse.Status,MetricResponse.Status> zipped){
                if (zipped._1() != MetricResponse.Status.SUCCESS || zipped._2() != MetricResponse.Status.SUCCESS) {
                  return MetricResponse.Status.FAILED;
                }
                return MetricResponse.Status.SUCCESS;
              }
            }
);
          }
        }
      }
      if (future != null) {
        future.onComplete(new OnComplete<MetricResponse.Status>(){
          @Override public void onComplete(          Throwable failure,          MetricResponse.Status status){
            if (failure != null) {
              writeIfConnected(session,new MetricResponse(MetricResponse.Status.FAILED));
            }
 else {
              writeIfConnected(session,new MetricResponse(status));
            }
          }
        }
);
        futureReaper.add(future);
      }
    }
  }
 else {
    writeIfConnected(session,new MetricResponse(MetricResponse.Status.INVALID));
  }
}