(int required)
| 445 | } |
| 446 | |
| 447 | private void growBy(int required) { |
| 448 | int adding = 0; |
| 449 | if (capacityIncrement <= 0) { |
| 450 | if ((adding = elementData.length) == 0) { |
| 451 | adding = required; |
| 452 | } |
| 453 | while (adding < required) { |
| 454 | adding += adding; |
| 455 | } |
| 456 | } else { |
| 457 | adding = (required / capacityIncrement) * capacityIncrement; |
| 458 | if (adding < required) { |
| 459 | adding += capacityIncrement; |
| 460 | } |
| 461 | } |
| 462 | E[] newData = newElementArray(elementData.length + adding); |
| 463 | System.arraycopy(elementData, 0, newData, 0, elementCount); |
| 464 | elementData = newData; |
| 465 | } |
| 466 | |
| 467 | /** |
| 468 | * Returns an integer hash code for the receiver. Objects which are equal |
no test coverage detected