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.95 by jsr166, Wed Aug 8 15:55:00 2007 UTC vs.
Revision 1.96 by jsr166, Sun May 18 23:47:56 2008 UTC

# Line 199 | Line 199 | public class ConcurrentHashMap<K, V> ext
199              this.value = value;
200          }
201  
202 <        @SuppressWarnings("unchecked")
203 <        static final <K,V> HashEntry<K,V>[] newArray(int i) {
204 <            return new HashEntry[i];
205 <        }
202 >        @SuppressWarnings("unchecked")
203 >        static final <K,V> HashEntry<K,V>[] newArray(int i) {
204 >            return new HashEntry[i];
205 >        }
206      }
207  
208      /**
# Line 290 | Line 290 | public class ConcurrentHashMap<K, V> ext
290              setTable(HashEntry.<K,V>newArray(initialCapacity));
291          }
292  
293 <        @SuppressWarnings("unchecked")
293 >        @SuppressWarnings("unchecked")
294          static final <K,V> Segment<K,V>[] newArray(int i) {
295 <            return new Segment[i];
295 >            return new Segment[i];
296          }
297  
298          /**
# Line 918 | Line 918 | public class ConcurrentHashMap<K, V> ext
918       * @throws NullPointerException if the specified key is null
919       */
920      public V remove(Object key) {
921 <        int hash = hash(key.hashCode());
921 >        int hash = hash(key.hashCode());
922          return segmentFor(hash).remove(key, hash, null);
923      }
924  
# Line 1110 | Line 1110 | public class ConcurrentHashMap<K, V> ext
1110      }
1111  
1112      final class KeyIterator
1113 <        extends HashIterator
1114 <        implements Iterator<K>, Enumeration<K>
1113 >        extends HashIterator
1114 >        implements Iterator<K>, Enumeration<K>
1115      {
1116          public K next()        { return super.nextEntry().key; }
1117          public K nextElement() { return super.nextEntry().key; }
1118      }
1119  
1120      final class ValueIterator
1121 <        extends HashIterator
1122 <        implements Iterator<V>, Enumeration<V>
1121 >        extends HashIterator
1122 >        implements Iterator<V>, Enumeration<V>
1123      {
1124          public V next()        { return super.nextEntry().value; }
1125          public V nextElement() { return super.nextEntry().value; }
# Line 1130 | Line 1130 | public class ConcurrentHashMap<K, V> ext
1130       * setValue changes to the underlying map.
1131       */
1132      final class WriteThroughEntry
1133 <        extends AbstractMap.SimpleEntry<K,V>
1133 >        extends AbstractMap.SimpleEntry<K,V>
1134      {
1135          WriteThroughEntry(K k, V v) {
1136              super(k,v);
# Line 1145 | Line 1145 | public class ConcurrentHashMap<K, V> ext
1145           * removed in which case the put will re-establish). We do not
1146           * and cannot guarantee more.
1147           */
1148 <        public V setValue(V value) {
1148 >        public V setValue(V value) {
1149              if (value == null) throw new NullPointerException();
1150              V v = super.setValue(value);
1151              ConcurrentHashMap.this.put(getKey(), value);
# Line 1154 | Line 1154 | public class ConcurrentHashMap<K, V> ext
1154      }
1155  
1156      final class EntryIterator
1157 <        extends HashIterator
1158 <        implements Iterator<Entry<K,V>>
1157 >        extends HashIterator
1158 >        implements Iterator<Entry<K,V>>
1159      {
1160          public Map.Entry<K,V> next() {
1161              HashEntry<K,V> e = super.nextEntry();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines