(int required)
| 470 | } |
| 471 | |
| 472 | private void growBy(int required) { |
| 473 | int adding = 0; |
| 474 | if (capacityIncrement <= 0) { |
| 475 | if ((adding = elementData.length) == 0) { |
| 476 | adding = required; |
| 477 | } |
| 478 | while (adding < required) { |
| 479 | adding += adding; |
| 480 | } |
| 481 | } else { |
| 482 | adding = (required / capacityIncrement) * capacityIncrement; |
| 483 | if (adding < required) { |
| 484 | adding += capacityIncrement; |
| 485 | } |
| 486 | } |
| 487 | E[] newData = newElementArray(elementData.length + adding); |
| 488 | System.arraycopy(elementData, 0, newData, 0, elementCount); |
| 489 | elementData = newData; |
| 490 | } |
| 491 | |
| 492 | /** |
| 493 | * Returns an integer hash code for the receiver. Objects which are equal |
no test coverage detected