Description
If there is no leading markup in a MarkupComponentBorder before the <wicket:border/> tag, the following error will occur:
Unexpected tag encountered in markup of component border TestComponentBorder. Tag: <wicket:body/>, expected tag: <wicket:border>
Steps to reproduce:
Create a ComponentBorder with no leading markup before <wicket:border/>:
TestComponentBorder.html
--------------------------------------
<wicket:border>
<div class="input">
<wicket:body/>
</div>
</wicket:border>
TestComponentBorder.java
--------------------------------------
public class TestComponentBorder extends MarkupComponentBorder
{
}
This happens because the rendering loop calls stream.next(); when it starts, always skipping the first element. It should call stream.get() before the loop, then stream.next() at the end.