Program: 49513
Project: 49513
Buggy source:
/** 
 * Method to compile service/support level lists. One is the available levels for consumers for this owner. The second is the level names that are exempt. Exempt means that a product pool with this level can be used with a consumer of any service level.
 * @param owner The owner that has the list of available service levels forits consumers
 * @param exempt boolean to show if the desired list is the levels that areexplicitly marked with the support_level_exempt attribute.
 * @return Set of levels based on exempt flag.
 */
public Set<String> retrieveServiceLevelsForOwner(Owner owner,boolean exempt){
  String stmt="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  Query q=currentSession().createQuery(stmt);
  q.setParameter("String_Node_Str",owner.getId());
  List<Object[]> results=q.list();
  Set<String> slaSet=new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);
  Set<String> exemptSlaSet=new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);
  Set<String> exemptProductIds=new HashSet<String>();
  for (  Object[] result : results) {
    String name=(String)result[0];
    String value=(String)result[1];
    String productId=(String)result[2];
    if ("String_Node_Str".equals(name) && "String_Node_Str".equalsIgnoreCase(value)) {
      exemptProductIds.add(productId);
    }
 else     if ("String_Node_Str".equalsIgnoreCase(name) && (value != null && !value.trim().equals("String_Node_Str"))) {
      if (exemptProductIds.contains(productId)) {
        exemptSlaSet.add(value);
      }
    }
  }
  for (  Object[] result : results) {
    String name=(String)result[0];
    String value=(String)result[1];
    if (!"String_Node_Str".equals(name)) {
      if (!exemptSlaSet.contains(value)) {
        slaSet.add(value);
      }
    }
  }
  if (exempt) {
    return exemptSlaSet;
  }
  return slaSet;
}

Fixed version (ground truth):
/** 
 * Method to compile service/support level lists. One is the available levels for consumers for this owner. The second is the level names that are exempt. Exempt means that a product pool with this level can be used with a consumer of any service level.
 * @param owner The owner that has the list of available service levels forits consumers
 * @param exempt boolean to show if the desired list is the levels that areexplicitly marked with the support_level_exempt attribute.
 * @return Set of levels based on exempt flag.
 */
public Set<String> retrieveServiceLevelsForOwner(Owner owner,boolean exempt){
  String stmt="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  Query q=currentSession().createQuery(stmt);
  q.setParameter("String_Node_Str",owner.getId());
  List<Object[]> results=q.list();
  Set<String> slaSet=new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);
  Set<String> exemptSlaSet=new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);
  Set<String> exemptProductIds=new HashSet<String>();
  for (  Object[] result : results) {
    String name=(String)result[0];
    String value=(String)result[1];
    String productId=(String)result[2];
    if ("String_Node_Str".equals(name) && "String_Node_Str".equalsIgnoreCase(value)) {
      exemptProductIds.add(productId);
    }
 else     if ("String_Node_Str".equalsIgnoreCase(name) && (value != null && !value.trim().equals("String_Node_Str"))) {
      if (exemptProductIds.contains(productId)) {
        exemptSlaSet.add(value);
      }
    }
  }
  for (  Object[] result : results) {
    String name=(String)result[0];
    String value=(String)result[1];
    if (!"String_Node_Str".equals(name)) {
      if (!exemptSlaSet.contains(value)) {
        slaSet.add(value);
      }
    }
  }
  if (exempt) {
    return exemptSlaSet;
  }
  return slaSet;
}