[jboss-cvs] jboss-portal/wsrp/src/main/org/jboss/portal/wsrp/consumer ...

Chris Laprun chris.laprun at jboss.com
Wed Jul 12 13:51:23 EDT 2006


  User: claprun 
  Date: 06/07/12 13:51:23

  Modified:    wsrp/src/main/org/jboss/portal/wsrp/consumer 
                        RenderHandler.java
  Log:
  Fixed NPE when consumer didn't specify cache expiration. [JBPORTAL-949]
  
  Revision  Changes    Path
  1.6       +6 -4      jboss-portal/wsrp/src/main/org/jboss/portal/wsrp/consumer/RenderHandler.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: RenderHandler.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-portal/wsrp/src/main/org/jboss/portal/wsrp/consumer/RenderHandler.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -b -r1.5 -r1.6
  --- RenderHandler.java	12 Jul 2006 17:04:08 -0000	1.5
  +++ RenderHandler.java	12 Jul 2006 17:51:23 -0000	1.6
  @@ -43,7 +43,7 @@
   
   /**
    * @author <a href="mailto:chris.laprun at jboss.com">Chris Laprun</a>
  - * @version $Revision: 1.5 $
  + * @version $Revision: 1.6 $
    * @since 2.4 (May 31, 2006)
    */
   public class RenderHandler extends InvocationHandler
  @@ -111,18 +111,20 @@
   
         // cache markup if possible
         CacheControl cacheControl = markupContext.getCacheControl();
  +      int expires;
         if (cacheControl != null)
         {
  -         int expires = cacheControl.getExpires();
  +         expires = cacheControl.getExpires();
            String userScope = cacheControl.getUserScope();
            log.debug("RenderHandler.processRenderRequest: trying to cache markup " + userScope + " for " + expires + " seconds.");
  -         result.setExpirationMillis(expires * 1000);
         }
         else
         {
            //use default value based on consumer cache expiration time
  -         result.setExpirationMillis(consumer.getExpirationCacheSeconds().intValue() * 1000);
  +         Integer expirationCacheSeconds = consumer.getExpirationCacheSeconds();
  +         expires = (expirationCacheSeconds != null ? expirationCacheSeconds.intValue() : 0);
         }
  +      result.setExpirationMillis(expires * 1000);
   
         PrintWriter writer = result.getWriter();
         writer.write(markup);
  
  
  



More information about the jboss-cvs-commits mailing list