You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Richard Emberson (JIRA)" <ji...@apache.org> on 2010/12/03 20:50:12 UTC
[jira] Created: (WICKET-3223) OpaqueRegion subtract for-loop does
not process all rectangles
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.
[jira] Resolved: (WICKET-3223) OpaqueRegion subtract for-loop does
not process all rectangles
Posted by "Juergen Donnerstag (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-3223?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Juergen Donnerstag resolved WICKET-3223.
----------------------------------------
Resolution: Fixed
Fix Version/s: 1.5-M4
good catch
> 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
> Fix For: 1.5-M4
>
>
> 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.