Changeset 18486 in josm
- Timestamp:
- 2022-06-13T15:42:34+02:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/PatternUtils.java
r18475 r18486 2 2 package org.openstreetmap.josm.tools; 3 3 4 import java.util.Optional; 4 5 import java.util.concurrent.TimeUnit; 5 6 import java.util.regex.Pattern; 6 7 7 8 import org.apache.commons.jcs3.access.CacheAccess; 9 import org.apache.commons.jcs3.engine.ElementAttributes; 8 10 import org.apache.commons.jcs3.engine.behavior.IElementAttributes; 9 11 import org.openstreetmap.josm.data.cache.JCSCacheManager; … … 24 26 static { 25 27 // We don't want to keep these around forever, so set a reasonablish max idle life. 26 final IElementAttributes defaultAttributes = cache.getDefaultElementAttributes(); 28 final IElementAttributes defaultAttributes = Optional.ofNullable(cache.getDefaultElementAttributes()).orElseGet( 29 ElementAttributes::new); 27 30 defaultAttributes.setIdleTime(TimeUnit.HOURS.toSeconds(1)); 28 31 cache.setDefaultElementAttributes(defaultAttributes);
Note:
See TracChangeset
for help on using the changeset viewer.