Buggy code:
public abstract class Session implements Serializable { private static final long serialVersionUID = 1L ; public static final String SESSION_ATTRIBUTE_NAME = "session" ; static final String pageMapEntryAttributePrefix = "p:" ; private static final ThreadLocal current = new ThreadLocal ( ) ; private static final ThreadLocal dirtyObjects = new ThreadLocal ( ) ; private static final Log log = LogFactory . getLog ( Session . class ) ; private static final String pageMapAttributePrefix = "m:" ; private ClientInfo clientInfo ; private transient IConverter converter ; private transient boolean dirty = false ; private Locale locale ; private int autoCreatePageMapCounter = 0 ; private LinkedList usedPageMaps = new LinkedList ( ) ; private String style ; private FeedbackMessages feedbackMessages = new FeedbackMessages ( new CopyOnWriteArrayList ( ) ) ; private transient Map pageMapsUsedInRequest ; private String id = null ; private transient ISessionStore sessionStore ; private MetaDataEntry [ ] metaData ; public static interface IPageMapVisitor { public void pageMap ( final PageMap pageMap ) { } } public static Session get ( ) { } public static boolean exists ( ) { } public static void set ( final Session session ) { } public static void unset ( ) { } protected Session ( final Application application ) { } public final void clear ( ) { } public final Application getApplication ( ) { } public IAuthorizationStrategy getAuthorizationStrategy ( ) { } public final IClassResolver getClassResolver ( ) { } public ClientInfo getClientInfo ( ) { } public final PageMap getDefaultPageMap ( ) { } public final String getId ( ) { } public Locale getLocale ( ) { } public final Serializable getMetaData ( final MetaDataKey key ) { } public final Page getPage ( final String pageMapName , final String path , final int versionNumber ) { if ( Session . log . isDebugEnabled ( ) ) { Session . log . debug ( ( ( ( ( "Getting<seq2seq4repair_space>page<seq2seq4repair_space>[path<seq2seq4repair_space>=<seq2seq4repair_space>" + path ) + ",<seq2seq4repair_space>versionNumber<seq2seq4repair_space>=<seq2seq4repair_space>" ) + versionNumber ) + "]" ) ) ; } PageMap pageMap = pageMapForName ( pageMapName , ( pageMapName == ( PageMap . DEFAULT_NAME ) ) ) ; if ( pageMap != null ) { synchronized ( pageMapsUsedInRequest ) { long startTime = System . currentTimeMillis ( ) ; Thread t = ( ( Thread ) ( pageMapsUsedInRequest . get ( pageMap ) ) ) ; while ( ( t != null ) && ( t != ( Thread . currentThread ( ) ) ) ) { try { <START_BUG> wait ( 20000 ) ; <END_BUG> } catch ( InterruptedException ex ) { throw new WicketRuntimeException ( ex ) ; } t = ( ( Thread ) ( pageMapsUsedInRequest . get ( pageMap ) ) ) ; if ( ( ( t != null ) && ( t != ( Thread . currentThread ( ) ) ) ) && ( ( startTime + 20000 ) < ( System . currentTimeMillis ( ) ) ) ) { throw new WicketRuntimeException ( ( ( ( ( ( "After<seq2seq4repair_space>20s<seq2seq4repair_space>the<seq2seq4repair_space>Pagemap<seq2seq4repair_space>" + pageMapName ) + "<seq2seq4repair_space>is<seq2seq4repair_space>still<seq2seq4repair_space>locked<seq2seq4repair_space>by:<seq2seq4repair_space>" ) + t ) + ",<seq2seq4repair_space>giving<seq2seq4repair_space>up<seq2seq4repair_space>trying<seq2seq4repair_space>to<seq2seq4repair_space>get<seq2seq4repair_space>the<seq2seq4repair_space>page<seq2seq4repair_space>for<seq2seq4repair_space>path:<seq2seq4repair_space>" ) + path ) ) ; } } pageMapsUsedInRequest . put ( pageMap , Thread . currentThread ( ) ) ; final String id = Strings . firstPathComponent ( path , PATH_SEPARATOR ) ; Page page = pageMap . get ( Integer . parseInt ( id ) , versionNumber ) ; if ( page == null ) { pageMapsUsedInRequest . remove ( pageMap ) ; pageMapsUsedInRequest . notifyAll ( ) ; } return page ; } } return null ; } public final IPageFactory getPageFactory ( ) { } public final IPageFactory getPageFactory ( final Page page ) { } public final PageMap pageMapForName ( String pageMapName , final boolean autoCreate ) { } public final synchronized PageMap createAutoPageMap ( ) { } public final synchronized String createAutoPageMapName ( ) { } public final List getPageMaps ( ) { } public final long getSizeInBytes ( ) { } public final String getStyle ( ) { } public final void init ( ) { } public void invalidate ( ) { } public final PageMap newPageMap ( final String name ) { } public final RequestCycle newRequestCycle ( final Request request , final Response response ) { } public final void removePageMap ( final PageMap 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 visitPageMaps ( final Session . IPageMapVisitor visitor ) { } public final void info ( final String message ) { } public final void warn ( final String message ) { } public final void error ( final String message ) { } public final FeedbackMessages getFeedbackMessages ( ) { } public final IConverter getConverter ( ) { } private void addFeedbackMessage ( String message , int level ) { } protected void detach ( ) { } protected final void dirty ( ) { } protected final Object getAttribute ( final String name ) { } protected final List getAttributeNames ( ) { } protected abstract IRequestCycleFactory getRequestCycleFactory ( ) { } protected ISessionStore getSessionStore ( ) { } protected final void removeAttribute ( String name ) { } protected final void setAttribute ( String name , Object value ) { } protected void update ( ) { } final void cleanupFeedbackMessages ( ) { } void dirtyPage ( final Page page ) { } final void requestDetached ( ) { } void dirtyPageMap ( final PageMap map ) { } private final String attributeForPageMapName ( final String pageMapName ) { } List getDirtyObjectsList ( ) { } }

Fix:
pageMapsUsedInRequest . wait ( 20000 ) ;