Buggy code:
public class BaseWicketTester { private static final Logger log = LoggerFactory . getLogger ( BaseWicketTester . class ) ; private static final class TestPageSource implements ITestPageSource { private final Page page ; private static final long serialVersionUID = 1L ; private TestPageSource ( Page page ) { } public Page getTestPage ( ) { } } private final ServletContext servletContext ; private MockHttpSession hsession ; private final WebApplication application ; private boolean followRedirects = true ; private int redirectCount ; private MockHttpServletRequest lastRequest ; private MockHttpServletResponse lastResponse ; private final List < MockHttpServletRequest > previousRequests = new ArrayList < MockHttpServletRequest > ( ) ; private final List < MockHttpServletResponse > previousResponses = new ArrayList < MockHttpServletResponse > ( ) ; private MockHttpServletRequest request ; private MockHttpServletResponse response ; private Session session ; private RequestCycle requestCycle ; private Page lastRenderedPage ; private boolean exposeExceptions = true ; private boolean useRequestUrlAsBase = true ; private IRequestHandler forcedHandler ; private final List < Cookie > browserCookies = new ArrayList < Cookie > ( ) ; private MarkupContainer startComponent ; public BaseWicketTester ( ) { } public < C extends Page > BaseWicketTester ( final Class < C > homePage ) { } public BaseWicketTester ( final WebApplication application ) { } public BaseWicketTester ( final WebApplication application , String servletContextBasePath ) { } public BaseWicketTester ( final WebApplication application , ServletContext servletCtx ) { } protected IPageManagerProvider newTestPageManagerProvider ( ) { } public Page getLastRenderedPage ( ) { } private void setupNextRequestCycle ( ) { } private ServletWebResponse createServletWebResponse ( ServletWebRequest servletWebRequest ) { } private ServletWebRequest createServletWebRequest ( ) { } private void createNewSession ( ) { } public MockHttpServletRequest getRequest ( ) { } public void setRequest ( MockHttpServletRequest request ) { } public Session getSession ( ) { } public MockHttpSession getHttpSession ( ) { } public WebApplication getApplication ( ) { } public ServletContext getServletContext ( ) { } public void destroy ( ) { } public boolean processRequest ( ) { } public void processRequest ( MockHttpServletRequest request ) { } public boolean processRequest ( MockHttpServletRequest request , IRequestHandler forcedRequestHandler ) { } public boolean processRequest ( IRequestHandler forcedRequestHandler ) { } private boolean processRequest ( MockHttpServletRequest forcedRequest , IRequestHandler forcedRequestHandler , boolean redirect ) { } private void recordRequestResponse ( ) { } public Page startPage ( IPageProvider pageProvider ) { } public Page startPage ( Page page ) { } public ResourceReference startResource ( final IResource resource ) { } public ResourceReference startResourceReference ( final ResourceReference reference ) { } public ResourceReference startResourceReference ( final ResourceReference reference , final PageParameters pageParameters ) { } public MockHttpServletResponse getLastResponse ( ) { } public String getLastResponseAsString ( ) { } public String getWicketAjaxBaseUrlEncodedInLastResponse ( ) throws IOException , ParseException , ResourceStreamNotFoundException { XmlPullParser parser = new XmlPullParser ( ) ; parser . parse ( getLastResponseAsString ( ) ) ; XmlTag tag ; while ( ( tag = ( ( XmlTag ) ( parser . nextTag ( ) ) ) ) != null ) { <START_BUG> if ( ( ( tag . isOpen ( ) ) && ( tag . getName ( ) . equals ( "script" ) ) ) && ( "wicket-ajax-base-url" . equals ( tag . getString ( "id" ) ) ) ) { <END_BUG> parser . next ( ) ; return parser . getString ( ) . toString ( ) . split ( "\\\"" ) [ 1 ] ; } } throw new WicketRuntimeException ( "Last<seq2seq4repair_space>response<seq2seq4repair_space>has<seq2seq4repair_space>no<seq2seq4repair_space>AJAX<seq2seq4repair_space>base<seq2seq4repair_space>URL<seq2seq4repair_space>set<seq2seq4repair_space>by<seq2seq4repair_space>AbstractDefaultAjaxBehavior." ) ; } public List < MockHttpServletRequest > getPreviousRequests ( ) { } public List < MockHttpServletResponse > getPreviousResponses ( ) { } public void setFollowRedirects ( boolean followRedirects ) { } public boolean isFollowRedirects ( ) { } public Url urlFor ( IRequestHandler handler ) { } public String urlFor ( Link link ) { } public final Page startPage ( final ITestPageSource testPageSource ) { } public void executeListener ( Component component , RequestListenerInterface listener ) { } public void executeListener ( Component component ) { } public void executeBehavior ( final AbstractAjaxBehavior behavior ) { } public Url urlFor ( AjaxLink < ? > link ) { } public void executeAjaxUrl ( Url url ) { } public final < C extends Page > Page startPage ( Class < C > pageClass ) { } public final < C extends Page > Page startPage ( Class < C > pageClass , PageParameters parameters ) { } public FormTester newFormTester ( String path ) { } public FormTester newFormTester ( String path , boolean fillBlankString ) { } public final Panel startPanel ( final ITestPanelSource testPanelSource ) { } public final < C extends Panel > Panel startPanel ( final Class < C > panelClass ) { } public void startComponent ( Component component ) { } private RuntimeException convertoUnexpect ( Exception e ) { } public Component getComponentFromLastRenderedPage ( String path , boolean wantVisibleInHierarchy ) { } public Component getComponentFromLastRenderedPage ( String path ) { } public Result hasLabel ( String path , String expectedLabelText ) { } public < C extends Component > Result isComponent ( String path , Class < C > expectedComponentClass ) { } public Result isVisible ( String path ) { } public Result isInvisible ( String path ) { } public Result isEnabled ( String path ) { } public Result isDisabled ( String path ) { } public Result isRequired ( String path ) { } public Result isRequired ( FormComponent < ? > component ) { } public Result ifContains ( String pattern ) { } public void assertListView ( String path , List < ? > expectedList ) { } public void clickLink ( String path ) { } public void clickLink ( String path , boolean isAjax ) { } public void submitForm ( Form < ? > form ) { } public void submitForm ( String path ) { } private void transform ( Url url ) { }

Fix:
if ( ( ( tag . isOpen ( ) ) && ( tag . getName ( ) . equals ( "script" ) ) ) && ( "wicket-ajax-base-url" . equals ( tag . getAttribute ( "id" ) ) ) ) {