From 9652c9a7ced728d532a95812b4f33b3eac331a68 Mon Sep 17 00:00:00 2001 From: mkpaz Date: Fri, 10 Feb 2023 15:57:48 +0400 Subject: [PATCH] Fix IDE code inspection warnings --- .../base/controls/RingProgressIndicatorSkin.java | 1 - base/src/main/java/atlantafx/base/theme/Styles.java | 2 +- .../atlantafx/sampler/page/components/DatePickerPage.java | 2 +- .../java/atlantafx/sampler/page/components/TablePage.java | 2 +- .../atlantafx/sampler/page/components/TreeTablePage.java | 2 +- .../page/showcase/widget/WidgetCollectionPage.java | 8 ++++---- 6 files changed, 8 insertions(+), 9 deletions(-) diff --git a/base/src/main/java/atlantafx/base/controls/RingProgressIndicatorSkin.java b/base/src/main/java/atlantafx/base/controls/RingProgressIndicatorSkin.java index 6ec62f2..34f3843 100755 --- a/base/src/main/java/atlantafx/base/controls/RingProgressIndicatorSkin.java +++ b/base/src/main/java/atlantafx/base/controls/RingProgressIndicatorSkin.java @@ -9,7 +9,6 @@ import javafx.animation.Animation; import javafx.animation.Interpolator; import javafx.animation.RotateTransition; import javafx.beans.property.DoubleProperty; -import javafx.beans.value.WritableValue; import javafx.css.CssMetaData; import javafx.css.Styleable; import javafx.css.StyleableDoubleProperty; diff --git a/base/src/main/java/atlantafx/base/theme/Styles.java b/base/src/main/java/atlantafx/base/theme/Styles.java index 51e51d7..f3f6a4f 100644 --- a/base/src/main/java/atlantafx/base/theme/Styles.java +++ b/base/src/main/java/atlantafx/base/theme/Styles.java @@ -118,7 +118,7 @@ public final class Styles { throw new NullPointerException("PseudoClass cannot be null!"); } - if (excludes != null && excludes.length > 0) { + if (excludes != null) { for (PseudoClass exclude : excludes) { node.pseudoClassStateChanged(exclude, false); } diff --git a/sampler/src/main/java/atlantafx/sampler/page/components/DatePickerPage.java b/sampler/src/main/java/atlantafx/sampler/page/components/DatePickerPage.java index d10746e..ec1d571 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/components/DatePickerPage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/components/DatePickerPage.java @@ -232,7 +232,7 @@ public class DatePickerPage extends AbstractPage { @Override public void updateItem(LocalDate date, boolean empty) { super.updateItem(date, empty); - setDisable(empty || date.compareTo(TODAY) < 0); + setDisable(empty || date.isBefore(TODAY)); } } diff --git a/sampler/src/main/java/atlantafx/sampler/page/components/TablePage.java b/sampler/src/main/java/atlantafx/sampler/page/components/TablePage.java index 3e3ded4..70d5944 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/components/TablePage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/components/TablePage.java @@ -251,7 +251,7 @@ public class TablePage extends AbstractPage { final var resizePolicyCaption = new CaptionMenuItem("Resize Policy"); final var resizePolicyGroup = new ToggleGroup(); resizePolicyGroup.selectedToggleProperty().addListener((obs, old, val) -> { - if (val != null && val.getUserData() instanceof Callback policy) { + if (val != null && val.getUserData() instanceof Callback policy) { //noinspection rawtypes,unchecked table.setColumnResizePolicy((Callback) policy); } diff --git a/sampler/src/main/java/atlantafx/sampler/page/components/TreeTablePage.java b/sampler/src/main/java/atlantafx/sampler/page/components/TreeTablePage.java index fb004de..f0bcaa1 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/components/TreeTablePage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/components/TreeTablePage.java @@ -230,7 +230,7 @@ public class TreeTablePage extends AbstractPage { final var resizePolicyCaption = new CaptionMenuItem("Resize Policy"); final var resizePolicyGroup = new ToggleGroup(); resizePolicyGroup.selectedToggleProperty().addListener((obs, old, val) -> { - if (val != null && val.getUserData() instanceof Callback policy) { + if (val != null && val.getUserData() instanceof Callback policy) { //noinspection rawtypes,unchecked treeTable.setColumnResizePolicy((Callback) policy); } diff --git a/sampler/src/main/java/atlantafx/sampler/page/showcase/widget/WidgetCollectionPage.java b/sampler/src/main/java/atlantafx/sampler/page/showcase/widget/WidgetCollectionPage.java index 2720610..964c9ad 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/showcase/widget/WidgetCollectionPage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/showcase/widget/WidgetCollectionPage.java @@ -96,10 +96,10 @@ public class WidgetCollectionPage extends BorderPane implements Page { @SuppressWarnings("ImmutableEnumChecker") public enum Example { - CARD("Card", () -> new CardSample()), - MESSAGE("Message", () -> new MessageSample()), - STEPPER("Stepper", () -> new StepperSample()), - TAG("Tag", () -> new TagSample()); + CARD("Card", CardSample::new), + MESSAGE("Message", MessageSample::new), + STEPPER("Stepper", StepperSample::new), + TAG("Tag", TagSample::new); private final String name; private final Supplier supplier;