-
Bug
-
Resolution: Unresolved
-
P4
-
None
-
8, 25
-
generic
-
generic
A DESCRIPTION OF THE PROBLEM :
public boolean hasNext() {
return cursor != size;
}
In this method we are checking cursor !=size, It will logically work fine but internally if somehow in future created new method which changes cursor variable manually, and after increasing it to more than size of ArrayList it will also return true, which cause affect to the purpose of this method. So we need to change instead to cursor<size .
REGRESSION : Last worked in version 24.0.1
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
public boolean hasNext() {
return cursor != size;
}
Change cursor to size+1 or more internally
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
false
---------- BEGIN SOURCE ----------
Logical change
---------- END SOURCE ----------
public boolean hasNext() {
return cursor != size;
}
In this method we are checking cursor !=size, It will logically work fine but internally if somehow in future created new method which changes cursor variable manually, and after increasing it to more than size of ArrayList it will also return true, which cause affect to the purpose of this method. So we need to change instead to cursor<size .
REGRESSION : Last worked in version 24.0.1
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
public boolean hasNext() {
return cursor != size;
}
Change cursor to size+1 or more internally
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
false
---------- BEGIN SOURCE ----------
Logical change
---------- END SOURCE ----------