File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
main/java/org/apache/ibatis/cache/decorators
test/java/org/apache/ibatis/cache Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright 2009-2022 the original author or authors.
2+ * Copyright 2009-2023 the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -64,6 +64,7 @@ public Object getObject(Object key) {
6464
6565 @ Override
6666 public Object removeObject (Object key ) {
67+ keyList .remove (key );
6768 return delegate .removeObject (key );
6869 }
6970
Original file line number Diff line number Diff line change @@ -60,4 +60,16 @@ void shouldFlushAllItemsOnDemand() {
6060 assertNull (cache .getObject (4 ));
6161 }
6262
63+ @ Test
64+ void shouldRiseConflictInBeyondFiveEntries () {
65+ FifoCache cache = new FifoCache (new PerpetualCache ("default" ));
66+ cache .setSize (5 );
67+ for (int i = 0 ; i < 5 ; i ++) {
68+ cache .putObject (i , i );
69+ }
70+ cache .removeObject (1 );
71+ cache .putObject (1 , 1 );
72+ assertNotNull (cache .getObject (0 ));
73+ }
74+
6375}
You can’t perform that action at this time.
0 commit comments