#vulnerable code 
                                private Populator getPopulatorFromSpringContext(String contextFileName) {

        ApplicationContext applicationContext = new ClassPathXmlApplicationContext(contextFileName);

        return applicationContext.getBean(Populator.class);
    } 
                            #location 5 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                private Populator getPopulatorFromSpringContext(String contextFileName) {
        try (AbstractApplicationContext applicationContext = new ClassPathXmlApplicationContext(contextFileName)) {
            return applicationContext.getBean(Populator.class);
        }
    }