Program: 4657
Project: 4657
Buggy source:
private WrappedMapper.Context createAutoFlushingContext(final Context context,final BasicMapReduceTaskContext basicMapReduceContext){
  final int flushFreq=context.getConfiguration().getInt("String_Node_Str",10000);
  @SuppressWarnings("String_Node_Str") WrappedMapper.Context flushingContext=new WrappedMapper().new Context(context){
    private int processedRecords=0;
    @Override public boolean nextKeyValue() throws IOException, InterruptedException {
      boolean result=super.nextKeyValue();
      if (++processedRecords > flushFreq) {
        try {
          LOG.trace("String_Node_Str");
          basicMapReduceContext.flushOperations();
        }
 catch (        Exception e) {
          LOG.error("String_Node_Str",e);
          throw Throwables.propagate(e);
        }
        processedRecords=0;
      }
      return result;
    }
    @Override public InputSplit getInputSplit(){
      InputSplit inputSplit=super.getInputSplit();
      if (inputSplit instanceof TaggedInputSplit) {
        inputSplit=((TaggedInputSplit)inputSplit).getInputSplit();
      }
      return inputSplit;
    }
    @Override public Class<? extends InputFormat<?,?>> getInputFormatClass() throws ClassNotFoundException {
      InputSplit inputSplit=super.getInputSplit();
      if (inputSplit instanceof MultiInputTaggedSplit) {
        return ((MultiInputTaggedSplit)inputSplit).getInputFormatClass();
      }
      return super.getInputFormatClass();
    }
  }
;
  return flushingContext;
}

Fixed version (ground truth):
private WrappedMapper.Context createAutoFlushingContext(final Context context,final BasicMapReduceTaskContext basicMapReduceContext,final MapTaskMetricsWriter metricsWriter){
  final int flushFreq=context.getConfiguration().getInt("String_Node_Str",10000);
  final long reportIntervalInMillis=basicMapReduceContext.getMetricsReportIntervalMillis();
  @SuppressWarnings("String_Node_Str") WrappedMapper.Context flushingContext=new WrappedMapper().new Context(context){
    private int processedRecords=0;
    private long nextTimeToReportMetrics=0L;
    @Override public boolean nextKeyValue() throws IOException, InterruptedException {
      boolean result=super.nextKeyValue();
      if (++processedRecords > flushFreq) {
        try {
          LOG.trace("String_Node_Str");
          basicMapReduceContext.flushOperations();
        }
 catch (        Exception e) {
          LOG.error("String_Node_Str",e);
          throw Throwables.propagate(e);
        }
        processedRecords=0;
      }
      if (System.currentTimeMillis() >= nextTimeToReportMetrics) {
        metricsWriter.reportMetrics();
        nextTimeToReportMetrics=System.currentTimeMillis() + reportIntervalInMillis;
      }
      return result;
    }
    @Override public InputSplit getInputSplit(){
      InputSplit inputSplit=super.getInputSplit();
      if (inputSplit instanceof TaggedInputSplit) {
        inputSplit=((TaggedInputSplit)inputSplit).getInputSplit();
      }
      return inputSplit;
    }
    @Override public Class<? extends InputFormat<?,?>> getInputFormatClass() throws ClassNotFoundException {
      InputSplit inputSplit=super.getInputSplit();
      if (inputSplit instanceof MultiInputTaggedSplit) {
        return ((MultiInputTaggedSplit)inputSplit).getInputFormatClass();
      }
      return super.getInputFormatClass();
    }
  }
;
  return flushingContext;
}