weaver      2004/07/20 11:53:03

  Modified:    portal/src/java/org/apache/jetspeed/request
                        JetspeedRequestContext.java
               jetspeed-api/src/java/org/apache/jetspeed/request
                        RequestContext.java
  Log:
  Become a good citizen:
  - getPortalUrl() never returns null and raises an IllegalStateException if 
getPortalUrl is called prior
    to the portalUrl being set.
  
  Revision  Changes    Path
  1.22      +14 -1     
jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/request/JetspeedRequestContext.java
  
  Index: JetspeedRequestContext.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/request/JetspeedRequestContext.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- JetspeedRequestContext.java       20 Jul 2004 05:50:23 -0000      1.21
  +++ JetspeedRequestContext.java       20 Jul 2004 18:53:03 -0000      1.22
  @@ -463,9 +463,22 @@
           this.requestPath = result;
           return this.requestPath;
       }
  -
  +    
  +    /**
  +     * 
  +     * <p>
  +     * getPortalURL
  +     * </p>
  +     *
  +     * @see org.apache.jetspeed.request.RequestContext#getPortalURL()
  +     * @return
  +     */
       public PortalURL getPortalURL()
       {
  +        if(url == null)
  +        {
  +            throw new IllegalStateException("This RequestContext's portalUrl has 
not been and is null.");
  +        }
           return url;
       }
   
  
  
  
  1.4       +5 -2      
jakarta-jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/request/RequestContext.java
  
  Index: RequestContext.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/request/RequestContext.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RequestContext.java       13 Jul 2004 20:59:32 -0000      1.3
  +++ RequestContext.java       20 Jul 2004 18:53:03 -0000      1.4
  @@ -161,7 +161,10 @@
       /**
        * Gets the Portal URL for the current request.
        * 
  -     * @return The Portal URL object for the current request.
  +     * @return The Portal URL object for the current request.  This method will 
never
  +     * return a <code>null</code> value.
  +     * @throws IllegalStateException if <code>portalUrl</code>
  +     * has not been set or is null.
        */
       public PortalURL getPortalURL();
       
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to