Skip to content

Commit 19dfd47

Browse files
committed
Add @SuppressWarnings("unchecked")
1 parent 470e1da commit 19dfd47

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/main/java/com/ra4king/circuitsim/gui/properties/PropertyListValidator.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ public String toString(T value) {
7676
return value == null ? "" : toString.apply(value);
7777
}
7878

79+
@SuppressWarnings("unchecked")
7980
@Override
8081
public Node createGui(Stage stage, T value, Consumer<T> onAction) {
8182
int size = validValues.size();
@@ -115,6 +116,9 @@ else if (size < 9) {
115116
button.setSelected(toString(value).equals(s));
116117
button.setOnAction(event -> {
117118
try {
119+
// Type warning suppressed here.
120+
// value is known to be an Integer at this point
121+
// (due to instanceof check above)
118122
onAction.accept((T) (Integer) n);
119123
} catch (Exception e) {
120124
e.printStackTrace();

0 commit comments

Comments
 (0)