OpaqueRegion subtract for-loop does not process all rectangles
--------------------------------------------------------------
Key: WICKET-3223
URL: https://issues.apache.org/jira/browse/WICKET-3223
Project: Wicket
Issue Type: Bug
Components: wicket-extensions
Affects Versions: 1.5-M3
Environment: all
Reporter: Richard Emberson
Priority: Minor
Don't know it this is a bug or not.
In the extendsions class OpaqueRegion, the subtract method has a for-loop that
works its way over the members of the workList:
// Go through work list to remove the given rectangle
for (int i = 0; i < workList.size(); i++)
In this loop is the following code:
if (rx1 <= x1 && rx2 >= x2)
{
// Whole rectangle is obscured
workList.remove(i);
}
The remove on the ArrayList removes the element at position i and shifts all
higher elements
of the list down one index. The element that was at i+1 is now at i.
But the loop then increments i, so the element that was at i+1 prior to the
removal of the
element at i, is now at position i and is never examined in the loop.
So, I do not know if this is correct or not, thanks
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.