Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-3275

Mismatch between comments and actual use of initialSize parameter in CacheFactory and Clock

    XMLWordPrintableJSON

Details

    • Normal
    • Newcomer

    Description

      The javadoc for org.apache.derby.iapi.services.cache.CacheFactory.newCacheManager() describes the initialSize parameter like this:

      @param initialSize The number of initial holder objects that will be created

      And org.apache.derby.impl.services.cache.Clock's constructor says the following:

      @param initialSize the initial number of cachable object this cache
      holds.
      @param maximumSize the maximum size of the cache. The cache may grow
      from initialSize to maximumSize if the cache policy notices that there
      is not enough free buffers availiable. Once the cache hits maximumSize
      it will not grow. If the cache is full, an exception will be thrown

      However, when Clock is created, it does not populate the cache with "holder objects" or "cacheable [objects]". It only uses the initialSize to specify the initial capacity of the HashMap and the ArrayList that are created.

      Either the code should be changed so that it's in line with the comments, or the comments should be changed to match the code. I don't see any compelling reason for changing the code, so I think I would prefer changing the comments.

      Attachments

        1. javadoc.diff
          2 kB
          Knut Anders Hatlen

        Activity

          People

            knutanders Knut Anders Hatlen
            knutanders Knut Anders Hatlen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: