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

Comparing jsr166/src/extra166y/CustomConcurrentHashMap.java (file contents):
Revision 1.28 by jsr166, Sat Jan 19 20:39:43 2013 UTC vs.
Revision 1.29 by jsr166, Sat Jan 19 21:37:46 2013 UTC

# Line 391 | Line 391 | public class CustomConcurrentHashMap<K,
391          final Node[] resizeTable(CustomConcurrentHashMap cchm) {
392              Node[] oldTable = table;
393              if (oldTable == null)
394 <                return table = (Node[])
395 <                    new Node[cchm.initialSegmentCapacity];
394 >                return table = new Node[cchm.initialSegmentCapacity];
395  
396              int oldCapacity = oldTable.length;
397              if (oldCapacity >= MAX_SEGMENT_CAPACITY)
398                  return oldTable;
399 <            Node[] newTable =
401 <                (Node[])new Node[oldCapacity<<1];
399 >            Node[] newTable = new Node[oldCapacity<<1];
400              int sizeMask = newTable.length - 1;
401              NodeFactory fac = cchm.factory;
402              for (int i = 0; i < oldCapacity ; i++) {
# Line 540 | Line 538 | public class CustomConcurrentHashMap<K,
538                  capacity = MAX_SEGMENT_CAPACITY;
539              this.initialSegmentCapacity = capacity;
540          }
541 <        this.segments = (Segment[])new Segment[NSEGMENTS];
541 >        this.segments = new Segment[NSEGMENTS];
542      }
543  
544      /**
# Line 1576 | Line 1574 | public class CustomConcurrentHashMap<K,
1574      private void readObject(java.io.ObjectInputStream s)
1575          throws IOException, ClassNotFoundException {
1576          s.defaultReadObject();
1577 <        this.segments = (Segment[])(new Segment[NSEGMENTS]);
1577 >        this.segments = new Segment[NSEGMENTS];
1578          for (;;) {
1579              K key = (K) s.readObject();
1580              V value = (V) s.readObject();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines