Buggy code:
public abstract class Border extends WebMarkupContainerWithAssociatedMarkup implements IComponentResolver { private static final long serialVersionUID = 1L ; public static final String BODY = "body" ; public static final String BORDER = "border" ; private final Border . BorderBodyContainer body ; private transient MarkupStream originalMarkupStream ; private transient ComponentTag openTag ; private int beginOfBodyIndex ; public Border ( final String id ) { } public Border ( final String id , final IModel < ? > model ) { } public final Border . BorderBodyContainer getBodyContainer ( ) { } Border . BorderBodyContainer newBorderBodyContainer ( final String id ) { } @ Override public MarkupContainer add ( final Component ... children ) { } @ Override public Component add ( final IBehavior ... behaviors ) { } public MarkupContainer addToBorder ( final Component ... children ) { } public Component addToBorder ( final IBehavior ... behaviors ) { } public Border addToBorderBody ( final Component ... child ) { } public Component addToBorderBody ( final IBehavior ... behaviors ) { } public final Component getFromBorderBody ( final String path ) { } public Component resolve ( final MarkupContainer container , final MarkupStream markupStream , final ComponentTag tag ) { } @ Override protected void onComponentTag ( final ComponentTag tag ) { } @ Override protected final void onComponentTagBody ( final MarkupStream markupStream , final ComponentTag openTag ) { } @ Override public IMarkupFragment getMarkup ( final Component child ) { IMarkupFragment markup = getAssociatedMarkup ( ) ; if ( markup == null ) { throw new MarkupException ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>find<seq2seq4repair_space>associated<seq2seq4repair_space>markup<seq2seq4repair_space>file<seq2seq4repair_space>for<seq2seq4repair_space>Border:<seq2seq4repair_space>" + ( this . toString ( ) ) ) ) ; } IMarkupFragment childMarkup = null ; for ( int i = 0 ; i < ( markup . size ( ) ) ; i ++ ) { MarkupElement elem = markup . get ( i ) ; if ( elem instanceof WicketTag ) { WicketTag tag = ( ( WicketTag ) ( elem ) ) ; if ( tag . isBorderTag ( ) ) { childMarkup = new org . apache . wicket . markup . MarkupFragment ( markup , i ) ; break ; } } } if ( child == null ) { return childMarkup ; } if ( child == ( body ) ) { return body . getMarkup ( ) ; } childMarkup = childMarkup . find ( child . getId ( ) ) ; if ( childMarkup != null ) { return childMarkup ; } <START_BUG> return findMarkupInAssociatedFileHeader ( markup , child ) ; <END_BUG> } public class BorderBodyContainer extends TransparentWebMarkupContainer { private static final long serialVersionUID = 1L ; private transient boolean wasOpenCloseTag = false ; protected boolean rendering ; public BorderBodyContainer ( final String id ) { } @ Override protected void onComponentTag ( final ComponentTag tag ) { } @ Override protected void onComponentTagBody ( final MarkupStream markupStream , final ComponentTag openTag ) { } @ Override protected void onRender ( ) { } @ Override public IMarkupFragment getMarkup ( ) { } private final IMarkupFragment findByName ( final IMarkupFragment markup , final String name ) { } @ Override public IMarkupFragment getMarkup ( final Component child ) { IMarkupFragment markup = Border . this . getMarkup ( ) ; if ( markup == null ) { return null ; } if ( child == null ) { return markup ; } return markup . find ( child . getId ( ) ) ; } } }

Fix:
return findMarkupInAssociatedFileHeader ( child ) ;