From a5191fb0b48eb54c807d2810353800e12770731b Mon Sep 17 00:00:00 2001 From: Dirk Lemmermann Date: Fri, 13 Dec 2024 11:30:54 +0100 Subject: [PATCH] Fix selection mode comparison in DateRangeView Replaced `!=` with `Objects.equals()` to ensure proper comparison of selection modes. This prevents potential issues when switching selection modes and maintains consistent behavior. --- .../src/main/java/com/dlsc/gemsfx/daterange/DateRangeView.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gemsfx/src/main/java/com/dlsc/gemsfx/daterange/DateRangeView.java b/gemsfx/src/main/java/com/dlsc/gemsfx/daterange/DateRangeView.java index 6003333e..139819fa 100644 --- a/gemsfx/src/main/java/com/dlsc/gemsfx/daterange/DateRangeView.java +++ b/gemsfx/src/main/java/com/dlsc/gemsfx/daterange/DateRangeView.java @@ -41,7 +41,7 @@ public DateRangeView() { selectionModel = new SelectionModel(); selectionModel.setSelectionMode(SelectionModel.SelectionMode.DATE_RANGE); selectionModel.selectionModeProperty().addListener(it -> { - if (selectionModel.getSelectionMode() != SelectionModel.SelectionMode.DATE_RANGE) { + if (!Objects.equals(selectionModel.getSelectionMode(), SelectionModel.SelectionMode.DATE_RANGE)) { throw new UnsupportedOperationException("SINGLE_DATE and MULTIPLE_DATES modes are not supported"); } });