code: private void updatePreviousJspIdAndIteratorStatus(String id)
      {
          Set<String> previousJspIdSet = TypedCollections.dynamicallyCastSet((Set)
                  pageContext.getAttribute(PREVIOUS_JSP_ID_SET, PageContext.PAGE_SCOPE), String.class);
  
          if (null == previousJspIdSet)
          {
              previousJspIdSet = new HashSet<String>();
  
              //noinspection CollectionWithoutInitialCapacity
              pageContext.setAttribute(PREVIOUS_JSP_ID_SET, previousJspIdSet, PageContext.PAGE_SCOPE);
          }
  
          // detect the iterator case, since add will return true if the collection already
          // contains the id
          if (previousJspIdSet.add(id))
          {
              // id wasn't in Set, so we aren't nested yet
              isNestedInIterator = false;
          }
          else
          {
              // the Set didn't change, so we are nested
              if (log.isLoggable(Level.FINEST))
              {
                  log.log(Level.FINEST, "Id " + id + " is nested within an iterating tag.");
              }
  
              isNestedInIterator = true;
          }
      }
docs: <p>Called from {@link #setJspId} to update the value saved for
  the previous call to {@link #setJspId} for this component <b>on
  this request</b>.  If this method is presented with the same
  argument <code>id</code> for the same tag instance more than once
  on the same request, then we know that the tag instance lies
  inside an iterator tag, such as <code>c:forEach</code>.  If so,
  we set the <code>isNestedInIterator</code> ivar to
  <code>true</code> otherwise, we set it to <code>false</code>.</p>
  
  <p>The implementation for this method stores a Map from tag
  instance to id String as a request scoped attribute.  This map
  contains the value used as the previousJspId and compared with
  the argument <code>id</code>.
  
  @param id the id to be compared with the previous id, if any, for
  this tag instance on this request.