Safety assertions on head and tail modifications
This commit is contained in:
parent
818d217ede
commit
a556e31010
|
@ -604,6 +604,7 @@ public class Cache<K, V> {
|
||||||
|
|
||||||
if (before == null) {
|
if (before == null) {
|
||||||
// removing the head
|
// removing the head
|
||||||
|
assert head == entry;
|
||||||
head = after;
|
head = after;
|
||||||
if (head != null) {
|
if (head != null) {
|
||||||
head.before = null;
|
head.before = null;
|
||||||
|
@ -616,6 +617,7 @@ public class Cache<K, V> {
|
||||||
|
|
||||||
if (after == null) {
|
if (after == null) {
|
||||||
// removing tail
|
// removing tail
|
||||||
|
assert tail == entry;
|
||||||
tail = before;
|
tail = before;
|
||||||
if (tail != null) {
|
if (tail != null) {
|
||||||
tail.after = null;
|
tail.after = null;
|
||||||
|
|
Loading…
Reference in New Issue