Changeset 18434 in josm for trunk/src/org
- Timestamp:
- 2022-04-21T21:54:17+02:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/cache/JCSCacheManager.java
r18213 r18434 8 8 import java.nio.file.StandardOpenOption; 9 9 import java.util.Arrays; 10 import java.util.Collections; 10 11 import java.util.Properties; 11 12 import java.util.logging.Handler; … … 17 18 import org.apache.commons.jcs3.JCS; 18 19 import org.apache.commons.jcs3.access.CacheAccess; 19 import org.apache.commons.jcs3.auxiliary.AuxiliaryCache;20 20 import org.apache.commons.jcs3.auxiliary.AuxiliaryCacheFactory; 21 21 import org.apache.commons.jcs3.auxiliary.disk.behavior.IDiskCacheAttributes; … … 187 187 * @return cache access object 188 188 */ 189 @SuppressWarnings("unchecked")190 189 public static <K, V> CacheAccess<K, V> getCache(String cacheName, int maxMemoryObjects, int maxDiskObjects, String cachePath) { 191 190 CacheAccess<K, V> cacheAccess = getCacheAccess(cacheName, getCacheAttributes(maxMemoryObjects)); … … 195 194 try { 196 195 IDiskCacheAttributes diskAttributes = getDiskCacheAttributes(maxDiskObjects, cachePath, cacheName); 197 if (cc.getAuxCache s().length == 0) {198 cc.setAuxCaches( new AuxiliaryCache[]{DISK_CACHE_FACTORY.createCache(199 diskAttributes, null, null, new StandardSerializer()) });196 if (cc.getAuxCacheList().isEmpty()) { 197 cc.setAuxCaches(Collections.singletonList(DISK_CACHE_FACTORY.createCache( 198 diskAttributes, null, null, new StandardSerializer()))); 200 199 } 201 200 } catch (Exception e) { // NOPMD 202 201 // in case any error in setting auxiliary cache, do not use disk cache at all - only memory 203 cc.setAuxCaches( new AuxiliaryCache[0]);202 cc.setAuxCaches(Collections.emptyList()); 204 203 Logging.debug(e); 205 204 }
Note:
See TracChangeset
for help on using the changeset viewer.