File tree 2 files changed +14
-1
lines changed
main/java/org/apache/ibatis/cache/decorators
test/java/org/apache/ibatis/cache
2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2009-2022 the original author or authors.
2
+ * Copyright 2009-2023 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -64,6 +64,7 @@ public Object getObject(Object key) {
64
64
65
65
@ Override
66
66
public Object removeObject (Object key ) {
67
+ keyList .remove (key );
67
68
return delegate .removeObject (key );
68
69
}
69
70
Original file line number Diff line number Diff line change @@ -60,4 +60,16 @@ void shouldFlushAllItemsOnDemand() {
60
60
assertNull (cache .getObject (4 ));
61
61
}
62
62
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
+
63
75
}
You can’t perform that action at this time.
0 commit comments