docs: private void setResourceIdOnFaceletsMode(FacesContext facesContext, UIComponent component,
              Class<?> inspectedClass)
      {
          if (component.getId() == null)
          {
              FaceletCompositionContext mctx = FaceletCompositionContext.getCurrentInstance(facesContext);
              if (mctx != null)
              {
                  UIViewRoot root = facesContext.getViewRoot();
                  root.getAttributes().put(RESOURCE_DEPENDENCY_UNIQUE_ID_KEY, Boolean.TRUE);
                  try
                  {
                      String uid = root.createUniqueId(facesContext, null);
                      component.setId(uid);
                  }
                  finally
                  {
                      root.getAttributes().put(RESOURCE_DEPENDENCY_UNIQUE_ID_KEY, Boolean.FALSE);
                  }
                  if (!mctx.isUsingPSSOnThisView())
                  {
                      // Now set the identifier that will help to know which classes has been already inspected.
                      component.getAttributes().put(
                              RequestViewContext.RESOURCE_DEPENDENCY_INSPECTED_CLASS, inspectedClass);
                  }
                  else if (mctx.isRefreshTransientBuildOnPSSPreserveState())
                  {
                      component.getAttributes().put(
                              RequestViewContext.RESOURCE_DEPENDENCY_INSPECTED_CLASS, inspectedClass);
                  }
              }
              else
              {
                  // This happens when there is a programmatic addition, which means the user has added the
                  // components to the tree on render response phase or earlier but outside facelets control.
                  // In that case we need to save the dependency.
                  component.getAttributes().put(
                          RequestViewContext.RESOURCE_DEPENDENCY_INSPECTED_CLASS, inspectedClass);
              }
          }
      }