On Thu, 19 Jun 2025 22:13:09 GMT, Michael Strauß <[email protected]> wrote:
>> Johan Vos has updated the pull request incrementally with one additional
>> commit since the last revision:
>>
>> Fix missing ;
>
> modules/javafx.graphics/src/main/java/com/sun/glass/ui/headless/HeadlessRobot.java
> line 293:
>
>> 291: if (button == MouseButton.BACK) return MouseEvent.BUTTON_BACK;
>> 292: if (button == MouseButton.FORWARD) return
>> MouseEvent.BUTTON_FORWARD;
>> 293: return MouseEvent.BUTTON_NONE;
>
> Use an expression to get compile-time exhaustiveness checks:
> Suggestion:
>
> return switch (button) {
> case NONE -> MouseEvent.BUTTON_NONE;
> case PRIMARY -> MouseEvent.BUTTON_LEFT;
> case MIDDLE -> MouseEvent.BUTTON_OTHER;
> case SECONDARY -> MouseEvent.BUTTON_RIGHT;
> case BACK -> MouseEvent.BUTTON_BACK;
> case FORWARD -> MouseEvent.BUTTON_FORWARD;
> };
fixed
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/1836#discussion_r2189249816