runtime/runtime_impl_jetty9/src/main/java/com/google/apphosting/runtime/jetty9/AppEngineWebAppContext.java [626:663]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    void ensure(String name, Class<? extends Filter> filter, String pathSpec) throws Exception {

      // Instantiate any holders referencing this filter (may be application instances)
      for (FilterHolder h : holders.values()) {
        if (filter.getName().equals(h.getClassName())) {
          h.setFilter(filter.getConstructor().newInstance());
          h.setAsyncSupported(APP_IS_ASYNC);
        }
      }

      // Look for (or instantiate) our named instance
      FilterHolder holder = holders.get(name);
      if (holder == null) {
        holder = new FilterHolder(filter.getConstructor().newInstance());
        holder.setName(name);
        holders.put(name, holder);
        holder.setAsyncSupported(APP_IS_ASYNC);
      }

      // Ensure mapping
      boolean mapped = false;
      for (FilterMapping mapping : mappings) {

        for (String ps : mapping.getPathSpecs()) {
          if (pathSpec.equals(ps) && name.equals(mapping.getFilterName())) {
            mapped = true;
            break;
          }
        }
      }
      if (!mapped) {
        FilterMapping mapping = new FilterMapping();
        mapping.setFilterName(name);
        mapping.setPathSpec(pathSpec);
        mapping.setDispatches(FilterMapping.REQUEST);
        mappings.add(mapping);
      }
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



runtime/runtime_impl_jetty12/src/main/java/com/google/apphosting/runtime/jetty/ee8/AppEngineWebAppContext.java [589:626]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    void ensure(String name, Class<? extends Filter> filter, String pathSpec) throws Exception {

      // Instantiate any holders referencing this filter (may be application instances)
      for (FilterHolder h : holders.values()) {
        if (filter.getName().equals(h.getClassName())) {
          h.setFilter(filter.getConstructor().newInstance());
          h.setAsyncSupported(APP_IS_ASYNC);
        }
      }

      // Look for (or instantiate) our named instance
      FilterHolder holder = holders.get(name);
      if (holder == null) {
        holder = new FilterHolder(filter.getConstructor().newInstance());
        holder.setName(name);
        holders.put(name, holder);
        holder.setAsyncSupported(APP_IS_ASYNC);
      }

      // Ensure mapping
      boolean mapped = false;
      for (FilterMapping mapping : mappings) {

        for (String ps : mapping.getPathSpecs()) {
          if (pathSpec.equals(ps) && name.equals(mapping.getFilterName())) {
            mapped = true;
            break;
          }
        }
      }
      if (!mapped) {
        FilterMapping mapping = new FilterMapping();
        mapping.setFilterName(name);
        mapping.setPathSpec(pathSpec);
        mapping.setDispatches(FilterMapping.REQUEST);
        mappings.add(mapping);
      }
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



runtime/runtime_impl_jetty12/src/main/java/com/google/apphosting/runtime/jetty/ee10/AppEngineWebAppContext.java [587:624]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    void ensure(String name, Class<? extends Filter> filter, String pathSpec) throws Exception {

      // Instantiate any holders referencing this filter (may be application instances)
      for (FilterHolder h : holders.values()) {
        if (filter.getName().equals(h.getClassName())) {
          h.setFilter(filter.getConstructor().newInstance());
          h.setAsyncSupported(APP_IS_ASYNC);
        }
      }

      // Look for (or instantiate) our named instance
      FilterHolder holder = holders.get(name);
      if (holder == null) {
        holder = new FilterHolder(filter.getConstructor().newInstance());
        holder.setName(name);
        holders.put(name, holder);
        holder.setAsyncSupported(APP_IS_ASYNC);
      }

      // Ensure mapping
      boolean mapped = false;
      for (FilterMapping mapping : mappings) {

        for (String ps : mapping.getPathSpecs()) {
          if (pathSpec.equals(ps) && name.equals(mapping.getFilterName())) {
            mapped = true;
            break;
          }
        }
      }
      if (!mapped) {
        FilterMapping mapping = new FilterMapping();
        mapping.setFilterName(name);
        mapping.setPathSpec(pathSpec);
        mapping.setDispatches(FilterMapping.REQUEST);
        mappings.add(mapping);
      }
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



