René's URL Explorer Experiment


Title: Add remove, computeIfAbsent and keys() by kasapdev · Pull Request #1 · kasapdev/java-simple-cache · GitHub

Open Graph Title: Add remove, computeIfAbsent and keys() by kasapdev · Pull Request #1 · kasapdev/java-simple-cache

X Title: Add remove, computeIfAbsent and keys() by kasapdev · Pull Request #1 · kasapdev/java-simple-cache

Description: What Adds three methods to LruCache: V remove(K key) removes an entry and returns its live value (null if absent/expired). V computeIfAbsent(K key, Function loader) (plus an overload with an explicit ttlMillis) returns the cached value or computes, stores and returns it. List keys() returns a snapshot of the live keys, least- to most-recently-used (eviction order). Why The cache offered no way to invalidate a single key, so callers had to clear() everything or wait for TTL. The "get, check for null, load, put" pattern was left to every caller, and done naively from several threads it loads the same value repeatedly (a thundering herd on a cold key). computeIfAbsent runs under the existing lock, so concurrent callers for one key trigger exactly one load. keys() gives a debugging/inspection view without perturbing recency. Behaviour remove is not a lookup: hit/miss statistics are untouched. computeIfAbsent counts as exactly one hit or one miss. A null loader result stores nothing; a thrown exception propagates and stores nothing; an expired entry is treated as a miss. Documented caveat: the loader runs under the lock, so it must not call back into the cache. keys() does not refresh recency (it iterates the entry set, which is not an access in access-ordered LinkedHashMap) and skips expired entries. Additive: no change to existing methods. CHANGELOG.md (1.3.0) and the README API table are updated. Testing Compiled with javac -Xlint:all (no warnings) and LruCacheTest passes, with 23 new checks covering: remove return values, expired/absent, size and freed-slot reuse, and no stat impact; computeIfAbsent hit/miss accounting, null result, exception, both TTL overloads, and null-loader rejection; a contention test where 8 threads race for one key and the loader runs exactly once; and keys() ordering, being a detached copy, not changing which entry gets evicted, and skipping expired entries. 🤖 Generated with Claude Code

