ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/concurrent/ConcurrentHashMap.java
(Generate patch)

Comparing jsr166/src/main/java/util/concurrent/ConcurrentHashMap.java (file contents):
Revision 1.28 by dl, Mon Nov 10 17:31:23 2003 UTC vs.
Revision 1.29 by dl, Wed Nov 12 01:04:24 2003 UTC

# Line 249 | Line 249 | public class ConcurrentHashMap<K, V> ext
249  
250          /* Specialized implementations of map methods */
251  
252 <        V get(K key, int hash) {
252 >        V get(Object key, int hash) {
253              if (count != 0) { // read-volatile
254                  HashEntry[] tab = table;
255                  int index = hash & (tab.length - 1);
# Line 332 | Line 332 | public class ConcurrentHashMap<K, V> ext
332               * offset. We eliminate unnecessary node creation by catching
333               * cases where old nodes can be reused because their next
334               * fields won't change. Statistically, at the default
335 <             * threshhold, only about one-sixth of them need cloning when
335 >             * threshold, only about one-sixth of them need cloning when
336               * a table doubles. The nodes they replace will be garbage
337               * collectable as soon as they are no longer referenced by any
338               * reader thread that may be in the midst of traversing table
# Line 408 | Line 408 | public class ConcurrentHashMap<K, V> ext
408                      return null;
409  
410                  // All entries following removed node can stay in list, but
411 <                // all preceeding ones need to be cloned.
411 >                // all preceding ones need to be cloned.
412                  HashEntry<K,V> newFirst = e.next;
413                  for (HashEntry<K,V> p = first; p != e; p = p.next)
414                      newFirst = new HashEntry<K,V>(p.hash, p.key,
# Line 642 | Line 642 | public class ConcurrentHashMap<K, V> ext
642       */
643      public V get(Object key) {
644          int hash = hash(key); // throws NullPointerException if key null
645 <        return segmentFor(hash).get((K) key, hash);
645 >        return segmentFor(hash).get(key, hash);
646      }
647  
648      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines