Buggy code:
public class DiskPageStore extends AbstractPageStore implements ISerializationAwarePageStore { protected static class PageMapEntry implements Serializable { private static final long serialVersionUID = 1L ; private String pageMapName ; private String fileName ; private PageWindowManager manager ; public String getPageMapName ( ) { } public String getFileName ( ) { } public PageWindowManager getManager ( ) { } } protected static class SessionEntry implements Serializable { private static final long serialVersionUID = 1L ; private String sessionId ; private final List < DiskPageStore . PageMapEntry > pageMapEntryList = new ArrayList < DiskPageStore . PageMapEntry > ( ) ; private transient DiskPageStore diskPageStore ; protected SessionEntry ( DiskPageStore diskPageStore ) { } public String getSessionId ( ) { } public int getTotalSize ( ) { } public List < DiskPageStore . PageMapEntry > getPageMapEntryList ( ) { } public DiskPageStore . PageMapEntry getPageMapEntry ( String pageMapName , boolean create ) { } private void removePageMapEntry ( DiskPageStore . PageMapEntry entry ) { } public synchronized void removePageMap ( String pageMapName ) { } public synchronized void savePage ( SerializedPage page ) { } public synchronized void removePage ( String pageMapName , int pageId ) { } public byte [ ] loadPage ( PageWindow window , String pageMapFileName ) { } public synchronized byte [ ] loadPage ( String pageMapName , int id , int versionNumber , int ajaxVersionNumber ) { } public synchronized void unbind ( ) { } public synchronized boolean exists ( String pageMapName , int pageId , int versionNumber ) { } } private File getStoreFolder ( ) { } private File getSessionFolder ( String sessionId , boolean create ) { } private void mkdirs ( File file ) { } private String getPageMapFileName ( String sessionId , String pageMapName , boolean createSessionFolder ) { } private final int maxSizePerPageMap ; protected int getMaxSizePerPageMap ( ) { } private final int maxSizePerSession ; protected int getMaxSizePerSession ( ) { } private final FileChannelPool fileChannelPool ; private final File fileStoreFolder ; protected File getFileStoreFolder ( ) { } private final String appName ; public DiskPageStore ( File fileStoreFolder , int maxSizePerPagemap , int maxSizePerSession , int fileChannelPoolCapacity ) { } @ SuppressWarnings ( "unchecked" ) private void loadIndex ( ) { } private void saveIndex ( ) { } private static File getDefaultFileStoreFolder ( ) { } public DiskPageStore ( int maxSizePerPagemap , int maxSizePerSession , int fileChannelPoolCapacity ) { } public DiskPageStore ( ) { } public void destroy ( ) { } private Map < String , DiskPageStore . SessionEntry > sessionIdToEntryMap = new ConcurrentHashMap < String , DiskPageStore . SessionEntry > ( ) ; protected DiskPageStore . SessionEntry getSessionEntry ( String sessionId , boolean createIfDoesNotExist ) { } public < T > Page < T > getPage ( String sessionId , String pagemap , int id , int versionNumber , int ajaxVersionNumber ) { } public void pageAccessed ( String sessionId , Page < ? > page ) { } private void removePage ( DiskPageStore . SessionEntry entry , String pageMap , int id ) { } public void removePage ( String sessionId , String pageMap , int id ) { } protected void storeSerializedPages ( String sessionId , List < SerializedPage > pages ) { } protected void onPagesSerialized ( String sessionId , List < SerializedPage > pages ) { } public void storePage ( String sessionId , Page < ? > page ) { } public void unbind ( String sessionId ) { <START_BUG> DiskPageStore . SessionEntry entry = sessionIdToEntryMap . get ( sessionId ) ; <END_BUG> if ( entry != null ) { if ( isSynchronous ( ) ) { entry . unbind ( ) ; } else { List < SerializedPage > pages = getPagesToSaveList ( sessionId ) ; synchronized ( pages ) { flushPagesToSaveList ( sessionId , pages ) ; entry . unbind ( ) ; } pagesToSaveAll . remove ( sessionId ) ; } } } private final Map < String , List < SerializedPage > > pagesToSaveAll = new ConcurrentHashMap < String , List < SerializedPage > > ( ) ; private final Map < String , List < SerializedPage > > pagesToSaveActive = new ConcurrentHashMap < String , List < SerializedPage > > ( ) ; protected List < SerializedPage > getPagesToSaveList ( String sessionId ) { } protected void flushPagesToSaveList ( String sessionId , List < SerializedPage > list ) { } private void schedulePagesSave ( String sessionId , List < SerializedPage > pages ) { } private class PageSavingThread implements Runnable { private volatile Boolean stop = Boolean . FALSE ; public void run ( ) { } public void stop ( ) { } } private void initPageSavingThread ( ) { } private DiskPageStore . PageSavingThread pageSavingThread = null ; protected int getSavingThreadSleepTime ( ) { } protected boolean isSynchronous ( ) { } private int lastRecentlySerializedPagesCacheSize = 50 ; public void setLastRecentlySerializedPagesCacheSize ( int lastRecentlySerializedPagesCacheSize ) { } protected int getLastRecentlySerializedPagesCacheSize ( ) { } private final SerializedPagesCache serializedPagesCache = new SerializedPagesCache ( getLastRecentlySerializedPagesCacheSize ( ) ) ; private SerializedPageWithSession stripSerializedPage ( SerializedPageWithSession page ) { } private byte [ ] getPageData ( String sessionId , int pageId , String pageMapName , int versionNumber , int ajaxVersionNumber ) { } private SerializedPageWithSession restoreStrippedSerializedPage ( SerializedPageWithSession page ) { } public Serializable prepareForSerialization ( String sessionId , Object page ) { } protected boolean storeAfterSessionReplication ( ) { } public Object restoreAfterSerialization ( Serializable serializable ) { } public Page < ? > convertToPage ( Object page ) { } public boolean containsPage ( String sessionId , String pageMapName , int pageId , int pageVersion ) { } private static final Logger log = LoggerFactory . getLogger ( DiskPageStore . class ) ; }

Fix:
DiskPageStore . SessionEntry entry = sessionIdToEntryMap . remove ( sessionId ) ;