You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by dl...@apache.org on 2001/09/16 19:31:43 UTC

cvs commit: jakarta-turbine-2/src/java/org/apache/turbine/services/pull TurbinePullService.java

dlr         01/09/16 10:31:43

  Modified:    src/java/org/apache/turbine/services/pull
                        TurbinePullService.java
  Log:
  Backported some fixes which handle the case where no User object is in
  the RunData.
  
  Revision  Changes    Path
  1.3       +16 -10    jakarta-turbine-2/src/java/org/apache/turbine/services/pull/TurbinePullService.java
  
  Index: TurbinePullService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/services/pull/TurbinePullService.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -u -r1.2 -r1.3
  --- TurbinePullService.java	2001/08/28 16:33:46	1.2
  +++ TurbinePullService.java	2001/09/16 17:31:43	1.3
  @@ -144,7 +144,7 @@
    *
    * @author <a href="mailto:jvanzyl@periapt.com">Jason van Zyl</a>
    * @author <a href="mailto:sean@informage.net">Sean Legassick</a>
  - * @version $Id: TurbinePullService.java,v 1.2 2001/08/28 16:33:46 jvanzyl Exp $
  + * @version $Id: TurbinePullService.java,v 1.3 2001/09/16 17:31:43 dlr Exp $
    */
   public class TurbinePullService extends TurbineBaseService 
       implements PullService
  @@ -415,8 +415,12 @@
           // very similar, so the same method is used - the
           // boolean parameter indicates whether get/setPerm is to be used
           // rather than get/setTemp)
  -        populateWithSessionTools(sessionTools,    context, data, false);
  -        populateWithSessionTools(persistentTools, context, data, true);
  +        User user = data.getUser();
  +        if (user != null)
  +        {
  +            populateWithSessionTools(sessionTools,    context, user, false);
  +            populateWithSessionTools(persistentTools, context, user, true);
  +        }
       }
   
       /**
  @@ -488,21 +492,23 @@
       }
   
       /**
  -     * Populate the given context with the session-scope tools
  +     * Populate the given context with the session-scoped tools.
        *
  -     * @param context a Velocity Context to populate
  -     * @param data a RunData instance
  +     * @param tools The list of tools with which to populate the
  +     * session.
  +     * @param context The context to populate.
  +     * @param user The <code>User</code> object whose storage to
  +     * retrieve the tool from.
  +     * @param userPerm Whether to retrieve the tools from the
  +     * permanent storage (as opposed to the temporary storage).
        */
       private void populateWithSessionTools(List tools, Context context,
  -            RunData data, boolean usePerm)
  +                                          User user, boolean usePerm)
       {
           // Get the PoolService to fetch object instances from
           PoolService pool = (PoolService)
               TurbineServices.getInstance().getService(PoolService.SERVICE_NAME);
   
  -        // Get the current user
  -        User user = data.getUser();
  -        
           // Iterate the tools
           Iterator it = tools.iterator();
           while (it.hasNext())
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org