(int required)
| 500 | } |
| 501 | |
| 502 | private void growBy(int required) { |
| 503 | int adding = 0; |
| 504 | if (capacityIncrement <= 0) { |
| 505 | if ((adding = elementData.length) == 0) { |
| 506 | adding = required; |
| 507 | } |
| 508 | while (adding < required) { |
| 509 | adding += adding; |
| 510 | } |
| 511 | } else { |
| 512 | adding = (required / capacityIncrement) * capacityIncrement; |
| 513 | if (adding < required) { |
| 514 | adding += capacityIncrement; |
| 515 | } |
| 516 | } |
| 517 | E[] newData = newElementArray(elementData.length + adding); |
| 518 | System.arraycopy(elementData, 0, newData, 0, elementCount); |
| 519 | elementData = newData; |
| 520 | } |
| 521 | |
| 522 | /// Returns an integer hash code for the receiver. Objects which are equal |
| 523 | /// return the same value for this method. |
no test coverage detected