Program: 39607
Project: 39607
Buggy source:
/** 
 * Performs the transformation utility against the application to be transformed <br> This is the one called by the transformation engine, and regardless of any customization it could have, it must always: <ol> <li>1- Call   {@link #applyPropertiesFromContext(TransformationContext)}</li> <li>2- Call   {@link #execution(File,TransformationContext)}</li> </ol> <br> This method is NOT supposed to be overwritten, unless you really know what you are doing.
 * @param transformedAppFolder the folder where the transformed application code is
 * @param transformationContext the transformation context object
 * @return the result
 */
@SuppressFBWarnings("String_Node_Str") public PerformResult perform(File transformedAppFolder,TransformationContext transformationContext) throws TransformationUtilityException {
  if (hasBeenPerformed.get()) {
    String exceptionMessage=String.format("String_Node_Str",getName());
    TransformationUtilityException e=new TransformationUtilityException(exceptionMessage);
    return PerformResult.error(this,e);
  }
  if (ifConditionAttributeName != null) {
    Object conditionResult=transformationContext.get(ifConditionAttributeName);
    if (conditionResult == null || conditionResult instanceof Boolean && !((Boolean)conditionResult).booleanValue()) {
      String details=String.format("String_Node_Str",getName(),ifConditionAttributeName);
      return PerformResult.skippedCondition(this,details);
    }
  }
  if (unlessConditionAttributeName != null) {
    Object conditionResult=transformationContext.get(unlessConditionAttributeName);
    if (conditionResult != null && conditionResult instanceof Boolean && ((Boolean)conditionResult).booleanValue()) {
      String details=String.format("String_Node_Str",getName(),unlessConditionAttributeName);
      return PerformResult.skippedCondition(this,details);
    }
  }
  if (utilityCondition != null) {
    try {
      TransformationUtility utilityCondition=this.utilityCondition.clone();
      utilityCondition.relative(this.getRelativePath());
      TUExecutionResult conditionExecutionResult=(TUExecutionResult)utilityCondition.execution(transformedAppFolder,transformationContext);
      Object conditionResult=conditionExecutionResult.getValue();
      if (conditionResult == null || conditionResult instanceof Boolean && !((Boolean)conditionResult).booleanValue()) {
        String utilityConditionName=(utilityCondition.getName() == null ? utilityCondition.toString() : utilityCondition.getName());
        String details=String.format("String_Node_Str",getName(),utilityConditionName);
        return PerformResult.skippedCondition(this,details);
      }
    }
 catch (    CloneNotSupportedException e) {
      String exceptionMessage=String.format("String_Node_Str",getName());
      TransformationUtilityException ex=new TransformationUtilityException(exceptionMessage,e);
      return PerformResult.error(this,ex);
    }
  }
  PerformResult result=(PerformResult)checkDependencies(transformationContext);
  if (result != null) {
    return result;
  }
  applyPropertiesFromContext(transformationContext);
  try {
    ExecutionResult executionResult=execution(transformedAppFolder,transformationContext);
    result=PerformResult.executionResult(this,executionResult);
  }
 catch (  Exception e) {
    String exceptionMessage=String.format("String_Node_Str",getName());
    TransformationUtilityException ex=new TransformationUtilityException(exceptionMessage,e);
    return PerformResult.error(this,ex);
  }
 finally {
    if (result == null) {
      String exceptionMessage=String.format("String_Node_Str",getName());
      TransformationUtilityException ex=new TransformationUtilityException(exceptionMessage);
      logger.error("String_Node_Str",ex);
    }
    hasBeenPerformed.set(true);
  }
  if (result == null) {
    String exceptionMessage=String.format("String_Node_Str",getName());
    TransformationUtilityException ex=new TransformationUtilityException(exceptionMessage);
    result=PerformResult.error(this,ex);
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Performs the transformation utility against the application to be transformed <br> This is the one called by the transformation engine, and regardless of any customization it could have, it must always: <ol> <li>1- Call   {@link #applyPropertiesFromContext(TransformationContext)}</li> <li>2- Call   {@link #execution(File,TransformationContext)}</li> </ol> <br> This method is NOT supposed to be overwritten, unless you really know what you are doing.
 * @param transformedAppFolder the folder where the transformed application code is
 * @param transformationContext the transformation context object
 * @return the result
 */
@SuppressFBWarnings("String_Node_Str") public PerformResult perform(File transformedAppFolder,TransformationContext transformationContext) throws TransformationUtilityException {
  if (hasBeenPerformed.get()) {
    String exceptionMessage=String.format("String_Node_Str",getName());
    TransformationUtilityException e=new TransformationUtilityException(exceptionMessage);
    return PerformResult.error(this,e);
  }
  if (ifConditionAttributeName != null) {
    Object conditionResult=transformationContext.get(ifConditionAttributeName);
    if (conditionResult == null || conditionResult instanceof Boolean && !((Boolean)conditionResult).booleanValue()) {
      String details=String.format("String_Node_Str",getName(),ifConditionAttributeName);
      return PerformResult.skippedCondition(this,details);
    }
  }
  if (unlessConditionAttributeName != null) {
    Object conditionResult=transformationContext.get(unlessConditionAttributeName);
    if (conditionResult != null && conditionResult instanceof Boolean && ((Boolean)conditionResult).booleanValue()) {
      String details=String.format("String_Node_Str",getName(),unlessConditionAttributeName);
      return PerformResult.skippedCondition(this,details);
    }
  }
  if (utilityCondition != null) {
    try {
      TransformationUtility utilityCondition=this.utilityCondition.clone();
      utilityCondition.relative(this.getRelativePath());
      TUExecutionResult conditionExecutionResult=(TUExecutionResult)utilityCondition.execution(transformedAppFolder,transformationContext);
      Object conditionResult=conditionExecutionResult.getValue();
      if (conditionResult == null || conditionResult instanceof Boolean && !((Boolean)conditionResult).booleanValue()) {
        String utilityConditionName=(utilityCondition.getName() == null ? utilityCondition.toString() : utilityCondition.getName());
        String details=String.format("String_Node_Str",getName(),utilityConditionName);
        return PerformResult.skippedCondition(this,details);
      }
    }
 catch (    CloneNotSupportedException e) {
      String exceptionMessage=String.format("String_Node_Str",getName());
      TransformationUtilityException ex=new TransformationUtilityException(exceptionMessage,e);
      return PerformResult.error(this,ex);
    }
  }
  PerformResult result=(PerformResult)checkDependencies(transformationContext);
  if (result != null) {
    return result;
  }
  applyPropertiesFromContext(transformationContext);
  TransformationUtilityException ex=null;
  try {
    ExecutionResult executionResult=execution(transformedAppFolder,transformationContext);
    result=PerformResult.executionResult(this,executionResult);
  }
 catch (  Exception e) {
    String exceptionMessage=String.format("String_Node_Str",getName());
    ex=new TransformationUtilityException(exceptionMessage,e);
    return PerformResult.error(this,ex);
  }
 finally {
    if (result == null && ex == null) {
      String exceptionMessage=String.format("String_Node_Str",getName());
      ex=new TransformationUtilityException(exceptionMessage);
      logger.error("String_Node_Str",ex);
    }
    hasBeenPerformed.set(true);
  }
  if (result == null) {
    String exceptionMessage=String.format("String_Node_Str",getName());
    ex=new TransformationUtilityException(exceptionMessage);
    result=PerformResult.error(this,ex);
  }
  return result;
}