Safety assertions on head and tail modifications

This commit is contained in:
Jason Tedor 2015-10-08 17:51:16 -04:00
parent 818d217ede
commit a556e31010
1 changed files with 2 additions and 0 deletions

View File

@ -604,6 +604,7 @@ public class Cache<K, V> {
if (before == null) {
// removing the head
assert head == entry;
head = after;
if (head != null) {
head.before = null;
@ -616,6 +617,7 @@ public class Cache<K, V> {
if (after == null) {
// removing tail
assert tail == entry;
tail = before;
if (tail != null) {
tail.after = null;