On Wed, 23 Nov 2022 23:21:52 GMT, Andy Goryachev <ango...@openjdk.org> wrote:
>> I wouldn't recommend that, since it will then obscure the main reason for >> this call -- to load the toolkit (honestly, the cast was probably an >> afterthought). So this would be OK: >> >> >> tk = Toolkit.getToolkit();//This step is not needed (Just to make >> sure StubToolkit is loaded into VM) >> assertTrue(tk instanceof StubToolkit); > > could we just create a method in Util instead of dragging multi-line > construct across the tests? > > e.g. `Util.loadStubToolkit()` ? Yes, but this is now getting to be a bit out of scope for this PR. Even adding the `assertTrue` requires running all the tests (which thankfully, GHA will do). Perhaps a better approach is to not make any more changes here, and file a follow-on bug to A) add a utility method, and B) call it from a `@BeforeClass` method (no need to call it more than once per class). ------------- PR: https://git.openjdk.org/jfx/pull/959