Open Graph Description: What Adds three methods to LruCache: V remove(K key) removes an entry and returns its live value (null if absent/expired). V computeIfAbsent(K key, Function loader) (plus an overload with an expli...

X Description: What Adds three methods to LruCache: V remove(K key) removes an entry and returns its live value (null if absent/expired). V computeIfAbsent(K key, Function loader) (plus an overload with an expli...

Opengraph URL: https://github.com/kasapdev/java-simple-cache/pull/1

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.112.4

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:a65c123e-d8c1-05bc-02d2-2b67ae8411a7
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idC728:43FF1:264360B:310C2D0:6B03EF5B
html-safe-noncebcb93f3684580cab7b3e4d75dcdec00cf848197b10bb9921403b8f2db227b07c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNzI4OjQzRkYxOjI2NDM2MEI6MzEwQzJEMDo2QjAzRUY1QiIsInZpc2l0b3JfaWQiOiI3MTE2MzMwODU5MjcxMjg2NjIwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacc5d61da16bc874abbfe2c4c8e34098db496042ab7c4f15d10c87640237836e82
hovercard-subject-tagpull_request:4581364473
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/kasapdev/java-simple-cache/pull/1/files
twitter:imagehttps://avatars.githubusercontent.com/u/85077328?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/85077328?s=400&v=4
og:image:altWhat Adds three methods to LruCache: V remove(K key) removes an entry and returns its live value (null if absent/expired). V computeIfAbsent(K key, Function loader) (plus an overload with an expli...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/kasapdev/java-simple-cache git https://github.com/kasapdev/java-simple-cache.git
octolytics-dimension-user_id85077328
octolytics-dimension-user_loginkasapdev
octolytics-dimension-repository_id1358572019
octolytics-dimension-repository_nwokasapdev/java-simple-cache
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1358572019
octolytics-dimension-repository_network_root_nwokasapdev/java-simple-cache
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/kasapdev/java-simple-cache/pull/1/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fkasapdev%2Fjava-simple-cache%2Fpull%2F1%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fkasapdev%2Fjava-simple-cache%2Fpull%2F1%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=kasapdev%2Fjava-simple-cache
Reloadhttps://github.com/kasapdev/java-simple-cache/pull/1/files
Reloadhttps://github.com/kasapdev/java-simple-cache/pull/1/files
Reloadhttps://github.com/kasapdev/java-simple-cache/pull/1/files
kasapdevhttps://github.com/kasapdev
java-simple-cachehttps://github.com/kasapdev/java-simple-cache
Codehttps://github.com/kasapdev/java-simple-cache
Issueshttps://github.com/kasapdev/java-simple-cache/issues
Pull requestshttps://github.com/kasapdev/java-simple-cache/pulls
Actionshttps://github.com/kasapdev/java-simple-cache/actions
Projectshttps://github.com/kasapdev/java-simple-cache/projects
Security and qualityhttps://github.com/kasapdev/java-simple-cache/security
Insightshttps://github.com/kasapdev/java-simple-cache/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fkasapdev%2Fjava-simple-cache%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fkasapdev%2Fjava-simple-cache%2Fissues%2Fnew%2Fchoose
kasapdevhttps://github.com/kasapdev
mainhttps://github.com/kasapdev/java-simple-cache/tree/main
feat/remove-compute-keyshttps://github.com/kasapdev/java-simple-cache/tree/feat/remove-compute-keys
Conversation 0 https://github.com/kasapdev/java-simple-cache/pull/1
Commits 1 https://github.com/kasapdev/java-simple-cache/pull/1/commits
Checks 2 https://github.com/kasapdev/java-simple-cache/pull/1/checks
Files changed https://github.com/kasapdev/java-simple-cache/pull/1/files
Please reload this pagehttps://github.com/kasapdev/java-simple-cache/pull/1/files
Add remove, computeIfAbsent and keys() https://github.com/kasapdev/java-simple-cache/pull/1/files#top
Show all changes 1 commit https://github.com/kasapdev/java-simple-cache/pull/1/files
fd6c495 Add remove, computeIfAbsent and keys kasapdev Sep 20, 2026 https://github.com/kasapdev/java-simple-cache/pull/1/commits/fd6c4956782f75a7a9bfd512484f4a193e77e103
Clear filters https://github.com/kasapdev/java-simple-cache/pull/1/files
Please reload this pagehttps://github.com/kasapdev/java-simple-cache/pull/1/files
Please reload this pagehttps://github.com/kasapdev/java-simple-cache/pull/1/files
CHANGELOG.md https://github.com/kasapdev/java-simple-cache/pull/1/files#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4ed
README.md https://github.com/kasapdev/java-simple-cache/pull/1/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5
LruCache.java https://github.com/kasapdev/java-simple-cache/pull/1/files#diff-4bdffb62c5a89ba9d875ddae2bda37c430e4653e0123da2ec32cd6492df50f7e
LruCacheTest.java https://github.com/kasapdev/java-simple-cache/pull/1/files#diff-8fa8ff31ed5abda4907cb9ef4373f691d7c430ddd12414fd547916a04141f883
CHANGELOG.mdhttps://github.com/kasapdev/java-simple-cache/pull/1/files#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4ed
View file https://github.com/kasapdev/java-simple-cache/blob/fd6c4956782f75a7a9bfd512484f4a193e77e103/CHANGELOG.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/kasapdev/java-simple-cache/pull/1/{{ revealButtonHref }}
https://github.com/kasapdev/java-simple-cache/pull/1/files#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4ed
https://github.com/kasapdev/java-simple-cache/pull/1/files#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4ed
README.mdhttps://github.com/kasapdev/java-simple-cache/pull/1/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5
View file https://github.com/kasapdev/java-simple-cache/blob/fd6c4956782f75a7a9bfd512484f4a193e77e103/README.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/kasapdev/java-simple-cache/pull/1/{{ revealButtonHref }}
https://github.com/kasapdev/java-simple-cache/pull/1/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5
https://github.com/kasapdev/java-simple-cache/pull/1/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5
https://github.com/kasapdev/java-simple-cache/pull/1/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5
https://github.com/kasapdev/java-simple-cache/pull/1/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5
src/main/java/dev/kasapdev/simplecache/LruCache.javahttps://github.com/kasapdev/java-simple-cache/pull/1/files#diff-4bdffb62c5a89ba9d875ddae2bda37c430e4653e0123da2ec32cd6492df50f7e
View file https://github.com/kasapdev/java-simple-cache/blob/fd6c4956782f75a7a9bfd512484f4a193e77e103/src/main/java/dev/kasapdev/simplecache/LruCache.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/kasapdev/java-simple-cache/pull/1/{{ revealButtonHref }}
https://github.com/kasapdev/java-simple-cache/pull/1/files#diff-4bdffb62c5a89ba9d875ddae2bda37c430e4653e0123da2ec32cd6492df50f7e
https://github.com/kasapdev/java-simple-cache/pull/1/files#diff-4bdffb62c5a89ba9d875ddae2bda37c430e4653e0123da2ec32cd6492df50f7e
https://github.com/kasapdev/java-simple-cache/pull/1/files#diff-4bdffb62c5a89ba9d875ddae2bda37c430e4653e0123da2ec32cd6492df50f7e
src/test/java/dev/kasapdev/simplecache/LruCacheTest.javahttps://github.com/kasapdev/java-simple-cache/pull/1/files#diff-8fa8ff31ed5abda4907cb9ef4373f691d7c430ddd12414fd547916a04141f883
View file https://github.com/kasapdev/java-simple-cache/blob/fd6c4956782f75a7a9bfd512484f4a193e77e103/src/test/java/dev/kasapdev/simplecache/LruCacheTest.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/kasapdev/java-simple-cache/pull/1/{{ revealButtonHref }}
https://github.com/kasapdev/java-simple-cache/pull/1/files#diff-8fa8ff31ed5abda4907cb9ef4373f691d7c430ddd12414fd547916a04141f883
https://github.com/kasapdev/java-simple-cache/pull/1/files#diff-8fa8ff31ed5abda4907cb9ef4373f691d7c430ddd12414fd547916a04141f883
https://github.com/kasapdev/java-simple-cache/pull/1/files#diff-8fa8ff31ed5abda4907cb9ef4373f691d7c430ddd12414fd547916a04141f883
Please reload this pagehttps://github.com/kasapdev/java-simple-cache/pull/1/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlno-cache

Viewport: width=device-width


URLs of crawlers that visited me.