Program: 109027
Project: 109027
Buggy source:
/** 
 * Performs data anonymization
 * @param data The data
 * @param config The privacy config
 * @return ARXResult
 * @throws IOException
 */
public ARXResult anonymize(final Data data,ARXConfiguration config) throws IOException {
  final long time=System.currentTimeMillis();
  if (data == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (config.containsCriterion(LDiversity.class) || config.containsCriterion(TCloseness.class)) {
    if (data.getDefinition().getSensitiveAttributes().size() == 0) {
      throw new IllegalArgumentException("String_Node_Str");
    }
  }
  for (  String attr : data.getDefinition().getSensitiveAttributes()) {
    boolean found=false;
    for (    LDiversity c : config.getCriteria(LDiversity.class)) {
      if (c.getAttribute().equals(attr)) {
        found=true;
        break;
      }
    }
    if (!found) {
      for (      TCloseness c : config.getCriteria(TCloseness.class)) {
        if (c.getAttribute().equals(attr)) {
          found=true;
          break;
        }
      }
    }
    if (!found) {
      throw new IllegalArgumentException("String_Node_Str" + attr + "String_Node_Str");
    }
  }
  for (  LDiversity c : config.getCriteria(LDiversity.class)) {
    if (data.getDefinition().getAttributeType(c.getAttribute()) != AttributeType.SENSITIVE_ATTRIBUTE) {
      throw new RuntimeException("String_Node_Str" + c.getAttribute() + "String_Node_Str");
    }
  }
  for (  TCloseness c : config.getCriteria(TCloseness.class)) {
    if (data.getDefinition().getAttributeType(c.getAttribute()) != AttributeType.SENSITIVE_ATTRIBUTE) {
      throw new RuntimeException("String_Node_Str" + c.getAttribute() + "String_Node_Str");
    }
  }
  final DataHandle handle=data.getHandle();
  if (!(handle instanceof DataHandleInput)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  checkBeforeEncoding(config.getAllowedOutliers(),handle.getDefinition().getHierarchies());
  if (data.getDefinition().getSensitiveAttributes().size() > 1) {
    final AttributeType substition;
    if (config.isProtectSensitiveAssociations()) {
      substition=AttributeType.QUASI_IDENTIFYING_ATTRIBUTE;
    }
 else {
      substition=AttributeType.INSENSITIVE_ATTRIBUTE;
    }
    Result result=null;
    List<String> sensitive=new ArrayList<String>(data.getDefinition().getSensitiveAttributes());
    for (int i=0; i < sensitive.size(); i++) {
      String attribute=sensitive.get(i);
      config=config.clone();
      DataDefinition definition=handle.getDefinition().clone();
      for (      LDiversity c : config.getCriteria(LDiversity.class)) {
        if (!c.getAttribute().equals(attribute)) {
          config.removeCriterion(c);
          definition.setAttributeType(c.getAttribute(),substition);
        }
      }
      for (      TCloseness c : config.getCriteria(TCloseness.class)) {
        if (!c.getAttribute().equals(attribute)) {
          config.removeCriterion(c);
          definition.setAttributeType(c.getAttribute(),substition);
        }
      }
      if (config.isProtectSensitiveAssociations()) {
        throw new RuntimeException("String_Node_Str");
      }
      Lattice lattice=null;
      AbstractAlgorithm algorithm=null;
      if (result != null) {
        if (config.isProtectSensitiveAssociations()) {
          throw new RuntimeException("String_Node_Str");
        }
 else {
          reset(result.lattice);
          lattice=result.lattice;
        }
        algorithm=result.algorithm;
      }
      result=anonymizeInternal(handle,definition,config,lattice,sensitive.size(),algorithm);
    }
    if (config.isProtectSensitiveAssociations()) {
      throw new RuntimeException("String_Node_Str");
    }
 else {
      return result.asResult(config,handle,time);
    }
  }
 else {
    return anonymizeInternal(handle,handle.getDefinition(),config).asResult(config,handle,time);
  }
}

Fixed version (ground truth):
/** 
 * Performs data anonymization
 * @param data The data
 * @param config The privacy config
 * @return ARXResult
 * @throws IOException
 */
public ARXResult anonymize(final Data data,ARXConfiguration config) throws IOException {
  final long time=System.currentTimeMillis();
  if (data == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (config.containsCriterion(LDiversity.class) || config.containsCriterion(TCloseness.class)) {
    if (data.getDefinition().getSensitiveAttributes().size() == 0) {
      throw new IllegalArgumentException("String_Node_Str");
    }
  }
  for (  String attr : data.getDefinition().getSensitiveAttributes()) {
    boolean found=false;
    for (    LDiversity c : config.getCriteria(LDiversity.class)) {
      if (c.getAttribute().equals(attr)) {
        found=true;
        break;
      }
    }
    if (!found) {
      for (      TCloseness c : config.getCriteria(TCloseness.class)) {
        if (c.getAttribute().equals(attr)) {
          found=true;
          break;
        }
      }
    }
    if (!found) {
      throw new IllegalArgumentException("String_Node_Str" + attr + "String_Node_Str");
    }
  }
  for (  LDiversity c : config.getCriteria(LDiversity.class)) {
    if (data.getDefinition().getAttributeType(c.getAttribute()) != AttributeType.SENSITIVE_ATTRIBUTE) {
      throw new RuntimeException("String_Node_Str" + c.getAttribute() + "String_Node_Str");
    }
  }
  for (  TCloseness c : config.getCriteria(TCloseness.class)) {
    if (data.getDefinition().getAttributeType(c.getAttribute()) != AttributeType.SENSITIVE_ATTRIBUTE) {
      throw new RuntimeException("String_Node_Str" + c.getAttribute() + "String_Node_Str");
    }
  }
  final DataHandle handle=data.getHandle();
  if (!(handle instanceof DataHandleInput)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  checkBeforeEncoding(config.getAllowedOutliers(),handle.getDefinition().getHierarchies());
  if (data.getDefinition().getSensitiveAttributes().size() > 1) {
    final AttributeType substition;
    if (config.isProtectSensitiveAssociations()) {
      substition=AttributeType.QUASI_IDENTIFYING_ATTRIBUTE;
    }
 else {
      substition=AttributeType.INSENSITIVE_ATTRIBUTE;
    }
    Result result=null;
    List<String> sensitive=new ArrayList<String>(data.getDefinition().getSensitiveAttributes());
    for (int i=0; i < sensitive.size(); i++) {
      String attribute=sensitive.get(i);
      config=config.clone();
      DataDefinition definition=handle.getDefinition().clone();
      for (      LDiversity c : config.getCriteria(LDiversity.class)) {
        if (!c.getAttribute().equals(attribute)) {
          config.removeCriterion(c);
          definition.setAttributeType(c.getAttribute(),substition);
        }
      }
      for (      TCloseness c : config.getCriteria(TCloseness.class)) {
        if (!c.getAttribute().equals(attribute)) {
          config.removeCriterion(c);
          definition.setAttributeType(c.getAttribute(),substition);
        }
      }
      if (config.isProtectSensitiveAssociations()) {
        throw new RuntimeException("String_Node_Str");
      }
      Lattice lattice=null;
      AbstractAlgorithm algorithm=null;
      if (result != null) {
        if (config.isProtectSensitiveAssociations()) {
          throw new RuntimeException("String_Node_Str");
        }
 else {
          resetLattice(result.lattice);
          lattice=result.lattice;
        }
        algorithm=result.algorithm;
      }
      result=anonymizeInternal(handle,definition,config,lattice,sensitive.size(),algorithm);
    }
    if (config.isProtectSensitiveAssociations()) {
      throw new RuntimeException("String_Node_Str");
    }
 else {
      return result.asResult(config,handle,time);
    }
  }
 else {
    return anonymizeInternal(handle,handle.getDefinition(),config).asResult(config,handle,time);
  }
}