ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/jsr166e/ConcurrentHashMapV8.java
(Generate patch)

Comparing jsr166/src/jsr166e/ConcurrentHashMapV8.java (file contents):
Revision 1.88 by jsr166, Fri Jan 18 04:23:27 2013 UTC vs.
Revision 1.92 by jsr166, Mon Jan 28 17:27:03 2013 UTC

# Line 1785 | Line 1785 | public class ConcurrentHashMapV8<K, V>
1785                              }
1786                          }
1787                          if (len != 0) {
1788 <                            if (len > 1)
1788 >                            if (len > 1) {
1789                                  addCount(delta, len);
1790 +                                delta = 0L;
1791 +                            }
1792                              break;
1793                          }
1794                      }
# Line 1975 | Line 1977 | public class ConcurrentHashMapV8<K, V>
1977          }
1978      }
1979  
1980 <    /*
1980 >    /**
1981       * Moves and/or copies the nodes in each bin to new table. See
1982       * above for explanation.
1983       */
# Line 3371 | Line 3373 | public class ConcurrentHashMapV8<K, V>
3373       * of each (key, value).
3374       *
3375       * @param transformer a function returning the transformation
3376 <     * for an element, or null of there is no transformation (in
3376 >     * for an element, or null if there is no transformation (in
3377       * which case the action is not applied).
3378       * @param action the action
3379       */
# Line 3415 | Line 3417 | public class ConcurrentHashMapV8<K, V>
3417       * combine values, or null if none.
3418       *
3419       * @param transformer a function returning the transformation
3420 <     * for an element, or null of there is no transformation (in
3420 >     * for an element, or null if there is no transformation (in
3421       * which case it is not combined).
3422       * @param reducer a commutative associative combining function
3423       * @return the result of accumulating the given transformation
# Line 3528 | Line 3530 | public class ConcurrentHashMapV8<K, V>
3530       * of each key.
3531       *
3532       * @param transformer a function returning the transformation
3533 <     * for an element, or null of there is no transformation (in
3533 >     * for an element, or null if there is no transformation (in
3534       * which case the action is not applied).
3535       * @param action the action
3536       */
# Line 3593 | Line 3595 | public class ConcurrentHashMapV8<K, V>
3595       * null if none.
3596       *
3597       * @param transformer a function returning the transformation
3598 <     * for an element, or null of there is no transformation (in
3598 >     * for an element, or null if there is no transformation (in
3599       * which case it is not combined).
3600       * @param reducer a commutative associative combining function
3601       * @return the result of accumulating the given transformation
# Line 3706 | Line 3708 | public class ConcurrentHashMapV8<K, V>
3708       * of each value.
3709       *
3710       * @param transformer a function returning the transformation
3711 <     * for an element, or null of there is no transformation (in
3711 >     * for an element, or null if there is no transformation (in
3712       * which case the action is not applied).
3713       */
3714      public <U> void forEachValueSequentially
# Line 3766 | Line 3768 | public class ConcurrentHashMapV8<K, V>
3768       * null if none.
3769       *
3770       * @param transformer a function returning the transformation
3771 <     * for an element, or null of there is no transformation (in
3771 >     * for an element, or null if there is no transformation (in
3772       * which case it is not combined).
3773       * @param reducer a commutative associative combining function
3774       * @return the result of accumulating the given transformation
# Line 3880 | Line 3882 | public class ConcurrentHashMapV8<K, V>
3882       * of each entry.
3883       *
3884       * @param transformer a function returning the transformation
3885 <     * for an element, or null of there is no transformation (in
3885 >     * for an element, or null if there is no transformation (in
3886       * which case the action is not applied).
3887       * @param action the action
3888       */
# Line 3943 | Line 3945 | public class ConcurrentHashMapV8<K, V>
3945       * or null if none.
3946       *
3947       * @param transformer a function returning the transformation
3948 <     * for an element, or null of there is no transformation (in
3948 >     * for an element, or null if there is no transformation (in
3949       * which case it is not combined).
3950       * @param reducer a commutative associative combining function
3951       * @return the result of accumulating the given transformation
# Line 4055 | Line 4057 | public class ConcurrentHashMapV8<K, V>
4057       * of each (key, value).
4058       *
4059       * @param transformer a function returning the transformation
4060 <     * for an element, or null of there is no transformation (in
4060 >     * for an element, or null if there is no transformation (in
4061       * which case the action is not applied).
4062       * @param action the action
4063       */
# Line 4090 | Line 4092 | public class ConcurrentHashMapV8<K, V>
4092       * combine values, or null if none.
4093       *
4094       * @param transformer a function returning the transformation
4095 <     * for an element, or null of there is no transformation (in
4095 >     * for an element, or null if there is no transformation (in
4096       * which case it is not combined).
4097       * @param reducer a commutative associative combining function
4098       * @return the result of accumulating the given transformation
# Line 4178 | Line 4180 | public class ConcurrentHashMapV8<K, V>
4180       * of each key.
4181       *
4182       * @param transformer a function returning the transformation
4183 <     * for an element, or null of there is no transformation (in
4183 >     * for an element, or null if there is no transformation (in
4184       * which case the action is not applied).
4185       * @param action the action
4186       */
# Line 4227 | Line 4229 | public class ConcurrentHashMapV8<K, V>
4229       * null if none.
4230       *
4231       * @param transformer a function returning the transformation
4232 <     * for an element, or null of there is no transformation (in
4232 >     * for an element, or null if there is no transformation (in
4233       * which case it is not combined).
4234       * @param reducer a commutative associative combining function
4235       * @return the result of accumulating the given transformation
# Line 4315 | Line 4317 | public class ConcurrentHashMapV8<K, V>
4317       * of each value.
4318       *
4319       * @param transformer a function returning the transformation
4320 <     * for an element, or null of there is no transformation (in
4320 >     * for an element, or null if there is no transformation (in
4321       * which case the action is not applied).
4322       */
4323      public <U> void forEachValueInParallel
# Line 4362 | Line 4364 | public class ConcurrentHashMapV8<K, V>
4364       * null if none.
4365       *
4366       * @param transformer a function returning the transformation
4367 <     * for an element, or null of there is no transformation (in
4367 >     * for an element, or null if there is no transformation (in
4368       * which case it is not combined).
4369       * @param reducer a commutative associative combining function
4370       * @return the result of accumulating the given transformation
# Line 4450 | Line 4452 | public class ConcurrentHashMapV8<K, V>
4452       * of each entry.
4453       *
4454       * @param transformer a function returning the transformation
4455 <     * for an element, or null of there is no transformation (in
4455 >     * for an element, or null if there is no transformation (in
4456       * which case the action is not applied).
4457       * @param action the action
4458       */
# Line 4498 | Line 4500 | public class ConcurrentHashMapV8<K, V>
4500       * or null if none.
4501       *
4502       * @param transformer a function returning the transformation
4503 <     * for an element, or null of there is no transformation (in
4503 >     * for an element, or null if there is no transformation (in
4504       * which case it is not combined).
4505       * @param reducer a commutative associative combining function
4506       * @return the result of accumulating the given transformation
# Line 6804 | Line 6806 | public class ConcurrentHashMapV8<K, V>
6806      private static final int ASHIFT;
6807  
6808      static {
6807        int ss;
6809          try {
6810              U = getUnsafe();
6811              Class<?> k = ConcurrentHashMapV8.class;
# Line 6823 | Line 6824 | public class ConcurrentHashMapV8<K, V>
6824                  (ck.getDeclaredField("value"));
6825              Class<?> sc = Node[].class;
6826              ABASE = U.arrayBaseOffset(sc);
6827 <            ss = U.arrayIndexScale(sc);
6828 <            ASHIFT = 31 - Integer.numberOfLeadingZeros(ss);
6827 >            int scale = U.arrayIndexScale(sc);
6828 >            if ((scale & (scale - 1)) != 0)
6829 >                throw new Error("data type scale not a power of two");
6830 >            ASHIFT = 31 - Integer.numberOfLeadingZeros(scale);
6831          } catch (Exception e) {
6832              throw new Error(e);
6833          }
6831        if ((ss & (ss-1)) != 0)
6832            throw new Error("data type scale not a power of two");
6834      }
6835  
6836      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines