Clean up FontRegistry's legacy collection handling - #4268
Open
HeikoKlare wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request simplifies FontRegistry collection handling and font-record lifecycle management, including invalidation before listener notifications.
Changes:
- Replaces raw iterators and casts with typed collection APIs.
- Refactors font allocation and disposal responsibilities.
- Documents
cleanOnDisplayDisposal == falsebehavior. - Ensures replaced records are invalidated before notifications.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
FontRegistry still handles its collections the way it did before generics: explicit Iterators, casts through Object, and one variable reused for two unrelated values. It also lets FontRecord reach into the registry to retire its own fonts, mixing up who owns that decision. Simplify all of that, and write down what cleanOnDisplayDisposal == false already promises. No behavior change, other than put() now invalidating the replaced record entirely before notifying listeners rather than partly after, so the registry is consistent by the time they run. That listeners already see the new font when notified was untested, so a test now covers it. Assisted-by: Claude Opus 5 <noreply@anthropic.com>
HeikoKlare
force-pushed
the
fontregistry-multidisplay-step1e
branch
from
August 21, 2026 16:14
5f1feb8 to
719d847
Compare
HeikoKlare
marked this pull request as ready for review
August 21, 2026 16:36
Contributor
Test Results 858 files ±0 858 suites ±0 46m 1s ⏱️ - 4m 32s For more details on these errors, see this check. Results for commit 719d847. ± Comparison against base commit 5b3e6dd. |
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.
Pure simplification of long-standing awkwardness in
FontRegistry: collections handled as if generics did not exist (explicitIterators, casts throughObject), one variable ingetFontRecord()reused for two unrelated values, andFontRecordreaching into the registry to retire its own fonts rather than just reporting which ones it allocated.Also documents what
cleanOnDisplayDisposal == falsealready promises.No behaviour change, other than
put()now invalidating the replaced record entirely before notifying listeners rather than partly after, so the registry is consistent by the time they run.🤖 Generated with Claude Code