Uploaded image for project: 'Batik'
  1. Batik
  2. BATIK-936

[PATCH] The setSize(0) method of LRUCache does not disable the cache

    XMLWordPrintableJSON

Details

    Description

      I'm using JPEGTranscoder in a webapp.

      I call the LRUCache.setsize at init of my webapp. It flushed the LRUCache.used list and set the LRUCache.maxsize variable to 0. The LRUCache.free list remains at 50 (which it initizialed by TileCache) which is in my opinion not logic.

      The LRUCache.add method test the size of the LRUCache.free list to cache new item to the LRUCache.used list.

      The LRUCache.used list grows up to 50. The LRUCache.setSize method is not able to flush the LRUCache.used list because there is if statement (inferior strict) on the maxsize (at 0) value against the new size (at 0).

      If think a workaround would be to call LRUCache.setSized twice, the first with value > 50 and the second with 0

      Attachments

        1. batik.patch
          16 kB
          Nicolas Labrot
        2. batik.patch
          23 kB
          Nicolas Labrot

        Activity

          People

            batik-dev@xmlgraphics.apache.org Batik Developer's Mailing list
            nithril Nicolas Labrot
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: