#vulnerable code 
                              @Override
  public void doStartup(String configLocation) {

    ClassPathXmlApplicationContext applicationContext = null;
    try {
      applicationContext = new ClassPathXmlApplicationContext(configLocation);
      applicationContext.start();
    } catch (Exception e) {
      if (applicationContext != null) {
        applicationContext.close();
      }
      logger.error("", e);
    }
    logger.info("spring初始化完成");
  } 
                            #location 14 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                              @Override
  public void doStartup(String configLocation) throws Throwable {
    Class<?> applicationContextClazz =
        Class.forName("org.springframework.context.support.ClassPathXmlApplicationContext", true, getClassLoader());
    Object flowerFactory = applicationContextClazz.getConstructor(String.class).newInstance(configLocation);
    Method startMethod = applicationContextClazz.getMethod("start");
    startMethod.invoke(flowerFactory);

    logger.info("spring初始化完成");
  }