Program: 108859
Project: 108859
Buggy source:
/** 
 * Reads the data definition from the file
 * @param config
 * @param prefix
 * @param zip
 * @throws IOException
 * @throws SAXException
 */
private void readDefinition(final ModelConfiguration config,final String prefix,final ZipFile zip) throws IOException, SAXException {
  final ZipEntry entry=zip.getEntry(prefix + "String_Node_Str");
  if (entry == null) {
    return;
  }
  final XMLReader xmlReader=XMLReaderFactory.createXMLReader();
  final InputSource inputSource=new InputSource(zip.getInputStream(entry));
  xmlReader.setContentHandler(new XMLHandler(){
    String attr, dtype, atype, ref, min, max, format;
    @Override protected boolean end(    final String uri,    final String localName,    final String qName) throws SAXException {
      if (vocabulary.isDefinition(localName)) {
        return true;
      }
 else       if (vocabulary.isAssigment(localName)) {
        if (attr == null) {
          throw new SAXException(Resources.getMessage("String_Node_Str"));
        }
        if (vocabulary.getVersion().equals("String_Node_Str")) {
          if (dtype.equals(DataType.STRING.toString())) {
            config.getInput().getDefinition().setDataType(attr,DataType.STRING);
          }
 else           if (dtype.equals(DataType.DECIMAL.toString())) {
            config.getInput().getDefinition().setDataType(attr,DataType.DECIMAL);
          }
 else {
            config.getInput().getDefinition().setDataType(attr,DataType.DATE(dtype));
          }
        }
 else         if (vocabulary.getVersion().equals("String_Node_Str")) {
          DataType<?> datatype=null;
          for (          DataTypeDescription<?> description : DataType.LIST) {
            if (description.getLabel().equals(dtype)) {
              if (format != null) {
                if (!description.hasFormat()) {
                  throw new RuntimeException("String_Node_Str");
                }
                datatype=description.newInstance(format);
              }
 else {
                datatype=description.newInstance();
              }
              break;
            }
          }
          if (datatype == null) {
            throw new RuntimeException("String_Node_Str" + attr);
          }
          config.getInput().getDefinition().setDataType(attr,DataType.STRING);
        }
        if (atype.equals(AttributeType.IDENTIFYING_ATTRIBUTE.toString())) {
          config.getInput().getDefinition().setAttributeType(attr,AttributeType.IDENTIFYING_ATTRIBUTE);
        }
 else         if (atype.equals(AttributeType.SENSITIVE_ATTRIBUTE.toString())) {
          config.getInput().getDefinition().setAttributeType(attr,AttributeType.SENSITIVE_ATTRIBUTE);
          if (ref != null) {
            try {
              config.setHierarchy(attr,readHierarchy(zip,prefix,ref));
            }
 catch (            final IOException e) {
              throw new SAXException(e);
            }
          }
        }
 else         if (atype.equals(AttributeType.INSENSITIVE_ATTRIBUTE.toString())) {
          config.getInput().getDefinition().setAttributeType(attr,AttributeType.INSENSITIVE_ATTRIBUTE);
        }
 else         if (atype.equals(Hierarchy.create().toString())) {
          try {
            config.getInput().getDefinition().setAttributeType(attr,readHierarchy(zip,prefix,ref));
          }
 catch (          final IOException e) {
            throw new SAXException(e);
          }
          config.getInput().getDefinition().setMinimumGeneralization(attr,Double.valueOf(min).intValue());
          config.getInput().getDefinition().setMaximumGeneralization(attr,Double.valueOf(max).intValue());
        }
 else {
          throw new SAXException(Resources.getMessage("String_Node_Str"));
        }
        attr=null;
        atype=null;
        dtype=null;
        ref=null;
        min=null;
        max=null;
        format=null;
        return true;
      }
 else       if (vocabulary.isName(localName)) {
        attr=payload;
        return true;
      }
 else       if (vocabulary.isType(localName)) {
        atype=payload;
        return true;
      }
 else       if (vocabulary.isDatatype(localName)) {
        dtype=payload;
        return true;
      }
 else       if (vocabulary.isFormat(localName)) {
        format=payload;
        return true;
      }
 else       if (vocabulary.isRef(localName)) {
        ref=payload;
        return true;
      }
 else       if (vocabulary.isMin(localName)) {
        min=payload;
        return true;
      }
 else       if (vocabulary.isMax(localName)) {
        max=payload;
        return true;
      }
 else {
        return false;
      }
    }
    @Override protected boolean start(    final String uri,    final String localName,    final String qName,    final Attributes attributes) throws SAXException {
      if (vocabulary.isDefinition(localName)) {
        return true;
      }
 else       if (vocabulary.isAssigment(localName)) {
        attr=null;
        dtype=null;
        atype=null;
        ref=null;
        min=null;
        max=null;
        return true;
      }
 else       if (vocabulary.isName(localName) || vocabulary.isType(localName) || vocabulary.isDatatype(localName)|| vocabulary.isFormat(localName)|| vocabulary.isRef(localName)|| vocabulary.isMin(localName)|| vocabulary.isMax(localName)) {
        return true;
      }
 else {
        return false;
      }
    }
  }
);
  xmlReader.parse(inputSource);
}

