Repository navigation
Use access order for LRU type cache eviction - #143
Open
Mr-KnightCLI wants to merge 1 commit into
Open
Mr-KnightCLI wants to merge 1 commit into
Mr-KnightCLI wants to merge 1 commit into
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
LRUTypeCache.CacheMapcurrently usesLinkedHashMap's default insertion order. Although the cache is documented as retaining the most recently accessed types, reading an entry does not refresh its eviction position. With capacity two, inserting A and B, reading A, then inserting C incorrectly evicts A instead of B.Enable access order in the backing map, retaining its default initial capacity and load factor. Reads and writes are already synchronized by
LRUTypeCache. Add regressions for both a successful cache lookup and replacement of an existing value refreshing the eviction order. No wall-clock performance claim is made; this restores the intended cache retention policy.Validation:
javac --release 8, then executed it through Maven Surefire using the project's JUnit dependencies.mvn -B -Dtest=TestResolvedTypeCache surefire:test.git diff --cached --check: passed before committing.Full Maven test-lifecycle attempts on Temurin 21.0.2 and Oracle JDK 22 stalled while compiling the broader test sources. The JDK 21 thread dump showed recursive javac
Type.isErroneouscalls. Those runs were stopped; the complete suite andverifywere not completed locally. The focused test and updated class were compiled independently to avoid that compiler stall.Prepared with OpenAI Codex assistance at the account owner's request for another tested open-source Java contribution. No independent human review is claimed.