Buggy code:
public class WebRequestCodingStrategy implements IRequestCodingStrategy { public static final String INTERFACE_PARAMETER_NAME = "wicket:interface" ; public static final String BEHAVIOR_ID_PARAMETER_NAME = "wicket:behaviorId" ; public static final String BOOKMARKABLE_PAGE_PARAMETER_NAME = "wicket:bookmarkablePage" ; private static final Comparator lengthComparator = new Comparator ( ) { public int compare ( Object o1 , Object o2 ) { } } ; private static Log log = LogFactory . getLog ( WebRequestCodingStrategy . class ) ; private final SortedMap mountsOnPath = new TreeMap ( WebRequestCodingStrategy . lengthComparator ) ; private CharSequence urlPrefix ; public WebRequestCodingStrategy ( ) { } public final RequestParameters decode ( final Request request ) { } public final String encode ( final RequestCycle requestCycle , final IRequestTarget requestTarget ) { } public final IRequestTargetUrlCodingStrategy urlCodingStrategyForPath ( final String path ) { } public final void mount ( String path , IRequestTargetUrlCodingStrategy encoder ) { } public final CharSequence pathForTarget ( IRequestTarget requestTarget ) { } public final IRequestTarget targetForPath ( String path ) { } public final void unmount ( String path ) { } protected void addBookmarkablePageParameters ( final Request request , final RequestParameters parameters ) { } protected void addInterfaceParameters ( final Request request , final RequestParameters parameters ) { } protected void addResourceParameters ( Request request , RequestParameters parameters ) { } protected String doEncode ( RequestCycle requestCycle , IRequestTarget requestTarget ) { } protected final String encode ( RequestCycle requestCycle , IBookmarkablePageRequestTarget requestTarget ) { } protected String encode ( RequestCycle requestCycle , ISharedResourceRequestTarget requestTarget ) { } protected final String encode ( RequestCycle requestCycle , IListenerInterfaceRequestTarget requestTarget ) { final RequestListenerInterface rli = requestTarget . getRequestListenerInterface ( ) ; <START_BUG> final StringBuffer url = new StringBuffer ( 64 ) ; <END_BUG> url . append ( urlPrefix ( requestCycle ) ) ; url . append ( '?' ) ; url . append ( WebRequestCodingStrategy . INTERFACE_PARAMETER_NAME ) ; url . append ( '=' ) ; final Component component = requestTarget . getTarget ( ) ; final Page page = component . getPage ( ) ; final PageMap pageMap = page . getPageMap ( ) ; if ( ! ( pageMap . isDefault ( ) ) ) { url . append ( pageMap . getName ( ) ) ; } url . append ( PATH_SEPARATOR ) ; url . append ( component . getPath ( ) ) ; url . append ( PATH_SEPARATOR ) ; final int versionNumber = component . getPage ( ) . getCurrentVersionNumber ( ) ; if ( ! ( rli . getRecordsPageVersion ( ) ) ) { url . append ( LATEST_VERSION ) ; } else if ( versionNumber > 0 ) { url . append ( versionNumber ) ; } url . append ( PATH_SEPARATOR ) ; final String listenerName = rli . getName ( ) ; if ( ! ( INTERFACE . getName ( ) . equals ( listenerName ) ) ) { url . append ( listenerName ) ; } return requestCycle . getResponse ( ) . encodeURL ( url . toString ( ) ) ; } protected final String encode ( RequestCycle requestCycle , IPageRequestTarget requestTarget ) { } protected IRequestTargetUrlCodingStrategy getMountEncoder ( IRequestTarget requestTarget ) { } protected String getRequestPath ( Request request ) { } protected final CharSequence urlPrefix ( RequestCycle requestCycle ) { } }

Fix:
final AppendingStringBuffer url = new AppendingStringBuffer ( 64 ) ;