On Wed, 9 Sep 2026 18:40:55 GMT, Marius Hanl <[email protected]> wrote:

>> modules/javafx.graphics/src/test/java/test/javafx/scene/NodeTest.java line 
>> 112:
>> 
>>> 110:     public void setUp() {
>>> 111:         toolkit = (StubToolkit) Toolkit.getToolkit();
>>> 112:         stage = new Stage();
>> 
>> 1. many other tests do `((StubToolkit) Toolkit.getToolkit())` so it probably 
>> makes sense either do the same, or fix the other test to use this reference
>> 2. this Stage is being created for each test, but only used it in one, is 
>> this right?
>> 
>> what do you think?
>
> changed. Regarding `StubToolkit`, normally the cast is not needed. But 
> `StubToolkit` has some methods that might be needed (rarely) for tests.
> 
> Change the `Stage` logic. Note that the `StageLoader` would be perfect here, 
> but only accessible in `javafx.controls`. I would really like to move it in a 
> testbug PR, but the diff will probably be huge. What do you think? If this is 
> okay, I will create a ticket.

I think it's ok for now, only one test needs a `Stage`.

-------------

PR Review Comment: https://git.openjdk.org/jfx/pull/2191#discussion_r3972264746

Reply via email to