myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mat...@apache.org
Subject svn commit: r885737 - in /myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/component/visit: FullVisitContext.java PartialVisitContext.java VisitContextFactoryImpl.java
Date Tue, 01 Dec 2009 11:25:08 GMT
Author: matzew
Date: Tue Dec  1 11:25:07 2009
New Revision: 885737

URL: http://svn.apache.org/viewvc?rev=885737&view=rev
Log:
made myfaces' impl of VisitContexts compliant with Trinidad (and RI)

Modified:
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/component/visit/FullVisitContext.java
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/component/visit/PartialVisitContext.java
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/component/visit/VisitContextFactoryImpl.java

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/component/visit/FullVisitContext.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/component/visit/FullVisitContext.java?rev=885737&r1=885736&r2=885737&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/component/visit/FullVisitContext.java
(original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/component/visit/FullVisitContext.java
Tue Dec  1 11:25:07 2009
@@ -19,9 +19,10 @@
 package org.apache.myfaces.component.visit;
 
 import java.util.Collection;
+import java.util.Collections;
 import java.util.EnumSet;
-import java.util.HashSet;
 import java.util.Set;
+
 import javax.faces.component.NamingContainer;
 import javax.faces.component.UIComponent;
 import javax.faces.component.visit.VisitCallback;
@@ -31,70 +32,116 @@
 import javax.faces.context.FacesContext;
 
 /**
- *
- * @author Werner Punz (latest modification by $Author$)
- * @version $Rev$ $Date$
- * 
- *
- * Another visit context for the full Tree Traversal!
- *
- * This visit context is rather simplistic because full tree
- * traversal means always all components have to be visited!
+ * <p>A VisitContext implementation that is
+ * used when performing a full component tree visit.</p>
  * 
+ * @author Werner Punz, Matthias Wessendorf (latest modification by $Author$)
+ * @version $Rev$ $Date$
  */
-public class FullVisitContext extends VisitContext {
-
-    FacesContext _facesContext;
-    Set<VisitHint> _hints;
-    Set<String> _ids;
-    Set<String> _visited = new HashSet<String>();
-
-    public FullVisitContext(FacesContext context, Set<VisitHint> hints) {
-        _facesContext = context;
-        _hints = (hints != null && hints.size() > 0) ?  EnumSet.copyOf(hints)
: EnumSet.noneOf(VisitHint.class);
-    }
-
-    private void assertNamingContainer(UIComponent component) throws IllegalArgumentException
{
-        if (!(component instanceof NamingContainer)) {
-            throw new IllegalArgumentException("Component  " + component.getClientId(_facesContext)
+ "must be of type NamingContainer");
-        }
-    }
-
-
-    @Override
-    public FacesContext getFacesContext() {
-        return _facesContext;
-    }
+public class FullVisitContext extends VisitContext
+{
 
-    @Override
-    public Set<VisitHint> getHints() {
-        return _hints;
-    }
-
-    @Override
-    public Collection<String> getIdsToVisit() {
-        return VisitContext.ALL_IDS;
-    }
-
-    @Override
-    public Collection<String> getSubtreeIdsToVisit(UIComponent component) {
-        assertNamingContainer(component);
-
-        return VisitContext.ALL_IDS;
-    }
-
-    @Override
-    public VisitResult invokeVisitCallback(UIComponent component, VisitCallback callback)
{
-
-        String clientId = component.getClientId();
-
-        if (_visited.contains(clientId)) {
-            return VisitResult.ACCEPT;
-        } else {
-            _visited.add(clientId);
-            VisitResult retVal = callback.visit(this, component);
-            return retVal;
-        }
-
-    }
-}
+  /**
+   * Creates a FullVisitorContext instance.
+   * @param facesContext the FacesContext for the current request
+   * @throws NullPointerException  if {@code facesContext}
+   *                               is {@code null}
+   */    
+  public FullVisitContext(FacesContext facesContext)
+  {
+    this(facesContext, null);
+  }
+
+  /**
+   * Creates a FullVisitorContext instance with the specified
+   * hints.
+   *
+   * @param facesContext the FacesContext for the current request
+   * @param hints a the VisitHints for this visit
+   * @param phaseId PhaseId, if any that visit is ocurring under
+   * @throws NullPointerException  if {@code facesContext}
+   *                               is {@code null}
+   * @throws IllegalArgumentException if the phaseId is specified and
+   * hints does not contain VisitHint.EXECUTE_LIFECYCLE
+   */    
+  public FullVisitContext(
+    FacesContext facesContext,
+    Set<VisitHint> hints)
+  {
+    if (facesContext == null)
+      throw new NullPointerException();
+
+    _facesContext = facesContext;
+
+    // Copy and store hints - ensure unmodifiable and non-empty
+    EnumSet<VisitHint> hintsEnumSet = ((hints == null) || (hints.isEmpty()))
+                                          ? EnumSet.noneOf(VisitHint.class)
+                                          : EnumSet.copyOf(hints);
+
+    _hints = Collections.unmodifiableSet(hintsEnumSet);
+  }
+
+  /**
+   * @see VisitContext#getFacesContext VisitContext.getFacesContext()
+   */
+  @Override
+  public FacesContext getFacesContext()
+  {
+    return _facesContext;
+  }
+
+  /**
+   * @see VisitContext#getIdsToVisit VisitContext.getIdsToVisit()
+   */
+  @Override
+  public Collection<String> getIdsToVisit()
+  {
+    // We always visits all ids
+    return ALL_IDS;
+  }
+
+  /**
+   * @see VisitContext#getSubtreeIdsToVisit VisitContext.getSubtreeIdsToVisit()
+   */
+  @Override
+  public Collection<String> getSubtreeIdsToVisit(UIComponent component)
+  {
+    // Make sure component is a NamingContainer
+    if (!(component instanceof NamingContainer))
+    {
+      throw new IllegalArgumentException("Component is not a NamingContainer: " + component);
+    }
+
+    // We always visits all ids
+    return ALL_IDS;
+  }
+
+  /**
+   * @see VisitContext#getHints VisitContext.getHints
+   */
+  @Override
+  public Set<VisitHint> getHints()
+  {
+    return _hints;
+  }
+
+  /**
+   * @see VisitContext#invokeVisitCallback VisitContext.invokeVisitCallback()
+   */
+  @Override
+  public VisitResult invokeVisitCallback(
+    UIComponent component, 
+    VisitCallback callback)
+  {
+    // Nothing interesting here - just invoke the callback.
+    // (PartialVisitContext.invokeVisitCallback() does all of the 
+    // interesting work.)
+    return callback.visit(this, component);
+  }
+
+  // The FacesContext for this request
+  private final FacesContext _facesContext;
+
+  // Our visit hints
+  private final Set<VisitHint> _hints;
+}
\ No newline at end of file

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/component/visit/PartialVisitContext.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/component/visit/PartialVisitContext.java?rev=885737&r1=885736&r2=885737&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/component/visit/PartialVisitContext.java
(original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/component/visit/PartialVisitContext.java
Tue Dec  1 11:25:07 2009
@@ -18,153 +18,444 @@
  */
 package org.apache.myfaces.component.visit;
 
-import javax.faces.component.visit.*;
+import java.util.AbstractCollection;
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.EnumSet;
+import java.util.HashMap;
 import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
 import java.util.Set;
+
 import javax.faces.component.NamingContainer;
 import javax.faces.component.UIComponent;
 import javax.faces.component.UINamingContainer;
+import javax.faces.component.visit.VisitCallback;
+import javax.faces.component.visit.VisitContext;
+import javax.faces.component.visit.VisitHint;
+import javax.faces.component.visit.VisitResult;
 import javax.faces.context.FacesContext;
 
 /**
- * @author Werner Punz (latest modification by $Author$)
+ * <p>A VisitContext implementation that is
+ * used when performing a partial component tree visit.</p>
+ * 
+ * @author Werner Punz, Matthias Wessendorf (latest modification by $Author$)
  * @version $Rev$ $Date$
- *
- * Implementation of a PartialVisitContext!
- * The partial visit context works on a subset of ids and has several
- * differences to a Full visit context!
- * First getIds returns a mutable set
- * Secondly  getSubtreeIdsToVisit returns either a valid id subset or ALL_IDS
  */
-public class PartialVisitContext extends VisitContext {
+public class PartialVisitContext extends VisitContext
+{
+
+  /**
+   * Creates a PartialVisitorContext instance.
+   * @param facesContext the FacesContext for the current request
+   * @param clientIds the client ids of the components to visit
+   * @throws NullPointerException  if {@code facesContext}
+   *                               is {@code null}
+   */    
+  public PartialVisitContext(
+    FacesContext facesContext,
+    Collection<String> clientIds)
+  {
+    this(facesContext, clientIds, null);
+  }
+
+  /**
+   * Creates a PartialVisitorContext instance with the specified hints.
+   * @param facesContext the FacesContext for the current request
+   * @param clientIds the client ids of the components to visit
+   * @param hints a the VisitHints for this visit
+   * @throws NullPointerException  if {@code facesContext}
+   *                               is {@code null}
+   * @throws IllegalArgumentException if the phaseId is specified and
+   * hints does not contain VisitHint.EXECUTE_LIFECYCLE
+   */    
+  public PartialVisitContext(FacesContext facesContext,
+                             Collection<String> clientIds,
+                             Set<VisitHint> hints)
+  {
+    if (facesContext == null)
+      throw new NullPointerException();
+
+    _facesContext = facesContext;
+
+    // Copy the client ids into a HashSet to allow for quick lookups.
+    Set<String> clientIdSet = (clientIds == null)
+                                ? new HashSet<String>()
+                                : new HashSet<String>(clientIds);
+
+    // Initialize our various collections
+    // We maintain 4 collections:
+    //
+    // 1. clientIds: contains all of the client ids to visit
+    // 2. ids: contains just ids (not client ids) to visit.
+    //    We use this to optimize our check to see whether a
+    //    particular component is in the visit set (ie. to
+    //    avoid having to compute the client id).
+    // 3. subtreeClientIds: contains client ids to visit broken
+    //    out by naming container subtree.  (Needed by
+    //    getSubtreeIdsToVisit()).
+    // 4. unvisitedClientIds: contains the client ids to visit that
+    //    have not yet been visited.
+    //
+    // We populate these now.
+    //
+    // Note that we use default HashSet/Map initial capacities, though
+    // perhaps we could pick more intelligent defaults.
+
+    // Initialize unvisitedClientIds collection
+    _unvisitedClientIds = new HashSet<String>();
+
+    // Initialize ids collection
+    _ids = new HashSet<String>();
+
+    // Intialize subtreeClientIds collection
+    _subtreeClientIds = new HashMap<String, Collection<String>>();
+
+    // Initialize the clientIds collection.  Note that we proxy 
+    // this collection so that we can trap adds/removes and sync 
+    // up all of the other collections.
+    _clientIds = new CollectionProxy<String>(new HashSet<String>());
+
+    // Finally, populate the clientIds collection.  This has the
+    // side effect of populating all of the other collections.       
+    _clientIds.addAll(clientIdSet);
+
+    // Copy and store hints - ensure unmodifiable and non-empty
+    EnumSet<VisitHint> hintsEnumSet = ((hints == null) || (hints.isEmpty()))
+                                        ? EnumSet.noneOf(VisitHint.class)
+                                        : EnumSet.copyOf(hints);
+
+    _hints = Collections.unmodifiableSet(hintsEnumSet);
+  }
+
+  /**
+   * @see VisitContext#getFacesContext VisitContext.getFacesContext()
+   */
+  @Override
+  public FacesContext getFacesContext()
+  {
+    return _facesContext;
+  }
+
+  /**
+   * @see VisitContext#getHints VisitContext.getHints
+   */
+  @Override
+  public Set<VisitHint> getHints()
+  {
+    return _hints;
+  }
+
+  /**
+   * @see VisitContext#getIdsToVisit VisitContext.getIdsToVisit()
+   */
+  @Override
+  public Collection<String> getIdsToVisit()
+  {
+    // We just return our clientIds collection.  This is
+    // the modifiable (but proxied) collection of all of
+    // the client ids to visit.
+    return _clientIds;
+  }
+
+  /**
+   * @see VisitContext#getSubtreeIdsToVisit VisitContext.getSubtreeIdsToVisit()
+   */
+  @Override
+  public Collection<String> getSubtreeIdsToVisit(UIComponent component)
+  {
+    // Make sure component is a NamingContainer
+    if (!(component instanceof NamingContainer))
+    {
+      throw new IllegalArgumentException("Component is not a NamingContainer: " + component);
+    }
 
-    FacesContext _facesContext;
-    Set<VisitHint> _hints;
-    Set<String> _visited = new HashSet<String>();
-    PartialVisitIdProxy _idProxy = null;
+    String clientId = component.getClientId(getFacesContext());
+    Collection<String> ids = _subtreeClientIds.get(clientId);
 
-    public PartialVisitContext(FacesContext context, Collection<VisitHint> hints, Collection<String>
ids) {
-        super();
-        _facesContext = context;
-        _hints =   (hints == null) ? EnumSet.noneOf(VisitHint.class):EnumSet.copyOf(hints);
-        _idProxy = new PartialVisitIdProxy(UINamingContainer.getSeparatorChar(context), ids);
+    if (ids == null)
+      return Collections.emptyList();
+    else
+      return Collections.unmodifiableCollection(ids);     
+  }
+
+  /**
+   * @see VisitContext#invokeVisitCallback VisitContext.invokeVisitCallback()
+   */
+  @Override
+  public VisitResult invokeVisitCallback(
+    UIComponent component, 
+    VisitCallback callback)
+  {
+    // First sure that we should visit this component - ie.
+    // that this component is represented in our id set.
+    String clientId = _getVisitId(component);
+
+    if (clientId == null)
+    {
+      // Not visiting this component, but allow visit to
+      // continue into this subtree in case we've got
+      // visit targets there.
+      return VisitResult.ACCEPT;
+    }
 
+    // If we made it this far, the component matches one of
+    // client ids, so perform the visit.
+    VisitResult result = callback.visit(this, component);
+
+    // Remove the component from our "unvisited" collection
+    _unvisitedClientIds.remove(clientId);
+
+    // If the unvisited collection is now empty, we are done.
+    // Return VisitResult.COMPLETE to terminate the visit.
+    if (_unvisitedClientIds.isEmpty())
+      return VisitResult.COMPLETE;
+    else
+    {
+      // Otherwise, just return the callback's result 
+      return result;
     }
+  }
 
-    private void assertNamingContainer(UIComponent component) throws IllegalArgumentException
{
-        if (!(component instanceof NamingContainer)) {
-            throw new IllegalArgumentException("Component  " + component.getClientId(_facesContext)
+ "must be of type NamingContainer");
+
+  // Called by CollectionProxy to notify PartialVisitContext that
+  // an new id has been added.
+  private void _idAdded(String clientId)
+  {
+    // An id to visit has been added, update our other
+    // collections to reflect this.
+
+    // Update the ids collection
+    _ids.add(_getIdFromClientId(clientId));
+
+    // Update the unvisited ids collection
+    _unvisitedClientIds.add(clientId);
+
+    // Update the subtree ids collection
+    _addSubtreeClientId(clientId);
+  }
+
+  // Called by CollectionProxy to notify PartialVisitContext that
+  // an id has been removed
+  private void _idRemoved(String clientId)
+  {
+    // An id to visit has been removed, update our other
+    // collections to reflect this.  Note that we don't
+    // update the ids collection, since we ids (non-client ids)
+    // may not be unique.
+
+    // Update the unvisited ids collection
+    _unvisitedClientIds.remove(clientId);
+
+    // Update the subtree ids collection
+    _removeSubtreeClientId(clientId);
+  }
+
+  // Tests whether the specified component should be visited.
+  // If so, returns its client id.  If not, returns null.
+  private String _getVisitId(UIComponent component)
+  {
+    // We first check to see whether the component's id
+    // is in our id collection.  We do this before checking
+    // for the full client id because getting the full client id
+    // is more expensive than just getting the local id.
+    String id = component.getId();
+
+    if ((id != null) && !_ids.contains(id))
+      return null;
+
+    // The id was a match - now check the client id.
+    // note that client id should never be null (should be
+    // generated even if id is null, so asserting this.)
+    String clientId = component.getClientId(getFacesContext());
+    assert(clientId != null);
+
+    return _clientIds.contains(clientId) ? clientId : null;
+  }
+
+
+
+  // Converts an client id into a plain old id by ripping
+  // out the trailing id segmetn.
+  private String _getIdFromClientId(String clientId)
+  {
+    char separator = UINamingContainer.SEPARATOR_CHAR;
+    int lastIndex = clientId.lastIndexOf(separator);
+
+    String id = null;
+
+    if (lastIndex < 0)
+    {
+      id = clientId;
+    }
+    else if (lastIndex < (clientId.length() - 1))
+    {
+      id = clientId.substring(lastIndex + 1);              
+    }
+    else
+    {
+      // TODO log warning for trailing colon case
+    }
+ 
+    return id;
+  }
+
+
+  // Given a single client id, populate the subtree map with all possible
+  // subtree client ids
+  private void _addSubtreeClientId(String clientId)
+  {
+    // Loop over the client id and find the substring corresponding to
+    // each ancestor NamingContainer client id.  For each ancestor
+    // NamingContainer, add an entry into the map for the full client
+    // id.
+    char separator = NamingContainer.SEPARATOR_CHAR;
+    
+    int length = clientId.length();
+
+    for (int i = 0; i < length; i++)
+    {
+      if (clientId.charAt(i) == separator)
+      {
+        // We found an ancestor NamingContainer client id - add 
+        // an entry to the map.
+        String namingContainerClientId = clientId.substring(0, i);
+
+        // Check to see whether we've already ids under this
+        // NamingContainer client id.  If not, create the 
+        // Collection for this NamingContainer client id and
+        // stash it away in our map
+        Collection<String> c = _subtreeClientIds.get(namingContainerClientId);
+
+        if (c == null)
+        {
+          // TODO: smarter initial size?
+          c = new ArrayList<String>();
+          _subtreeClientIds.put(namingContainerClientId, c);
         }
+
+        // Stash away the client id
+        c.add(clientId);
+      }
     }
+  }
 
-    @Override
-    public FacesContext getFacesContext() {
-        return _facesContext;
+  // Given a single client id, remove any entries corresponding
+  // entries from our subtree collections
+  private void _removeSubtreeClientId(String clientId)
+  {
+    // Loop through each entry in the map and check to see whether
+    // the client id to remove should be contained in the corresponding
+    // collection - ie. whether the key (the NamingContainer client id)
+    // is present at the start of the client id to remove.
+    for (String key : _subtreeClientIds.keySet())
+    {
+      if (clientId.startsWith(key))
+      {
+        // If the clientId starts with the key, we should
+        // have an entry for this clientId in the corresponding
+        // collection.  Remove it.
+        Collection<String> ids = _subtreeClientIds.get(key);
+        ids.remove(clientId);
+      }
+    }
+  }
+
+  // Little proxy collection implementation.  We proxy the id
+  // collection so that we can detect modifications and update
+  // our internal state when ids to visit are added or removed.
+  private class CollectionProxy<E extends String> extends AbstractCollection<E>
+  {
+    private CollectionProxy(Collection<E> wrapped)
+    {
+      _wrapped = wrapped;
     }
 
     @Override
-    public Set<VisitHint> getHints() {
-        return _hints;
+    public int size()
+    {
+      return _wrapped.size();
     }
 
-    /**
-     * Returns the collection of ids, as mutable collection!
-     * (In our case our internal PartialVisitProxy doing the heavy lifting)
-     */
     @Override
-    public Collection<String> getIdsToVisit() {
-        return _idProxy;
+    public Iterator<E> iterator()
+    {
+      return new IteratorProxy<E>(_wrapped.iterator());
     }
 
-    /**
-     * returns all visit ids below the component given
-     * the component has to be a naming container!
-     * To speed things up we use an inverse cache,
-     * the component itself does not have to be in the visting list
-     * it can even be the body element!
-     *
-     *
-     * @param component
-     * @return
-     */
     @Override
-    public Collection<String> getSubtreeIdsToVisit(UIComponent component) {
-        assertNamingContainer(component);
+    public boolean add(E o)
+    {
+      boolean added = _wrapped.add(o);
+
+      if (added)
+      {
+        _idAdded(o);
+      }
 
-        //ok this is suboptimal, if we have forced ids we have to visit all components!
-        if (_idProxy.getForcedIds().size() > 0) {
-            return VisitContext.ALL_IDS;
-        }
-        //the alternative would be to descend into the subtrees
-        //but given the spec this method just gives hints whether
-        //we can shortcut or not!
-        //given this method might be called many times, it is not really justified to make
a deep scan here
-        //it probably is better just to send an all have to be visited instead!
-
-
-        //an alternative might be to add the deep scan ids to the result set every time
-        //so that a component can shortcut if they are found!
-        //but this method is safer because the component then cannot make the assumption
-        //that a subtree id might be present while in reality it is not!
-        //the main issue here is simply that we cannot rely on the positions of our deep
scan ids
-        //another one is performance, we have to treewalk here which is not optimal! especially
-        //since this method might be called many times
-
-        //I have to check this out if concatenation of the _deepScan Ids is possible in this
case!
-        //if we can do it that we the speedup definitely will be bigger than
-
-        //also the hint system is ignored in our case, because UIComponent.isVisitable takes
-        //care of it!
-
-        Collection<String> retVal = new HashSet<String>(_idProxy.size());
-
-        String clientId = component.getClientId(_facesContext);
-        Collection<String> visitableComponents = _idProxy.getInverseCache().get(clientId);
-        if (visitableComponents == null || visitableComponents.size() == 0) {
-            return Collections.emptySet();
-        }
+      return added;
+    }
 
-        //not ideal still faster than influencing the visitableComponents data structure
on the invoke side!
-        for (String componentId : visitableComponents) {
-            if (!_visited.contains(componentId)) {
-                retVal.add(componentId);
-            }
-        }
+    private final Collection<E> _wrapped;
+  }
 
-        //this seems weird at the first look because it is not handled what has to happen
-        //if someone removed or adds an id from the outside, what happens is following
-        //that the caches are updated on the fly if this happens, the cache itself
-        //is not thread safe because, servlets normally can expect to be in a single thread
-        //context unless you work on singletons which is not the case in the case of a context!
+  // Little proxy iterator implementation used by CollectionProxy
+  // so that we can catch removes.
+  private class IteratorProxy<E extends String> implements Iterator<E>
+  {
+    private IteratorProxy(Iterator<E> wrapped)
+    {
+      _wrapped = wrapped;
+    }
 
-        return retVal;
+    public boolean hasNext()
+    {
+      return _wrapped.hasNext();
     }
 
-    @Override
-    public VisitResult invokeVisitCallback(UIComponent component, VisitCallback callback)
{
+    public E next()
+    {
+      _current = _wrapped.next();
+      
+      return _current;
+    }
 
-        String clientId = component.getClientId();
-        int idSize = _idProxy.size();
+    public void remove()
+    {
+      if (_current != null)
+      {
+        _idRemoved(_current);
+      }
 
+      _wrapped.remove();
+    }
 
-        //premature termination condition
-        if (_visited.size() == idSize) {
-            return VisitResult.COMPLETE;
-        }
+    private final Iterator<E> _wrapped;
 
-        //accept in case of not processing or processed
-        boolean notProcessing = _visited.contains(clientId) ||
-                !_idProxy.contains(clientId);
-
-        if (notProcessing) {
-            return VisitResult.ACCEPT;
-        } else {
-            _visited.add(clientId);
-            VisitResult retVal = callback.visit(this, component);
-            return retVal;
-        }
-    }
-}
+    private E _current = null;
+  }
+
+  // The client ids to visit
+  private final Collection<String> _clientIds;
+
+  // The ids to visit
+  private final Collection<String> _ids;
+
+  // The client ids that have yet to be visited
+  private final Collection<String> _unvisitedClientIds;
+
+  // This map contains the information needed by getIdsToVisit().
+  // The keys in this map are NamingContainer client ids.  The values
+  // are collections containing all of the client ids to visit within
+  // corresponding naming container.
+  private final Map<String,Collection<String>> _subtreeClientIds;
+
+  // The FacesContext for this request
+  private final FacesContext _facesContext;
+
+  // Our visit hints
+  private final Set<VisitHint> _hints;
+}
\ No newline at end of file

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/component/visit/VisitContextFactoryImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/component/visit/VisitContextFactoryImpl.java?rev=885737&r1=885736&r2=885737&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/component/visit/VisitContextFactoryImpl.java
(original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/component/visit/VisitContextFactoryImpl.java
Tue Dec  1 11:25:07 2009
@@ -52,7 +52,7 @@
         if (ids == null || ids.isEmpty()) {
             return new FullVisitContext(context, hints);
         } else {
-            return new PartialVisitContext(context, hints, ids);
+            return new PartialVisitContext(context, ids, hints);
         }
     }
 }



Mime
View raw message