Program: 100769
Project: 100769
Buggy source:
@Override public void startElement(final String uri,final String localName,final String qName,final Attributes atts) throws SAXException {
  String domains=null;
  final Properties params=new Properties();
  final String printValue=atts.getValue(ATTRIBUTE_NAME_PRINT);
  final String processingRole=atts.getValue(ATTRIBUTE_NAME_PROCESSING_ROLE);
  final URI href=toURI(atts.getValue(ATTRIBUTE_NAME_HREF));
  final String scope=atts.getValue(ATTRIBUTE_NAME_SCOPE);
  if (processingRole != null) {
    processRoleStack.push(processingRole);
    processRoleLevel++;
    if (ATTR_SCOPE_VALUE_EXTERNAL.equals(scope)) {
    }
 else     if (ATTR_PROCESSING_ROLE_VALUE_RESOURCE_ONLY.equals(processingRole)) {
      if (href != null) {
        resourceOnlySet.add(FileUtils.resolveFile(currentDir,toFile(href).getPath()));
      }
    }
 else     if (ATTR_PROCESSING_ROLE_VALUE_NORMAL.equals(processingRole)) {
      if (href != null) {
        crossSet.add(FileUtils.resolveFile(currentDir,toFile(href).getPath()));
      }
    }
  }
 else   if (processRoleLevel > 0) {
    processRoleLevel++;
    if (ATTR_SCOPE_VALUE_EXTERNAL.equals(scope)) {
    }
 else     if (ATTR_PROCESSING_ROLE_VALUE_RESOURCE_ONLY.equals(processRoleStack.peek())) {
      if (href != null) {
        resourceOnlySet.add(FileUtils.resolveFile(currentDir,toFile(href).getPath()));
      }
    }
 else     if (ATTR_PROCESSING_ROLE_VALUE_NORMAL.equals(processRoleStack.peek())) {
      if (href != null) {
        crossSet.add(FileUtils.resolveFile(currentDir,toFile(href).getPath()));
      }
    }
  }
 else {
    if (href != null) {
      crossSet.add(FileUtils.resolveFile(currentDir,toFile(href).getPath()));
    }
  }
  final String classValue=atts.getValue(ATTRIBUTE_NAME_CLASS);
  if (classValue != null) {
    if (TOPIC_TOPIC.matches(classValue)) {
      topicId=atts.getValue(ATTRIBUTE_NAME_ID);
      final String filename=FileUtils.getRelativeUnixPath(rootFilePath.getAbsolutePath(),currentFile.getAbsolutePath());
      for (      final ExportAnchor e : resultList) {
        if (e.topicids.contains(filename + QUESTION)) {
          e.topicids.add(topicId);
          e.topicids.remove(filename + QUESTION);
        }
      }
    }
    if (FileUtils.isDITAMapFile(currentFile.getName()) && rootFilePath.equals(currentFile) && MAP_MAP.matches(classValue)&& INDEX_TYPE_ECLIPSEHELP.equals(transtype)) {
      String pluginId=atts.getValue(ATTRIBUTE_NAME_ID);
      if (pluginId == null) {
        pluginId="String_Node_Str";
      }
      final Set<String> set=StringUtils.restoreSet(pluginId);
      pluginMap.put("String_Node_Str",set);
    }
    if (INDEX_TYPE_ECLIPSEHELP.equals(transtype)) {
      if (MAP_TOPICMETA.matches(classValue) || TOPIC_PROLOG.matches(classValue)) {
        topicMetaSet.add(qName);
      }
      if (DELAY_D_EXPORTANCHORS.matches(classValue)) {
        hasExport=true;
        if (FileUtils.isDITAMapFile(currentFile.getName())) {
          URI editedHref=null;
          if (topicHref != null && topicHref.getPath().endsWith(FILE_EXTENSION_XML)) {
            editedHref=toURI(topicHref.toString().replace(FILE_EXTENSION_XML,FILE_EXTENSION_DITA));
          }
 else {
            editedHref=topicHref;
          }
          currentExportAnchor=new ExportAnchor(editedHref);
          currentExportAnchor.topicids.add(topicId);
        }
 else         if (FileUtils.isDITATopicFile(currentFile.getName())) {
          URI filename=toURI(FileUtils.getRelativeUnixPath(rootFilePath.getAbsolutePath(),currentFile.getAbsolutePath()));
          if (filename.toString().endsWith(FILE_EXTENSION_XML)) {
            filename=toURI(filename.toString().replace(FILE_EXTENSION_XML,FILE_EXTENSION_DITA));
          }
          currentExportAnchor=new ExportAnchor(filename);
          currentExportAnchor.topicids.add(topicId);
          shouldAppendEndTag=true;
        }
      }
 else       if (DELAY_D_ANCHORKEY.matches(classValue)) {
        final String keyref=atts.getValue(ATTRIBUTE_NAME_KEYREF);
        currentExportAnchor.keys.add(keyref);
      }
 else       if (DELAY_D_ANCHORID.matches(classValue)) {
        final String id=atts.getValue(ATTRIBUTE_NAME_ID);
        if (FileUtils.isDITAMapFile(currentFile.getName())) {
          if (!topicId.equals(id)) {
            currentExportAnchor.ids.add(id);
          }
        }
 else         if (FileUtils.isDITATopicFile(currentFile.getName())) {
          if (!topicId.equals(id)) {
            currentExportAnchor.ids.add(id);
          }
        }
      }
    }
  }
  if (SUBJECTSCHEME_SUBJECTSCHEME.matches(classValue)) {
    if (schemeRelationGraph == null) {
      schemeRelationGraph=new LinkedHashMap<File,Set<File>>();
    }
    Set<File> children=schemeRelationGraph.get(new File("String_Node_Str"));
    if (children == null || children.isEmpty()) {
      children=new LinkedHashSet<File>();
    }
    children.add(currentFile.getAbsoluteFile());
    schemeRelationGraph.put(new File("String_Node_Str"),children);
    schemeRefSet.add(FileUtils.getRelativePath(rootFilePath.getAbsoluteFile(),currentFile.getAbsoluteFile()));
  }
 else   if (SUBJECTSCHEME_SCHEMEREF.matches(classValue)) {
    Set<File> children=schemeRelationGraph.get(currentFile.getAbsoluteFile());
    if (children == null) {
      children=new LinkedHashSet<File>();
      schemeRelationGraph.put(currentFile.getAbsoluteFile(),children);
    }
    if (href != null) {
      children.add(FileUtils.resolveFile(rootDir.getAbsoluteFile(),toFile(href).getPath()));
    }
  }
  if (foreignLevel > 0) {
    foreignLevel++;
    return;
  }
 else   if (classValue != null && (TOPIC_FOREIGN.matches(classValue) || TOPIC_UNKNOWN.matches(classValue))) {
    foreignLevel++;
  }
  if (chunkLevel > 0) {
    chunkLevel++;
  }
 else   if (atts.getValue(ATTRIBUTE_NAME_CHUNK) != null) {
    chunkLevel++;
  }
  if (relTableLevel > 0) {
    relTableLevel++;
  }
 else   if (classValue != null && MAP_RELTABLE.matches(classValue)) {
    relTableLevel++;
  }
  if (chunkToNavLevel > 0) {
    chunkToNavLevel++;
  }
 else   if (atts.getValue(ATTRIBUTE_NAME_CHUNK) != null && atts.getValue(ATTRIBUTE_NAME_CHUNK).indexOf("String_Node_Str") != -1) {
    chunkToNavLevel++;
  }
  if (topicGroupLevel > 0) {
    topicGroupLevel++;
  }
 else   if (atts.getValue(ATTRIBUTE_NAME_CLASS) != null && atts.getValue(ATTRIBUTE_NAME_CLASS).contains(MAPGROUP_D_TOPICGROUP.matcher)) {
    topicGroupLevel++;
  }
  if (classValue == null && !ELEMENT_NAME_DITA.equals(localName)) {
    logger.logInfo(MessageUtils.getInstance().getMessage("String_Node_Str",localName).toString());
  }
  if (classValue != null && TOPIC_TOPIC.matches(classValue)) {
    domains=atts.getValue(ATTRIBUTE_NAME_DOMAINS);
    if (domains == null) {
      logger.logInfo(MessageUtils.getInstance().getMessage("String_Node_Str",localName).toString());
    }
 else {
      props=StringUtils.getExtProps(domains);
    }
  }
  if (insideExcludedElement) {
    ++excludedLevel;
    return;
  }
  if (filterUtils.needExclude(atts,props)) {
    insideExcludedElement=true;
    ++excludedLevel;
    return;
  }
  if (classValue != null) {
    if ((MAP_MAP.matches(classValue)) || (TOPIC_TITLE.matches(classValue))) {
      isValidInput=true;
    }
 else     if (TOPIC_OBJECT.matches(classValue)) {
      parseAttribute(atts,ATTRIBUTE_NAME_DATA);
    }
  }
  topicref:   if (job.getOnlyTopicInMap() && this.canResolved()) {
    if (MAP_TOPICREF.matches(classValue)) {
      final URI hrefValue=toURI(atts.getValue(ATTRIBUTE_NAME_HREF));
      final URI conrefValue=toURI(atts.getValue(ATTRIBUTE_NAME_CONREF));
      if (hrefValue != null && !hrefValue.toString().isEmpty()) {
        final String attrScope=atts.getValue(ATTRIBUTE_NAME_SCOPE);
        if (ATTR_SCOPE_VALUE_EXTERNAL.equals(attrScope) || ATTR_SCOPE_VALUE_PEER.equals(attrScope) || hrefValue.toString().indexOf(COLON_DOUBLE_SLASH) != -1 || hrefValue.toString().startsWith(SHARP)) {
          break topicref;
        }
        final File target=toFile(hrefValue);
        String fileName=null;
        if (target.isAbsolute()) {
          fileName=FileUtils.getRelativeUnixPath(rootFilePath.getAbsolutePath(),toFile(hrefValue).getPath());
        }
        fileName=FileUtils.normalizeDirectory(currentDir,toFile(hrefValue).getPath()).getPath();
        fileName=FileUtils.separatorsToUnix(fileName);
        final boolean canParse=parseBranch(atts,hrefValue,fileName);
        if (!canParse) {
          break topicref;
        }
 else {
          topicrefStack.push(localName);
        }
      }
 else       if (conrefValue != null && !conrefValue.toString().isEmpty()) {
        final String attrScope=atts.getValue(ATTRIBUTE_NAME_SCOPE);
        if (ATTR_SCOPE_VALUE_EXTERNAL.equals(attrScope) || ATTR_SCOPE_VALUE_PEER.equals(attrScope) || conrefValue.toString().indexOf(COLON_DOUBLE_SLASH) != -1 || conrefValue.toString().startsWith(SHARP)) {
          break topicref;
        }
        final File target=new File(conrefValue);
        String fileName=null;
        if (target.isAbsolute()) {
          fileName=FileUtils.getRelativeUnixPath(rootFilePath.getAbsolutePath(),toFile(conrefValue).getPath());
        }
        fileName=FileUtils.normalizeDirectory(currentDir,toFile(conrefValue).getPath()).getPath();
        fileName=FileUtils.separatorsToUnix(fileName);
        final boolean canParse=parseBranch(atts,conrefValue,fileName);
        if (!canParse) {
          break topicref;
        }
 else {
          topicrefStack.push(localName);
        }
      }
    }
  }
  parseAttribute(atts,ATTRIBUTE_NAME_CONREF);
  parseAttribute(atts,ATTRIBUTE_NAME_HREF);
  parseAttribute(atts,ATTRIBUTE_NAME_COPY_TO);
  parseAttribute(atts,ATTRIBUTE_NAME_IMG);
  parseAttribute(atts,ATTRIBUTE_NAME_CONACTION);
  parseAttribute(atts,ATTRIBUTE_NAME_KEYS);
  parseAttribute(atts,ATTRIBUTE_NAME_CONKEYREF);
  parseAttribute(atts,ATTRIBUTE_NAME_KEYREF);
}

Fixed version (ground truth):
@Override public void startElement(final String uri,final String localName,final String qName,final Attributes atts) throws SAXException {
  String domains=null;
  final String processingRole=atts.getValue(ATTRIBUTE_NAME_PROCESSING_ROLE);
  final URI href=toURI(atts.getValue(ATTRIBUTE_NAME_HREF));
  final String scope=atts.getValue(ATTRIBUTE_NAME_SCOPE);
  if (processingRole != null) {
    processRoleStack.push(processingRole);
    processRoleLevel++;
    if (ATTR_SCOPE_VALUE_EXTERNAL.equals(scope)) {
    }
 else     if (ATTR_PROCESSING_ROLE_VALUE_RESOURCE_ONLY.equals(processingRole)) {
      if (href != null) {
        resourceOnlySet.add(FileUtils.resolveFile(currentDir,toFile(href).getPath()));
      }
    }
 else     if (ATTR_PROCESSING_ROLE_VALUE_NORMAL.equals(processingRole)) {
      if (href != null) {
        crossSet.add(FileUtils.resolveFile(currentDir,toFile(href).getPath()));
      }
    }
  }
 else   if (processRoleLevel > 0) {
    processRoleLevel++;
    if (ATTR_SCOPE_VALUE_EXTERNAL.equals(scope)) {
    }
 else     if (ATTR_PROCESSING_ROLE_VALUE_RESOURCE_ONLY.equals(processRoleStack.peek())) {
      if (href != null) {
        resourceOnlySet.add(FileUtils.resolveFile(currentDir,toFile(href).getPath()));
      }
    }
 else     if (ATTR_PROCESSING_ROLE_VALUE_NORMAL.equals(processRoleStack.peek())) {
      if (href != null) {
        crossSet.add(FileUtils.resolveFile(currentDir,toFile(href).getPath()));
      }
    }
  }
 else {
    if (href != null) {
      crossSet.add(FileUtils.resolveFile(currentDir,toFile(href).getPath()));
    }
  }
  final String classValue=atts.getValue(ATTRIBUTE_NAME_CLASS);
  if (classValue != null) {
    if (TOPIC_TOPIC.matches(classValue)) {
      topicId=atts.getValue(ATTRIBUTE_NAME_ID);
      final String filename=FileUtils.getRelativeUnixPath(rootFilePath.getAbsolutePath(),currentFile.getAbsolutePath());
      for (      final ExportAnchor e : resultList) {
        if (e.topicids.contains(filename + QUESTION)) {
          e.topicids.add(topicId);
          e.topicids.remove(filename + QUESTION);
        }
      }
    }
    if (FileUtils.isDITAMapFile(currentFile.getName()) && rootFilePath.equals(currentFile) && MAP_MAP.matches(classValue)&& INDEX_TYPE_ECLIPSEHELP.equals(transtype)) {
      String pluginId=atts.getValue(ATTRIBUTE_NAME_ID);
      if (pluginId == null) {
        pluginId="String_Node_Str";
      }
      final Set<String> set=StringUtils.restoreSet(pluginId);
      pluginMap.put("String_Node_Str",set);
    }
    if (INDEX_TYPE_ECLIPSEHELP.equals(transtype)) {
      if (MAP_TOPICMETA.matches(classValue) || TOPIC_PROLOG.matches(classValue)) {
        topicMetaSet.add(qName);
      }
      if (DELAY_D_EXPORTANCHORS.matches(classValue)) {
        hasExport=true;
        if (FileUtils.isDITAMapFile(currentFile.getName())) {
          URI editedHref=null;
          if (topicHref != null && topicHref.getPath().endsWith(FILE_EXTENSION_XML)) {
            editedHref=toURI(topicHref.toString().replace(FILE_EXTENSION_XML,FILE_EXTENSION_DITA));
          }
 else {
            editedHref=topicHref;
          }
          currentExportAnchor=new ExportAnchor(editedHref);
          currentExportAnchor.topicids.add(topicId);
        }
 else         if (FileUtils.isDITATopicFile(currentFile.getName())) {
          URI filename=toURI(FileUtils.getRelativeUnixPath(rootFilePath.getAbsolutePath(),currentFile.getAbsolutePath()));
          if (filename.toString().endsWith(FILE_EXTENSION_XML)) {
            filename=toURI(filename.toString().replace(FILE_EXTENSION_XML,FILE_EXTENSION_DITA));
          }
          currentExportAnchor=new ExportAnchor(filename);
          currentExportAnchor.topicids.add(topicId);
          shouldAppendEndTag=true;
        }
      }
 else       if (DELAY_D_ANCHORKEY.matches(classValue)) {
        final String keyref=atts.getValue(ATTRIBUTE_NAME_KEYREF);
        currentExportAnchor.keys.add(keyref);
      }
 else       if (DELAY_D_ANCHORID.matches(classValue)) {
        final String id=atts.getValue(ATTRIBUTE_NAME_ID);
        if (FileUtils.isDITAMapFile(currentFile.getName())) {
          if (!topicId.equals(id)) {
            currentExportAnchor.ids.add(id);
          }
        }
 else         if (FileUtils.isDITATopicFile(currentFile.getName())) {
          if (!topicId.equals(id)) {
            currentExportAnchor.ids.add(id);
          }
        }
      }
    }
  }
  if (SUBJECTSCHEME_SUBJECTSCHEME.matches(classValue)) {
    if (schemeRelationGraph == null) {
      schemeRelationGraph=new LinkedHashMap<File,Set<File>>();
    }
    Set<File> children=schemeRelationGraph.get(new File("String_Node_Str"));
    if (children == null || children.isEmpty()) {
      children=new LinkedHashSet<File>();
    }
    children.add(currentFile.getAbsoluteFile());
    schemeRelationGraph.put(new File("String_Node_Str"),children);
    schemeRefSet.add(FileUtils.getRelativePath(rootFilePath.getAbsoluteFile(),currentFile.getAbsoluteFile()));
  }
 else   if (SUBJECTSCHEME_SCHEMEREF.matches(classValue)) {
    Set<File> children=schemeRelationGraph.get(currentFile.getAbsoluteFile());
    if (children == null) {
      children=new LinkedHashSet<File>();
      schemeRelationGraph.put(currentFile.getAbsoluteFile(),children);
    }
    if (href != null) {
      children.add(FileUtils.resolveFile(rootDir.getAbsoluteFile(),toFile(href).getPath()));
    }
  }
  if (foreignLevel > 0) {
    foreignLevel++;
    return;
  }
 else   if (classValue != null && (TOPIC_FOREIGN.matches(classValue) || TOPIC_UNKNOWN.matches(classValue))) {
    foreignLevel++;
  }
  if (chunkLevel > 0) {
    chunkLevel++;
  }
 else   if (atts.getValue(ATTRIBUTE_NAME_CHUNK) != null) {
    chunkLevel++;
  }
  if (relTableLevel > 0) {
    relTableLevel++;
  }
 else   if (classValue != null && MAP_RELTABLE.matches(classValue)) {
    relTableLevel++;
  }
  if (chunkToNavLevel > 0) {
    chunkToNavLevel++;
  }
 else   if (atts.getValue(ATTRIBUTE_NAME_CHUNK) != null && atts.getValue(ATTRIBUTE_NAME_CHUNK).indexOf("String_Node_Str") != -1) {
    chunkToNavLevel++;
  }
  if (topicGroupLevel > 0) {
    topicGroupLevel++;
  }
 else   if (atts.getValue(ATTRIBUTE_NAME_CLASS) != null && atts.getValue(ATTRIBUTE_NAME_CLASS).contains(MAPGROUP_D_TOPICGROUP.matcher)) {
    topicGroupLevel++;
  }
  if (classValue == null && !ELEMENT_NAME_DITA.equals(localName)) {
    logger.logInfo(MessageUtils.getInstance().getMessage("String_Node_Str",localName).toString());
  }
  if (classValue != null && TOPIC_TOPIC.matches(classValue)) {
    domains=atts.getValue(ATTRIBUTE_NAME_DOMAINS);
    if (domains == null) {
      logger.logInfo(MessageUtils.getInstance().getMessage("String_Node_Str",localName).toString());
    }
 else {
      props=StringUtils.getExtProps(domains);
    }
  }
  if (insideExcludedElement) {
    ++excludedLevel;
    return;
  }
  if (filterUtils.needExclude(atts,props)) {
    insideExcludedElement=true;
    ++excludedLevel;
    return;
  }
  if (classValue != null) {
    if ((MAP_MAP.matches(classValue)) || (TOPIC_TITLE.matches(classValue))) {
      isValidInput=true;
    }
 else     if (TOPIC_OBJECT.matches(classValue)) {
      parseAttribute(atts,ATTRIBUTE_NAME_DATA);
    }
  }
  topicref:   if (job.getOnlyTopicInMap() && this.canResolved()) {
    if (MAP_TOPICREF.matches(classValue)) {
      final URI hrefValue=toURI(atts.getValue(ATTRIBUTE_NAME_HREF));
      final URI conrefValue=toURI(atts.getValue(ATTRIBUTE_NAME_CONREF));
      if (hrefValue != null && !hrefValue.toString().isEmpty()) {
        final String attrScope=atts.getValue(ATTRIBUTE_NAME_SCOPE);
        if (ATTR_SCOPE_VALUE_EXTERNAL.equals(attrScope) || ATTR_SCOPE_VALUE_PEER.equals(attrScope) || hrefValue.toString().indexOf(COLON_DOUBLE_SLASH) != -1 || hrefValue.toString().startsWith(SHARP)) {
          break topicref;
        }
        final File target=toFile(hrefValue);
        String fileName=null;
        if (target.isAbsolute()) {
          fileName=FileUtils.getRelativeUnixPath(rootFilePath.getAbsolutePath(),toFile(hrefValue).getPath());
        }
        fileName=FileUtils.normalizeDirectory(currentDir,toFile(hrefValue).getPath()).getPath();
        fileName=FileUtils.separatorsToUnix(fileName);
        final boolean canParse=parseBranch(atts,hrefValue,fileName);
        if (!canParse) {
          break topicref;
        }
 else {
          topicrefStack.push(localName);
        }
      }
 else       if (conrefValue != null && !conrefValue.toString().isEmpty()) {
        final String attrScope=atts.getValue(ATTRIBUTE_NAME_SCOPE);
        if (ATTR_SCOPE_VALUE_EXTERNAL.equals(attrScope) || ATTR_SCOPE_VALUE_PEER.equals(attrScope) || conrefValue.toString().indexOf(COLON_DOUBLE_SLASH) != -1 || conrefValue.toString().startsWith(SHARP)) {
          break topicref;
        }
        final File target=new File(conrefValue);
        String fileName=null;
        if (target.isAbsolute()) {
          fileName=FileUtils.getRelativeUnixPath(rootFilePath.getAbsolutePath(),toFile(conrefValue).getPath());
        }
        fileName=FileUtils.normalizeDirectory(currentDir,toFile(conrefValue).getPath()).getPath();
        fileName=FileUtils.separatorsToUnix(fileName);
        final boolean canParse=parseBranch(atts,conrefValue,fileName);
        if (!canParse) {
          break topicref;
        }
 else {
          topicrefStack.push(localName);
        }
      }
    }
  }
  parseAttribute(atts,ATTRIBUTE_NAME_CONREF);
  parseAttribute(atts,ATTRIBUTE_NAME_HREF);
  parseAttribute(atts,ATTRIBUTE_NAME_COPY_TO);
  parseAttribute(atts,ATTRIBUTE_NAME_IMG);
  parseAttribute(atts,ATTRIBUTE_NAME_CONACTION);
  parseAttribute(atts,ATTRIBUTE_NAME_KEYS);
  parseAttribute(atts,ATTRIBUTE_NAME_CONKEYREF);
  parseAttribute(atts,ATTRIBUTE_NAME_KEYREF);
}