diff --git a/source/de/anomic/http/httpdFileHandler.java b/source/de/anomic/http/httpdFileHandler.java index 5c5cd74f7..6f53a7aa2 100644 --- a/source/de/anomic/http/httpdFileHandler.java +++ b/source/de/anomic/http/httpdFileHandler.java @@ -78,6 +78,7 @@ import java.util.Iterator; import java.util.Map; import java.util.Properties; import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; import java.util.zip.GZIPOutputStream; import de.anomic.htmlFilter.htmlFilterContentScraper; @@ -115,11 +116,11 @@ public final class httpdFileHandler { private static File htLocalePath = null; private static final class TemplateCacheEntry { - Date lastModified; - byte[] content; + Date lastModified; + byte[] content; } - private static final HashMap> templateCache; - private static final HashMap> templateMethodCache; + private static final ConcurrentHashMap> templateCache; + private static final ConcurrentHashMap> templateMethodCache; public static final boolean useTemplateCache; @@ -130,8 +131,8 @@ public final class httpdFileHandler { static { final serverSwitch theSwitchboard = plasmaSwitchboard.getSwitchboard(); useTemplateCache = theSwitchboard.getConfig("enableTemplateCache","true").equalsIgnoreCase("true"); - templateCache = (useTemplateCache)? new HashMap>() : new HashMap>(0); - templateMethodCache = (useTemplateCache) ? new HashMap>() : new HashMap>(0); + templateCache = (useTemplateCache)? new ConcurrentHashMap>() : new ConcurrentHashMap>(0); + templateMethodCache = (useTemplateCache) ? new ConcurrentHashMap>() : new ConcurrentHashMap>(0); if (httpdFileHandler.switchboard == null) { httpdFileHandler.switchboard = theSwitchboard;