#fixed code
                             public static void setServletContext(ServletContext servletContext) {
		if (servletContext == null) {
			return;
		}
		if (ServletLoader.getServletContext() == null) {
			ServletLoader.setServletContext(servletContext);
		}
		if (ENGINE == null) {
			synchronized (WebEngine.class) {
				if (ENGINE == null) { // double check
					Properties properties = new Properties();
					String config = servletContext.getInitParameter(CONFIG_KEY);
					if (StringUtils.isEmpty(config)) {
						config = WEBINF_CONFIG;
					}
					if (config.startsWith("/")) {
						InputStream in = servletContext.getResourceAsStream(config);
						if (in != null) {
							try {
								properties.load(in);
							} catch (IOException e) {
								throw new IllegalStateException("Failed to load httl config " + config + " in wepapp. cause: " + e.getMessage(), e);
							}
						} else if (servletContext.getInitParameter(CONFIG_KEY) != null) { // 用户主动配置错误提醒
							throw new IllegalStateException("Not found httl config " + config + " in wepapp.");
						} else {
							config = null;
						}
					}
					ENGINE = Engine.getEngine(config, addProperties(properties));
					logConfigPath(ENGINE, servletContext, config);
				}
			}
		}
	}
#vulnerable code 
                             public static void setServletContext(ServletContext servletContext) {
		if (servletContext == null) {
			return;
		}
		if (ServletLoader.getServletContext() == null) {
			ServletLoader.setServletContext(servletContext);
		}
		if (ENGINE == null) {
			synchronized (WebEngine.class) {
				if (ENGINE == null) { // double check
					Properties properties = new Properties();
					String config = servletContext.getInitParameter(CONFIG_KEY);
					if (config == null || config.length() == 0) {
						config = WEBINF_CONFIG;
					}
					if (config.startsWith("/")) {
						InputStream in = servletContext.getResourceAsStream(config);
						if (in != null) {
							try {
								properties.load(in);
							} catch (IOException e) {
								throw new IllegalStateException("Failed to load httl config " + config + " in wepapp. cause: " + e.getMessage(), e);
							}
						} else if (servletContext.getInitParameter(CONFIG_KEY) != null) { // 用户主动配置错误提醒
							throw new IllegalStateException("Not found httl config " + config + " in wepapp.");
						} else {
							config = null;
						}
					}
					ENGINE = Engine.getEngine(config, addProperties(properties));
					logConfigPath(ENGINE, servletContext, config);
				}
			}
		}
	} 
                            #location 6 
                            #vulnerability type THREAD_SAFETY_VIOLATION