• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ben-manes / caffeine / #5314
100%
master: 100%

Build:
Build:
LAST BUILD BRANCH: v3.dev
DEFAULT BRANCH: master
Ran 22 Feb 2026 08:03AM UTC
Jobs 1
Files 78
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

22 Feb 2026 07:33AM UTC coverage: 99.962%. Remained the same
#5314

push

github

ben-manes
fix putIfAbsent calculating the read expiry from the offered new value

When the value is present in the cache the offered new value for insert
is ignored and the current value is returned. If using expireAfter then
Expiry's expireAfterRead(..) is called to calculate the new expiration
time if changed. This was being passed the abandoned new value, not
the existing value, which was incorrect. The unit test for this case
was accidentally verifying the old value was passed in and asserting
this typo.

This call mistake is very rare and should be benign. Typically an
optimistic fast path suceeds to avoid unnecessary locking which
correctly uses the current value. It was only if a race of the entry
appearing expired or GC'd, but a concurrent insert rectified that,
did the lock fallback's incorrect call get used. Most putIfAbsent calls
are for the same value or a memoizing proxy, and then unlikely to
use access expiration or inspect the value for the calculation. That
made it very rare to be negatively impacted by this mistake.

3832 of 3840 branches covered (99.79%)

1 of 1 new or added line in 1 file covered. (100.0%)

7874 of 7877 relevant lines covered (99.96%)

1.0 hits per line

Jobs
ID Job ID Ran Files Coverage
1 #5314.1 22 Feb 2026 08:03AM UTC 78
99.96
Source Files on build #5314
  • Tree
  • List 78
  • Changed 1
  • Source Changed 1
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • 211dd547 on github
  • Prev Build on master
  • Next Build on v3.dev
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc