Program: 100626
Project: 100626
Buggy source:
private void extractIndexTerm() throws SAXException {
  final int topicNum=topicList.size();
  final int ditamapNum=ditamapList.size();
  FileInputStream inputStream=null;
  XMLReader xmlReader=null;
  final IndexTermReader handler=new IndexTermReader(indexTermCollection);
  handler.setLogger(logger);
  final DitamapIndexTermReader ditamapIndexTermReader=new DitamapIndexTermReader(indexTermCollection,true);
  ditamapIndexTermReader.setLogger(logger);
  xmlReader=XMLUtils.getXMLReader();
  try {
    xmlReader.setContentHandler(handler);
    for (    String aTopicList : topicList) {
      String target;
      String targetPathFromMap;
      String targetPathFromMapWithoutExt;
      handler.reset();
      target=aTopicList;
      targetPathFromMap=FileUtils.getRelativeUnixPath(inputMap,target);
      targetPathFromMapWithoutExt=targetPathFromMap.substring(0,targetPathFromMap.lastIndexOf("String_Node_Str"));
      handler.setTargetFile(targetPathFromMapWithoutExt + targetExt);
      try {
        inputStream=new FileInputStream(new File(job.tempDir,target));
        xmlReader.parse(new InputSource(inputStream));
        inputStream.close();
      }
 catch (      final Exception e) {
        final StringBuilder buff=new StringBuilder();
        String msg=null;
        msg=MessageUtils.getInstance().getMessage("String_Node_Str",target).toString();
        logger.error(buff.append(msg).append(e.getMessage()).toString());
      }
    }
    xmlReader.setContentHandler(ditamapIndexTermReader);
    for (    final String ditamap : ditamapList) {
      final String currentMapPathName=FileUtils.getRelativeUnixPath(inputMap,ditamap);
      String mapPathFromInputMap="String_Node_Str";
      if (currentMapPathName.lastIndexOf(SLASH) != -1) {
        mapPathFromInputMap=currentMapPathName.substring(0,currentMapPathName.lastIndexOf(SLASH));
      }
      ditamapIndexTermReader.setMapPath(mapPathFromInputMap);
      try {
        inputStream=new FileInputStream(new File(job.tempDir,ditamap));
        xmlReader.parse(new InputSource(inputStream));
        inputStream.close();
      }
 catch (      final Exception e) {
        String msg=null;
        msg=MessageUtils.getInstance().getMessage("String_Node_Str",ditamap).toString();
        logger.error(msg,e);
      }
    }
  }
  finally {
    if (inputStream != null) {
      try {
        inputStream.close();
      }
 catch (      final IOException e) {
        logger.error(e.getMessage(),e);
      }
    }
  }
}

Fixed version (ground truth):
private void extractIndexTerm() throws SAXException {
  FileInputStream inputStream=null;
  XMLReader xmlReader=null;
  final IndexTermReader handler=new IndexTermReader(indexTermCollection);
  handler.setLogger(logger);
  final DitamapIndexTermReader ditamapIndexTermReader=new DitamapIndexTermReader(indexTermCollection,true);
  ditamapIndexTermReader.setLogger(logger);
  xmlReader=XMLUtils.getXMLReader();
  try {
    xmlReader.setContentHandler(handler);
    for (    String aTopicList : topicList) {
      String target;
      String targetPathFromMap;
      String targetPathFromMapWithoutExt;
      handler.reset();
      target=aTopicList;
      targetPathFromMap=FileUtils.getRelativeUnixPath(inputMap,target);
      targetPathFromMapWithoutExt=targetPathFromMap.substring(0,targetPathFromMap.lastIndexOf("String_Node_Str"));
      handler.setTargetFile(targetPathFromMapWithoutExt + targetExt);
      try {
        inputStream=new FileInputStream(new File(job.tempDir,target));
        xmlReader.parse(new InputSource(inputStream));
        inputStream.close();
      }
 catch (      final Exception e) {
        final StringBuilder buff=new StringBuilder();
        String msg=null;
        msg=MessageUtils.getInstance().getMessage("String_Node_Str",target).toString();
        logger.error(buff.append(msg).append(e.getMessage()).toString());
      }
    }
    xmlReader.setContentHandler(ditamapIndexTermReader);
    for (    final String ditamap : ditamapList) {
      final String currentMapPathName=FileUtils.getRelativeUnixPath(inputMap,ditamap);
      String mapPathFromInputMap="String_Node_Str";
      if (currentMapPathName.lastIndexOf(SLASH) != -1) {
        mapPathFromInputMap=currentMapPathName.substring(0,currentMapPathName.lastIndexOf(SLASH));
      }
      ditamapIndexTermReader.setMapPath(mapPathFromInputMap);
      try {
        inputStream=new FileInputStream(new File(job.tempDir,ditamap));
        xmlReader.parse(new InputSource(inputStream));
        inputStream.close();
      }
 catch (      final Exception e) {
        String msg=null;
        msg=MessageUtils.getInstance().getMessage("String_Node_Str",ditamap).toString();
        logger.error(msg,e);
      }
    }
  }
  finally {
    if (inputStream != null) {
      try {
        inputStream.close();
      }
 catch (      final IOException e) {
        logger.error(e.getMessage(),e);
      }
    }
  }
}