/[classpath]/classpath/java/util/WeakHashMap.java
ViewVC logotype

Diff of /classpath/java/util/WeakHashMap.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.18.2.3 by gnu_andrew, Tue Aug 2 20:12:30 2005 UTC revision 1.18.2.4 by gnu_andrew, Sun Nov 27 21:00:37 2005 UTC
# Line 243  public class WeakHashMap<K,V> extends Ab Line 243  public class WeakHashMap<K,V> extends Ab
243            // This method will get inlined.            // This method will get inlined.
244            cleanQueue();            cleanQueue();
245            if (knownMod != modCount)            if (knownMod != modCount)
246              throw new ConcurrentModificationException();              throw new ConcurrentModificationException(knownMod + " != "
247                                                          + modCount);
248          }          }
249    
250          /**          /**
# Line 700  public class WeakHashMap<K,V> extends Ab Line 701  public class WeakHashMap<K,V> extends Ab
701      // bucket may be enqueued later by the garbage collection, and      // bucket may be enqueued later by the garbage collection, and
702      // internalRemove will be called a second time.      // internalRemove will be called a second time.
703      bucket.slot = -1;      bucket.slot = -1;
704      if (buckets[slot] == bucket)  
705        buckets[slot] = bucket.next;      WeakBucket prev = null;
706      else      WeakBucket next = buckets[slot];
707        {      while (next != bucket)
708          WeakBucket prev = buckets[slot];        {
709          /* This may throw a NullPointerException.  It shouldn't but if           if (next == null) throw new InternalError("WeakHashMap in incosistent state");
710           * a race condition occurred (two threads removing the same           prev = next;
711           * bucket at the same time) it may happen.  <br>           next = prev.next;
          * But with race condition many much worse things may happen  
          * anyway.  
          */  
         while (prev.next != bucket)  
           prev = prev.next;  
         prev.next = bucket.next;  
712        }        }
713        if (prev == null)
714          buckets[slot] = bucket.next;
715        else
716          prev.next = bucket.next;
717    
718      size--;      size--;
719    }    }
720    

Legend:
Removed from v.1.18.2.3  
changed lines
  Added in v.1.18.2.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26