On Fri, 22 May 2026 21:58:25 GMT, Phil Race <[email protected]> wrote:
> This removes the remaining uses of AppContext and AppContext itself. > > Some tests needed to be removed. Some seemed possibly still useful if I > removed AppContext. > > The source code changes are fairly straightforward - almost entirely just > deletions. > > The only interesting question is where to call SunToolkit.initEQ() > It was usually initialized via the AppContext creation which isn't possible > any more. > > The EQ can - in theory - be created lazily. > But because the EQ needs to be created before any events are posted there > aren't many places to choose from. > I've put it in the SunToolkit constructor, and it is also - of course - still > initialized in the static method to get the EQ. > In postEvent() itself was the only other option that worked but then it is > checked *every* time an event is posted. > One of the 2 above seems to be always needed to cover all paths. > > --------- > - [x] I confirm that I make this contribution in accordance with the [OpenJDK > Interim AI Policy](https://openjdk.org/legal/ai). This pull request has now been integrated. Changeset: 05244e8d Author: Phil Race <[email protected]> URL: https://git.openjdk.org/jdk/commit/05244e8d374ea00807ed6bfd04d49ab4a0ef7324 Stats: 2209 lines in 23 files changed: 12 ins; 2156 del; 41 mod 8385347: Remove AppContext from SunToolkit and also remove AppContext Reviewed-by: azvegint, serb, kizune ------------- PR: https://git.openjdk.org/jdk/pull/31262
