Program: 61462
Project: 61462
Buggy source:
/** 
 * Return an ingredient. As it has a cache, it never returns twice the same ingredient.
 * @param modificationPoint
 * @param targetStmt
 * @param operationType
 * @param elementsFromFixSpace
 * @return
 */
@Override public Ingredient getFixIngredient(ModificationPoint modificationPoint,AstorOperator operationType){
  int attemptsBaseIngredients=0;
  List<CtCodeElement> baseElements=getNotExhaustedBaseElements(modificationPoint,operationType);
  if (baseElements.isEmpty()) {
    log.debug("String_Node_Str" + modificationPoint);
    log.debug("String_Node_Str" + this.exhaustTemplates.get(getKey(modificationPoint,operationType)));
    return null;
  }
  int elementsFromFixSpace=baseElements.size();
  log.debug("String_Node_Str" + elementsFromFixSpace);
  Stats.currentStat.addSize(Stats.currentStat.ingredientSpaceSize,baseElements.size());
  while (attemptsBaseIngredients < elementsFromFixSpace) {
    log.debug(String.format("String_Node_Str",attemptsBaseIngredients,elementsFromFixSpace));
    Ingredient baseIngredient=new Ingredient(getRandomStatementFromSpace(baseElements),null);
    if (baseIngredient == null || baseIngredient.getCode() == null) {
      return null;
    }
    Ingredient refinedIngredient=getNotUsedTransformedElement(modificationPoint,operationType,baseIngredient);
    attemptsBaseIngredients++;
    if (refinedIngredient != null) {
      refinedIngredient.setDerivedFrom(baseIngredient.getCode());
      return refinedIngredient;
    }
  }
  log.debug("String_Node_Str" + StringUtil.trunc(modificationPoint.getCodeElement().getShortRepresentation()) + "String_Node_Str"+ elementsFromFixSpace);
  return null;
}

Fixed version (ground truth):
/** 
 * Return an ingredient. As it has a cache, it never returns twice the same ingredient.
 * @param modificationPoint
 * @param targetStmt
 * @param operationType
 * @param elementsFromFixSpace
 * @return
 */
@Override public Ingredient getFixIngredient(ModificationPoint modificationPoint,AstorOperator operationType){
  int attemptsBaseIngredients=0;
  List<CtCodeElement> baseElements=getNotExhaustedBaseElements(modificationPoint,operationType);
  if (baseElements == null || baseElements.isEmpty()) {
    log.debug("String_Node_Str" + modificationPoint);
    log.debug("String_Node_Str" + this.exhaustTemplates.get(getKey(modificationPoint,operationType)));
    return null;
  }
  int elementsFromFixSpace=baseElements.size();
  log.debug("String_Node_Str" + elementsFromFixSpace);
  Stats.currentStat.addSize(Stats.currentStat.ingredientSpaceSize,baseElements.size());
  while (attemptsBaseIngredients < elementsFromFixSpace) {
    log.debug(String.format("String_Node_Str",attemptsBaseIngredients,elementsFromFixSpace));
    Ingredient baseIngredient=new Ingredient(getRandomStatementFromSpace(baseElements),null);
    if (baseIngredient == null || baseIngredient.getCode() == null) {
      return null;
    }
    Ingredient refinedIngredient=getNotUsedTransformedElement(modificationPoint,operationType,baseIngredient);
    attemptsBaseIngredients++;
    if (refinedIngredient != null) {
      refinedIngredient.setDerivedFrom(baseIngredient.getCode());
      return refinedIngredient;
    }
  }
  log.debug("String_Node_Str" + StringUtil.trunc(modificationPoint.getCodeElement().getShortRepresentation()) + "String_Node_Str"+ elementsFromFixSpace);
  return null;
}