Because servlet containers generally don't specify the ordering of the initialization
(and different implementations indeed do this differently --- See HUDSON-3878),
we cannot use Hudson to the CrumbIssuer into CrumbFilter eagerly.
189111
public CrumbIssuer getCrumbIssuer() {
        Jenkins h = Jenkins.getInstanceOrNull();
        if(h==null)     return null;    // before Jenkins is initialized?
        return h.getCrumbIssuer();
    }
278067
public static void initServletContext( ServletContext servletContext, TemplatedURLFormatter formatter )
    {
        assert servletContext != null : "The ServletContext cannot be null.";

        if ( servletContext == null )
        {
            throw new IllegalArgumentException( "The ServletContext cannot be null." );
        }

        servletContext.setAttribute( TEMPLATED_URL_FORMATTER_ATTR, formatter );
    }
1354328
private void initRequestHandler(ServletContext context, Properties configProps) throws ServletException {

		long initialTime = System.currentTimeMillis();
		if (LOGGER.isInfoEnabled())
			LOGGER.info("Initializing jawr config for request handler named " + getInitParameter("handlerName"));

		this.servletContext = context;
		this.overrideProperties = configProps;
		resourceType = getInitParameter("type");
		resourceType = null == resourceType ? "js" : resourceType;

		if (resourceType.equals("img")) {
			throw new BundlingProcessException(
					"The resource type 'img' is not supported since the version 3.6. You should use the type 'binary' instead.");
		}

		// Check if the resource type is a valid one
		if (!(resourceType.equals(JawrConstant.JS_TYPE) || resourceType.equals(JawrConstant.CSS_TYPE)
				|| resourceType.equals(JawrConstant.BINARY_TYPE))) {
			throw new BundlingProcessException("Unknown resource Type:" + resourceType);
		}

		// Initialize the config properties source that will provide with all
		// configuration options.
		ConfigPropertiesSource propsSrc = initConfigPropertiesSource(context, configProps);

		// Read properties from properties source
		Properties props = propsSrc.getConfigProperties();
		// override the properties if needed
		if (this.overrideProperties != null) {
			props.putAll(overrideProperties);
		}

		// hang onto the propertiesSource for manual reloads
		this.propertiesSource = propsSrc;

		// Initialize the ConfigPropertyResolver
		initConfigPropertyResolver(context);

		initializeJawrContext(props);

		// Initialize the properties reloading checker daemon if specified
		if (!ThreadLocalJawrContext.isBundleProcessingAtBuildTime()
				&& null != props.getProperty(CONFIG_RELOAD_INTERVAL)) {
			int interval = Integer.parseInt(props.getProperty(CONFIG_RELOAD_INTERVAL));
			LOGGER.warn("Jawr started with configuration auto reloading on. "
					+ "Be aware that a daemon thread will be checking for changes to configuration every " + interval
					+ " seconds.");

			this.configChangeListenerThread = new ConfigChangeListenerThread(this.resourceType, propsSrc,
					this.overrideProperties, this, this.bundlesHandler, interval);
			configChangeListenerThread.start();
		}

		if (this.bundlesHandler != null && jawrConfig.getUseSmartBundling()) {

			this.watcher = new ResourceWatcher(this.bundlesHandler, this.rsReaderHandler);
			this.bundlesHandler.setResourceWatcher(watcher);
			try {
				this.watcher.initPathToResourceBundleMap(this.bundlesHandler.getGlobalBundles());
				this.watcher.initPathToResourceBundleMap(this.bundlesHandler.getContextBundles());
			} catch (IOException e) {
				throw new BundlingProcessException("Impossible to initialize Jawr Resource Watcher", e);
			}

			this.watcher.start();
		}

		if (LOGGER.isInfoEnabled()) {
			long totaltime = System.currentTimeMillis() - initialTime;
			LOGGER.info("Init method successful. jawr started in " + (totaltime / 1000) + " seconds....");
		}

		// Reset ThreadLocalJawrContext
		ThreadLocalJawrContext.reset();
	}
