We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 470e1da commit 19dfd47Copy full SHA for 19dfd47
src/main/java/com/ra4king/circuitsim/gui/properties/PropertyListValidator.java
@@ -76,6 +76,7 @@ public String toString(T value) {
76
return value == null ? "" : toString.apply(value);
77
}
78
79
+ @SuppressWarnings("unchecked")
80
@Override
81
public Node createGui(Stage stage, T value, Consumer<T> onAction) {
82
int size = validValues.size();
@@ -115,6 +116,9 @@ else if (size < 9) {
115
116
button.setSelected(toString(value).equals(s));
117
button.setOnAction(event -> {
118
try {
119
+ // Type warning suppressed here.
120
+ // value is known to be an Integer at this point
121
+ // (due to instanceof check above)
122
onAction.accept((T) (Integer) n);
123
} catch (Exception e) {
124
e.printStackTrace();
0 commit comments