Program: 55458
Project: 55458
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void invoke() throws Exception {
  if (LOG.isInfoEnabled())   LOG.info(getLogString("String_Node_Str"));
  try {
    AbstractPactTask.openChainedTasks(this.chainedTasks,this);
    final Iterator<InputSplit> splitIterator=getInputSplits();
    while (!this.taskCanceled && splitIterator.hasNext()) {
      final InputSplit split=splitIterator.next();
      if (LOG.isDebugEnabled())       LOG.debug(getLogString("String_Node_Str" + split.toString()));
      final InputFormat<OT,InputSplit> format=this.format;
      format.open(split);
      if (LOG.isDebugEnabled())       LOG.debug(getLogString("String_Node_Str" + split.toString()));
      final OT record=this.serializer.createInstance();
      if (record.getClass() == PactRecord.class) {
        final PactRecord pactRecord=(PactRecord)record;
        @SuppressWarnings("String_Node_Str") final InputFormat<PactRecord,InputSplit> inFormat=(InputFormat<PactRecord,InputSplit>)format;
        if (this.output instanceof PactRecordOutputCollector) {
          final PactRecordOutputCollector output=(PactRecordOutputCollector)this.output;
          while (!this.taskCanceled && !inFormat.reachedEnd()) {
            if (inFormat.nextRecord(pactRecord)) {
              output.collect(pactRecord);
            }
          }
        }
 else         if (this.output instanceof ChainedMapTask) {
          @SuppressWarnings("String_Node_Str") final ChainedMapTask<PactRecord,?> output=(ChainedMapTask<PactRecord,?>)this.output;
          while (!this.taskCanceled && !inFormat.reachedEnd()) {
            if (inFormat.nextRecord(pactRecord)) {
              output.collect(pactRecord);
            }
          }
        }
      }
 else {
        if (this.output instanceof OutputCollector) {
          final OutputCollector<OT> output=(OutputCollector<OT>)this.output;
          while (!this.taskCanceled && !format.reachedEnd()) {
            if (format.nextRecord(record)) {
              output.collect(record);
            }
          }
        }
 else         if (this.output instanceof ChainedMapTask) {
          @SuppressWarnings("String_Node_Str") final ChainedMapTask<OT,?> output=(ChainedMapTask<OT,?>)this.output;
          while (!this.taskCanceled && !format.reachedEnd()) {
            if (format.nextRecord(record)) {
              output.collect(record);
            }
          }
        }
 else {
          final Collector<OT> output=this.output;
          while (!this.taskCanceled && !format.reachedEnd()) {
            if (format.nextRecord(record)) {
              output.collect(record);
            }
          }
        }
      }
      if (!this.taskCanceled) {
        if (LOG.isDebugEnabled())         LOG.debug(getLogString("String_Node_Str" + split.toString()));
        format.close();
      }
    }
    this.output.close();
    AbstractPactTask.closeChainedTasks(this.chainedTasks,this);
  }
 catch (  Exception ex) {
    try {
      this.format.close();
    }
 catch (    Throwable t) {
    }
    AbstractPactTask.cancelChainedTasks(this.chainedTasks);
    if (!this.taskCanceled) {
      AbstractPactTask.logAndThrowException(ex,this);
    }
  }
  if (!this.taskCanceled) {
    if (LOG.isInfoEnabled())     LOG.info(getLogString("String_Node_Str"));
  }
 else {
    if (LOG.isWarnEnabled())     LOG.warn(getLogString("String_Node_Str"));
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void invoke() throws Exception {
  if (LOG.isInfoEnabled())   LOG.info(getLogString("String_Node_Str"));
  try {
    AbstractPactTask.openChainedTasks(this.chainedTasks,this);
    final Iterator<InputSplit> splitIterator=getInputSplits();
    while (!this.taskCanceled && splitIterator.hasNext()) {
      final InputSplit split=splitIterator.next();
      if (LOG.isDebugEnabled())       LOG.debug(getLogString("String_Node_Str" + split.toString()));
      final InputFormat<OT,InputSplit> format=this.format;
      format.open(split);
      if (LOG.isDebugEnabled())       LOG.debug(getLogString("String_Node_Str" + split.toString()));
      final OT record=this.serializer.createInstance();
      if (record.getClass() == PactRecord.class) {
        final PactRecord pactRecord=(PactRecord)record;
        @SuppressWarnings("String_Node_Str") final InputFormat<PactRecord,InputSplit> inFormat=(InputFormat<PactRecord,InputSplit>)format;
        if (this.output instanceof PactRecordOutputCollector) {
          final PactRecordOutputCollector output=(PactRecordOutputCollector)this.output;
          while (!this.taskCanceled && !inFormat.reachedEnd()) {
            if (inFormat.nextRecord(pactRecord)) {
              output.collect(pactRecord);
            }
          }
        }
 else         if (this.output instanceof ChainedMapTask) {
          @SuppressWarnings("String_Node_Str") final ChainedMapTask<PactRecord,?> output=(ChainedMapTask<PactRecord,?>)this.output;
          while (!this.taskCanceled && !inFormat.reachedEnd()) {
            if (inFormat.nextRecord(pactRecord)) {
              output.collect(pactRecord);
            }
          }
        }
 else {
          @SuppressWarnings("String_Node_Str") final Collector<PactRecord> output=(Collector<PactRecord>)this.output;
          while (!this.taskCanceled && !inFormat.reachedEnd()) {
            if (inFormat.nextRecord(pactRecord)) {
              output.collect(pactRecord);
            }
          }
        }
      }
 else {
        if (this.output instanceof OutputCollector) {
          final OutputCollector<OT> output=(OutputCollector<OT>)this.output;
          while (!this.taskCanceled && !format.reachedEnd()) {
            if (format.nextRecord(record)) {
              output.collect(record);
            }
          }
        }
 else         if (this.output instanceof ChainedMapTask) {
          @SuppressWarnings("String_Node_Str") final ChainedMapTask<OT,?> output=(ChainedMapTask<OT,?>)this.output;
          while (!this.taskCanceled && !format.reachedEnd()) {
            if (format.nextRecord(record)) {
              output.collect(record);
            }
          }
        }
 else {
          final Collector<OT> output=this.output;
          while (!this.taskCanceled && !format.reachedEnd()) {
            if (format.nextRecord(record)) {
              output.collect(record);
            }
          }
        }
      }
      if (!this.taskCanceled) {
        if (LOG.isDebugEnabled())         LOG.debug(getLogString("String_Node_Str" + split.toString()));
        format.close();
      }
    }
    this.output.close();
    AbstractPactTask.closeChainedTasks(this.chainedTasks,this);
  }
 catch (  Exception ex) {
    try {
      this.format.close();
    }
 catch (    Throwable t) {
    }
    AbstractPactTask.cancelChainedTasks(this.chainedTasks);
    if (!this.taskCanceled) {
      AbstractPactTask.logAndThrowException(ex,this);
    }
  }
  if (!this.taskCanceled) {
    if (LOG.isInfoEnabled())     LOG.info(getLogString("String_Node_Str"));
  }
 else {
    if (LOG.isWarnEnabled())     LOG.warn(getLogString("String_Node_Str"));
  }
}