1071658
private FilterChainContents getFilterChainContents(String reqURI, String reqServletName, DispatcherType dispatcherType, boolean servletIsInternal) {
        final boolean isTraceOn = com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && logger.isLoggable(Level.FINE)) {
            logger.entering(CLASS_NAME, "getFilterChainContents", "reqUri->" + reqURI + ", reqServletName->" + reqServletName + ", mode->" + dispatcherType
                            + ", servletIsInternal->" + servletIsInternal);
        }
        FilterChainContents fcc = null;
        String strippedUri = null;

        // search for existing filter chains by URI (if not null) else by name
        if (reqURI != null) {
            int queryIndex = reqURI.indexOf("?");
            if (queryIndex > 0) {
                strippedUri = reqURI.substring(0, queryIndex);
            } else {
                strippedUri = reqURI;
            }

            // begin 262685: strip off any path elements after ;
            int semicolon = strippedUri.indexOf(';');
            if (semicolon != -1) {
                strippedUri = strippedUri.substring(0, semicolon);
            }
            // end 262685: strip off any path elements after ;

            if (isTraceOn && logger.isLoggable(Level.FINE)) {
                logger.logp(Level.FINE, CLASS_NAME, "getFilterChainContents", "strippedUri->" + strippedUri);
            }

            // 144464 end part 1
            // see if the chain has been previously constructed (look for a
            // filter contents object)
            if (dispatcherType == DispatcherType.REQUEST) {
                fcc = (FilterChainContents) chainCache.get(strippedUri);
                if (isTraceOn && logger.isLoggable(Level.FINE)) {
                    logger.logp(Level.FINE, CLASS_NAME, "getFilterChainContents", "filter request mode, get cache entry fcc->" + fcc);
                }
            } else if (dispatcherType == DispatcherType.FORWARD) {
                fcc = (FilterChainContents) forwardChainCache.get(strippedUri);
                if (isTraceOn && logger.isLoggable(Level.FINE)) {
                    logger.logp(Level.FINE, CLASS_NAME, "getFilterChainContents", "filter forward mode, get cache entry fcc->" + fcc);
                }
            } else if (dispatcherType == DispatcherType.INCLUDE) {
                fcc = (FilterChainContents) includeChainCache.get(strippedUri);
                if (isTraceOn && logger.isLoggable(Level.FINE)) {
                    logger.logp(Level.FINE, CLASS_NAME, "getFilterChainContents", "filter include mode, get cache entry fcc->" + fcc);
                }
            } else if (dispatcherType == DispatcherType.ERROR) {
                fcc = (FilterChainContents) errorChainCache.get(strippedUri);
                if (isTraceOn && logger.isLoggable(Level.FINE)) {
                    logger.logp(Level.FINE, CLASS_NAME, "getFilterChainContents", "filter error mode, get cache entry fcc->" + fcc);
                }
            }

        } else {
            if (dispatcherType == DispatcherType.REQUEST) {
                fcc = (FilterChainContents) chainCache.get(reqServletName);
                if (isTraceOn && logger.isLoggable(Level.FINE)) {
                    logger.logp(Level.FINE, CLASS_NAME, "getFilterChainContents", "filter request mode, get cache entry fcc->" + fcc);
                }
            } else if (dispatcherType == DispatcherType.FORWARD) {
                fcc = (FilterChainContents) forwardChainCache.get(reqServletName);
                if (isTraceOn && logger.isLoggable(Level.FINE)) {
                    logger.logp(Level.FINE, CLASS_NAME, "getFilterChainContents", "filter forward mode, get cache entry fcc->" + fcc);
                }
            } else if (dispatcherType == DispatcherType.INCLUDE) {
                fcc = (FilterChainContents) includeChainCache.get(reqServletName);
                if (isTraceOn && logger.isLoggable(Level.FINE)) {
                    logger.logp(Level.FINE, CLASS_NAME, "getFilterChainContents", "filter include mode, get cache entry fcc->" + fcc);
                }
            } else if (dispatcherType == DispatcherType.ERROR) {
                fcc = (FilterChainContents) errorChainCache.get(reqServletName);
                if (isTraceOn && logger.isLoggable(Level.FINE)) {
                    logger.logp(Level.FINE, CLASS_NAME, "getFilterChainContents", "filter error mode, get cache entry fcc->" + fcc);
                }

            }

        }

        if (fcc == null) {
            // no current chain...build one
            int i;

            // create a filter contents object so we can store it and avoid
            // doing this step again
            fcc = new FilterChainContents();

            // check the uri against the uri filter mapping list
            IFilterMapping fmInfo;
            int nbrOfMappings;

            if (strippedUri != null) {
                List<IFilterMapping> uriFilterMappings = webAppConfig.getUriFilterMappings();
                if (uriFilterMappings != null) {
                    nbrOfMappings = uriFilterMappings.size();

                    if (isTraceOn && logger.isLoggable(Level.FINE)) {
                        logger.logp(Level.FINE, CLASS_NAME, "getFilterChainContents", "number of uri filter mapping->" + nbrOfMappings);
                    }
                    for (i = 0; i < nbrOfMappings; i++) {
                        fmInfo = (IFilterMapping) uriFilterMappings.get(i);
                        if (isTraceOn && logger.isLoggable(Level.FINE)) {
                            logger.logp(Level.FINE, CLASS_NAME, "getFilterChainContents", "filter mapping info->" + fmInfo);
                        }
                        if ((servletIsInternal || servletIsInternal == fmInfo.getFilterConfig().isInternal())
                                        && (uriMatch(strippedUri, fmInfo, dispatcherType))) { // 144464
                            // part
                            // 3
                            fcc.addFilter(fmInfo.getFilterConfig().getFilterName());
                        }
                    }
                }
            }

            // check the requested servlet name against the servlet filter
            // mapping list
            List<IFilterMapping> servletFilterMappings = webAppConfig.getServletFilterMappings();
            if (servletFilterMappings != null) {
                nbrOfMappings = servletFilterMappings.size();

                if (isTraceOn && logger.isLoggable(Level.FINE)) {
                    logger.logp(Level.FINE, CLASS_NAME, "getFilterChainContents", "number of servlet filter mapping->" + nbrOfMappings);
                }
                for (i = 0; i < nbrOfMappings; i++) {
                    fmInfo = (IFilterMapping) servletFilterMappings.get(i);
                    String filterServlet = fmInfo.getServletConfig().getServletName();
                    if (isTraceOn && logger.isLoggable(Level.FINE)) {
                        logger.logp(Level.FINE, CLASS_NAME, "getFilterChainContents", "filter mapping info->" + fmInfo);
                    }
                    if (filterServlet != null) {
                        if (reqServletName.equals(filterServlet)) {
                            if (isTraceOn && logger.isLoggable(Level.FINE)) {
                                logger.logp(Level.FINE, CLASS_NAME, "getFilterChainContents", "matches servlet name");
                            }
                            for (int j = 0; j < fmInfo.getDispatchMode().length; j++) {
                                if (isTraceOn && logger.isLoggable(Level.FINE)) {
                                    logger.logp(Level.FINE, CLASS_NAME, "getFilterChainContents", "current dispatch mode->"
                                                    + fmInfo.getDispatchMode()[j]);
                                }
                                if ((servletIsInternal || servletIsInternal == fmInfo.getFilterConfig().isInternal())
                                                && (dispatcherType == fmInfo.getDispatchMode()[j])) {
                                    fcc.addFilter(fmInfo.getFilterConfig().getFilterName());
                                    break;
                                }
                            }
                        }
                        // begin, ADDED for Servlet 2.5 SRV.6.2.5
                        else if (filterServlet.equals("*")) {
                            if (isTraceOn && logger.isLoggable(Level.FINE)) {
                                logger.logp(Level.FINE, CLASS_NAME, "getFilterChainContents", "matches *");
                            }
                            for (int j = 0; j < fmInfo.getDispatchMode().length; j++) {
                                if (isTraceOn && logger.isLoggable(Level.FINE)) {
                                    logger.logp(Level.FINE, CLASS_NAME, "getFilterChainContents", "current dispatch mode->"
                                                    + fmInfo.getDispatchMode()[j]);
                                }
                                if (fmInfo.getDispatchMode()[j] == DispatcherType.FORWARD
                                                || fmInfo.getDispatchMode()[j] == DispatcherType.INCLUDE) {
                                    if ((servletIsInternal || servletIsInternal == fmInfo.getFilterConfig().isInternal())
                                                    && (dispatcherType == fmInfo.getDispatchMode()[j])) {
                                        fcc.addFilter(fmInfo.getFilterConfig().getFilterName());
                                        break;
                                    }
                                }
                            }
                        }
                    } else if (logger.isLoggable(Level.WARNING)) { // 306998.15
                        logger.logp(Level.WARNING, CLASS_NAME, "getFilterChainContents", "Null.Filter.Mapping");
                    }
                    // end, ADDED for Servlet 2.5 SRV.6.2.5
                }
            }

            // add the new chain contents to the chain list, indexed by the uri
            // or name
            if (strippedUri != null) {
                if (dispatcherType == DispatcherType.REQUEST)
                    chainCache.put(strippedUri, fcc);
                else if (dispatcherType == DispatcherType.FORWARD)
                    forwardChainCache.put(strippedUri, fcc);
                else if (dispatcherType == DispatcherType.INCLUDE)
                    includeChainCache.put(strippedUri, fcc);
                else if (dispatcherType == DispatcherType.ERROR)
                    errorChainCache.put(strippedUri, fcc);
            } else {
                if (dispatcherType == DispatcherType.REQUEST)
                    chainCache.put(reqServletName, fcc);
                else if (dispatcherType == DispatcherType.FORWARD)
                    forwardChainCache.put(reqServletName, fcc);
                else if (dispatcherType == DispatcherType.INCLUDE)
                    includeChainCache.put(reqServletName, fcc);
                else if (dispatcherType == DispatcherType.ERROR)
                    errorChainCache.put(reqServletName, fcc);
            }

            // 144464 part 4
        }
        if (isTraceOn && logger.isLoggable(Level.FINE)) {
            logger.exiting(CLASS_NAME, "getFilterChainContents");
        }

        return fcc;
    }
