Program: 141739
Project: 141739
Buggy source:
/** 
 */
private static void initMap(){
  XPathFactory xpFactory=XPathFactory.newInstance();
  XPath newXPath=xpFactory.newXPath();
  try {
    InputStream input=CamelFeatureUtil.class.getResourceAsStream(MAPPING_XML_FILE);
    DocumentBuilder builder=DocumentBuilderFactory.newInstance().newDocumentBuilder();
    Document document=builder.parse(input);
    try {
      NodeList list=(NodeList)newXPath.evaluate("String_Node_Str",document,XPathConstants.NODESET);
      String camelVersion=list.item(0).getAttributes().getNamedItem("String_Node_Str").getNodeValue();
      list=(NodeList)newXPath.evaluate("String_Node_Str",document,XPathConstants.NODESET);
      for (int index=0; index < list.getLength(); index++) {
        Node node=list.item(index);
        String hotLib=node.getParentNode().getAttributes().getNamedItem("String_Node_Str").getNodeValue();
        hotLib=hotLib.replace("String_Node_Str",camelVersion);
        Collection<FeatureModel> features=camelFeaturesMap.get(hotLib);
        if (features == null) {
          features=new HashSet<FeatureModel>();
          camelFeaturesMap.put(hotLib,features);
        }
        String featureVersion=node.getAttributes().getNamedItem("String_Node_Str").getNodeValue();
        String featureName=node.getFirstChild().getNodeValue();
        features.add(new FeatureModel(featureName,featureVersion));
      }
      list=(NodeList)newXPath.evaluate("String_Node_Str",document,XPathConstants.NODESET);
      for (int index=0; index < list.getLength(); index++) {
        Node node=list.item(index);
        String hotLib=node.getParentNode().getAttributes().getNamedItem("String_Node_Str").getNodeValue();
        hotLib=hotLib.replace("String_Node_Str",camelVersion);
        Collection<BundleModel> bundles=camelBundlesMap.get(hotLib);
        if (bundles == null) {
          bundles=new HashSet<BundleModel>();
          camelBundlesMap.put(hotLib,bundles);
        }
        String version=node.getAttributes().getNamedItem("String_Node_Str").getNodeValue();
        String groupId=node.getAttributes().getNamedItem("String_Node_Str").getNodeValue();
        String name=node.getFirstChild().getNodeValue();
        bundles.add(new BundleModel(name,groupId,version));
      }
    }
  finally {
      input.close();
    }
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
  }
}

Fixed version (ground truth):
/** 
 */
private static void initMap(){
  XPathFactory xpFactory=XPathFactory.newInstance();
  XPath newXPath=xpFactory.newXPath();
  try {
    InputStream input=CamelFeatureUtil.class.getResourceAsStream(MAPPING_XML_FILE);
    DocumentBuilder builder=DocumentBuilderFactory.newInstance().newDocumentBuilder();
    Document document=builder.parse(input);
    try {
      NodeList list=(NodeList)newXPath.evaluate("String_Node_Str",document,XPathConstants.NODESET);
      String camelVersion=list.item(0).getAttributes().getNamedItem("String_Node_Str").getNodeValue();
      list=(NodeList)newXPath.evaluate("String_Node_Str",document,XPathConstants.NODESET);
      for (int index=0; index < list.getLength(); index++) {
        Node node=list.item(index);
        String hotLib=node.getParentNode().getAttributes().getNamedItem("String_Node_Str").getNodeValue();
        hotLib=hotLib.replace("String_Node_Str",camelVersion);
        Collection<FeatureModel> features=camelFeaturesMap.get(hotLib);
        if (features == null) {
          features=new HashSet<FeatureModel>();
          camelFeaturesMap.put(hotLib,features);
        }
        String featureVersion=node.getAttributes().getNamedItem("String_Node_Str").getNodeValue();
        String featureName=node.getFirstChild().getNodeValue();
        features.add(new FeatureModel(featureName,featureVersion));
      }
      list=(NodeList)newXPath.evaluate("String_Node_Str",document,XPathConstants.NODESET);
      for (int index=0; index < list.getLength(); index++) {
        Node node=list.item(index);
        String hotLib=node.getParentNode().getAttributes().getNamedItem("String_Node_Str").getNodeValue();
        hotLib=hotLib.replace("String_Node_Str",camelVersion);
        Collection<BundleModel> bundles=camelBundlesMap.get(hotLib);
        if (bundles == null) {
          bundles=new HashSet<BundleModel>();
          camelBundlesMap.put(hotLib,bundles);
        }
        String version=node.getAttributes().getNamedItem("String_Node_Str").getNodeValue();
        String groupId=node.getAttributes().getNamedItem("String_Node_Str").getNodeValue();
        String name=node.getFirstChild().getNodeValue();
        bundles.add(new BundleModel(groupId,name,version));
      }
    }
  finally {
      input.close();
    }
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
  }
}