]> source.dussan.org Git - aspectj.git/commitdiff
269867: synchronized the map
authoraclement <aclement>
Tue, 24 Mar 2009 22:04:41 +0000 (22:04 +0000)
committeraclement <aclement>
Tue, 24 Mar 2009 22:04:41 +0000 (22:04 +0000)
aspectj5rt/java5-src/org/aspectj/lang/reflect/AjTypeSystem.java

index 5ac17e26fff63e5dc9e4637a2b9b06e32c6ae608..6999dac1968e9d38f4db2bbc7b0e8de355bcad1a 100644 (file)
@@ -12,6 +12,7 @@
 package org.aspectj.lang.reflect;
 
 import java.lang.ref.WeakReference;
+import java.util.Collections;
 import java.util.Map;
 import java.util.WeakHashMap;
 
@@ -24,7 +25,8 @@ import org.aspectj.internal.lang.reflect.AjTypeImpl;
  */
 public class AjTypeSystem {
        
-               private static Map<Class, WeakReference<AjType>> ajTypes = new WeakHashMap<Class,WeakReference<AjType>>();
+               private static Map<Class, WeakReference<AjType>> ajTypes = 
+                       Collections.synchronizedMap(new WeakHashMap<Class,WeakReference<AjType>>());
 
                /**
                 * Return the AspectJ runtime type representation of the given Java type.