769132
@Override
    public void init()
    {
        this.log.debug("Initializing the chaining uberspector.");
        // Create the chain
        // TODO Since we're in Plexus already, should we use components?
        String[] chainClassnames = this.runtime.getConfiguration().getStringArray(UBERSPECT_CHAIN_CLASSNAMES);
        for (String classname : chainClassnames) {
            initializeUberspector(classname);
        }
        // If the chain is empty, use a SecureUberspector
        if (this.inner == null) {
            this.log.error("No chained uberspectors defined! "
                + "This uberspector is just a placeholder that relies on a real uberspector "
                + "to actually allow method calls. Using SecureUberspect instead as a fallback.");
            initializeUberspector(SecureUberspector.class.getCanonicalName());
        }
        // Initialize all the uberspectors in the chain
        try {
            this.inner.init();
        } catch (Exception e) {
            this.log.warn(e.getMessage());
        }
    }
846896
@Override
    protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain)
            throws ServletException, IOException {

        LocaleContextHolder.setLocale(request.getLocale());
        response = new OutputAwareHttpServletResponse(response);

        boolean isIncludeOrForward = WebUtils.isForwardOrInclude(request);
        GrailsWebRequest previous = isIncludeOrForward ? GrailsWebRequest.lookup(request) : null;
        GrailsWebRequest webRequest = new GrailsWebRequest(request, response, getServletContext());
        configureParameterCreationListeners(webRequest);

        if (logger.isDebugEnabled()) {
            logger.debug("Bound Grails request context to thread: " + request);
        }

        try {
            WebUtils.storeGrailsWebRequest(webRequest);

            if(!isIncludeOrForward) {
                // Set the flash scope instance to its next state. We do
                // this here so that the flash is available from Grails
                // filters in a valid state.
                FlashScope fs = webRequest.getAttributes().getFlashScope(request);
                fs.next();
            }

            // Pass control on to the next filter (or the servlet if
            // there are no more filters in the chain).
            filterChain.doFilter(request, response);
        }
        finally {
            webRequest.requestCompleted();

            if(isIncludeOrForward) {
                if(previous != null) {
                    WebUtils.storeGrailsWebRequest(previous);
                }
            }
            else {

                WebUtils.clearGrailsWebRequest();
                LocaleContextHolder.setLocale(null);
            }
            if (logger.isDebugEnabled()) {
                logger.debug("Cleared Grails thread-bound request context: " + request);
            }
        }
    }
