Fix IDE code inspection warnings

This commit is contained in:
mkpaz 2023-02-10 15:57:48 +04:00
parent deae198ae0
commit 9652c9a7ce
6 changed files with 8 additions and 9 deletions

@ -9,7 +9,6 @@ import javafx.animation.Animation;
import javafx.animation.Interpolator; import javafx.animation.Interpolator;
import javafx.animation.RotateTransition; import javafx.animation.RotateTransition;
import javafx.beans.property.DoubleProperty; import javafx.beans.property.DoubleProperty;
import javafx.beans.value.WritableValue;
import javafx.css.CssMetaData; import javafx.css.CssMetaData;
import javafx.css.Styleable; import javafx.css.Styleable;
import javafx.css.StyleableDoubleProperty; import javafx.css.StyleableDoubleProperty;

@ -118,7 +118,7 @@ public final class Styles {
throw new NullPointerException("PseudoClass cannot be null!"); throw new NullPointerException("PseudoClass cannot be null!");
} }
if (excludes != null && excludes.length > 0) { if (excludes != null) {
for (PseudoClass exclude : excludes) { for (PseudoClass exclude : excludes) {
node.pseudoClassStateChanged(exclude, false); node.pseudoClassStateChanged(exclude, false);
} }

@ -232,7 +232,7 @@ public class DatePickerPage extends AbstractPage {
@Override @Override
public void updateItem(LocalDate date, boolean empty) { public void updateItem(LocalDate date, boolean empty) {
super.updateItem(date, empty); super.updateItem(date, empty);
setDisable(empty || date.compareTo(TODAY) < 0); setDisable(empty || date.isBefore(TODAY));
} }
} }

@ -251,7 +251,7 @@ public class TablePage extends AbstractPage {
final var resizePolicyCaption = new CaptionMenuItem("Resize Policy"); final var resizePolicyCaption = new CaptionMenuItem("Resize Policy");
final var resizePolicyGroup = new ToggleGroup(); final var resizePolicyGroup = new ToggleGroup();
resizePolicyGroup.selectedToggleProperty().addListener((obs, old, val) -> { 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 //noinspection rawtypes,unchecked
table.setColumnResizePolicy((Callback<TableView.ResizeFeatures, Boolean>) policy); table.setColumnResizePolicy((Callback<TableView.ResizeFeatures, Boolean>) policy);
} }

@ -230,7 +230,7 @@ public class TreeTablePage extends AbstractPage {
final var resizePolicyCaption = new CaptionMenuItem("Resize Policy"); final var resizePolicyCaption = new CaptionMenuItem("Resize Policy");
final var resizePolicyGroup = new ToggleGroup(); final var resizePolicyGroup = new ToggleGroup();
resizePolicyGroup.selectedToggleProperty().addListener((obs, old, val) -> { 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 //noinspection rawtypes,unchecked
treeTable.setColumnResizePolicy((Callback<TreeTableView.ResizeFeatures, Boolean>) policy); treeTable.setColumnResizePolicy((Callback<TreeTableView.ResizeFeatures, Boolean>) policy);
} }

@ -96,10 +96,10 @@ public class WidgetCollectionPage extends BorderPane implements Page {
@SuppressWarnings("ImmutableEnumChecker") @SuppressWarnings("ImmutableEnumChecker")
public enum Example { public enum Example {
CARD("Card", () -> new CardSample()), CARD("Card", CardSample::new),
MESSAGE("Message", () -> new MessageSample()), MESSAGE("Message", MessageSample::new),
STEPPER("Stepper", () -> new StepperSample()), STEPPER("Stepper", StepperSample::new),
TAG("Tag", () -> new TagSample()); TAG("Tag", TagSample::new);
private final String name; private final String name;
private final Supplier<Pane> supplier; private final Supplier<Pane> supplier;