portletspec3
  1. portletspec3
  2. PORTLETSPEC3-3

Errata: Clarification in Javadoc for CacheControl.getExpirationTime()

    Details

      Description

      In the Javadoc for the CacheControl class, the following is stated for getExpirationTime() and setExpirationTime().
      Taken together, it's a bit unclear as to what a return value of 0 from getExpirationTime() actually means - does
      it mean "hasn't been set" or does it mean "disabled"?

      The description for getExpirationTime() should be changed as indicated. The description for setExpirationTime() would remain unchanged.

      Original:
      -------------------------
      getExpirationTime
      
      int getExpirationTime()
      
          Get the currently set expiration time. If no expiration time is set on this response 
          the default defined in the portlet deployment descriptor with the expiration-cache 
          tag is returned, or 0 if no default is defined.
      
          This call returns the same value as the getProperty(EXPIRATION_CACHE) call.
      
          Returns:
              the currently set expiration time in seconds, or 0 if no expiration time is set.
      
      setExpirationTime
      
      void setExpirationTime(int time)
      
          Sets a new expiration time for the current response in seconds.
      
          If the expiration value is set to 0, caching is disabled for this portlet; 
          if the value is set to -1, the cache does not expire.
      
          This call is equivalent to calling setProperty(EXPIRATION_CACHE).
      
          Parameters:
              time - expiration time in seconds
      -------------------------
      
      Corrected:
      -------------------------
      getExpirationTime
      
      int getExpirationTime()
      
          Get the currently set expiration time. If no expiration time has been 
          explicitly set on this response, the default defined in the portlet 
          deployment descriptor with the expiration-cache tag is returned; If
          no default value is provided in the portlet deployment descriptor, 
          0 is returned.
      
          This call returns the same value as the getProperty(EXPIRATION_CACHE) call.
      
          Returns:
              the currently set expiration time in seconds; 
              0 indicates caching is disabled for this portlet; 
              -1 indicates the cache does not expire.
      
      setExpirationTime
      
      (unchanged)
      -------------------------
      

        Activity

          People

          • Assignee:
            Unassigned
            Reporter:
            msnicklous
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: