Add tests for retrieving styled fonts from FontRegistry in non-UI threads - #4277
Merged
HeikoKlare merged 1 commit intoAug 24, 2026
Conversation
…eads FontRegistry supports retrieving a font from a thread that has no Display of its own: rather than failing, it falls back to the default font already realized on the registry's own display. That fallback is only covered by tests for the plain font, not for the bold and italic variants, which still have to be realized when they are requested. Add tests pinning that such a caller still gets a font in the requested style, and that the style is realized on the display the fallback font belongs to rather than on an arbitrary one. The latter matters because creating a Font without a device does not fail: SWT substitutes Display.getDefault(). With a single display that happens to be correct, with more than one it need not be, and a styled font can end up on a different display than the record holding it. Assisted-by: Claude Opus 5 <noreply@anthropic.com>
HeikoKlare
marked this pull request as ready for review
August 24, 2026 14:36
Contributor
Contributor
Author
|
Just test extensions, thus merging even though we are effectively in freeze period. |
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.
FontRegistrysupports retrieving a font from a thread that has noDisplayof its own, falling back to the default font instead of failing. That fallback is covered by a test forget(), but not forgetBold()andgetItalic(), whose variants still have to be realized when they are requested.These tests close that gap. They pass on
master— they document existing behaviour rather than change it.🤖 Generated with Claude Code