Permalink
Browse files

Merge pull request #198 from zfleet/1.3.x

1.3.x
  • Loading branch information...
2 parents 5bf0bdf + 0af41c5 commit 4fd8331855d74c528cf09fba3de4bc40c0f07686 @graemerocher graemerocher committed Jun 1, 2012
Showing with 5 additions and 3 deletions.
  1. +5 −3 src/java/org/codehaus/groovy/grails/support/SoftThreadLocalMap.java
@@ -16,20 +16,22 @@
package org.codehaus.groovy.grails.support;
import org.apache.commons.collections.map.ReferenceMap;
+import java.util.Collections;
+import java.util.Map;
/**
* Creates a InheritableThreadLocal with an intial value of a Map.
*
* @author Graeme Rocher
* @since 0.6
*/
-public class SoftThreadLocalMap extends InheritableThreadLocal<ReferenceMap> {
+public class SoftThreadLocalMap extends InheritableThreadLocal<Map> {
/**
* Creates an initial value of a Map
*/
@Override
- protected ReferenceMap initialValue() {
- return new ReferenceMap(ReferenceMap.SOFT, ReferenceMap.SOFT);
+ protected Map initialValue() {
+ return Collections.synchronizedMap(new ReferenceMap(ReferenceMap.SOFT, ReferenceMap.SOFT));
}
}

0 comments on commit 4fd8331

Please sign in to comment.