]> source.dussan.org Git - aspectj.git/commitdiff
allow for entries not getting into the ref queue quick enough
authoraclement <aclement>
Thu, 14 Jun 2007 13:33:48 +0000 (13:33 +0000)
committeraclement <aclement>
Thu, 14 Jun 2007 13:33:48 +0000 (13:33 +0000)
weaver/src/org/aspectj/weaver/World.java

index 3b27934cae8be4c3eebec7c34a83702a85bb3745..2774dc16c6c5b722ba6c93084bdcee66c20b6390 100644 (file)
@@ -856,20 +856,15 @@ public abstract class World implements Dump.INode {
                  private void processQueue() {
                        KeyedValue sv = null;
                        while ((sv = (KeyedValue)rq.poll())!=null) {
-                               map.remove(sv.key);
+                               Object o = map.get(sv.key);
+                               if(o == sv) map.remove(sv.key);
                        }
                  }
                
                  public Object get(Object key) {
                        KeyedValue value = (KeyedValue)map.get(key);
                        if (value==null) return null;
-                       if (value.get()==null) {
-                               // it got GC'd
-                               map.remove(value.key);
-                               return null;
-                       } else {
-                               return value.get();
-                       }
+                       return value.get();
                  }
 
                  public Object put(Object k, Object v) {