57714
public static void initServletContext( ServletContext servletContext, URLTemplatesFactory templatesFactory )
    {
        assert servletContext != null : "The ServletContext cannot be null.";

        if ( servletContext == null )
        {
            throw new IllegalArgumentException( "The ServletContext cannot be null." );
        }

        servletContext.setAttribute( URL_TEMPLATE_FACTORY_ATTR, templatesFactory );
    }
155874
private void initializeNonDDRepresentableAnnotation(IServletConfig servletConfig) {
        if (com.ibm.ws.webcontainer.osgi.WebContainer.isServerStopping())
            return;
        
        String methodName = "initializeNonDDRepresentableAnnotation";
        
        String configClassName = servletConfig.getClassName();
        if (configClassName == null) {
            return; // Strange; but impossible to process; ignore.
        }
        
        if (!acceptAnnotationsFrom(configClassName, DO_NOT_ACCEPT_PARTIAL, DO_NOT_ACCEPT_EXCLUDED)) {
            return; // Ignore: In a metadata-complete or excluded region.
        }

        // Process: In a non-metadata-complete, non-excluded region.
        
        Class<?> configClass;
        
        try {
            configClass = Class.forName(configClassName, false, this.getClassLoader());
        } catch (ClassNotFoundException e) {
            if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE)) {
                LoggingUtil.logParamsAndException(logger, Level.FINE, CLASS_NAME, methodName,
                                                  "unable to load class [{0}] which is benign if the class is never used",
                                                  new Object[] { configClassName }, e);
            }
            return;
            
        } catch (NoClassDefFoundError e) {
            if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE)) {
                LoggingUtil.logParamsAndException(logger, Level.FINE, CLASS_NAME, methodName,
                                                  "unable to load class [{0}] which is benign if the class is never used",
                                                  new Object[] { configClassName }, e);
            }
            return;
        }
        
        checkForServletSecurityAnnotation(configClass, servletConfig);
    }
