-
Enhancement
-
Resolution: Won't Fix
-
P4
-
None
-
8
-
generic
-
generic
ADDITIONAL SYSTEM INFORMATION :
Linux / jdk - 8
A DESCRIPTION OF THE PROBLEM :
We generate unit test cases by our tool automatically.
And the unit test case failed.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
This is the unit test case:
@Test
public void test_shiftLeft_5_5(){
long long1 = 9223372036854775807L;
long long2 = 1L;
long[] longArray3 = {-1L, 1L, -1L, 0L};
BitVector bitVector0 = new BitVector(longArray3);
bitVector0.shiftLeft(long1, long2);
}
ACTUAL -
throw ArrayIndexOutOfBoundsException
---------- BEGIN SOURCE ----------
public void shiftLeft(long shift, long length) {
if (shift != 0L) {
int leftShift = (int)(shift & 63L);
int rightShift = 64 - leftShift;
int slotShift = (int)(shift >> 6);
int slotCount = this.bits.length - slotShift;
int slot;
int from;
if (leftShift == 0) {
slot = 0;
for(from = slotShift; slot < slotCount; ++from) {
this.bits[slot] = this.slot(from);
++slot;
}
} else {
slot = 0;
for(from = slotShift; slot < slotCount; ++slot) {
long[] var10000 = this.bits;
long var10002 = this.slot(from) >>> leftShift;
++from;
var10000[slot] = var10002 | this.slot(from) << rightShift;
}
}
}
this.resize(length);
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Maybe you should compare slot with the length of var10000
Linux / jdk - 8
A DESCRIPTION OF THE PROBLEM :
We generate unit test cases by our tool automatically.
And the unit test case failed.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
This is the unit test case:
@Test
public void test_shiftLeft_5_5(){
long long1 = 9223372036854775807L;
long long2 = 1L;
long[] longArray3 = {-1L, 1L, -1L, 0L};
BitVector bitVector0 = new BitVector(longArray3);
bitVector0.shiftLeft(long1, long2);
}
ACTUAL -
throw ArrayIndexOutOfBoundsException
---------- BEGIN SOURCE ----------
public void shiftLeft(long shift, long length) {
if (shift != 0L) {
int leftShift = (int)(shift & 63L);
int rightShift = 64 - leftShift;
int slotShift = (int)(shift >> 6);
int slotCount = this.bits.length - slotShift;
int slot;
int from;
if (leftShift == 0) {
slot = 0;
for(from = slotShift; slot < slotCount; ++from) {
this.bits[slot] = this.slot(from);
++slot;
}
} else {
slot = 0;
for(from = slotShift; slot < slotCount; ++slot) {
long[] var10000 = this.bits;
long var10002 = this.slot(from) >>> leftShift;
++from;
var10000[slot] = var10002 | this.slot(from) << rightShift;
}
}
}
this.resize(length);
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Maybe you should compare slot with the length of var10000