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

Comparing jsr166/src/jdk8/java/util/concurrent/ConcurrentHashMap.java (file contents):
Revision 1.1 by jsr166, Sat Mar 26 06:22:49 2016 UTC vs.
Revision 1.4 by jsr166, Wed Mar 8 22:13:42 2017 UTC

# Line 1213 | Line 1213 | public class ConcurrentHashMap<K,V> exte
1213       */
1214      public KeySetView<K,V> keySet() {
1215          KeySetView<K,V> ks;
1216 <        return (ks = keySet) != null ? ks : (keySet = new KeySetView<K,V>(this, null));
1216 >        if ((ks = keySet) != null) return ks;
1217 >        return keySet = new KeySetView<K,V>(this, null);
1218      }
1219  
1220      /**
# Line 1236 | Line 1237 | public class ConcurrentHashMap<K,V> exte
1237       */
1238      public Collection<V> values() {
1239          ValuesView<K,V> vs;
1240 <        return (vs = values) != null ? vs : (values = new ValuesView<K,V>(this));
1240 >        if ((vs = values) != null) return vs;
1241 >        return values = new ValuesView<K,V>(this);
1242      }
1243  
1244      /**
# Line 1258 | Line 1260 | public class ConcurrentHashMap<K,V> exte
1260       */
1261      public Set<Map.Entry<K,V>> entrySet() {
1262          EntrySetView<K,V> es;
1263 <        return (es = entrySet) != null ? es : (entrySet = new EntrySetView<K,V>(this));
1263 >        if ((es = entrySet) != null) return es;
1264 >        return entrySet = new EntrySetView<K,V>(this);
1265      }
1266  
1267      /**
# Line 2529 | Line 2532 | public class ConcurrentHashMap<K,V> exte
2532       * A padded cell for distributing counts.  Adapted from LongAdder
2533       * and Striped64.  See their internal docs for explanation.
2534       */
2535 <    @jdk.internal.vm.annotation.Contended static final class CounterCell {
2535 >    @sun.misc.Contended static final class CounterCell {
2536          volatile long value;
2537          CounterCell(long x) { value = x; }
2538      }
# Line 3429 | Line 3432 | public class ConcurrentHashMap<K,V> exte
3432  
3433      static final class KeyIterator<K,V> extends BaseIterator<K,V>
3434          implements Iterator<K>, Enumeration<K> {
3435 <        KeyIterator(Node<K,V>[] tab, int index, int size, int limit,
3435 >        KeyIterator(Node<K,V>[] tab, int size, int index, int limit,
3436                      ConcurrentHashMap<K,V> map) {
3437 <            super(tab, index, size, limit, map);
3437 >            super(tab, size, index, limit, map);
3438          }
3439  
3440          public final K next() {
# Line 3449 | Line 3452 | public class ConcurrentHashMap<K,V> exte
3452  
3453      static final class ValueIterator<K,V> extends BaseIterator<K,V>
3454          implements Iterator<V>, Enumeration<V> {
3455 <        ValueIterator(Node<K,V>[] tab, int index, int size, int limit,
3455 >        ValueIterator(Node<K,V>[] tab, int size, int index, int limit,
3456                        ConcurrentHashMap<K,V> map) {
3457 <            super(tab, index, size, limit, map);
3457 >            super(tab, size, index, limit, map);
3458          }
3459  
3460          public final V next() {
# Line 3469 | Line 3472 | public class ConcurrentHashMap<K,V> exte
3472  
3473      static final class EntryIterator<K,V> extends BaseIterator<K,V>
3474          implements Iterator<Map.Entry<K,V>> {
3475 <        EntryIterator(Node<K,V>[] tab, int index, int size, int limit,
3475 >        EntryIterator(Node<K,V>[] tab, int size, int index, int limit,
3476                        ConcurrentHashMap<K,V> map) {
3477 <            super(tab, index, size, limit, map);
3477 >            super(tab, size, index, limit, map);
3478          }
3479  
3480          public final Map.Entry<K,V> next() {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines