@@ -56,7 +56,7 @@ public class Controller {
5656
5757 @ FXML private MenuBar menuBar ;
5858
59- @ FXML private ChoiceBox deviceTypeChoiceBox , deviceModelChoiceBox ;
59+ @ FXML private ChoiceBox < String > deviceTypeChoiceBox , deviceModelChoiceBox ;
6060
6161 @ FXML TextField ecidField , boardConfigField , apnonceField , versionField , identifierField ,
6262 pathField , ipswField , buildIDField ;
@@ -80,8 +80,8 @@ public class Controller {
8080 private boolean editingPresets = false ;
8181 private boolean choosingRunInBackground = false ;
8282
83- static DropShadow errorBorder = new DropShadow (9.5 , 0f , 0f , Color .RED );
84- private static DropShadow borderGlow = new DropShadow (9.5 , 0f , 0f , Color .DARKCYAN );
83+ static final DropShadow errorBorder = new DropShadow (9.5 , 0f , 0f , Color .RED );
84+ static final DropShadow borderGlow = new DropShadow (9.5 , 0f , 0f , Color .DARKCYAN );
8585
8686 static Controller INSTANCE ;
8787
@@ -95,14 +95,13 @@ static void afterStageShowing() {
9595 checkForUpdates (false );
9696 }
9797
98- @ SuppressWarnings ("unchecked" )
9998 @ FXML
10099 public void initialize () {
101100 INSTANCE = this ;
102101
103102 deviceTypeChoiceBox .getSelectionModel ().selectedItemProperty ().addListener ((x , y , newValue ) -> {
104103 deviceTypeChoiceBox .setEffect (null );
105- switch (( String ) ( newValue == null ? "" : newValue ) ) {
104+ switch (newValue == null ? "" : newValue ) {
106105 case "iPhone" :
107106 deviceModelChoiceBox .setItems (Devices .getiPhones ());
108107 versionLabel .setText ("iOS Version" );
@@ -127,10 +126,10 @@ public void initialize() {
127126 deviceTypeChoiceBox .setValue ("iPhone" );
128127 deviceModelChoiceBox .getSelectionModel ().selectedItemProperty ().addListener ((x , y , newValue ) -> {
129128 deviceModelChoiceBox .setEffect (null );
130- if (Shared .isEmptyOrNull (( String ) newValue )) {
129+ if (Shared .isEmptyOrNull (newValue )) {
131130 return ;
132131 }
133- String identifier = Devices .getDeviceModelIdentifiersMap ().get (newValue . toString () );
132+ String identifier = Devices .getDeviceModelIdentifiersMap ().get (newValue );
134133 requireBoardConfig (identifier );
135134 requireApnonce (identifier );
136135 });
@@ -236,7 +235,6 @@ public void versionCheckBoxHandler() {
236235 }
237236 }
238237
239- @ SuppressWarnings ("unchecked" )
240238 public void identifierCheckBoxHandler () {
241239 if (identifierCheckBox .isSelected ()) {
242240 identifierField .setDisable (false );
@@ -295,7 +293,6 @@ public void filePickerHandler() {
295293 }
296294 }
297295
298- @ SuppressWarnings ("unchecked" )
299296 private void loadPreset (int preset ) {
300297 Preferences prefs = Preferences .userRoot ().node ("airsquared/blobsaver/preset" + preset );
301298 if (!prefs .getBoolean ("Exists" , false )) {
@@ -370,7 +367,7 @@ public void presetButtonHandler(ActionEvent evt) {
370367 @ SuppressWarnings ("Duplicates" )
371368 private void savePreset (int preset ) {
372369 boolean doReturn = false ;
373- if (!identifierCheckBox .isSelected () && Shared .isEmptyOrNull (( String ) deviceModelChoiceBox .getValue ())) {
370+ if (!identifierCheckBox .isSelected () && Shared .isEmptyOrNull (deviceModelChoiceBox .getValue ())) {
374371 deviceModelChoiceBox .setEffect (errorBorder );
375372 doReturn = true ;
376373 }
@@ -404,8 +401,8 @@ private void savePreset(int preset) {
404401 presetPrefs .put ("Device Model" , "none" );
405402 presetPrefs .put ("Device Identifier" , identifierField .getText ());
406403 } else {
407- presetPrefs .put ("Device Type" , ( String ) deviceTypeChoiceBox .getValue ());
408- presetPrefs .put ("Device Model" , ( String ) deviceModelChoiceBox .getValue ());
404+ presetPrefs .put ("Device Type" , deviceTypeChoiceBox .getValue ());
405+ presetPrefs .put ("Device Model" , deviceModelChoiceBox .getValue ());
409406 }
410407 if (getBoardConfig ) {
411408 presetPrefs .put ("Board Config" , boardConfigField .getText ());
@@ -796,7 +793,6 @@ public void showWiki() {
796793 openURL ("https://github.com/airsquared/blobsaver/wiki" );
797794 }
798795
799- @ SuppressWarnings ("unchecked" )
800796 public void readInfo () {
801797 if (!PlatformUtil .isMac () && !PlatformUtil .isWindows ()) {
802798 Alert alert = new Alert (Alert .AlertType .CONFIRMATION );
@@ -895,11 +891,11 @@ public void readApnonce() {
895891 @ SuppressWarnings ("Duplicates" )
896892 public void goButtonHandler () {
897893 boolean doReturn = false ;
898- if (!identifierCheckBox .isSelected () && Shared .isEmptyOrNull (( String ) deviceTypeChoiceBox .getValue ())) {
894+ if (!identifierCheckBox .isSelected () && Shared .isEmptyOrNull (deviceTypeChoiceBox .getValue ())) {
899895 deviceTypeChoiceBox .setEffect (errorBorder );
900896 doReturn = true ;
901897 }
902- if (!identifierCheckBox .isSelected () && Shared .isEmptyOrNull (( String ) deviceModelChoiceBox .getValue ())) {
898+ if (!identifierCheckBox .isSelected () && Shared .isEmptyOrNull (deviceModelChoiceBox .getValue ())) {
903899 deviceModelChoiceBox .setEffect (errorBorder );
904900 doReturn = true ;
905901 }
@@ -913,7 +909,7 @@ public void goButtonHandler() {
913909 doReturn = doReturn || isTextFieldInvalid (betaCheckBox , ipswField );
914910 if (doReturn ) return ;
915911
916- String deviceModel = ( String ) deviceModelChoiceBox .getValue ();
912+ String deviceModel = deviceModelChoiceBox .getValue ();
917913 if (Shared .isEmptyOrNull (deviceModel )) {
918914 String identifierText = identifierField .getText ();
919915 try {
0 commit comments