Buggy code:
public abstract class Link < T > extends WebMarkupContainer < T > implements ILinkListener { private final class AnchorChange extends Change { private static final long serialVersionUID = 1L ; private Component anchor ; public AnchorChange ( Component anchor ) { } public final void undo ( ) { } } private static final long serialVersionUID = 1L ; private String afterDisabledLink ; private Component anchor ; private boolean autoEnable = false ; private String beforeDisabledLink ; private PopupSettings popupSettings = null ; public Link ( MarkupContainer parent , final String id ) { } public Link ( MarkupContainer parent , final String id , IModel < T > object ) { } public String getAfterDisabledLink ( ) { } public Component getAnchor ( ) { } public final boolean getAutoEnable ( ) { } public String getBeforeDisabledLink ( ) { } public PopupSettings getPopupSettings ( ) { } @ Override public boolean isEnabled ( ) { } public abstract void onClick ( ) { } public final void onLinkClicked ( ) { } public void setAfterDisabledLink ( final String afterDisabledLink ) { } public void setAnchor ( Component anchor ) { } public final Link setAutoEnable ( final boolean autoEnable ) { } public void setBeforeDisabledLink ( final String beforeDisabledLink ) { } public final Link setPopupSettings ( final PopupSettings popupSettings ) { } protected CharSequence appendAnchor ( final ComponentTag tag , CharSequence url ) { if ( url != null ) { Component anchor = getAnchor ( ) ; if ( anchor != null ) { if ( ( url . toString ( ) . indexOf ( '#' ) ) == ( - 1 ) ) { String id ; if ( anchor . getOutputMarkupId ( ) ) { id = anchor . getMarkupId ( ) ; } else { id = anchor . getMarkupAttributes ( ) . getString ( "id" ) ; } if ( id != null ) { url = ( url + "#" ) + ( anchor . getMarkupId ( ) ) ; } else { throw new WicketRuntimeException ( ( ( ( "an<seq2seq4repair_space>achor<seq2seq4repair_space>component<seq2seq4repair_space>was<seq2seq4repair_space>set<seq2seq4repair_space>on<seq2seq4repair_space>" + ( this ) ) + "<seq2seq4repair_space>but<seq2seq4repair_space>it<seq2seq4repair_space>neither<seq2seq4repair_space>has<seq2seq4repair_space>outputMarkupId<seq2seq4repair_space>set<seq2seq4repair_space>to<seq2seq4repair_space>true<seq2seq4repair_space>" ) + "nor<seq2seq4repair_space>has<seq2seq4repair_space>a<seq2seq4repair_space>id<seq2seq4repair_space>set<seq2seq4repair_space>explicitly" ) ) ; } } } else { if ( tag . getName ( ) . equalsIgnoreCase ( "a" ) ) { if ( ( url . toString ( ) . indexOf ( '#' ) ) == ( - 1 ) ) { <START_BUG> String href = Link . getMarkupAttributes ( ) . getString ( "href" ) ; <END_BUG> if ( ( ( href != null ) && ( ( href . length ( ) ) > 1 ) ) && ( ( href . charAt ( 0 ) ) == '#' ) ) { url = url + href ; } } } } } return url ; } protected CharSequence getOnClickScript ( final CharSequence url ) { } protected CharSequence getURL ( ) { } @ Override protected void internalOnAttach ( ) { } @ Override protected boolean isStateless ( ) { } protected boolean linksTo ( final Page page ) { } @ Override protected final void onComponentTag ( final ComponentTag tag ) { } @ Override protected final void onComponentTagBody ( final MarkupStream markupStream , final ComponentTag openTag ) { } }

Fix:
String href = tag . getAttributes ( ) . getString ( "href" ) ;