From 25277e5bdd3116dff98b72336e2511367146b794 Mon Sep 17 00:00:00 2001 From: aclement Date: Fri, 16 Jan 2009 22:41:12 +0000 Subject: [PATCH] prevent multi-threaded access problems to the map --- .../aspectj/bridge/context/CompilationAndWeavingContext.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bridge/src/org/aspectj/bridge/context/CompilationAndWeavingContext.java b/bridge/src/org/aspectj/bridge/context/CompilationAndWeavingContext.java index 90dbad5e2..1df076b11 100644 --- a/bridge/src/org/aspectj/bridge/context/CompilationAndWeavingContext.java +++ b/bridge/src/org/aspectj/bridge/context/CompilationAndWeavingContext.java @@ -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(); -- 2.39.5