Program: 100875
Project: 100875
Buggy source:
private void extractIndexTerm() throws SAXException {
  int topicNum=topicList.size();
  int ditamapNum=ditamapList.size();
  FileInputStream inputStream=null;
  XMLReader xmlReader=null;
  IndexTermReader handler=new IndexTermReader();
  DitamapIndexTermReader ditamapIndexTermReader=new DitamapIndexTermReader();
  if (System.getProperty(Constants.SAX_DRIVER_PROPERTY) == null) {
    StringUtils.initSaxDriver();
  }
  xmlReader=XMLReaderFactory.createXMLReader();
  try {
    xmlReader.setContentHandler(handler);
    for (int i=0; i < topicNum; i++) {
      String target;
      String targetPathFromMap;
      String targetPathFromMapWithoutExt;
      handler.reset();
      target=(String)topicList.get(i);
      targetPathFromMap=FileUtils.getRelativePathFromMap(inputMap,target);
      targetPathFromMapWithoutExt=targetPathFromMap.substring(0,targetPathFromMap.lastIndexOf("String_Node_Str"));
      handler.setTargetFile(new StringBuffer(targetPathFromMapWithoutExt).append(targetExt).toString());
      try {
        if (!new File(baseInputDir,target).exists()) {
          javaLogger.logWarn("String_Node_Str" + target);
          continue;
        }
        inputStream=new FileInputStream(new File(baseInputDir,target));
        xmlReader.parse(new InputSource(inputStream));
        inputStream.close();
      }
 catch (      Exception e) {
        Properties params=new Properties();
        StringBuffer buff=new StringBuffer();
        String msg=null;
        params.put("String_Node_Str",target);
        msg=MessageUtils.getMessage("String_Node_Str",params).toString();
        javaLogger.logError(buff.append(msg).append(e.getMessage()).toString());
      }
    }
    xmlReader.setContentHandler(ditamapIndexTermReader);
    for (int j=0; j < ditamapNum; j++) {
      String ditamap=(String)ditamapList.get(j);
      String currentMapPathName=FileUtils.getRelativePathFromMap(inputMap,ditamap);
      String mapPathFromInputMap="String_Node_Str";
      if (currentMapPathName.lastIndexOf(Constants.SLASH) != -1) {
        mapPathFromInputMap=currentMapPathName.substring(0,currentMapPathName.lastIndexOf(Constants.SLASH));
      }
      ditamapIndexTermReader.setMapPath(mapPathFromInputMap);
      try {
        if (!new File(baseInputDir,ditamap).exists()) {
          javaLogger.logWarn("String_Node_Str" + ditamap);
          continue;
        }
        inputStream=new FileInputStream(new File(baseInputDir,ditamap));
        xmlReader.parse(new InputSource(inputStream));
        inputStream.close();
      }
 catch (      Exception e) {
        Properties params=new Properties();
        String msg=null;
        params.put("String_Node_Str",ditamap);
        msg=MessageUtils.getMessage("String_Node_Str",params).toString();
        javaLogger.logError(msg);
        javaLogger.logException(e);
      }
    }
  }
  finally {
    if (inputStream != null) {
      try {
        inputStream.close();
      }
 catch (      IOException e) {
        javaLogger.logException(e);
      }
    }
  }
}

Fixed version (ground truth):
private void extractIndexTerm() throws SAXException {
  int topicNum=topicList.size();
  int ditamapNum=ditamapList.size();
  FileInputStream inputStream=null;
  XMLReader xmlReader=null;
  IndexTermReader handler=new IndexTermReader();
  if (System.getProperty(Constants.SAX_DRIVER_PROPERTY) == null) {
    StringUtils.initSaxDriver();
  }
  xmlReader=XMLReaderFactory.createXMLReader();
  try {
    xmlReader.setContentHandler(handler);
    for (int i=0; i < topicNum; i++) {
      String target;
      String targetPathFromMap;
      String targetPathFromMapWithoutExt;
      handler.reset();
      target=(String)topicList.get(i);
      targetPathFromMap=FileUtils.getRelativePathFromMap(inputMap,target);
      targetPathFromMapWithoutExt=targetPathFromMap.substring(0,targetPathFromMap.lastIndexOf("String_Node_Str"));
      handler.setTargetFile(new StringBuffer(targetPathFromMapWithoutExt).append(targetExt).toString());
      try {
        if (!new File(baseInputDir,target).exists()) {
          javaLogger.logWarn("String_Node_Str" + target);
          continue;
        }
        inputStream=new FileInputStream(new File(baseInputDir,target));
        xmlReader.parse(new InputSource(inputStream));
        inputStream.close();
      }
 catch (      Exception e) {
        Properties params=new Properties();
        StringBuffer buff=new StringBuffer();
        String msg=null;
        params.put("String_Node_Str",target);
        msg=MessageUtils.getMessage("String_Node_Str",params).toString();
        javaLogger.logError(buff.append(msg).append(e.getMessage()).toString());
      }
    }
  }
  finally {
    if (inputStream != null) {
      try {
        inputStream.close();
      }
 catch (      IOException e) {
        javaLogger.logException(e);
      }
    }
  }
}