Program: 29151
Project: 29151
Buggy source:
/** 
 * Populate xml values to Jaxb mapping classes
 */
private void populateJaxbMappings() throws CannotLoadConfigurationException {
  JAXBContext jaxbContext;
  dbTypeMappings=new HashMap<String,Map<String,String>>();
  try {
    jaxbContext=JAXBContext.newInstance(Mappings.class);
    Unmarshaller unmarshaller=jaxbContext.createUnmarshaller();
    ClassLoader classLoader=getClass().getClassLoader();
    File configFile=new File(classLoader.getResource(RDBMSEventTableConstants.RDBMS_TABLE_CONFIG_FILE).getFile());
    if (!configFile.exists()) {
      log.error(RDBMSEventTableConstants.RDBMS_TABLE_CONFIG_FILE + "String_Node_Str");
    }
    Mappings mappings=(Mappings)unmarshaller.unmarshal(configFile);
    Map<String,Mapping> dbMap=new HashMap<String,Mapping>();
    List<Mapping> mappingList=mappings.getMapping();
    for (    Mapping mapping : mappingList) {
      dbMap.put(mapping.getDb(),mapping);
    }
    for (    Mapping mapping : mappingList) {
      if (mapping.getDb() != null) {
        Mapping defaultMapping=dbMap.get(null);
        Mapping specificMapping=dbMap.get(mapping.getDb());
        List<Element> defaultElementList=defaultMapping.getElements().getElementList();
        Map<String,String> elementMappings=new HashMap<String,String>();
        for (        Element element : defaultElementList) {
          Element elementDetails=null;
          if (specificMapping.getElements().getElementList() != null) {
            elementDetails=specificMapping.getElements().getType(element.getKey());
          }
          if (elementDetails == null) {
            elementDetails=defaultMapping.getElements().getType(element.getKey());
          }
          elementMappings.put(elementDetails.getKey(),elementDetails.getValue());
        }
        dbTypeMappings.put(mapping.getDb(),elementMappings);
      }
    }
  }
 catch (  JAXBException e) {
    throw new CannotLoadConfigurationException("String_Node_Str" + RDBMSEventTableConstants.RDBMS_TABLE_CONFIG_FILE + e.getMessage(),e);
  }
}

Fixed version (ground truth):
/** 
 * Populate xml values to Jaxb mapping classes
 */
private void populateJaxbMappings() throws CannotLoadConfigurationException {
  JAXBContext jaxbContext;
  dbTypeMappings=new HashMap<String,Map<String,String>>();
  try {
    jaxbContext=JAXBContext.newInstance(Mappings.class);
    Unmarshaller unmarshaller=jaxbContext.createUnmarshaller();
    ClassLoader classLoader=getClass().getClassLoader();
    InputStream inputStream=classLoader.getResourceAsStream(RDBMSEventTableConstants.RDBMS_TABLE_CONFIG_FILE);
    if (inputStream == null) {
      throw new CannotLoadConfigurationException(RDBMSEventTableConstants.RDBMS_TABLE_CONFIG_FILE + "String_Node_Str");
    }
    Mappings mappings=(Mappings)unmarshaller.unmarshal(inputStream);
    Map<String,Mapping> dbMap=new HashMap<String,Mapping>();
    List<Mapping> mappingList=mappings.getMapping();
    for (    Mapping mapping : mappingList) {
      dbMap.put(mapping.getDb(),mapping);
    }
    for (    Mapping mapping : mappingList) {
      if (mapping.getDb() != null) {
        Mapping defaultMapping=dbMap.get(null);
        Mapping specificMapping=dbMap.get(mapping.getDb());
        List<Element> defaultElementList=defaultMapping.getElements().getElementList();
        Map<String,String> elementMappings=new HashMap<String,String>();
        for (        Element element : defaultElementList) {
          Element elementDetails=null;
          if (specificMapping.getElements().getElementList() != null) {
            elementDetails=specificMapping.getElements().getType(element.getKey());
          }
          if (elementDetails == null) {
            elementDetails=defaultMapping.getElements().getType(element.getKey());
          }
          elementMappings.put(elementDetails.getKey(),elementDetails.getValue());
        }
        dbTypeMappings.put(mapping.getDb(),elementMappings);
      }
    }
  }
 catch (  JAXBException e) {
    throw new CannotLoadConfigurationException("String_Node_Str" + RDBMSEventTableConstants.RDBMS_TABLE_CONFIG_FILE + e.getMessage(),e);
  }
}