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.283 by jsr166, Sat Sep 19 20:34:42 2015 UTC vs.
Revision 1.284 by jsr166, Sat Sep 19 21:39:44 2015 UTC

# Line 4423 | Line 4423 | public class ConcurrentHashMap<K,V> exte
4423          public abstract boolean contains(Object o);
4424          public abstract boolean remove(Object o);
4425  
4426 <        private static final String oomeMsg = "Required array size too large";
4426 >        private static final String OOME_MSG = "Required array size too large";
4427  
4428          public final Object[] toArray() {
4429              long sz = map.mappingCount();
4430              if (sz > MAX_ARRAY_SIZE)
4431 <                throw new OutOfMemoryError(oomeMsg);
4431 >                throw new OutOfMemoryError(OOME_MSG);
4432              int n = (int)sz;
4433              Object[] r = new Object[n];
4434              int i = 0;
4435              for (E e : this) {
4436                  if (i == n) {
4437                      if (n >= MAX_ARRAY_SIZE)
4438 <                        throw new OutOfMemoryError(oomeMsg);
4438 >                        throw new OutOfMemoryError(OOME_MSG);
4439                      if (n >= MAX_ARRAY_SIZE - (MAX_ARRAY_SIZE >>> 1) - 1)
4440                          n = MAX_ARRAY_SIZE;
4441                      else
# Line 4451 | Line 4451 | public class ConcurrentHashMap<K,V> exte
4451          public final <T> T[] toArray(T[] a) {
4452              long sz = map.mappingCount();
4453              if (sz > MAX_ARRAY_SIZE)
4454 <                throw new OutOfMemoryError(oomeMsg);
4454 >                throw new OutOfMemoryError(OOME_MSG);
4455              int m = (int)sz;
4456              T[] r = (a.length >= m) ? a :
4457                  (T[])java.lang.reflect.Array
# Line 4461 | Line 4461 | public class ConcurrentHashMap<K,V> exte
4461              for (E e : this) {
4462                  if (i == n) {
4463                      if (n >= MAX_ARRAY_SIZE)
4464 <                        throw new OutOfMemoryError(oomeMsg);
4464 >                        throw new OutOfMemoryError(OOME_MSG);
4465                      if (n >= MAX_ARRAY_SIZE - (MAX_ARRAY_SIZE >>> 1) - 1)
4466                          n = MAX_ARRAY_SIZE;
4467                      else

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines