Buggy code:
public class DefaultPageStore implements IPageStore { private final DefaultPageStore . SerializedPagesCache serializedPagesCache ; private final IDataStore pageDataStore ; private final ISerializer pageSerializer ; public DefaultPageStore ( final ISerializer pageSerializer , final IDataStore dataStore , final int cacheSize ) { } public void destroy ( ) { } protected byte [ ] getPageData ( final String sessionId , final int pageId ) { } protected void removePageData ( final String sessionId , final int pageId ) { } protected void removePageData ( final String sessionId ) { } protected void storePageData ( final String sessionId , final int pageId , final byte [ ] data ) { } public IManageablePage getPage ( final String sessionId , final int id ) { DefaultPageStore . SerializedPage fromCache = serializedPagesCache . getPage ( sessionId , id ) ; <START_BUG> if ( fromCache != null ) { <END_BUG> return deserializePage ( fromCache . data ) ; } byte [ ] data = getPageData ( sessionId , id ) ; if ( data != null ) { return deserializePage ( data ) ; } return null ; } public void removePage ( final String sessionId , final int id ) { } public void storePage ( final String sessionId , final IManageablePage page ) { } public void unbind ( final String sessionId ) { } public IManageablePage convertToPage ( final Object object ) { } private DefaultPageStore . SerializedPage restoreStrippedSerializedPage ( final DefaultPageStore . SerializedPage serializedPage ) { } public Serializable prepareForSerialization ( final String sessionId , final Object object ) { } protected boolean storeAfterSessionReplication ( ) { } public Object restoreAfterSerialization ( final Serializable serializable ) { } protected static class SerializedPage implements Serializable { private static final long serialVersionUID = 1L ; private final int pageId ; private final String sessionId ; private final byte [ ] data ; public SerializedPage ( String sessionId , int pageId , byte [ ] data ) { } public byte [ ] getData ( ) { } public int getPageId ( ) { } public String getSessionId ( ) { } @ Override public boolean equals ( Object obj ) { } @ Override public int hashCode ( ) { } } protected DefaultPageStore . SerializedPage serializePage ( final String sessionId , final IManageablePage page ) { } protected IManageablePage deserializePage ( final byte [ ] data ) { } static class SerializedPagesCache { private final int size ; private final List < SoftReference < DefaultPageStore . SerializedPage > > cache ; public SerializedPagesCache ( final int size ) { } public DefaultPageStore . SerializedPage removePage ( final String sessionId , final int id ) { } public void removePages ( String sessionId ) { } public DefaultPageStore . SerializedPage getPage ( String sessionId , int pageId ) { Args . notNull ( sessionId , "sessionId" ) ; DefaultPageStore . SerializedPage result = null ; if ( ( size ) > 0 ) { synchronized ( cache ) { for ( Iterator < SoftReference < DefaultPageStore . SerializedPage > > i = cache . iterator ( ) ; i . hasNext ( ) ; ) { SoftReference < DefaultPageStore . SerializedPage > ref = i . next ( ) ; DefaultPageStore . SerializedPage entry = ref . get ( ) ; if ( ( ( entry != null ) && ( ( entry . getPageId ( ) ) == pageId ) ) && ( entry . getSessionId ( ) . equals ( sessionId ) ) ) { i . remove ( ) ; result = entry ; break ; } } if ( result != null ) { storePage ( result ) ; } } } return result ; } void storePage ( DefaultPageStore . SerializedPage page ) { } } }

Fix:
if ( ( fromCache != null ) && ( ( fromCache . data ) != null ) ) {