Program: 107818
Project: 107818
Buggy source:
/** 
 * Returns an XML representation of the data definition.
 * @param config
 * @param handle
 * @param definition
 * @return
 * @throws IOException
 */
private String toXML(final ModelConfiguration config,final DataHandle handle,final DataDefinition definition) throws IOException {
  XMLWriter writer=new XMLWriter();
  writer.indent(vocabulary.getDefinition());
  for (int i=0; i < handle.getNumColumns(); i++) {
    final String attr=handle.getAttributeName(i);
    AttributeType t=definition.getAttributeType(attr);
    DataType<?> dt=definition.getDataType(attr);
    if (t == null)     t=AttributeType.IDENTIFYING_ATTRIBUTE;
    if (dt == null)     dt=DataType.STRING;
    writer.indent(vocabulary.getAssigment());
    writer.write(vocabulary.getName(),attr);
    writer.write(vocabulary.getType(),t.toString());
    writer.write(vocabulary.getDatatype(),dt.getDescription().getLabel());
    if (dt.getDescription().hasFormat()) {
      String format=((DataTypeWithFormat)dt).getFormat();
      if (format != null) {
        writer.write(vocabulary.getFormat(),format);
      }
      Locale locale=((DataTypeWithFormat)dt).getLocale();
      if (locale != null) {
        writer.write(vocabulary.getLocale(),locale.getLanguage().toUpperCase());
      }
    }
    if (definition.getHierarchy(attr) != null && definition.getHierarchy(attr).length != 0 && definition.getHierarchy(attr)[0].length != 0) {
      writer.write(vocabulary.getRef(),"String_Node_Str" + toFileName(attr) + "String_Node_Str");
      Integer min=config.getMinimumGeneralization(attr);
      Integer max=config.getMaximumGeneralization(attr);
      writer.write(vocabulary.getMin(),min == null ? "String_Node_Str" : String.valueOf(min));
      writer.write(vocabulary.getMax(),max == null ? "String_Node_Str" : String.valueOf(max));
    }
    if (definition.getMicroAggregationFunction(attr) != null) {
      writer.write(vocabulary.getMicroAggregationFunction(),config.getMicroAggregationFunction(attr).getLabel());
      writer.write(vocabulary.getMicroAggregationIgnoreMissingData(),config.getMicroAggregationIgnoreMissingData(attr));
    }
    writer.unindent();
  }
  writer.unindent();
  return writer.toString();
}

Fixed version (ground truth):
/** 
 * Returns an XML representation of the data definition.
 * @param config
 * @param handle
 * @param definition
 * @return
 * @throws IOException
 */
private String toXML(final ModelConfiguration config,final DataHandle handle,final DataDefinition definition) throws IOException {
  XMLWriter writer=new XMLWriter();
  writer.indent(vocabulary.getDefinition());
  for (int i=0; i < handle.getNumColumns(); i++) {
    final String attr=handle.getAttributeName(i);
    AttributeType t=definition.getAttributeType(attr);
    DataType<?> dt=definition.getDataType(attr);
    if (t == null)     t=AttributeType.IDENTIFYING_ATTRIBUTE;
    if (dt == null)     dt=DataType.STRING;
    writer.indent(vocabulary.getAssigment());
    writer.write(vocabulary.getName(),attr);
    writer.write(vocabulary.getType(),t.toString());
    writer.write(vocabulary.getDatatype(),dt.getDescription().getLabel());
    if (dt.getDescription().hasFormat()) {
      String format=((DataTypeWithFormat)dt).getFormat();
      if (format != null) {
        writer.write(vocabulary.getFormat(),format);
      }
      Locale locale=((DataTypeWithFormat)dt).getLocale();
      if (locale != null) {
        writer.write(vocabulary.getLocale(),locale.getLanguage().toUpperCase());
      }
    }
    if (definition.isResponseVariable(attr)) {
      writer.write(vocabulary.getResponseVariable(),"String_Node_Str");
    }
    if (definition.getHierarchy(attr) != null && definition.getHierarchy(attr).length != 0 && definition.getHierarchy(attr)[0].length != 0) {
      writer.write(vocabulary.getRef(),"String_Node_Str" + toFileName(attr) + "String_Node_Str");
      Integer min=config.getMinimumGeneralization(attr);
      Integer max=config.getMaximumGeneralization(attr);
      writer.write(vocabulary.getMin(),min == null ? "String_Node_Str" : String.valueOf(min));
      writer.write(vocabulary.getMax(),max == null ? "String_Node_Str" : String.valueOf(max));
    }
    if (definition.getMicroAggregationFunction(attr) != null) {
      writer.write(vocabulary.getMicroAggregationFunction(),config.getMicroAggregationFunction(attr).getLabel());
      writer.write(vocabulary.getMicroAggregationIgnoreMissingData(),config.getMicroAggregationIgnoreMissingData(attr));
    }
    writer.unindent();
  }
  writer.unindent();
  return writer.toString();
}