Fixed version (ground truth):
/** 
 * Reads the data definition from the file
 * @param config
 * @param prefix
 * @param zip
 * @throws IOException
 * @throws SAXException
 */
private void readDefinition(final ModelConfiguration config,final String prefix,final ZipFile zip) throws IOException, SAXException {
  final ZipEntry entry=zip.getEntry(prefix + "String_Node_Str");
  if (entry == null) {
    return;
  }
  final XMLReader xmlReader=XMLReaderFactory.createXMLReader();
  final InputSource inputSource=new InputSource(zip.getInputStream(entry));
  xmlReader.setContentHandler(new XMLHandler(){
    String attr, dtype, atype, ref, min, max, format;
    @Override protected boolean end(    final String uri,    final String localName,    final String qName) throws SAXException {
      if (vocabulary.isDefinition(localName)) {
        return true;
      }
 else       if (vocabulary.isAssigment(localName)) {
        if (attr == null) {
          throw new SAXException(Resources.getMessage("String_Node_Str"));
        }
        if (vocabulary.getVocabularyVersion().equals("String_Node_Str")) {
          if (dtype.equals(DataType.STRING.toString())) {
            config.getInput().getDefinition().setDataType(attr,DataType.STRING);
          }
 else           if (dtype.equals(DataType.DECIMAL.toString())) {
            config.getInput().getDefinition().setDataType(attr,DataType.DECIMAL);
          }
 else {
            config.getInput().getDefinition().setDataType(attr,DataType.DATE(dtype));
          }
        }
 else         if (vocabulary.getVocabularyVersion().equals("String_Node_Str")) {
          DataType<?> datatype=null;
          for (          DataTypeDescription<?> description : DataType.LIST) {
            if (description.getLabel().equals(dtype)) {
              if (format != null) {
                if (!description.hasFormat()) {
                  throw new RuntimeException("String_Node_Str");
                }
                datatype=description.newInstance(format);
              }
 else {
                datatype=description.newInstance();
              }
              break;
            }
          }
          if (datatype == null) {
            throw new RuntimeException("String_Node_Str" + attr);
          }
          config.getInput().getDefinition().setDataType(attr,datatype);
        }
        if (atype.equals(AttributeType.IDENTIFYING_ATTRIBUTE.toString())) {
          config.getInput().getDefinition().setAttributeType(attr,AttributeType.IDENTIFYING_ATTRIBUTE);
        }
 else         if (atype.equals(AttributeType.SENSITIVE_ATTRIBUTE.toString())) {
          config.getInput().getDefinition().setAttributeType(attr,AttributeType.SENSITIVE_ATTRIBUTE);
          if (ref != null) {
            try {
              config.setHierarchy(attr,readHierarchy(zip,prefix,ref));
            }
 catch (            final IOException e) {
              throw new SAXException(e);
            }
          }
        }
 else         if (atype.equals(AttributeType.INSENSITIVE_ATTRIBUTE.toString())) {
          config.getInput().getDefinition().setAttributeType(attr,AttributeType.INSENSITIVE_ATTRIBUTE);
        }
 else         if (atype.equals(Hierarchy.create().toString())) {
          try {
            config.getInput().getDefinition().setAttributeType(attr,readHierarchy(zip,prefix,ref));
          }
 catch (          final IOException e) {
            throw new SAXException(e);
          }
          config.getInput().getDefinition().setMinimumGeneralization(attr,Double.valueOf(min).intValue());
          config.getInput().getDefinition().setMaximumGeneralization(attr,Double.valueOf(max).intValue());
        }
 else {
          throw new SAXException(Resources.getMessage("String_Node_Str"));
        }
        attr=null;
        atype=null;
        dtype=null;
        ref=null;
        min=null;
        max=null;
        format=null;
        return true;
      }
 else       if (vocabulary.isName(localName)) {
        attr=payload;
        return true;
      }
 else       if (vocabulary.isType(localName)) {
        atype=payload;
        return true;
      }
 else       if (vocabulary.isDatatype(localName)) {
        dtype=payload;
        return true;
      }
 else       if (vocabulary.isFormat(localName)) {
        format=payload;
        return true;
      }
 else       if (vocabulary.isRef(localName)) {
        ref=payload;
        return true;
      }
 else       if (vocabulary.isMin(localName)) {
        min=payload;
        return true;
      }
 else       if (vocabulary.isMax(localName)) {
        max=payload;
        return true;
      }
 else {
        return false;
      }
    }
    @Override protected boolean start(    final String uri,    final String localName,    final String qName,    final Attributes attributes) throws SAXException {
      if (vocabulary.isDefinition(localName)) {
        return true;
      }
 else       if (vocabulary.isAssigment(localName)) {
        attr=null;
        dtype=null;
        atype=null;
        ref=null;
        min=null;
        max=null;
        return true;
      }
 else       if (vocabulary.isName(localName) || vocabulary.isType(localName) || vocabulary.isDatatype(localName)|| vocabulary.isFormat(localName)|| vocabulary.isRef(localName)|| vocabulary.isMin(localName)|| vocabulary.isMax(localName)) {
        return true;
      }
 else {
        return false;
      }
    }
  }
);
  xmlReader.parse(inputSource);
}