(Object[] array)
| 36 | } |
| 37 | |
| 38 | private void copyInto(Object[] array) { |
| 39 | if (startIndex <= endIndex) { |
| 40 | // only one copy needed |
| 41 | System.arraycopy(dataArray, startIndex, array, 0, size); |
| 42 | } else { |
| 43 | int firstCopyCount = dataArray.length - startIndex; |
| 44 | System.arraycopy(dataArray, startIndex, array, 0, firstCopyCount); |
| 45 | System.arraycopy(dataArray, 0, array, firstCopyCount, endIndex + 1); |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | private void ensureCapacity(int newSize) { |
| 50 | if (dataArray.length < newSize) { |
no test coverage detected