On Thu, 11 Jun 2026 10:50:10 GMT, Christopher Schnick <[email protected]> 
wrote:

>> modules/javafx.controls/src/test/java/test/javafx/scene/control/ComboBoxTest.java
>>  line 603:
>> 
>>> 601: 
>>> 602:         // Calls updateDisplayNode()
>>> 603:         getDisplayNode();
>> 
>> This looks a bit weird - but should be the `buttonCell`, right?
>> 
>> So you may can just do: `ListCell<?> buttonCell = getDisplayNode()`
>> and then use it below for the assertions
>> 
>>         assertNotNull(buttonCell.getGraphic());
>>         assertEquals("null-text", ((Label) 
>> buttonCell.getGraphic()).getText());
>> 
>>         comboBox.setValue("ITEM1");
>>         assertEquals("ITEM1", ((Label) buttonCell.getGraphic()).getText());
>> 
>>         comboBox.setValue("ITEM2");
>>         assertEquals("ITEM2", ((Label) buttonCell.getGraphic()).getText());
>
> I think I mentioned that before, this is done to prevent calls to 
> updateDisplayNode(). E.g. the method getDisplayNode() calls 
> updateDisplayNode(), which would defeat the point of the test

Yes, thats why my idea is to assign it once here and just reuse it below

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

PR Review Comment: https://git.openjdk.org/jfx/pull/2179#discussion_r3395947765

Reply via email to