Program: 39619
Project: 39619
Buggy source:
/** 
 * When set, this TU will only execute if this   {@code utilityCondition} object,executed right before this TU, result in true. <br> Differences between this approach and  {@link #executeIf(String)}: <ol> <li>Instead of relying on a TCA (  {@link TransformationContext attribute}) with the condition result, this method is based on the direct execution of the   {@link UtilityCondition} object</li><li>The  {@link UtilityCondition} object is always executed necessarily against the same file. Because of that, any value set on it via {@link #relative(String)} or {@link #absolute(String)} is ignored.</li><li>The  {@link UtilityCondition} object does not produce any TCA, neither its result value or result object. Instead, it hands its result directly to the TU, so that the condition can be evaluated just before the TU executes (or not, if it fails).</li><li>The  {@link UtilityCondition} object does not exist from a transformation template point of view. That means this method is totally different than adding a new {@link UtilityCondition} object by calling {@link TransformationTemplate#add(TransformationUtility)}.</li> <li>No TU can   {@link #dependsOn(String)} this {@link UtilityCondition} object.</li></ol> <strong>The actual  {@link UtilityCondition} object is not the one used, but a clone of it<strong/>
 * @param utilityCondition the condition to be executed and evaluated right before this TU
 * @return this utility instance
 */
public final TU executeIf(UtilityCondition utilityCondition){
  this.utilityCondition=utilityCondition;
  return (TU)this;
}

Fixed version (ground truth):
/** 
 * When set, this TU will only execute if this   {@code utilityCondition} object,executed right before this TU, result in true. <br> Differences between this approach and  {@link #executeIf(String)}: <ol> <li>Instead of relying on a TCA (  {@link TransformationContext attribute}) with the condition result, this method is based on the direct execution of the   {@link UtilityCondition} object</li><li>The  {@link UtilityCondition} object is always executed necessarily against the same file. Because of that, any value set on it via {@link #relative(String)} or {@link #absolute(String)} is ignored.</li><li>The  {@link UtilityCondition} object does not produce any TCA, neither its result value or result object. Instead, it hands its result directly to the TU, so that the condition can be evaluated just before the TU executes (or not, if it fails).</li><li>The  {@link UtilityCondition} object does not exist from a transformation template point of view. That means this method is totally different than adding a new {@link UtilityCondition} object by calling {@link TransformationTemplate#add(TransformationUtility)}.</li> <li>No TU can   {@link #dependsOn(String)} this {@link UtilityCondition} object.</li></ol> <strong>The actual  {@link UtilityCondition} object is not the one used, but a clone of it</strong>
 * @param utilityCondition the condition to be executed and evaluated right before this TU
 * @return this utility instance
 */
public final TU executeIf(UtilityCondition utilityCondition){
  this.utilityCondition=utilityCondition;
  return (TU)this;
}