155090
private void setTopInitArgsAsInvariants(SolrQueryRequest req) {
    // First convert top level initArgs to SolrParams
    HashMap<String,String> map = new HashMap<>(initArgs.size());
    for (int i=0; i<initArgs.size(); i++) {
      Object val = initArgs.getVal(i);
      if (val != null && !(val instanceof NamedList))
        map.put(initArgs.getName(i), val.toString());
    }
    if (map.isEmpty())
      return;//short circuit; nothing to do
    SolrParams topInvariants = new MapSolrParams(map);
    // By putting putting the top level into the 1st arg, it overrides request params in 2nd arg.
    req.setParams(SolrParams.wrapDefaults(topInvariants, req.getParams()));
  }
447217
public void init(IFilterConfig filterConfig) throws ServletException
    {
        try
        {
            // init the filter instance
            _filterState = FILTER_STATE_INITIALIZING;

    		// LIDB-3598: begin
            this._filterConfig = filterConfig;
    		if(_eventSource != null && _eventSource.hasFilterListeners()){
	    	        
	           	_eventSource.onFilterStartInit(getFilterEvent());
	    		// LIDB-3598: end
	        	_filterInstance.init(filterConfig);
	        	// LIDB-3598: begin
	        	_eventSource.onFilterFinishInit(getFilterEvent());
	    		// LIDB-3598: end
    		}
    		else{
    			_filterInstance.init(filterConfig);
    		}

            _filterState = FILTER_STATE_AVAILABLE;
        }
        catch (Throwable th)
        {
    		if(_eventSource != null && _eventSource.hasFilterErrorListeners()){
	        	FilterErrorEvent errorEvent = getFilterErrorEvent(th);
	        	_eventSource.onFilterInitError(errorEvent);
    		}
        	
            com.ibm.wsspi.webcontainer.util.FFDCWrapper.processException(th, "com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.init", "111", this);
            _filterState = FILTER_STATE_UNAVAILABLE;
            throw new ServletException(MessageFormat.format("Filter [{0}]: could not be initialized", new Object[] {_filterName}), th);
        }

    }
