Buggy code:
public class AjaxRequestTarget implements IRequestTarget { public static interface IListener { public void onBeforeRespond ( Map map , AjaxRequestTarget target ) { } public void onAfterRespond ( Map map , AjaxRequestTarget . IJavascriptResponse response ) { } } public static interface IJavascriptResponse { public void addJavascript ( String script ) { } } private final class AjaxResponse extends WebResponse { private final AppendingStringBuffer buffer = new AppendingStringBuffer ( 256 ) ; private boolean escaped = false ; private final Response originalResponse ; public AjaxResponse ( Response originalResponse ) { } public CharSequence encodeURL ( CharSequence url ) { } public CharSequence getContents ( ) { } public OutputStream getOutputStream ( ) { } public boolean isContentsEncoded ( ) { } public void reset ( ) { } public void write ( CharSequence cs ) { } } private static final Logger LOG = LoggerFactory . getLogger ( AjaxRequestTarget . class ) ; private final List appendJavascripts = new ArrayList ( ) ; private final AjaxRequestTarget . AjaxResponse encodingBodyResponse ; private final AjaxRequestTarget . AjaxResponse encodingHeaderResponse ; private final Map markupIdToComponent = new LinkedHashMap ( ) ; private final List prependJavascripts = new ArrayList ( ) ; private List listeners = null ; public AjaxRequestTarget ( ) { } public void addListener ( AjaxRequestTarget . IListener listener ) { } public final void addChildren ( MarkupContainer parent , Class childCriteria ) { } public final void addComponent ( Component component ) { } public final void addComponent ( Component component , String markupId ) { } public final void addJavascript ( String javascript ) { } public final void focusComponent ( Component component ) { if ( ( component != null ) && ( ( component . getOutputMarkupId ( ) ) == false ) ) { throw new IllegalArgumentException ( ( "cannot<seq2seq4repair_space>update<seq2seq4repair_space>component<seq2seq4repair_space>that<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>have<seq2seq4repair_space>setOutputMarkupId<seq2seq4repair_space>property<seq2seq4repair_space>set<seq2seq4repair_space>to<seq2seq4repair_space>true.<seq2seq4repair_space>Component:<seq2seq4repair_space>" + ( component . toString ( ) ) ) ) ; } final String id = ( component != null ) ? component . getMarkupId ( ) : null ; <START_BUG> appendJavascript ( ( ( "Wicket.Focus.setFocusOnId('" + null ) + "');" ) ) ; <END_BUG> } public final void appendJavascript ( String javascript ) { } public void detach ( final RequestCycle requestCycle ) { } public boolean equals ( final Object obj ) { } public int hashCode ( ) { } public final void prependJavascript ( String javascript ) { } public final void respond ( final RequestCycle requestCycle ) { } private void fireOnBeforeRespondListeners ( ) { } private void fireOnAfterRespondListeners ( final WebResponse response ) { } private void respondComponents ( WebResponse response ) { } public String toString ( ) { } protected String encode ( String s ) { } protected String getEncodingName ( ) { } protected boolean needsEncoding ( String str ) { } private void respondComponent ( final Response response , final String markupId , final Component component ) { } private class AjaxHeaderResponse extends HeaderResponse { private static final long serialVersionUID = 1L ; private void checkHeaderRendering ( ) { } public void renderCSSReference ( ResourceReference reference , String media ) { } public void renderCSSReference ( String url ) { } public void renderCSSReference ( String url , String media ) { } public void renderJavascript ( CharSequence javascript , String id ) { } public void renderCSSReference ( ResourceReference reference ) { } public void renderJavascriptReference ( ResourceReference reference ) { } public void renderJavascriptReference ( String url ) { } public void renderString ( CharSequence string ) { } public AjaxHeaderResponse ( ) { } public void renderOnDomReadyJavascript ( String javascript ) { } public void renderOnLoadJavascript ( String javascript ) { } public Response getResponse ( ) { } } private boolean headerRendering = false ; private HtmlHeaderContainer header = null ; private IHeaderResponse headerResponse ; public IHeaderResponse getHeaderResponse ( ) { } private static class AjaxHtmlHeaderContainer extends HtmlHeaderContainer { private static final long serialVersionUID = 1L ; public AjaxHtmlHeaderContainer ( String id , AjaxRequestTarget target ) { } protected IHeaderResponse newHeaderResponse ( ) { } private transient AjaxRequestTarget target ; } private void respondHeaderContribution ( final Response response , final Component component ) { } private void respondInvocation ( final Response response , final String js ) { } }

Fix:
appendJavascript ( ( ( "Wicket.Focus.setFocusOnId('" + id ) + "');" ) ) ;