Ticket #11216: fix_IndexedDiskCacheManager.patch

File fix_IndexedDiskCacheManager.patch, 2.6 KB (added by wiktorn, 4 years ago)

Indeed. JCS just commited some changes. Fix attached.

  • build.xml

     
    434434        -keep class * extends org.openstreetmap.josm.io.FileExporter
    435435        -keep class org.w3._2001.xmlschema.Adapter1
    436436        -keep class org.openstreetmap.josm.actions.search.SearchCompiler$Never
     437        -keep class org.apache.commons.logging.impl.*
    437438
    438439        -keepclassmembers enum  * {
    439440            public static **[] values();
  • src/org/openstreetmap/josm/data/cache/JCSCacheManager.java

     
    1414import org.apache.commons.jcs.auxiliary.AuxiliaryCache;
    1515import org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCache;
    1616import org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes;
    17 import org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCacheManager;
     17import org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory;
    1818import org.apache.commons.jcs.engine.CompositeCacheAttributes;
    1919import org.apache.commons.jcs.engine.behavior.ICompositeCacheAttributes.DiskUsagePattern;
    2020import org.apache.commons.jcs.engine.control.CompositeCache;
     
    2727
    2828/**
    2929 * @author Wiktor Niesiobędzki
    30  * 
     30 *
    3131 * Wrapper class for JCS Cache. Sets some sane environment and returns instances of cache objects.
    3232 * Static configuration for now assumes some small LRU cache in memory and larger LRU cache on disk
    3333 *
     
    3838    private static volatile CompositeCacheManager cacheManager = null;
    3939    private static long maxObjectTTL        = Long.MAX_VALUE;
    4040    private final static String PREFERENCE_PREFIX = "jcs.cache";
     41    private final static IndexedDiskCacheFactory diskCacheFactory = new IndexedDiskCacheFactory();
    4142
    4243    /**
    4344     * default objects to be held in memory by JCS caches (per region)
     
    140141        if (cachePath != null) {
    141142            IndexedDiskCacheAttributes diskAttributes = getDiskCacheAttributes(maxDiskObjects, cachePath);
    142143            diskAttributes.setCacheName(cacheName);
    143             IndexedDiskCache<K, V> diskCache = IndexedDiskCacheManager.getInstance(null, null, new StandardSerializer()).getCache(diskAttributes);
     144            IndexedDiskCache<K, V> diskCache = diskCacheFactory.createCache(diskAttributes, cacheManager, null, new StandardSerializer());
     145
    144146            cc.setAuxCaches(new AuxiliaryCache[]{diskCache});
    145147        }
    146148        return new CacheAccess<K, V>(cc);