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 final IRequestTargetUrlCodingStrategy urlCodingStrategyForPath ( String path ) { } public final void mount ( IRequestTargetUrlCodingStrategy encoder ) { } 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 ) { } protected CharSequence encode ( RequestCycle requestCycle , ISharedResourceRequestTarget requestTarget ) { final String sharedResourceKey = requestTarget . getResourceKey ( ) ; if ( ( sharedResourceKey == null ) || ( ( sharedResourceKey . trim ( ) . length ( ) ) == 0 ) ) { return "" ; } else { final AppendingStringBuffer buffer = new AppendingStringBuffer ( sharedResourceKey . length ( ) ) ; buffer . append ( "resources//" ) ; buffer . append ( sharedResourceKey ) ; Map map = requestTarget . getRequestParameters ( ) . getParameters ( ) ; if ( ( map != null ) && ( ( map . size ( ) ) > 0 ) ) { buffer . append ( '?' ) ; Iterator it = map . entrySet ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { Map . Entry entry = ( ( Map . Entry ) ( it . next ( ) ) ) ; buffer . append ( entry . getKey ( ) ) ; buffer . append ( '=' ) ; buffer . append ( entry . getValue ( ) ) ; if ( it . hasNext ( ) ) { <START_BUG> buffer . append ( "&amp;" ) ; <END_BUG> } } } return buffer ; } } 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 map ; public MountsMap ( boolean caseSensitiveMounts ) { } public IRequestTargetUrlCodingStrategy strategyForPath ( String path ) { } public int size ( ) { } public Collection strategies ( ) { } public void unmount ( String mount ) { } public IRequestTargetUrlCodingStrategy strategyForMount ( String mount ) { } public IRequestTargetUrlCodingStrategy mount ( String mount , IRequestTargetUrlCodingStrategy encoder ) { } private static final Comparator LENGTH_COMPARATOR = new Comparator ( ) { public int compare ( Object o1 , Object o2 ) { } } ; } public static final String encodePageMapName ( String pageMapName ) { } public static String decodePageMapName ( String pageMapName ) { } }

Fix:
buffer . append ( '&' ) ;