-
Bug
-
Resolution: Fixed
-
P4
-
8
-
b112
-
Not verified
Unsafe long to int typecast:
public E get(long index) {
......
return curChunk[((int) index)];
......
return spine[j][((int) (index - priorElementCount[j]))];
public E[] asArray(IntFunction<E[]> arrayFactory) {
// @@@ will fail for size == MAX_VALUE
E[] result = arrayFactory.apply((int) count());
public T_ARR asPrimitiveArray() {
// @@@ will fail for size == MAX_VALUE
T_ARR result = newArray((int) count());
static class OfInt extends SpinedBuffer.OfPrimitive<Integer, int[], IntConsumer>
........
public int get(long index) {
int ch = chunkFor(index);
if (spineIndex == 0 && ch == 0)
return curChunk[(int) index];
else
return spine[ch][(int) (index-priorElementCount[ch])];
}
Same for:
static class OfLong
static class OfDouble
public E get(long index) {
......
return curChunk[((int) index)];
......
return spine[j][((int) (index - priorElementCount[j]))];
public E[] asArray(IntFunction<E[]> arrayFactory) {
// @@@ will fail for size == MAX_VALUE
E[] result = arrayFactory.apply((int) count());
public T_ARR asPrimitiveArray() {
// @@@ will fail for size == MAX_VALUE
T_ARR result = newArray((int) count());
static class OfInt extends SpinedBuffer.OfPrimitive<Integer, int[], IntConsumer>
........
public int get(long index) {
int ch = chunkFor(index);
if (spineIndex == 0 && ch == 0)
return curChunk[(int) index];
else
return spine[ch][(int) (index-priorElementCount[ch])];
}
Same for:
static class OfLong
static class OfDouble