Fix previous value of EmptyCache map representation#14702
Fix previous value of EmptyCache map representation#14702kokosing merged 2 commits intotrinodb:masterfrom
Conversation
findepi
left a comment
There was a problem hiding this comment.
LGTM
Would it be possible to have a test for this?
for empty and non-empty caches?
2a79241 to
cf23167
Compare
|
Added tests. PTAL |
There was a problem hiding this comment.
the above comment looks weird now
There was a problem hiding this comment.
But you forced pushed.
Would you consider
// putIfAbsent returns the previous value
There was a problem hiding this comment.
Sorry about that 🤦
Notice that the put method has the old comment still, I find old comment still useful. It is more about empty cache, not the put method. I will leave both ones.
cf23167 to
8ad23f4
Compare
lib/trino-collect/src/main/java/io/trino/collect/cache/EvictableCacheBuilder.java
Outdated
Show resolved
Hide resolved
lib/trino-collect/src/test/java/io/trino/collect/cache/TestEvictableCache.java
Outdated
Show resolved
Hide resolved
lib/trino-collect/src/test/java/io/trino/collect/cache/TestEvictableCache.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
The cache constructed in this test looks to be empty.
There was a problem hiding this comment.
I wanted to stress that it is not EmptyCache implementation
lib/trino-collect/src/test/java/io/trino/collect/cache/TestEvictableCache.java
Outdated
Show resolved
Hide resolved
lib/trino-collect/src/test/java/io/trino/collect/cache/TestEvictableCache.java
Outdated
Show resolved
Hide resolved
lib/trino-collect/src/test/java/io/trino/collect/cache/TestEvictableCache.java
Outdated
Show resolved
Hide resolved
lib/trino-collect/src/test/java/io/trino/collect/cache/TestEvictableCache.java
Outdated
Show resolved
Hide resolved
8ad23f4 to
b7ac8d0
Compare
lib/trino-collect/src/test/java/io/trino/collect/cache/TestEvictableCache.java
Outdated
Show resolved
Hide resolved
b7ac8d0 to
d8a631c
Compare
findepi
left a comment
There was a problem hiding this comment.
"Move DataProviders to trino-testing-services" LGTM
testing/trino-testing/pom.xml
Outdated
There was a problem hiding this comment.
Let me do it as follow up.
There was a problem hiding this comment.
But you forced pushed.
Would you consider
// putIfAbsent returns the previous value
lib/trino-collect/src/test/java/io/trino/collect/cache/TestEvictableCache.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
The cache under test is empty.
Add a comment capturing #14702 (comment)
There was a problem hiding this comment.
I prefer to rename the test
putIfAbsent returns previous value and since EmptyCache is not storing anything there is no previous value, so null should be returned.
d8a631c to
5d3202f
Compare
|
Do we need a release note for this? |
|
No. It is not changing anything from point of the view of user. |
Fix previous value of EmptyCache map representation
putIfAbsent returns previous value and since EmptyCache is not storing
anything there is no previous value, so null should be returned.