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.87 by jsr166, Wed Jan 9 02:51:36 2013 UTC vs.
Revision 1.89 by jsr166, Sat Jan 19 20:39:43 2013 UTC

# Line 4577 | Line 4577 | public class ConcurrentHashMapV8<K, V>
4577      /**
4578       * Base class for views.
4579       */
4580 <    static abstract class CHMView<K, V> {
4580 >    abstract static class CHMView<K, V> {
4581          final ConcurrentHashMapV8<K, V> map;
4582          CHMView(ConcurrentHashMapV8<K, V> map)  { this.map = map; }
4583  
# Line 4593 | Line 4593 | public class ConcurrentHashMapV8<K, V>
4593          public final void clear()               { map.clear(); }
4594  
4595          // implementations below rely on concrete classes supplying these
4596 <        abstract public Iterator<?> iterator();
4597 <        abstract public boolean contains(Object o);
4598 <        abstract public boolean remove(Object o);
4596 >        public abstract Iterator<?> iterator();
4597 >        public abstract boolean contains(Object o);
4598 >        public abstract boolean remove(Object o);
4599  
4600          private static final String oomeMsg = "Required array size too large";
4601  
# Line 6804 | Line 6804 | public class ConcurrentHashMapV8<K, V>
6804      private static final int ASHIFT;
6805  
6806      static {
6807        int ss;
6807          try {
6808              U = getUnsafe();
6809              Class<?> k = ConcurrentHashMapV8.class;
# Line 6823 | Line 6822 | public class ConcurrentHashMapV8<K, V>
6822                  (ck.getDeclaredField("value"));
6823              Class<?> sc = Node[].class;
6824              ABASE = U.arrayBaseOffset(sc);
6825 <            ss = U.arrayIndexScale(sc);
6826 <            ASHIFT = 31 - Integer.numberOfLeadingZeros(ss);
6825 >            int scale = U.arrayIndexScale(sc);
6826 >            if ((scale & (scale - 1)) != 0)
6827 >                throw new Error("data type scale not a power of two");
6828 >            ASHIFT = 31 - Integer.numberOfLeadingZeros(scale);
6829          } catch (Exception e) {
6830              throw new Error(e);
6831          }
6831        if ((ss & (ss-1)) != 0)
6832            throw new Error("data type scale not a power of two");
6832      }
6833  
6834      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines