Buggy code:
public abstract class RequestCycle { private static final ThreadLocal current = new ThreadLocal ( ) ; private static final int DETACH_REQUEST = 6 ; private static final int DONE = 7 ; private static final int HANDLE_EXCEPTION = 5 ; private static final Log log = LogFactory . getLog ( RequestCycle . class ) ; private static final int NOT_STARTED = 0 ; private static final int PREPARE_REQUEST = 1 ; private static final int PROCESS_EVENTS = 3 ; private static final int RESOLVE_TARGET = 2 ; private static final int RESPOND = 4 ; public static RequestCycle get ( ) { } protected static void set ( RequestCycle cycle ) { } protected final Application application ; protected final IRequestCycleProcessor processor ; protected Request request ; protected Response response ; protected final Session session ; private int currentStep = RequestCycle . NOT_STARTED ; private final Response originalResponse ; private boolean redirect ; private final transient ArrayListStack requestTargets = new ArrayListStack ( 3 ) ; private final long startTime = System . currentTimeMillis ( ) ; private boolean updateSession ; protected RequestCycle ( final Session session , final Request request , final Response response ) { } public final Application getApplication ( ) { } public final ClientInfo getClientInfo ( ) { } public final Response getOriginalResponse ( ) { } public abstract IRequestCycleProcessor getProcessor ( ) { } public boolean getRedirect ( ) { } public final Request getRequest ( ) { } public final IRequestTarget getRequestTarget ( ) { } public final Response getResponse ( ) { } public final Page getResponsePage ( ) { } public final Class getResponsePageClass ( ) { } public final Session getSession ( ) { } public final long getStartTime ( ) { } public Page onRuntimeException ( Page page , RuntimeException e ) { } public abstract void redirectTo ( final Page page ) { } public final void request ( ) { } public final void request ( final Component component ) { } public final void request ( IRequestTarget target ) { } public final void setRedirect ( final boolean redirect ) { } public final void setRequest ( Request request ) { } public final void setRequestTarget ( IRequestTarget requestTarget ) { } public final Response setResponse ( final Response response ) { } public final void setResponsePage ( final Class pageClass ) { } public final void setResponsePage ( final Class pageClass , final PageParameters pageParameters ) { } public final void setResponsePage ( final Page page ) { } public void setUpdateSession ( boolean updateCluster ) { } public String toString ( ) { } public final CharSequence urlFor ( final Component component , final RequestListenerInterface listener ) { } public final CharSequence urlFor ( final Component component , final IBehavior behaviour , final RequestListenerInterface listener ) { } public final CharSequence urlFor ( final IRequestTarget requestTarget ) { } public final CharSequence urlFor ( final Page page ) { } public final CharSequence urlFor ( final IPageMap pageMap , final Class pageClass , final PageParameters parameters ) { } public final CharSequence urlFor ( final ResourceReference resourceReference ) { } public final CharSequence urlFor ( final ResourceReference resourceReference , ValueMap parameters ) { } protected abstract ClientInfo newClientInfo ( ) { } protected void onBeginRequest ( ) { } protected void onEndRequest ( ) { } private void checkReuse ( ) { } private void detach ( ) { for ( Iterator iter = requestTargets . iterator ( ) ; iter . hasNext ( ) ; ) { IRequestTarget target = ( ( IRequestTarget ) ( iter . next ( ) ) ) ; if ( target != null ) { try { target . detach ( this ) ; } catch ( RuntimeException e ) { RequestCycle . log . error ( ( ( "there<seq2seq4repair_space>was<seq2seq4repair_space>an<seq2seq4repair_space>error<seq2seq4repair_space>cleaning<seq2seq4repair_space>up<seq2seq4repair_space>target<seq2seq4repair_space>" + target ) + "." ) , e ) ; } } } try { <START_BUG> session . cleanupFeedbackMessages ( ) ; <END_BUG> } catch ( RuntimeException re ) { RequestCycle . log . error ( "there<seq2seq4repair_space>was<seq2seq4repair_space>an<seq2seq4repair_space>error<seq2seq4repair_space>cleaning<seq2seq4repair_space>up<seq2seq4repair_space>the<seq2seq4repair_space>feedback<seq2seq4repair_space>messages" , re ) ; } if ( updateSession ) { try { session . update ( ) ; } catch ( RuntimeException re ) { RequestCycle . log . error ( ( ( "there<seq2seq4repair_space>was<seq2seq4repair_space>an<seq2seq4repair_space>error<seq2seq4repair_space>updating<seq2seq4repair_space>the<seq2seq4repair_space>session<seq2seq4repair_space>" + ( session ) ) + "." ) , re ) ; } } try { IRequestLogger requestLogger = getApplication ( ) . getRequestLogger ( ) ; if ( requestLogger != null ) { requestLogger . requestTime ( ( ( System . currentTimeMillis ( ) ) - ( startTime ) ) ) ; } } catch ( RuntimeException re ) { RequestCycle . log . error ( "there<seq2seq4repair_space>was<seq2seq4repair_space>an<seq2seq4repair_space>error<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>RequestLogger<seq2seq4repair_space>ending." , re ) ; } try { session . requestDetached ( ) ; } catch ( RuntimeException re ) { RequestCycle . log . error ( ( ( "there<seq2seq4repair_space>was<seq2seq4repair_space>an<seq2seq4repair_space>error<seq2seq4repair_space>detaching<seq2seq4repair_space>the<seq2seq4repair_space>request<seq2seq4repair_space>from<seq2seq4repair_space>the<seq2seq4repair_space>session<seq2seq4repair_space>" + ( session ) ) + "." ) , re ) ; } if ( ( getResponse ( ) ) instanceof BufferedWebResponse ) { try { ( ( BufferedWebResponse ) ( getResponse ( ) ) ) . filter ( ) ; } catch ( RuntimeException re ) { RequestCycle . log . error ( "there<seq2seq4repair_space>was<seq2seq4repair_space>an<seq2seq4repair_space>error<seq2seq4repair_space>filtering<seq2seq4repair_space>the<seq2seq4repair_space>response." , re ) ; } } try { onEndRequest ( ) ; } catch ( RuntimeException e ) { RequestCycle . log . error ( "Exception<seq2seq4repair_space>occurred<seq2seq4repair_space>during<seq2seq4repair_space>onEndRequest" , e ) ; } try { threadDetach ( ) ; } catch ( RuntimeException re ) { RequestCycle . log . error ( "Exception<seq2seq4repair_space>occurred<seq2seq4repair_space>during<seq2seq4repair_space>threadDetach" , re ) ; } } private void prepare ( ) { } private final void processEventsAndRespond ( ) { } private final void respond ( ) { } private final IRequestCycleProcessor safeGetRequestProcessor ( ) { } private final void step ( ) { } private final void steps ( ) { } private final void threadDetach ( ) { } }

Fix:
session . cleanupRenderedFeedbackMessages ( ) ;