Buggy code:
public class DataCacheStoreManager extends DelegatingStoreManager { private Collection < OpenJPAStateManager > _inserts = null ; private Map < OpenJPAStateManager , BitSet > _updates = null ; private Collection < OpenJPAStateManager > _deletes = null ; private StoreContext _ctx = null ; private DataCacheManager _mgr = null ; private PCDataGenerator _gen = null ; public DataCacheStoreManager ( StoreManager sm ) { } public void setContext ( StoreContext ctx ) { } public void begin ( ) { } public void commit ( ) { } public void rollback ( ) { } private void evictTypes ( Collection < Class < ? > > classes ) { if ( classes . isEmpty ( ) ) return ; MetaDataRepository mdr = _ctx . getConfiguration ( ) . getMetaDataRepositoryInstance ( ) ; ClassLoader loader = _ctx . getClassLoader ( ) ; DataCache cache ; for ( Class < ? > cls : classes ) { cache = mdr . getMetaData ( cls , loader , false ) . getDataCache ( ) ; <START_BUG> if ( cache != null ) <END_BUG> cache . removeAll ( cls , false ) ; } } private void updateCaches ( ) { } private List < DataCachePCData > transformToVersionSafePCDatas ( DataCache cache , List < DataCacheStoreManager . PCDataHolder > holders ) { } private static DataCacheStoreManager . Modifications getModifications ( Map < DataCache , DataCacheStoreManager . Modifications > modMap , DataCache cache ) { } public boolean exists ( OpenJPAStateManager sm , Object edata ) { } public boolean isCached ( List < Object > oids , BitSet edata ) { } public boolean syncVersion ( OpenJPAStateManager sm , Object edata ) { } public boolean initialize ( OpenJPAStateManager sm , PCState state , FetchConfiguration fetch , Object edata ) { } private void cacheStateManager ( DataCache cache , OpenJPAStateManager sm , DataCachePCData data ) { } public boolean load ( OpenJPAStateManager sm , BitSet fields , FetchConfiguration fetch , int lockLevel , Object edata ) { } private void updateDataCache ( boolean found , OpenJPAStateManager sm , FetchConfiguration fetch ) { } public Collection < Object > loadAll ( Collection < OpenJPAStateManager > sms , PCState state , int load , FetchConfiguration fetch , Object edata ) { } private static Map < OpenJPAStateManager , BitSet > addUnloaded ( OpenJPAStateManager sm , BitSet fields , Map < OpenJPAStateManager , BitSet > unloaded ) { } public Collection < Exception > flush ( Collection < OpenJPAStateManager > states ) { } private void notifyOptimisticLockFailure ( OptimisticException e ) { } private DataCachePCData newPCData ( OpenJPAStateManager sm ) { } boolean bypass ( FetchConfiguration fetch , int load ) { } private boolean isLocking ( FetchConfiguration fetch ) { } private static class Modifications { public final List < DataCacheStoreManager . PCDataHolder > additions = new ArrayList < DataCacheStoreManager . PCDataHolder > ( ) ; public final List < DataCacheStoreManager . PCDataHolder > newUpdates = new ArrayList < DataCacheStoreManager . PCDataHolder > ( ) ; public final List < DataCacheStoreManager . PCDataHolder > existingUpdates = new ArrayList < DataCacheStoreManager . PCDataHolder > ( ) ; public final List < Object > deletes = new ArrayList < Object > ( ) ; } private static class PCDataHolder { public final DataCachePCData pcdata ; public final OpenJPAStateManager sm ; public PCDataHolder ( DataCachePCData pcdata , OpenJPAStateManager sm ) { } } }

Fix:
if ( ( cache != null ) && ( cache . getEvictOnBulkUpdate ( ) ) )