Buggy code:
public final class SimpleSessionStore extends BaseInterceptor { int manager_note ; int maxActiveSessions = - 1 ; int size = 16 ; int max = 256 ; public SimpleSessionStore ( ) { } public void setMaxActiveSessions ( int count ) { } public void setInitialPool ( int initial ) { } public void setMaxPool ( int max ) { } public void engineInit ( ContextManager cm ) throws TomcatException { } public void reload ( Request req , Context ctx ) throws TomcatException { ClassLoader newLoader = ctx . getClassLoader ( ) ; SimpleSessionStore . SimpleSessionManager sM = getManager ( ctx ) ; <START_BUG> Enumeration sessionEnum = sM . getSessionIds ( ) ; <END_BUG> while ( sessionEnum . hasMoreElements ( ) ) { ServerSession session = ( ( ServerSession ) ( sessionEnum . nextElement ( ) ) ) ; ClassLoader oldLoader = ( ( ClassLoader ) ( ctx . getContainer ( ) . getNote ( "oldLoader" ) ) ) ; Hashtable newSession = new Hashtable ( ) ; Enumeration e = session . getAttributeNames ( ) ; while ( e . hasMoreElements ( ) ) { String key = ( ( String ) ( e . nextElement ( ) ) ) ; Object value = session . getAttribute ( key ) ; if ( ( value . getClass ( ) . getClassLoader ( ) ) != oldLoader ) { newSession . put ( key , value ) ; } else if ( value instanceof Serializable ) { Object newValue = ObjectSerializer . doSerialization ( newLoader , value ) ; newSession . put ( key , newValue ) ; } } e = newSession . keys ( ) ; while ( e . hasMoreElements ( ) ) { String key = ( ( String ) ( e . nextElement ( ) ) ) ; session . removeAttribute ( key ) ; } if ( ( debug ) > 0 ) log ( ( "Prepare<seq2seq4repair_space>for<seq2seq4repair_space>reloading,<seq2seq4repair_space>SUSPEND<seq2seq4repair_space>" + session ) ) ; session . setState ( STATE_SUSPEND , req ) ; if ( ( debug ) > 0 ) log ( ( "After<seq2seq4repair_space>reloading,<seq2seq4repair_space>RESTORED<seq2seq4repair_space>" + session ) ) ; session . setState ( STATE_RESTORED , req ) ; e = newSession . keys ( ) ; while ( e . hasMoreElements ( ) ) { String key = ( ( String ) ( e . nextElement ( ) ) ) ; Object value = newSession . get ( key ) ; session . setAttribute ( key , value ) ; } } } public ServerSession findSession ( Request request , String sessionId , boolean create ) { } public void contextInit ( Context ctx ) throws TomcatException { } public void contextShutdown ( Context ctx ) throws TomcatException { } public int sessionState ( Request req , ServerSession session , int state ) { } public Enumeration getSessionIds ( Context ctx ) { } public Enumeration getSessions ( Context ctx ) { } public int getSessionCount ( Context ctx ) { } public int getRecycledCount ( Context ctx ) { } public ServerSession findSession ( Context ctx , String sessionId ) { } private SimpleSessionStore . SimpleSessionManager getManager ( Context ctx ) { } public static class SimpleSessionManager { private int debug = 0 ; private BaseInterceptor mod ; protected SimplePool recycled = new SimplePool ( ) ; protected Hashtable sessions = new Hashtable ( ) ; public SimpleSessionManager ( ) { } public void setDebug ( int l ) { } public void setModule ( BaseInterceptor bi ) { } public Enumeration getSessionIds ( ) { } public Enumeration getSessions ( ) { } public int getSessionCount ( ) { } public int getRecycledCount ( ) { } public ServerSession findSession ( String id ) { } public void removeSession ( ServerSession session ) { } public ServerSession getNewSession ( Request req , Context ctx ) { } } }

Fix:
Enumeration sessionEnum = sM . getSessions ( ) ;