Skip to content
Snippets Groups Projects
Commit 0e2b99fb authored by Tobias Pietzsch's avatar Tobias Pietzsch
Browse files

Make local cache KeyBimaps more strict

Before, mapping any global Key to local Long index would just return the
Key's index, disregarding whether the Key actually belonged to the local
cache. Now, it is checked and if the Key is from a different local cache,
null will be returned.
parent b072b773
No related branches found
No related tags found
No related merge requests found
......@@ -218,9 +218,11 @@ public class VolatileGlobalCellCache implements CacheControl
}
};
final KeyBimap< Long, Key > bimap = KeyBimap.< Long, Key >build(
final KeyBimap< Long, Key > bimap = KeyBimap.build(
index -> new Key( timepoint, setup, level, index ),
key -> key.index );
key -> ( key.timepoint == timepoint && key.setup == setup && key.level == level )
? key.index
: null );
final Cache< Long, Cell< ? > > cache = backingCache
.mapKeys( bimap )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment