Buggy code:
public class WicketFilter implements Filter { public static final String APP_FACT_PARAM = "applicationFactoryClassName" ; public static final String FILTER_MAPPING_PARAM = "filterMappingUrlPattern" ; private static final Logger log = LoggerFactory . getLogger ( WicketFilter . class ) ; public static final String IGNORE_PATHS_PARAM = "ignorePaths" ; static final String SERVLET_PATH_HOLDER = "<servlet>" ; private FilterConfig filterConfig ; private String filterPath ; private WebApplication webApplication ; private IWebApplicationFactory webApplicationFactory ; private boolean servletMode = false ; private static final String PORTLET_ONLY_FILTER = "portletOnlyFilter" ; private static final String DETECT_PORTLET_CONTEXT = "detectPortletContext" ; private static final String DETECT_PORTLET_CONTEXT_FULL_NAME = "org.apache.wicket.detectPortletContext" ; private static final String WICKET_PORTLET_PROPERTIES = "org//apache//wicket//protocol//http//portlet//WicketPortlet.properties" ; private WicketFilterPortletContext filterPortletContext ; private boolean portletOnlyFilter ; private final Set < String > ignorePaths = new HashSet < String > ( ) ; public void destroy ( ) { } protected WebApplication getWebApplication ( ) { } public void doFilter ( ServletRequest request , ServletResponse response , FilterChain chain ) throws IOException , ServletException { } public boolean doGet ( final HttpServletRequest servletRequest , final HttpServletResponse servletResponse ) throws IOException , ServletException { String relativePath = getRelativePath ( servletRequest ) ; if ( ( ( relativePath . length ( ) ) == 0 ) && ( ! ( Strings . stripJSessionId ( servletRequest . getRequestURI ( ) ) . endsWith ( "//" ) ) ) ) { String redirectUrl = ( servletRequest . getRequestURI ( ) ) + "//" ; String queryString = servletRequest . getQueryString ( ) ; if ( queryString != null ) { redirectUrl += "?" + queryString ; } servletResponse . sendRedirect ( servletResponse . encodeRedirectURL ( redirectUrl ) ) ; return true ; } final ClassLoader previousClassLoader = Thread . currentThread ( ) . getContextClassLoader ( ) ; final ClassLoader newClassLoader = getClassLoader ( ) ; try { if ( previousClassLoader != newClassLoader ) { Thread . currentThread ( ) . setContextClassLoader ( newClassLoader ) ; } checkCharacterEncoding ( servletRequest ) ; final WebRequest request = webApplication . newWebRequest ( servletRequest ) ; <START_BUG> if ( ( webApplication . getRequestCycleSettings ( ) . getRenderStrategy ( ) ) == ( IRequestCycleSettings . REDIRECT_TO_BUFFER ) ) { <END_BUG> ISessionStore sessionStore = webApplication . getSessionStore ( ) ; String sessionId = sessionStore . getSessionId ( request , false ) ; if ( sessionId != null ) { BufferedHttpServletResponse bufferedResponse = null ; String queryString = servletRequest . getQueryString ( ) ; if ( ! ( Strings . isEmpty ( queryString ) ) ) { bufferedResponse = webApplication . popBufferedResponse ( sessionId , queryString ) ; } else { bufferedResponse = webApplication . popBufferedResponse ( sessionId , relativePath ) ; } if ( bufferedResponse != null ) { bufferedResponse . writeTo ( servletResponse ) ; return true ; } } } WebResponse response = null ; boolean externalCall = ! ( Application . exists ( ) ) ; try { if ( externalCall ) { Application . set ( webApplication ) ; } response = webApplication . newWebResponse ( servletResponse ) ; response . setAjax ( request . isAjax ( ) ) ; response . setCharacterEncoding ( webApplication . getRequestCycleSettings ( ) . getResponseRequestEncoding ( ) ) ; createRequestContext ( request , response ) ; final RequestCycle cycle = webApplication . newRequestCycle ( request , response ) ; try { cycle . request ( ) ; return cycle . wasHandled ( ) ; } catch ( AbortException e ) { } } finally { try { if ( response != null ) { response . close ( ) ; } } catch ( Exception e ) { WicketFilter . log . error ( "closing<seq2seq4repair_space>the<seq2seq4repair_space>buffer<seq2seq4repair_space>error" , e ) ; } finally { Session . unset ( ) ; if ( externalCall ) { Application . unset ( ) ; RequestContext . unset ( ) ; } } } } finally { if ( newClassLoader != previousClassLoader ) { Thread . currentThread ( ) . setContextClassLoader ( previousClassLoader ) ; } } return true ; } private void checkCharacterEncoding ( final HttpServletRequest servletRequest ) { } public FilterConfig getFilterConfig ( ) { } public String getRelativePath ( HttpServletRequest request ) { } public void init ( FilterConfig filterConfig ) throws ServletException { } private void initIgnorePaths ( FilterConfig filterConfig ) { } protected boolean isPortletContextAvailable ( FilterConfig config ) throws ServletException { } protected WicketFilterPortletContext newWicketFilterPortletContext ( ) { } protected void createRequestContext ( WebRequest request , WebResponse response ) { } private String getFilterPath ( String filterName , InputStream is ) throws ServletException { } private boolean isWicketRequest ( String relativePath ) { } private void maybeSetLastModified ( final HttpServletResponse resp , final long lastModified ) { } protected IWebApplicationFactory getApplicationFactory ( ) { } protected ClassLoader getClassLoader ( ) { } protected String getFilterPath ( HttpServletRequest request ) { } private String stripWildcard ( String result ) { } long getLastModified ( final HttpServletRequest servletRequest ) { } }

Fix:
if ( ( webApplication . getRequestCycleSettings ( ) . getRenderStrategy ( ) ) == ( RenderStrategy . REDIRECT_TO_BUFFER ) ) {