-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix calculation of JCache's access expiration (fixes #158)
If the entry had been eternal then, on access, the current time was set to a duration with the unit of nanosecond instead of milliseconds. The JCache expiration time sometimes assumed wall-clock behavior and not nanoTime's. For writes there are still 3 magic values and those will be removed in the v3 JCache rewrite (to use Caffeine's variable expiration). Improved the documentation for Expiry. Unfortunately it would probably be best if the currentTime parameter was not provided. This was free as already obtained from the ticker, but that defaults to nanoTime and is not a wall-clock value. The main use cases for the parameter would be to calculate against an external resource's timestamp, but that must be done with a wall-clock resolution (System.currentTimeMillis). The focus on implementation details and writing docs late meant this API gaffe was overlooked, resulting in hinting towards an error prone usage.
- Loading branch information
Showing
10 changed files
with
121 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.