Program: 100822
Project: 100822
Buggy source:
/** 
 * read map files.
 * @param filename filename
 */
public void read(final String filename){
  final File inputFile=new File(filename);
  filePath=inputFile.getParent();
  inputFile.getPath();
  globalMeta.clear();
  try {
    final DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();
    final DocumentBuilder builder=factory.newDocumentBuilder();
    builder.setErrorHandler(new DITAOTXMLErrorHandler(filename));
    doc=builder.parse(inputFile);
    final Element root=doc.getDocumentElement();
    final NodeList list=root.getChildNodes();
    for (int i=0; i < list.getLength(); i++) {
      final Node node=list.item(i);
      Node classAttr=null;
      if (node.getNodeType() == Node.ELEMENT_NODE) {
        classAttr=node.getAttributes().getNamedItem(ATTRIBUTE_NAME_CLASS);
      }
      if (classAttr != null && MAP_TOPICMETA.matches(classAttr.getNodeValue())) {
        handleGlobalMeta(node);
      }
 else       if (classAttr != null && MAP_TOPICREF.matches(classAttr.getNodeValue())) {
        handleTopicref(node,globalMeta);
      }
    }
    for (    final Hashtable<String,Element> resultTableEntry : resultTable.values()) {
      for (      final Map.Entry<String,Element> mapEntry : resultTableEntry.entrySet()) {
        final String key=mapEntry.getKey();
        if (TOPIC_KEYWORDS.matcher.equals(key)) {
          removeIndexTermRecursive(mapEntry.getValue());
        }
      }
    }
    final FileOutputStream file=new FileOutputStream(inputFile.getCanonicalPath() + "String_Node_Str");
    final StreamResult res=new StreamResult(file);
    final DOMSource ds=new DOMSource(doc);
    final TransformerFactory tff=TransformerFactory.newInstance();
    final Transformer tf=tff.newTransformer();
    tf.transform(ds,res);
    if (res.getOutputStream() != null) {
      res.getOutputStream().close();
    }
    if (file != null) {
      file.close();
    }
  }
 catch (  final Exception e) {
    logger.logException(e);
  }
}

Fixed version (ground truth):
/** 
 * read map files.
 * @param filename filename
 */
public void read(final String filename){
  final File inputFile=new File(filename);
  filePath=inputFile.getParent();
  inputFile.getPath();
  globalMeta.clear();
  try {
    final DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();
    final DocumentBuilder builder=factory.newDocumentBuilder();
    builder.setErrorHandler(new DITAOTXMLErrorHandler(filename));
    doc=builder.parse(inputFile);
    final Element root=doc.getDocumentElement();
    final NodeList list=root.getChildNodes();
    for (int i=0; i < list.getLength(); i++) {
      final Node node=list.item(i);
      Node classAttr=null;
      if (node.getNodeType() == Node.ELEMENT_NODE) {
        classAttr=node.getAttributes().getNamedItem(ATTRIBUTE_NAME_CLASS);
      }
      if (classAttr != null && MAP_TOPICMETA.matches(classAttr.getNodeValue())) {
        handleGlobalMeta(node);
      }
 else       if (classAttr != null && MAP_TOPICREF.matches(classAttr.getNodeValue())) {
        handleTopicref(node,globalMeta);
      }
    }
    for (    final Hashtable<String,Element> resultTableEntry : resultTable.values()) {
      for (      final Map.Entry<String,Element> mapEntry : resultTableEntry.entrySet()) {
        final String key=mapEntry.getKey();
        if (TOPIC_KEYWORDS.matcher.equals(key)) {
          removeIndexTermRecursive(mapEntry.getValue());
        }
      }
    }
    FileOutputStream file=null;
    try {
      file=new FileOutputStream(inputFile.getCanonicalPath() + "String_Node_Str");
      final StreamResult res=new StreamResult(file);
      final DOMSource ds=new DOMSource(doc);
      final TransformerFactory tff=TransformerFactory.newInstance();
      final Transformer tf=tff.newTransformer();
      tf.transform(ds,res);
    }
  finally {
      if (file != null) {
        file.close();
      }
    }
  }
 catch (  final Exception e) {
    logger.logException(e);
  }
}