Program: 141198
Project: 141198
Buggy source:
/** 
 * Add a dependency. Add an additional step that copy/(un)compress data if necessary.
 * @param step the step
 * @param format format provided by the dependency
 * @param dependency the dependency
 * @throws EoulsanException if an error occurs while adding the dependency
 */
private void addDependency(final AbstractWorkflowStep step,final DataFormat format,final AbstractWorkflowStep dependency) throws EoulsanException {
  try {
    final DataFile stepDir=step.getStepWorkingDir();
    final DataFile depDir=dependency.getStepWorkingDir();
    final DataProtocol stepProtocol=stepDir.getProtocol();
    final DataProtocol depProtocol=depDir.getProtocol();
    final EnumSet<CompressionType> stepCompressionsAllowed=step.getInputDataFormatCompressionsAllowed(format);
    final CompressionType depOutputCompression=dependency == getDesignStep() ? CompressionType.NONE : dependency.getOutputDataFormatCompression(format);
    final Set<DataFormat> stepFormatRequieredWD=step.getInputFormatsRequieredInWorkingDirectory();
    CommandWorkflowStep newStep=null;
    if (step.getType() == StepType.STANDARD_STEP && stepProtocol != depProtocol && stepFormatRequieredWD.contains(format)) {
      newStep=newInputFormatCopyStep(this,step.getId(),stepDir,format,depOutputCompression,stepCompressionsAllowed);
    }
    if (newStep == null && step.getType() == StepType.STANDARD_STEP && !stepCompressionsAllowed.contains(depOutputCompression)) {
      newStep=newInputFormatCopyStep(this,step.getId(),stepDir,format,depOutputCompression,stepCompressionsAllowed);
    }
    if (newStep == null && step.getType() == StepType.STANDARD_STEP && dependency == this.getDesignStep() && !EnumSet.allOf(CompressionType.class).containsAll(stepCompressionsAllowed)) {
      newStep=newInputFormatCopyStep(this,step.getId(),stepDir,format,depOutputCompression,stepCompressionsAllowed);
    }
    if (newStep != null) {
      addStep(indexOfStep(step),newStep);
      newStep.addDependency(format,dependency);
      step.addDependency(format,newStep);
    }
 else {
      step.addDependency(format,dependency);
    }
  }
 catch (  IOException e) {
    throw new EoulsanException(e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * Add a dependency. Add an additional step that copy/(un)compress data if necessary.
 * @param step the step
 * @param format format provided by the dependency
 * @param dependency the dependency
 * @throws EoulsanException if an error occurs while adding the dependency
 */
private void addDependency(final AbstractWorkflowStep step,final DataFormat format,final AbstractWorkflowStep dependency) throws EoulsanException {
  try {
    final DataFile stepDir=step.getStepWorkingDir();
    final DataFile depDir=dependency.getStepWorkingDir();
    final DataProtocol stepProtocol=stepDir.getProtocol();
    final DataProtocol depProtocol=depDir.getProtocol();
    final EnumSet<CompressionType> stepCompressionsAllowed=step.getInputDataFormatCompressionsAllowed(format);
    final CompressionType depOutputCompression=dependency == getDesignStep() ? CompressionType.NONE : dependency.getOutputDataFormatCompression(format);
    final Set<DataFormat> stepFormatRequieredWD=step.getInputFormatsRequieredInWorkingDirectory();
    CommandWorkflowStep newStep=null;
    if (step.getType() == StepType.STANDARD_STEP && stepProtocol != depProtocol && stepFormatRequieredWD.contains(format)) {
      newStep=newInputFormatCopyStep(this,step.getId(),format,depOutputCompression,stepCompressionsAllowed);
    }
    if (newStep == null && step.getType() == StepType.STANDARD_STEP && !stepCompressionsAllowed.contains(depOutputCompression)) {
      newStep=newInputFormatCopyStep(this,step.getId(),format,depOutputCompression,stepCompressionsAllowed);
    }
    if (newStep == null && step.getType() == StepType.STANDARD_STEP && dependency == this.getDesignStep() && !EnumSet.allOf(CompressionType.class).containsAll(stepCompressionsAllowed)) {
      newStep=newInputFormatCopyStep(this,step.getId(),format,depOutputCompression,stepCompressionsAllowed);
    }
    if (newStep != null) {
      addStep(indexOfStep(step),newStep);
      newStep.addDependency(format,dependency);
      step.addDependency(format,newStep);
    }
 else {
      step.addDependency(format,dependency);
    }
  }
 catch (  IOException e) {
    throw new EoulsanException(e.getMessage());
  }
}