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

Gavin King gavin.king at jboss.com
Mon Oct 9 23:48:19 EDT 2006


  User: gavin   
  Date: 06/10/09 23:48:19

  Modified:    src/main/org/jboss/seam  Component.java
  Log:
  javadoc and minor refactor
  
  Revision  Changes    Path
  1.181     +7 -19     jboss-seam/src/main/org/jboss/seam/Component.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Component.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/Component.java,v
  retrieving revision 1.180
  retrieving revision 1.181
  diff -u -b -r1.180 -r1.181
  --- Component.java	9 Oct 2006 08:30:27 -0000	1.180
  +++ Component.java	10 Oct 2006 03:48:19 -0000	1.181
  @@ -109,7 +109,7 @@
    *
    * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
    * @author Gavin King
  - * @version $Revision: 1.180 $
  + * @version $Revision: 1.181 $
    */
   @Scope(ScopeType.APPLICATION)
   public class Component
  @@ -1050,7 +1050,7 @@
      {
         ScopeType scope = wrapper.getVariableScope(dataModelAnn);
   
  -      Object dataModel = getOutContext(scope).get(name);
  +      Object dataModel = getOutContext(scope, this).get(name);
         if ( dataModel != null )
         {
   
  @@ -1139,7 +1139,7 @@
   
         ScopeType scope = wrapper.getVariableScope(dataModelAnn);
   
  -      Context context = getOutContext(scope);
  +      Context context = getOutContext(scope, this);
         Object existingDataModel = context.get(name);
         boolean dirty = existingDataModel == null || scope==PAGE ||
               wrapper.isDirty(dataModelAnn, existingDataModel, list);
  @@ -1158,8 +1158,8 @@
   
      }
   
  -   private Context getOutContext(ScopeType specifiedScope) {
  -      ScopeType scope = this.scope;
  +   private static Context getOutContext(ScopeType specifiedScope, Component component) {
  +      ScopeType scope = component==null ? EVENT : component.getScope();
         if (scope==STATELESS)
         {
            scope = EVENT;
  @@ -1269,7 +1269,7 @@
            }
   
            Context context = component==null ?
  -               getOutContext( out.scope() ) :
  +               getOutContext( out.scope(), this ) :
                  component.getScope().getContext();
   
            if (value==null)
  @@ -1520,19 +1520,7 @@
         Object value = Contexts.lookupInStatefulContexts(name); //see if a value was outjected by the factory method
         if (value==null) //usually a factory method returning a value
         {
  -         if (scope==UNSPECIFIED)
  -         {
  -            if (component==null)
  -            {
  -               scope=EVENT;
  -            }
  -            else //an @Factory method defaults to the same scope as the component
  -            {
  -               scope = component.getScope();
  -               if (scope==STATELESS) scope=EVENT;
  -            }
  -         }
  -         scope.getContext().set(name, result);
  +         getOutContext(scope, component).set(name, result);
            return result;
         }
         else //usually a factory method with a void return type
  
  
  



More information about the jboss-cvs-commits mailing list