]> source.dussan.org Git - aspectj.git/commitdiff
prevent multi-threaded access problems to the map
authoraclement <aclement>
Fri, 16 Jan 2009 22:41:12 +0000 (22:41 +0000)
committeraclement <aclement>
Fri, 16 Jan 2009 22:41:12 +0000 (22:41 +0000)
bridge/src/org/aspectj/bridge/context/CompilationAndWeavingContext.java

index 90dbad5e21d3661e95652835aa96450f4c61e411..1df076b1199afecee9404ec68565ea7de2787403 100644 (file)
@@ -12,6 +12,7 @@
 package org.aspectj.bridge.context;
 
 import java.lang.ref.WeakReference;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
@@ -88,7 +89,7 @@ public class CompilationAndWeavingContext {
                        "type munging for @AspectJ aspectOf" };
 
        // context stacks, one per thread
-       private static Map contextMap = new HashMap();
+       private static Map contextMap = Collections.synchronizedMap(new HashMap());
 
        // single thread mode stack
        private static Stack contextStack = new Stack();