Index: trunk/src/org/openstreetmap/josm/data/cache/JCSCacheManager.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/cache/JCSCacheManager.java	(revision 16334)
+++ trunk/src/org/openstreetmap/josm/data/cache/JCSCacheManager.java	(revision 16335)
@@ -15,4 +15,5 @@
 import java.util.logging.SimpleFormatter;
 
+import org.apache.commons.jcs.JCS;
 import org.apache.commons.jcs.access.CacheAccess;
 import org.apache.commons.jcs.auxiliary.AuxiliaryCache;
@@ -26,5 +27,4 @@
 import org.apache.commons.jcs.engine.behavior.ICompositeCacheAttributes.DiskUsagePattern;
 import org.apache.commons.jcs.engine.control.CompositeCache;
-import org.apache.commons.jcs.engine.control.CompositeCacheManager;
 import org.apache.commons.jcs.utils.serialization.StandardSerializer;
 import org.openstreetmap.josm.data.preferences.BooleanProperty;
@@ -42,5 +42,4 @@
  */
 public final class JCSCacheManager {
-    private static volatile CompositeCacheManager cacheManager;
     private static final long maxObjectTTL = -1;
     private static final String PREFERENCE_PREFIX = "jcs.cache";
@@ -112,6 +111,5 @@
     }
 
-    @SuppressWarnings("resource")
-    private static void initialize() {
+    static {
         File cacheDir = new File(Config.getDirs().getCacheDirectory(true), "jcs");
 
@@ -154,7 +152,5 @@
         // CHECKSTYLE.ON: SingleSpaceSeparator
         try {
-            CompositeCacheManager cm = CompositeCacheManager.getUnconfiguredInstance();
-            cm.configure(props);
-            cacheManager = cm;
+            JCS.setConfigProperties(props);
         } catch (SecurityException e) {
             Logging.log(Logging.LEVEL_WARN, "Unable to initialize JCS", e);
@@ -183,18 +179,8 @@
      * @return cache access object
      */
+    @SuppressWarnings("unchecked")
     public static <K, V> CacheAccess<K, V> getCache(String cacheName, int maxMemoryObjects, int maxDiskObjects, String cachePath) {
-        if (cacheManager != null)
-            return getCacheInner(cacheName, maxMemoryObjects, maxDiskObjects, cachePath);
-
-        synchronized (JCSCacheManager.class) {
-            if (cacheManager == null)
-                initialize();
-            return cacheManager != null ? getCacheInner(cacheName, maxMemoryObjects, maxDiskObjects, cachePath) : null;
-        }
-    }
-
-    @SuppressWarnings("unchecked")
-    private static <K, V> CacheAccess<K, V> getCacheInner(String cacheName, int maxMemoryObjects, int maxDiskObjects, String cachePath) {
-        CompositeCache<K, V> cc = cacheManager.getCache(cacheName, getCacheAttributes(maxMemoryObjects));
+        CacheAccess<K, V> cacheAccess = JCS.getInstance(cacheName, getCacheAttributes(maxMemoryObjects));
+        CompositeCache<K, V> cc = cacheAccess.getCacheControl();
 
         if (cachePath != null && cacheDirLock != null) {
@@ -203,5 +189,5 @@
                 if (cc.getAuxCaches().length == 0) {
                     cc.setAuxCaches(new AuxiliaryCache[]{DISK_CACHE_FACTORY.createCache(
-                            diskAttributes, cacheManager, null, new StandardSerializer())});
+                            diskAttributes, null, null, new StandardSerializer())});
                 }
             } catch (Exception e) { // NOPMD
@@ -211,5 +197,5 @@
             }
         }
-        return new CacheAccess<>(cc);
+        return cacheAccess;
     }
 
@@ -218,9 +204,5 @@
      */
     public static void shutdown() {
-        // use volatile semantics to get consistent object
-        CompositeCacheManager localCacheManager = cacheManager;
-        if (localCacheManager != null) {
-            localCacheManager.shutDown();
-        }
+        JCS.shutdown();
     }
 
