Program: 4659
Project: 4659
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public void run(Context context) throws IOException, InterruptedException {
  MapReduceClassLoader classLoader=MapReduceClassLoader.getFromConfiguration(context.getConfiguration());
  ClassLoader weakReferenceClassLoader=new WeakReferenceDelegatorClassLoader(classLoader);
  BasicMapReduceTaskContext basicMapReduceContext=classLoader.getTaskContextProvider().get(context);
  String program=basicMapReduceContext.getProgramName();
  WrappedMapper.Context flushingContext=createAutoFlushingContext(context,basicMapReduceContext);
  basicMapReduceContext.setHadoopContext(flushingContext);
  InputSplit inputSplit=context.getInputSplit();
  if (inputSplit instanceof MultiInputTaggedSplit) {
    basicMapReduceContext.setInputContext(InputContexts.create((MultiInputTaggedSplit)inputSplit));
  }
  ClassLoader programClassLoader=classLoader.getProgramClassLoader();
  Mapper delegate=createMapperInstance(programClassLoader,getWrappedMapper(context.getConfiguration()),context,program);
  try {
    Reflections.visit(delegate,delegate.getClass(),new PropertyFieldSetter(basicMapReduceContext.getSpecification().getProperties()),new MetricsFieldSetter(basicMapReduceContext.getMetrics()),new DataSetFieldSetter(basicMapReduceContext));
  }
 catch (  Throwable t) {
    Throwable rootCause=Throwables.getRootCause(t);
    USERLOG.error("String_Node_Str",program,rootCause.getMessage(),rootCause);
    throw new IOException(String.format("String_Node_Str",delegate.getClass()),t);
  }
  ClassLoader oldClassLoader;
  if (delegate instanceof ProgramLifecycle) {
    oldClassLoader=ClassLoaders.setContextClassLoader(weakReferenceClassLoader);
    try {
      ((ProgramLifecycle)delegate).initialize(new MapReduceLifecycleContext(basicMapReduceContext));
    }
 catch (    Exception e) {
      Throwable rootCause=Throwables.getRootCause(e);
      USERLOG.error("String_Node_Str" + "String_Node_Str",program,rootCause.getMessage(),rootCause);
      throw new IOException(String.format("String_Node_Str",basicMapReduceContext),e);
    }
 finally {
      ClassLoaders.setContextClassLoader(oldClassLoader);
    }
  }
  oldClassLoader=ClassLoaders.setContextClassLoader(weakReferenceClassLoader);
  try {
    delegate.run(flushingContext);
  }
  finally {
    ClassLoaders.setContextClassLoader(oldClassLoader);
  }
  try {
    basicMapReduceContext.flushOperations();
  }
 catch (  Exception e) {
    throw new IOException("String_Node_Str" + basicMapReduceContext,e);
  }
  basicMapReduceContext.closeMultiOutputs();
  if (delegate instanceof ProgramLifecycle) {
    oldClassLoader=ClassLoaders.setContextClassLoader(weakReferenceClassLoader);
    try {
      ((ProgramLifecycle<? extends RuntimeContext>)delegate).destroy();
    }
 catch (    Exception e) {
      LOG.error("String_Node_Str",basicMapReduceContext,e);
    }
 finally {
      ClassLoaders.setContextClassLoader(oldClassLoader);
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public void run(Context context) throws IOException, InterruptedException {
  MapReduceClassLoader classLoader=MapReduceClassLoader.getFromConfiguration(context.getConfiguration());
  ClassLoader weakReferenceClassLoader=new WeakReferenceDelegatorClassLoader(classLoader);
  BasicMapReduceTaskContext basicMapReduceContext=classLoader.getTaskContextProvider().get(context);
  String program=basicMapReduceContext.getProgramName();
  final MapTaskMetricsWriter mapTaskMetricsWriter=new MapTaskMetricsWriter(basicMapReduceContext.getProgramMetrics(),context);
  WrappedMapper.Context flushingContext=createAutoFlushingContext(context,basicMapReduceContext,mapTaskMetricsWriter);
  basicMapReduceContext.setHadoopContext(flushingContext);
  InputSplit inputSplit=context.getInputSplit();
  if (inputSplit instanceof MultiInputTaggedSplit) {
    basicMapReduceContext.setInputContext(InputContexts.create((MultiInputTaggedSplit)inputSplit));
  }
  ClassLoader programClassLoader=classLoader.getProgramClassLoader();
  Mapper delegate=createMapperInstance(programClassLoader,getWrappedMapper(context.getConfiguration()),context,program);
  try {
    Reflections.visit(delegate,delegate.getClass(),new PropertyFieldSetter(basicMapReduceContext.getSpecification().getProperties()),new MetricsFieldSetter(basicMapReduceContext.getMetrics()),new DataSetFieldSetter(basicMapReduceContext));
  }
 catch (  Throwable t) {
    Throwable rootCause=Throwables.getRootCause(t);
    USERLOG.error("String_Node_Str",program,rootCause.getMessage(),rootCause);
    throw new IOException(String.format("String_Node_Str",delegate.getClass()),t);
  }
  ClassLoader oldClassLoader;
  if (delegate instanceof ProgramLifecycle) {
    oldClassLoader=ClassLoaders.setContextClassLoader(weakReferenceClassLoader);
    try {
      ((ProgramLifecycle)delegate).initialize(new MapReduceLifecycleContext(basicMapReduceContext));
    }
 catch (    Exception e) {
      Throwable rootCause=Throwables.getRootCause(e);
      USERLOG.error("String_Node_Str" + "String_Node_Str",program,rootCause.getMessage(),rootCause);
      throw new IOException(String.format("String_Node_Str",basicMapReduceContext),e);
    }
 finally {
      ClassLoaders.setContextClassLoader(oldClassLoader);
    }
  }
  oldClassLoader=ClassLoaders.setContextClassLoader(weakReferenceClassLoader);
  try {
    delegate.run(flushingContext);
  }
  finally {
    ClassLoaders.setContextClassLoader(oldClassLoader);
  }
  try {
    basicMapReduceContext.flushOperations();
  }
 catch (  Exception e) {
    throw new IOException("String_Node_Str" + basicMapReduceContext,e);
  }
  basicMapReduceContext.closeMultiOutputs();
  if (delegate instanceof ProgramLifecycle) {
    oldClassLoader=ClassLoaders.setContextClassLoader(weakReferenceClassLoader);
    try {
      ((ProgramLifecycle<? extends RuntimeContext>)delegate).destroy();
    }
 catch (    Exception e) {
      LOG.error("String_Node_Str",basicMapReduceContext,e);
    }
 finally {
      ClassLoaders.setContextClassLoader(oldClassLoader);
    }
  }
  mapTaskMetricsWriter.reportMetrics();
}