Index: trunk/src/org/openstreetmap/josm/tools/PatternUtils.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/PatternUtils.java	(revision 18485)
+++ trunk/src/org/openstreetmap/josm/tools/PatternUtils.java	(revision 18486)
@@ -2,8 +2,10 @@
 package org.openstreetmap.josm.tools;
 
+import java.util.Optional;
 import java.util.concurrent.TimeUnit;
 import java.util.regex.Pattern;
 
 import org.apache.commons.jcs3.access.CacheAccess;
+import org.apache.commons.jcs3.engine.ElementAttributes;
 import org.apache.commons.jcs3.engine.behavior.IElementAttributes;
 import org.openstreetmap.josm.data.cache.JCSCacheManager;
@@ -24,5 +26,6 @@
     static {
         // We don't want to keep these around forever, so set a reasonablish max idle life.
-        final IElementAttributes defaultAttributes = cache.getDefaultElementAttributes();
+        final IElementAttributes defaultAttributes = Optional.ofNullable(cache.getDefaultElementAttributes()).orElseGet(
+                ElementAttributes::new);
         defaultAttributes.setIdleTime(TimeUnit.HOURS.toSeconds(1));
         cache.setDefaultElementAttributes(defaultAttributes);
