From c883de13d15a3360749fa9122b44004aff766097 Mon Sep 17 00:00:00 2001 From: Matthew Buckett Date: Tue, 14 Jan 2014 10:20:07 +0000 Subject: [PATCH] Switch to ConcurrentHashMap for licenses. This means that we shouldn't get any problems with concurrent access to licenses. --- src/main/java/org/rometools/feed/module/cc/types/License.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/rometools/feed/module/cc/types/License.java b/src/main/java/org/rometools/feed/module/cc/types/License.java index 06eac29..c7c358c 100644 --- a/src/main/java/org/rometools/feed/module/cc/types/License.java +++ b/src/main/java/org/rometools/feed/module/cc/types/License.java @@ -43,6 +43,7 @@ import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.StringTokenizer; +import java.util.concurrent.ConcurrentHashMap; import com.sun.syndication.feed.impl.EqualsBean; import com.sun.syndication.feed.impl.ToStringBean; @@ -53,7 +54,7 @@ import com.sun.syndication.feed.impl.ToStringBean; */ public class License { private static final String CC_START = "http://creativecommons.org/licenses/"; - private static final Map lookupLicense = new HashMap(); + private static final Map lookupLicense = new ConcurrentHashMap(); public static final License NO_DERIVS = new License("http://creativecommons.org/licenses/nd/1.0/", new Behaviour[0], new Behaviour[] { Behaviour.DISTRIBUTION, Behaviour.REPRODUCTION }); public static final License NO_DERIVS_NONCOMMERCIAL = new License("http://creativecommons.org/licenses/nd-nc/1.0/",