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

Comparing jsr166/src/jdk7/java/util/concurrent/ConcurrentHashMap.java (file contents):
Revision 1.8 by jsr166, Fri Jan 18 04:23:27 2013 UTC vs.
Revision 1.9 by jsr166, Sat Jan 19 20:39:43 2013 UTC

# Line 6806 | Line 6806 | public class ConcurrentHashMap<K, V>
6806      private static final int ASHIFT;
6807  
6808      static {
6809        int ss;
6809          try {
6810              U = sun.misc.Unsafe.getUnsafe();
6811              Class<?> k = ConcurrentHashMap.class;
# Line 6825 | Line 6824 | public class ConcurrentHashMap<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          }
6833        if ((ss & (ss-1)) != 0)
6834            throw new Error("data type scale not a power of two");
6834      }
6835  
6836   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines