try
{
facesContext.getAttributes().put(SKIP_ITERATION_HINT, Boolean.TRUE);
EnumSet<VisitHint> visitHints = EnumSet.of(VisitHint.SKIP_ITERATION);
VisitContext visitContext = VisitContext.createVisitContext(facesContext, null, visitHints);
component.visitTree(visitContext, new RestoreStateCallback());
}
finally
{
// We must remove hint in finally, because an exception can break this phase,