Details
Description
org.apache.wicket.MarkupContainer
Method variable children was stepping-on/masking the global variable children in the children_get(), children_indexOf(), children_set() and onBeforeRenderChildren(). The simple solution was to rename the local method children to gchildren.
Could not attach diff, so it's pasted below:
- This patch file was generated by NetBeans IDE
- Following Index: paths are relative to: /home/athomson/Java/Wicket/wicket-svn/wicket/src/main/java/org/apache/wicket
- This patch can be applied using context Tools: Patch action on respective folder.
- It uses platform neutral UTF-8 encoding and \n newlines.
- Above lines and this line are ignored by the patching process.
Index: MarkupContainer.java-
- MarkupContainer.java Base (BASE)
+++ MarkupContainer.java Locally Modified (Based On LOCAL)
@@ -1043,21 +1043,21 @@
}
else
{
- MarkupContainer.java Base (BASE)
-
- Object[] children = null;
+ Object[] gchildren = null;
if (this.children instanceof ChildList) { // we have a list - children = ((ChildList)this.children).childs; + gchildren = ((ChildList)this.children).childs; }else
{ // we have a object array - children = (Object[])this.children; + gchildren = (Object[])this.children; } - component = postprocess(children[index], reconstruct, this, index);
- if (children[index] != component)
+ component = postprocess(gchildren[index], reconstruct, this, index);
+ if (gchildren[index] != component) { - children[index] = component; + gchildren[index] = component; }}
}
@@ -1112,26 +1112,26 @@
}
else
{ - Object[] children = null;
+ Object[] gchildren = null;
int size = 0;
if (this.children instanceof ChildList) { - children = ((ChildList)this.children).childs; + gchildren = ((ChildList)this.children).childs; size = ((ChildList)this.children).size; }
else
{ - children = (Object[])this.children; - size = children.length; + gchildren = (Object[])this.children; + size = gchildren.length; }
for (int i = 0; i < size; i++)
{
- if (getId(children[i]).equals(id))
+ if (getId(gchildren[i]).equals(id))
{
- component = (Component)postprocess(children[i], true, this, i);
- if (children[i] != component)
+ component = (Component)postprocess(gchildren[i], true, this, i);
+ if (gchildren[i] != component)
{ - children[i] = component; + gchildren[i] = component; }
break;
}
@@ -1161,21 +1161,21 @@
else
{
int size = 0;
- Object[] children;
+ Object[] gchildren;
if (this.children instanceof Object[])
{- children = (Object[])this.children;- size = children.length;+ gchildren = (Object[])this.children;+ size = gchildren.length; }
else
{- children = ((ChildList)this.children).childs;+ gchildren = ((ChildList)this.children).childs; size = ((ChildList)this.children).size; }
for (int i = 0; i < size; i++)
{
- if (getId(children[i]).equals(child.getId()))
+ if (getId(gchildren[i]).equals(child.getId())) { return i; }@@ -1282,9 +1282,9 @@
{ - final Object[] children = (Object[])this.children; - replaced = children[index]; - children[index] = child; + final Object[] gchildren = (Object[])this.children; + replaced = gchildren[index]; + gchildren[index] = child; }
}
else}
}
@@ -1698,14 +1698,14 @@
// We need to copy the children list because the children components can
// modify the hierarchy in their onBeforeRender.
- Component[] children = copyChildren();
+ Component[] gchildren = copyChildren();
try
{
// Loop through child components - for (int i = 0; i < children.length; i++)
+ for (int i = 0; i < gchildren.length; i++)
{
// Get next child - final Component child = children[i];
+ final Component child = gchildren[i];
// Call begin request on the child
// We need to check whether the child's wasn't removed from the