806621
@java.lang.SuppressWarnings({"rawtypes", "unchecked"}) // public RequestImpl ctor requires List<AncestorImpl> yet AncestorImpl is not public! API design flaw
    private static RequestImpl createMockRequest() {
        RequestImpl currentRequest = (RequestImpl) Stapler.getCurrentRequest();
        HttpServletRequest original = (HttpServletRequest) currentRequest.getRequest();
        final Map<String,Object> getters = new HashMap<>();
        for (Method method : HttpServletRequest.class.getMethods()) {
            String m = method.getName();
            if ((m.startsWith("get") || m.startsWith("is")) && method.getParameterTypes().length == 0) {
                Class<?> type = method.getReturnType();
                // TODO could add other types which are known to be safe to copy: Cookie[], Principal, HttpSession, etc.
                if (type.isPrimitive() || type == String.class || type == Locale.class) {
                    try {
                        getters.put(m, method.invoke(original));
                    } catch (Exception x) {
                        LOG.log(Level.WARNING, "cannot mock Stapler request " + method, x);
                    }
                }
            }
        }
        List/*<AncestorImpl>*/ ancestors = currentRequest.ancestors;
        LOG.log(Level.FINER, "mocking ancestors {0} using {1}", new Object[] {ancestors, getters});
        TokenList tokens = currentRequest.tokens;
        return new RequestImpl(Stapler.getCurrent(), (HttpServletRequest) Proxy.newProxyInstance(ProgressiveRendering.class.getClassLoader(), new Class<?>[] {HttpServletRequest.class}, new InvocationHandler() {
            @Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
                String m = method.getName();
                if (getters.containsKey(m)) {
                    return getters.get(m);
                } else { // TODO implement other methods as needed
                    throw new UnsupportedOperationException(m);
                }
            }
        }), ancestors, tokens);
    }
205583
public void init(FilterConfig filterConfig) throws ServletException {
    super.init(filterConfig);

    String dirBrowse = filterConfig.getInitParameter("directoryBrowsingDisallowed");

    if (dirBrowse != null) {
      dirBrowse = dirBrowse.toLowerCase();

      directoryBrowsingDisallowed = dirBrowse.equals("yes") ||
                                    dirBrowse.equals("true");
    }
  }
1139101
protected void initializeServletContainerInitializers(DeployedModule moduleConfig) {
        if (WCCustomProperties.DISABLE_SCI_FOR_PRE_V8_APPS && this.getVersionID()<30 ) { //don't do this for 2.5 apps 
            //don't handle SCIs for Servlet 2.5 and lower apps
            logger.logp(Level.FINE, CLASS_NAME, "initializeServletContainerInitializers", "No processing of ServletContainerInitializers on application due to custom property");
            return;
        }
        
        if (com.ibm.ws.webcontainer.osgi.WebContainer.isServerStopping())
            return;

        ServletContext ctx = this;
        List<ServletContainerInitializer> myScis = new ArrayList<ServletContainerInitializer>();
        HashMap<ServletContainerInitializer, Class[]> handleTypesHashMap = new HashMap<ServletContainerInitializer, Class[]>();
        HashMap<ServletContainerInitializer, HashSet<Class<?>>> onStartupHashMap = new HashMap<ServletContainerInitializer, HashSet<Class<?>>>();
        boolean needToScanClassesExtensionPoint = false;
        boolean needToScanClasses = false;
        
            if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)){
            logger.entering(CLASS_NAME, "initializeServletContainerInitializers");
            StringBuffer msg=new StringBuffer(";warFile=").append(moduleConfig.getName());
            logger.logp(Level.FINEST, CLASS_NAME, "initializeServletContainerInitializers", msg.toString());
        } 

        // investigate all of the ExtensionPointSCIs and determine if there is a need to scan for classes.
        needToScanClassesExtensionPoint = initializeExtensionPointSCIs(myScis, moduleConfig, handleTypesHashMap, onStartupHashMap);
        
        ServiceLoader<ServletContainerInitializer> scis = ServiceLoader.load(ServletContainerInitializer.class, this.getClassLoader());
            
        //map for classNames and 
        for (ServletContainerInitializer sci:scis) {
            
            // If server is stopping don't process any more sci's
            if (com.ibm.ws.webcontainer.osgi.WebContainer.isServerStopping())
                break;
            
            if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)){
                logger.logp(Level.FINE, CLASS_NAME, "initializeServletContainerInitializers","Checking " +sci.getClass().getName());
            }
            
            if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)){
                logger.logp(Level.FINE, CLASS_NAME, "initializeServletContainerInitializers","ServletContainerInitializer " +sci.getClass().getName() + " is valid.");
            }
            determineWhetherToAddScis(sci, myScis);
            //if the ServletContainerInitializer came from a valid jar, check the HandlesTypes annotation
            if(investigateHandlesTypes(sci, handleTypesHashMap, onStartupHashMap)){
                needToScanClasses = true;
            }
        }
        //by now we should have put the SCI's with their appropriate classes in the handleTypesHashMap
        // if we need to scan classes for either regular or ExtesnionPoint SCIs then we need to do so.
        if (needToScanClasses || needToScanClassesExtensionPoint) {
           scanForHandlesTypesClasses(moduleConfig, handleTypesHashMap, onStartupHashMap);
        }
        
        //need to use myScis instead of scis as the instances of the ServletContainerInitializer changes in scis
        for (ServletContainerInitializer sci:myScis) {
            if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)){
                logger.logp(Level.FINE, CLASS_NAME, "initializeServletContainerInitializers", "looping through ServletContainerInitializers again");
            }
            HashSet<Class<?>> setOfClasses = onStartupHashMap.get(sci);
            if (setOfClasses!=null && setOfClasses.isEmpty()) {
                setOfClasses=null;
            }
            try {
                sci.onStartup(setOfClasses, ctx);
            } catch (ServletException e) {
                logger.logp(Level.WARNING, CLASS_NAME,"initializeServletContainerInitializers", "exception.occurred.while.running.ServletContainerInitializers.onStartup", new Object[] {sci, this.config.getDisplayName()});;
            }
        }

        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)){
            logger.exiting(CLASS_NAME, "initializeServletContainerInitializers");
        }
    }
