Buggy code:
public final Application getApplication ( ) { } public IAuthorizationStrategy getAuthorizationStrategy ( ) { } public final IClassResolver getClassResolver ( ) { } public ClientInfo getClientInfo ( ) { } public final IPageMap getDefaultPageMap ( ) { } public final FeedbackMessages getFeedbackMessages ( ) { } public final String getId ( ) { } public Locale getLocale ( ) { } public final Serializable getMetaData ( final MetaDataKey key ) { } protected boolean isCurrentRequestValid ( RequestCycle lockedRequestCycle ) { } public final Page getPage ( final int pageId , final int versionNumber ) { } public final Page getPage ( final String pageMapName , final String path , final int versionNumber ) { } public final IPageFactory getPageFactory ( ) { } public final IPageFactory getPageFactory ( final Page page ) { } public final List getPageMaps ( ) { } public final long getSizeInBytes ( ) { } public final String getStyle ( ) { } public final void info ( final String message ) { } public void invalidate ( ) { } public void invalidateNow ( ) { } public final boolean isSessionInvalidated ( ) { } public final boolean isTemporary ( ) { } public final IPageMap newPageMap ( final String name ) { } public final IPageMap pageMapForName ( String pageMapName , final boolean autoCreate ) { } public final void removePageMap ( final IPageMap pageMap ) { } public final void setApplication ( final Application application ) { } public final void setClientInfo ( ClientInfo clientInfo ) { } public final void setLocale ( final Locale locale ) { } public final void setMetaData ( final MetaDataKey key , final Serializable object ) { } public final Session setStyle ( final String style ) { } public final void touch ( Page page ) { } public final void untouch ( Page page ) { } public final void visitPageMaps ( final Session . IPageMapVisitor visitor ) { } public final void warn ( final String message ) { } private void addFeedbackMessage ( String message , int level ) { } private final String attributeForPageMapName ( final String pageMapName ) { } protected void attach ( ) { } protected void detach ( ) { } public final void dirty ( ) { } protected final Object getAttribute ( final String name ) { } protected final List getAttributeNames ( ) { } protected ISessionStore getSessionStore ( ) { } protected final void removeAttribute ( String name ) { } protected final void setAttribute ( String name , Object value ) { } protected final void update ( ) { } void dirtyPage ( final Page page ) { } void dirtyPageMap ( final IPageMap map ) { } List getDirtyObjectsList ( ) { } final void requestDetached ( ) { List touchedPages = ( ( List ) ( Session . touchedPages . get ( ) ) ) ; Session . touchedPages . set ( null ) ; if ( touchedPages != null ) { for ( int i = 0 ; i < ( touchedPages . size ( ) ) ; i ++ ) { Page page = ( ( Page ) ( touchedPages . get ( i ) ) ) ; page . getPageMap ( ) . put ( page ) ; } } if ( dirty ) { dirty = false ; setAttribute ( Session . SESSION_ATTRIBUTE_NAME , this ) ; } else { if ( Session . log . isDebugEnabled ( ) ) { Session . log . debug ( "update:<seq2seq4repair_space>Session<seq2seq4repair_space>not<seq2seq4repair_space>dirty." ) ; } } List dirtyObjects = ( ( List ) ( Session . dirtyObjects . get ( ) ) ) ; Session . dirtyObjects . set ( null ) ; Map tempMap = new HashMap ( ) ; if ( dirtyObjects != null ) { for ( final Iterator iterator = dirtyObjects . iterator ( ) ; iterator . hasNext ( ) ; ) { String attribute = null ; Object object = iterator . next ( ) ; if ( object instanceof Page ) { final Page page = ( ( Page ) ( object ) ) ; <START_BUG> if ( page . isStateless ( ) ) { <END_BUG> continue ; } attribute = page . getPageMap ( ) . attributeForId ( page . getNumericId ( ) ) ; if ( ( getAttribute ( attribute ) ) == null ) { continue ; } object = page . getPageMapEntry ( ) ; } else if ( object instanceof IPageMap ) { attribute = attributeForPageMapName ( ( ( IPageMap ) ( object ) ) . getName ( ) ) ; } tempMap . put ( attribute , object ) ; } } if ( ( tempMap . isEmpty ( ) ) == false ) { for ( Iterator i = tempMap . entrySet ( ) . iterator ( ) ; i . hasNext ( ) ; ) { Map . Entry entry = ( ( Map . Entry ) ( i . next ( ) ) ) ; setAttribute ( ( ( String ) ( entry . getKey ( ) ) ) , entry . getValue ( ) ) ; } } if ( ( pageMapsUsedInRequest ) != null ) { synchronized ( pageMapsUsedInRequest ) { Thread t = Thread . currentThread ( ) ; Iterator it = pageMapsUsedInRequest . entrySet ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { Map . Entry entry = ( ( Map . Entry ) ( it . next ( ) ) ) ; if ( ( ( ( Session . PageMapsUsedInRequestEntry ) ( entry . getValue ( ) ) ) . thread ) == t ) { it . remove ( ) ; } } pageMapsUsedInRequest . notifyAll ( ) ; } } } private int pageIdCounter = 0 ; protected synchronized int nextPageId ( ) { } public synchronized int nextSequenceValue ( ) { } }

Fix:
if ( page . isPageStateless ( ) ) {