Buggy code:
public class WebPage extends Page implements INewBrowserWindowListener { private static final long serialVersionUID = 1L ; private static final MetaDataKey MISSING_BODY_TAG_LOGGED_MDK = new MetaDataKey ( WebPage . MissingBodyTagLoggedMetaData . class ) { private static final long serialVersionUID = 1L ; } ; private static final class MissingBodyTagLoggedMetaData implements Serializable { private static final long serialVersionUID = 1L ; Set missingBodyTagsLogged = new HashSet ( 1 ) ; } private static Log log = LogFactory . getLog ( WebPage . class ) ; private static ResourceReference cookiesResource = new ResourceReference ( WebPage . class , "cookies.js" ) ; private BodyContainer bodyContainer ; private URLCompressor compressor ; protected WebPage ( ) { } protected WebPage ( final IModel model ) { } protected WebPage ( final PageMap pageMap ) { } protected WebPage ( final PageMap pageMap , final IModel model ) { } protected WebPage ( final PageParameters parameters ) { } public BodyContainer getBodyContainer ( ) { } public String getMarkupType ( ) { } protected void configureResponse ( ) { } protected final WebRequestCycle getWebRequestCycle ( ) { } protected final BookmarkablePageLink homePageLink ( final String id ) { } private void commonInit ( ) { } public final URLCompressor getUrlCompressor ( ) { } protected void onDetach ( ) { } public void onNewBrowserWindow ( ) { } private final class PageMapChecker extends AbstractBehavior implements IHeaderContributor { private static final long serialVersionUID = 1L ; private Model onUnLoadModel ; public final void renderHead ( final Response response ) { final WebRequestCycle cycle = ( ( WebRequestCycle ) ( getRequestCycle ( ) ) ) ; final IRequestTarget target = cycle . getRequestTarget ( ) ; int initialAccessStackSize = 0 ; if ( ( ( getApplication ( ) . getRequestCycleSettings ( ) . getRenderStrategy ( ) ) == ( IRequestCycleSettings . REDIRECT_TO_RENDER ) ) && ( target instanceof RedirectPageRequestTarget ) ) { initialAccessStackSize = 1 ; } final ArrayListStack accessStack = getPageMap ( ) . getAccessStack ( ) ; if ( ( accessStack . size ( ) ) > initialAccessStackSize ) { CharSequence url = null ; if ( target instanceof IBookmarkablePageRequestTarget ) { IBookmarkablePageRequestTarget current = ( ( IBookmarkablePageRequestTarget ) ( target ) ) ; BookmarkablePageRequestTarget redirect = new BookmarkablePageRequestTarget ( getSession ( ) . createAutoPageMapName ( ) , current . getPageClass ( ) , current . getPageParameters ( ) ) ; url = cycle . urlFor ( redirect ) ; } else { url = urlFor ( INTERFACE ) ; } final BodyContainer body = getBodyContainer ( ) ; final Cookie [ ] cookies = cycle . getWebRequest ( ) . getCookies ( ) ; if ( ( cookies == null ) || ( body == null ) ) { if ( ( ( cookies != null ) && ( body == null ) ) && ( WebPage . log . isWarnEnabled ( ) ) ) { Application app = getApplication ( ) ; WebPage . MissingBodyTagLoggedMetaData meta = ( ( WebPage . MissingBodyTagLoggedMetaData ) ( app . getMetaData ( WebPage . MISSING_BODY_TAG_LOGGED_MDK ) ) ) ; if ( meta == null ) { meta = new WebPage . MissingBodyTagLoggedMetaData ( ) ; app . setMetaData ( WebPage . MISSING_BODY_TAG_LOGGED_MDK , meta ) ; } Class pageClass = WebPage . this . getClass ( ) ; if ( ! ( meta . missingBodyTagsLogged . contains ( pageClass ) ) ) { WebPage . log . warn ( ( ( ( "Page<seq2seq4repair_space>with<seq2seq4repair_space>class<seq2seq4repair_space>" + ( pageClass . getName ( ) ) ) + "<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>have<seq2seq4repair_space>a<seq2seq4repair_space>body<seq2seq4repair_space>tag.<seq2seq4repair_space>It<seq2seq4repair_space>is<seq2seq4repair_space>advisable<seq2seq4repair_space>to<seq2seq4repair_space>have" ) + "<seq2seq4repair_space>a<seq2seq4repair_space>body<seq2seq4repair_space>tag<seq2seq4repair_space>pair,<seq2seq4repair_space>as<seq2seq4repair_space>multi<seq2seq4repair_space>window<seq2seq4repair_space>support<seq2seq4repair_space>might<seq2seq4repair_space>be<seq2seq4repair_space>problematic<seq2seq4repair_space>without." ) ) ; meta . missingBodyTagsLogged . add ( pageClass ) ; } } <START_BUG> response . write ( "<script<seq2seq4repair_space>language=\"javascript\">if((history.length<seq2seq4repair_space>==<seq2seq4repair_space>0<seq2seq4repair_space>&&<seq2seq4repair_space>document.all)<seq2seq4repair_space>||<seq2seq4repair_space>(history.length<seq2seq4repair_space>==<seq2seq4repair_space>1<seq2seq4repair_space>&&<seq2seq4repair_space>!document.all)){<seq2seq4repair_space>if<seq2seq4repair_space>(!document.all)<seq2seq4repair_space>window.location.hash=\'some-random-hash!\';<seq2seq4repair_space>document.location.href<seq2seq4repair_space>=<seq2seq4repair_space>\'" ) ; <END_BUG> response . write ( url ) ; response . write ( "'}<//script>" ) ; } else { if ( ( onUnLoadModel ) == null ) { onUnLoadModel = new Model ( ) { private static final long serialVersionUID = 1L ; public Object getObject ( Component component ) { return ( "deleteCookie('pagemap-" + ( getPageMap ( ) . getName ( ) ) ) + "');" ; } } ; body . addOnUnLoadModifier ( onUnLoadModel ) ; } final String pageMapName = getPageMap ( ) . getName ( ) ; response . write ( "<script<seq2seq4repair_space>type=\"text//javascript\"<seq2seq4repair_space>src=\"" ) ; response . write ( urlFor ( WebPage . cookiesResource ) ) ; response . write ( "\"><//script>\n" ) ; response . write ( "<script<seq2seq4repair_space>language=\"javascript\">\n" ) ; response . write ( "var<seq2seq4repair_space>pagemapcookie<seq2seq4repair_space>=<seq2seq4repair_space>getCookie('pagemap-" ) ; response . write ( pageMapName ) ; response . write ( "\');\n" ) ; response . write ( "if(!pagemapcookie<seq2seq4repair_space>&&<seq2seq4repair_space>pagemapcookie<seq2seq4repair_space>!=<seq2seq4repair_space>'1'){setCookie('pagemap-" ) ; response . write ( pageMapName ) ; response . write ( "\',1);}\n" ) ; response . write ( "else<seq2seq4repair_space>{document.location.href<seq2seq4repair_space>=<seq2seq4repair_space>'" ) ; response . write ( url ) ; response . write ( "\';}\n" ) ; response . write ( "<//script>\n" ) ; } } } } }

Fix:
response . write ( "<script<seq2seq4repair_space>language=\"JavaScript\">if((history.length<seq2seq4repair_space>==<seq2seq4repair_space>0<seq2seq4repair_space>&&<seq2seq4repair_space>document.all)<seq2seq4repair_space>||<seq2seq4repair_space>(history.length<seq2seq4repair_space>==<seq2seq4repair_space>1<seq2seq4repair_space>&&<seq2seq4repair_space>!document.all)){<seq2seq4repair_space>if<seq2seq4repair_space>(!document.all)<seq2seq4repair_space>window.location.hash=\'some-random-hash!\';<seq2seq4repair_space>document.location.href<seq2seq4repair_space>=<seq2seq4repair_space>\'" ) ;