Buggy code:
public abstract class MarkupContainer extends Component { private static final long serialVersionUID = 1L ; private static final Log log = LogFactory . getLog ( MarkupContainer . class ) ; private Object children ; private transient MarkupStream markupStream ; public MarkupContainer ( final String id ) { } public MarkupContainer ( final String id , IModel model ) { } public final MarkupContainer add ( final Component child ) { } public final boolean autoAdd ( final Component component ) { } public final boolean contains ( final Component component , final boolean recurse ) { } public final Component get ( final String path ) { } public String getMarkupType ( ) { } public void internalAdd ( final Component child ) { } public void internalAttach ( ) { } public void internalDetach ( ) { } public final Iterator iterator ( ) { } public final Iterator iterator ( Comparator comparator ) { } public void remove ( final Component component ) { } public final void remove ( final String id ) { } public final void removeAll ( ) { } public final void renderAssociatedMarkup ( final String openTagName , final String exceptionMessage ) { } public final MarkupContainer replace ( final Component child ) { if ( child == null ) { throw new IllegalArgumentException ( "argument<seq2seq4repair_space>child<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>not<seq2seq4repair_space>null" ) ; } if ( MarkupContainer . log . isDebugEnabled ( ) ) { MarkupContainer . log . debug ( ( ( ( "Replacing<seq2seq4repair_space>" + ( child . getId ( ) ) ) + "<seq2seq4repair_space>in<seq2seq4repair_space>" ) + ( this ) ) ) ; } if ( ( child . getParent ( ) ) != ( this ) ) { final Component replaced = put ( child ) ; addedComponent ( child ) ; if ( replaced == null ) { <START_BUG> throw new WicketRuntimeException ( exceptionMessage ( ( ( "Cannot<seq2seq4repair_space>replace<seq2seq4repair_space>a<seq2seq4repair_space>component<seq2seq4repair_space>which<seq2seq4repair_space>has<seq2seq4repair_space>not<seq2seq4repair_space>been<seq2seq4repair_space>added:<seq2seq4repair_space>id='" + ( child . getId ( ) ) ) + "'" ) ) ) ; <END_BUG> } removedComponent ( replaced ) ; child . markupIndex = replaced . markupIndex ; } return this ; } public Component setModel ( final IModel model ) { } public final int size ( ) { } public String toString ( ) { } public String toString ( final boolean detailed ) { } public final Object visitChildren ( final Class clazz , final IVisitor visitor ) { } public final Object visitChildren ( final IVisitor visitor ) { } protected final MarkupStream findMarkupStream ( ) { } public final MarkupStream getAssociatedMarkupStream ( final boolean throwException ) { } public IResourceStream newMarkupResourceStream ( Class containerClass ) { } public final MarkupStream getMarkupStream ( ) { } protected void onComponentTagBody ( final MarkupStream markupStream , final ComponentTag openTag ) { } protected void onRender ( final MarkupStream markupStream ) { } protected void renderAll ( final MarkupStream markupStream ) { } protected final void renderComponentTagBody ( final MarkupStream markupStream , final ComponentTag openTag ) { } protected final void setMarkupStream ( final MarkupStream markupStream ) { } final boolean hasAssociatedMarkup ( ) { } private final void addedComponent ( final Component component ) { } private final void children_add ( final Component child ) { } private final Component children_get ( int index ) { } private final Component children_get ( final String id ) { } private final int children_indexOf ( Component child ) { } private final Component children_remove ( Component component ) { } private final Component children_remove ( int index ) { } private final Component children_set ( int index , Component child ) { } private final int children_size ( ) { } private final Component put ( final Component child ) { } private final void removedComponent ( final Component component ) { } private final void renderNext ( final MarkupStream markupStream ) { } public boolean isTransparentResolver ( ) { } }

Fix:
throw new WicketRuntimeException ( exceptionMessage ( ( ( ( "Cannot<seq2seq4repair_space>replace<seq2seq4repair_space>a<seq2seq4repair_space>component<seq2seq4repair_space>which<seq2seq4repair_space>has<seq2seq4repair_space>not<seq2seq4repair_space>been<seq2seq4repair_space>added:<seq2seq4repair_space>id='" + ( child . getId ( ) ) ) + "',<seq2seq4repair_space>component=" ) + child ) ) ) ;