[jboss-cvs] jboss-seam/src/main/org/jboss/seam/contexts ...

Gavin King gavin.king at jboss.com
Thu Nov 23 16:32:06 EST 2006


  User: gavin   
  Date: 06/11/23 16:32:06

  Modified:    src/main/org/jboss/seam/contexts  PageContext.java
  Log:
  JBSEAM-521
  
  Revision  Changes    Path
  1.12      +6 -5      jboss-seam/src/main/org/jboss/seam/contexts/PageContext.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: PageContext.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/contexts/PageContext.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -b -r1.11 -r1.12
  --- PageContext.java	4 Nov 2006 02:08:10 -0000	1.11
  +++ PageContext.java	23 Nov 2006 21:32:06 -0000	1.12
  @@ -34,7 +34,7 @@
    * returns values from the page that was the source of the request.
    * 
    * @author Gavin King
  - * @version $Revision: 1.11 $
  + * @version $Revision: 1.12 $
    */
   public class PageContext implements Context {
   
  @@ -43,7 +43,7 @@
      
      public PageContext()
      {
  -      previousPageMap = getAttributeMap();
  +      previousPageMap = getOrCreateAttributeMap();
         nextPageMap = new HashMap<String, Object>();
      }
   
  @@ -129,12 +129,12 @@
       */
      public void flush()
      {
  -      Map attributeMap = getAttributeMap();
  +      Map attributeMap = getOrCreateAttributeMap();
         attributeMap.putAll(nextPageMap);
         nextPageMap = attributeMap;
      }
   
  -   private static Map getAttributeMap()
  +   private static Map getOrCreateAttributeMap()
      {
         FacesContext facesContext = FacesContext.getCurrentInstance();
         if (facesContext==null)
  @@ -142,7 +142,8 @@
            throw new IllegalStateException("no FacesContext bound to current thread");
         }
         UIViewRoot viewRoot = facesContext.getViewRoot();
  -      return viewRoot==null ? Collections.EMPTY_MAP : viewRoot.getAttributes();
  +      return viewRoot==null ? 
  +            new HashMap() : viewRoot.getAttributes();
      }
   
      private static PhaseId getPhaseId()
  
  
  



More information about the jboss-cvs-commits mailing list