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.166 by jsr166, Sat Jan 19 17:39:10 2013 UTC vs.
Revision 1.167 by jsr166, Sat Jan 19 20:39:43 2013 UTC

# Line 6709 | Line 6709 | public class ConcurrentHashMap<K, V>
6709      private static final int ASHIFT;
6710  
6711      static {
6712        int ss;
6712          try {
6713              U = sun.misc.Unsafe.getUnsafe();
6714              Class<?> k = ConcurrentHashMap.class;
# Line 6728 | Line 6727 | public class ConcurrentHashMap<K, V>
6727                  (ck.getDeclaredField("value"));
6728              Class<?> sc = Node[].class;
6729              ABASE = U.arrayBaseOffset(sc);
6730 <            ss = U.arrayIndexScale(sc);
6731 <            ASHIFT = 31 - Integer.numberOfLeadingZeros(ss);
6730 >            int scale = U.arrayIndexScale(sc);
6731 >            if ((scale & (scale - 1)) != 0)
6732 >                throw new Error("data type scale not a power of two");
6733 >            ASHIFT = 31 - Integer.numberOfLeadingZeros(scale);
6734          } catch (Exception e) {
6735              throw new Error(e);
6736          }
6736        if ((ss & (ss-1)) != 0)
6737            throw new Error("data type scale not a power of two");
6737      }
6738  
6739   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines