FULL PRODUCT VERSION :
N/A
ADDITIONAL OS VERSION INFORMATION :
Multiple OSes
A DESCRIPTION OF THE PROBLEM :
The FilteredRowSetImpl class will iterate over a row twice under certain circumstance because it doesn't handle the logic correctly. Source code is as follows:
CURRENT SOURCE:
boolean bool = false;
for(int rows=this.getRow(); rows<=this.size();rows++) {
bool = super.internalNext();
if( p == null) {
return bool;
}
if(p.evaluate(this)){
break;
}
}
return bool;
Ignoring the bug with the "<=" operation in the for loop, this code never recognizes that a false could be returned the super.internalNext() when p is not null. If p evaluates to true, the method returns true when it should have returned false. The code to fix this issue (including the loop bug) could be as follows:
while(super.internalNext()){
if(p != null){
return p.evaluate(this);
}
return true;
}
return false;
If super.internalNext() returns false, the method returns false
If super.internalNext returns true and the predicate evaluates false, the method returns false
If super.internalNext() returns true and the predicate evalues true, the method returns true.
If super.internalNext() returns true and the predicate is null, the method returns true.
REPRODUCIBILITY :
This bug can be reproduced always.
###@###.### 2005-03-02 10:08:37 GMT
N/A
ADDITIONAL OS VERSION INFORMATION :
Multiple OSes
A DESCRIPTION OF THE PROBLEM :
The FilteredRowSetImpl class will iterate over a row twice under certain circumstance because it doesn't handle the logic correctly. Source code is as follows:
CURRENT SOURCE:
boolean bool = false;
for(int rows=this.getRow(); rows<=this.size();rows++) {
bool = super.internalNext();
if( p == null) {
return bool;
}
if(p.evaluate(this)){
break;
}
}
return bool;
Ignoring the bug with the "<=" operation in the for loop, this code never recognizes that a false could be returned the super.internalNext() when p is not null. If p evaluates to true, the method returns true when it should have returned false. The code to fix this issue (including the loop bug) could be as follows:
while(super.internalNext()){
if(p != null){
return p.evaluate(this);
}
return true;
}
return false;
If super.internalNext() returns false, the method returns false
If super.internalNext returns true and the predicate evaluates false, the method returns false
If super.internalNext() returns true and the predicate evalues true, the method returns true.
If super.internalNext() returns true and the predicate is null, the method returns true.
REPRODUCIBILITY :
This bug can be reproduced always.
###@###.### 2005-03-02 10:08:37 GMT