976256
private FilterMappingDescriptor createFilterMapping(FilterMappingType filterMappingType, Map<String, FilterDescriptor> filters,
            Map<String, ServletDescriptor> servlets, Store store) {
        FilterMappingDescriptor filterMappingDescriptor = store.create(FilterMappingDescriptor.class);
        FilterNameType filterName = filterMappingType.getFilterName();
        FilterDescriptor filterDescriptor = getOrCreateNamedDescriptor(FilterDescriptor.class, filterName.getValue(), filters, store);
        filterDescriptor.getMappings().add(filterMappingDescriptor);
        for (Object urlPatternOrServletName : filterMappingType.getUrlPatternOrServletName()) {
            if (urlPatternOrServletName instanceof UrlPatternType) {
                UrlPatternType urlPatternType = (UrlPatternType) urlPatternOrServletName;
                UrlPatternDescriptor urlPatternDescriptor = createUrlPattern(urlPatternType, store);
                filterMappingDescriptor.getUrlPatterns().add(urlPatternDescriptor);
            } else if (urlPatternOrServletName instanceof ServletNameType) {
                ServletNameType servletNameType = (ServletNameType) urlPatternOrServletName;
                ServletDescriptor servletDescriptor = getOrCreateNamedDescriptor(ServletDescriptor.class, servletNameType.getValue(), servlets, store);
                filterMappingDescriptor.setServlet(servletDescriptor);
            }
        }
        for (DispatcherType dispatcherType : filterMappingType.getDispatcher()) {
            DispatcherDescriptor dispatcherDescriptor = store.create(DispatcherDescriptor.class);
            dispatcherDescriptor.setValue(dispatcherType.getValue());
            filterMappingDescriptor.getDispatchers().add(dispatcherDescriptor);
        }

        return filterMappingDescriptor;
    }
1140556
@Override
    public PrepareJspHelper createPrepareJspHelper(AbstractJSPExtensionProcessor s, IServletContext webapp, JspOptions options) {
        return new PrepareJspHelper(s, webapp, options);
    }
108471
private void invokeInitializersBasedOnPriority(ITestContext context) {
        ServiceLoader<Initializer> serviceLoader = ServiceLoader.load(Initializer.class);
        List<AbstractConfigInitializer> loader = new ArrayList<AbstractConfigInitializer>();
        for (Initializer l : serviceLoader) {
            loader.add((AbstractConfigInitializer) l);
        }
        Collections.sort(loader);
        for (AbstractConfigInitializer temp : loader) {
            temp.initialize(context);
        }
    }
777023
private static boolean newPojoHasDifferentSubclassRegistrationOrder(
			LinkedOptionalMap<Class<?>, TypeSerializerSnapshot<?>> registeredSubclassSerializerSnapshots,
			PojoSerializer<?> newPojoSerializer) {
		Set<Class<?>> previousRegistrationOrder = registeredSubclassSerializerSnapshots.unwrapOptionals().keySet();
		Set<Class<?>> newRegistrationOrder = newPojoSerializer.getRegisteredClasses().keySet();
		return !isPreviousRegistrationPrefixOfNewRegistration(previousRegistrationOrder, newRegistrationOrder);
	}