Buggy code:
public class WebRequestCodingStrategy implements IRequestCodingStrategy , IRequestTargetMountsInfo { public static final String NAME_SPACE = "wicket:" ; public static final String INTERFACE_PARAMETER_NAME = ( WebRequestCodingStrategy . NAME_SPACE ) + "interface" ; public static final String BEHAVIOR_ID_PARAMETER_NAME = ( WebRequestCodingStrategy . NAME_SPACE ) + "behaviorId" ; public static final String BOOKMARKABLE_PAGE_PARAMETER_NAME = ( WebRequestCodingStrategy . NAME_SPACE ) + "bookmarkablePage" ; public static final String PAGEMAP = ( WebRequestCodingStrategy . NAME_SPACE ) + "pageMapName" ; public static final String DEFAULT_PAGEMAP_NAME = "wicketdef" ; public static final String RESOURCES_PATH_PREFIX = "resources//" ; public static final String IGNORE_IF_NOT_ACTIVE_PARAMETER_NAME = ( WebRequestCodingStrategy . NAME_SPACE ) + "ignoreIfNotActive" ; public static class Settings { private boolean mountsCaseSensitive = true ; public Settings ( ) { } public void setMountsCaseSensitive ( boolean mountsCaseSensitive ) { } public boolean areMountsCaseSensitive ( ) { } } private static final Logger log = LoggerFactory . getLogger ( WebRequestCodingStrategy . class ) ; private final WebRequestCodingStrategy . MountsMap mountsOnPath ; public WebRequestCodingStrategy ( ) { } public WebRequestCodingStrategy ( WebRequestCodingStrategy . Settings settings ) { } public final RequestParameters decode ( final Request request ) { } public final CharSequence encode ( final RequestCycle requestCycle , final IRequestTarget requestTarget ) { } public CharSequence encode ( CharSequence url ) { } public IRequestTargetUrlCodingStrategy [ ] listMounts ( ) { } public IRequestTargetUrlCodingStrategy urlCodingStrategyForPath ( String path ) { } public final void mount ( IRequestTargetUrlCodingStrategy encoder ) { } public void addIgnoreMountPath ( String path ) { } public final CharSequence pathForTarget ( IRequestTarget requestTarget ) { } public final IRequestTarget targetForRequest ( RequestParameters requestParameters ) { } public final void unmount ( String path ) { } protected void addBookmarkablePageParameters ( final Request request , final RequestParameters parameters ) { } protected void addInterfaceParameters ( final Request request , final RequestParameters parameters ) { } public static void addInterfaceParameters ( final String interfaceParameter , final RequestParameters parameters ) { } protected void addResourceParameters ( Request request , RequestParameters parameters ) { } protected String doEncode ( RequestCycle requestCycle , IRequestTarget requestTarget ) { } protected CharSequence encode ( RequestCycle requestCycle , IBookmarkablePageRequestTarget requestTarget ) { final AppendingStringBuffer url = new AppendingStringBuffer ( 64 ) ; final Class < ? extends Page > pageClass = requestTarget . getPageClass ( ) ; final Application application = Application . get ( ) ; <START_BUG> String pageMapName = requestTarget . getPageMapName ( ) ; <END_BUG> if ( pageMapName == null ) { IRequestTarget currentTarget = requestCycle . getRequestTarget ( ) ; if ( currentTarget instanceof IPageRequestTarget ) { Page currentPage = ( ( IPageRequestTarget ) ( currentTarget ) ) . getPage ( ) ; final IPageMap pageMap = currentPage . getPageMap ( ) ; if ( pageMap . isDefault ( ) ) { pageMapName = "" ; } else { pageMapName = pageMap . getName ( ) ; } } else { pageMapName = "" ; } } WebRequestEncoder encoder = new WebRequestEncoder ( url ) ; if ( ( ( ! ( application . getHomePage ( ) . equals ( pageClass ) ) ) || ( ! ( "" . equals ( pageMapName ) ) ) ) || ( ( application . getHomePage ( ) . equals ( pageClass ) ) && ( requestTarget instanceof BookmarkableListenerInterfaceRequestTarget ) ) ) { encoder . addValue ( WebRequestCodingStrategy . BOOKMARKABLE_PAGE_PARAMETER_NAME , ( ( pageMapName + ( Component . PATH_SEPARATOR ) ) + ( pageClass . getName ( ) ) ) ) ; } final PageParameters parameters = requestTarget . getPageParameters ( ) ; if ( parameters != null ) { final Iterator < String > iterator = parameters . keySet ( ) . iterator ( ) ; while ( iterator . hasNext ( ) ) { final String key = iterator . next ( ) ; final String [ ] values = parameters . getStringArray ( key ) ; if ( values != null ) { for ( int i = 0 ; i < ( values . length ) ; i ++ ) { encoder . addValue ( key , values [ i ] ) ; } } } } return url ; } protected CharSequence encode ( RequestCycle requestCycle , ISharedResourceRequestTarget requestTarget ) { } protected CharSequence encode ( RequestCycle requestCycle , PageReferenceRequestTarget requestTarget ) { } protected CharSequence encode ( RequestCycle requestCycle , IListenerInterfaceRequestTarget requestTarget ) { } protected CharSequence encode ( RequestCycle requestCycle , IPageRequestTarget requestTarget ) { } protected IRequestTargetUrlCodingStrategy getMountEncoder ( IRequestTarget requestTarget ) { } protected String getRequestPath ( Request request ) { } private static class MountsMap { private static final long serialVersionUID = 1L ; private final boolean caseSensitiveMounts ; private final TreeMap < String , IRequestTargetUrlCodingStrategy > map ; public MountsMap ( boolean caseSensitiveMounts ) { } public IRequestTargetUrlCodingStrategy strategyForPath ( String path ) { } public int size ( ) { } public Collection < IRequestTargetUrlCodingStrategy > strategies ( ) { } public void unmount ( String mount ) { } public IRequestTargetUrlCodingStrategy strategyForMount ( String mount ) { } public IRequestTargetUrlCodingStrategy mount ( String mount , IRequestTargetUrlCodingStrategy encoder ) { } private static final Comparator < String > LENGTH_COMPARATOR = new Comparator < String > ( ) { public int compare ( String o1 , String o2 ) { } } ; } public static final String encodePageMapName ( String pageMapName ) { } public static String decodePageMapName ( String pageMapName ) { } private static class PassThroughUrlCodingStrategy extends AbstractRequestTargetUrlCodingStrategy { public PassThroughUrlCodingStrategy ( String path ) { } public IRequestTarget decode ( RequestParameters requestParameters ) { } public CharSequence encode ( IRequestTarget requestTarget ) { } public boolean matches ( IRequestTarget requestTarget ) { } } public String rewriteStaticRelativeUrl ( String string ) { } }

Fix:
String pageMapName = null ;