@@ -56,7 +56,7 @@ public class Controller {
56
56
57
57
@ FXML private MenuBar menuBar ;
58
58
59
- @ FXML private ChoiceBox deviceTypeChoiceBox , deviceModelChoiceBox ;
59
+ @ FXML private ChoiceBox < String > deviceTypeChoiceBox , deviceModelChoiceBox ;
60
60
61
61
@ FXML TextField ecidField , boardConfigField , apnonceField , versionField , identifierField ,
62
62
pathField , ipswField , buildIDField ;
@@ -80,8 +80,8 @@ public class Controller {
80
80
private boolean editingPresets = false ;
81
81
private boolean choosingRunInBackground = false ;
82
82
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 );
85
85
86
86
static Controller INSTANCE ;
87
87
@@ -95,14 +95,13 @@ static void afterStageShowing() {
95
95
checkForUpdates (false );
96
96
}
97
97
98
- @ SuppressWarnings ("unchecked" )
99
98
@ FXML
100
99
public void initialize () {
101
100
INSTANCE = this ;
102
101
103
102
deviceTypeChoiceBox .getSelectionModel ().selectedItemProperty ().addListener ((x , y , newValue ) -> {
104
103
deviceTypeChoiceBox .setEffect (null );
105
- switch (( String ) ( newValue == null ? "" : newValue ) ) {
104
+ switch (newValue == null ? "" : newValue ) {
106
105
case "iPhone" :
107
106
deviceModelChoiceBox .setItems (Devices .getiPhones ());
108
107
versionLabel .setText ("iOS Version" );
@@ -127,10 +126,10 @@ public void initialize() {
127
126
deviceTypeChoiceBox .setValue ("iPhone" );
128
127
deviceModelChoiceBox .getSelectionModel ().selectedItemProperty ().addListener ((x , y , newValue ) -> {
129
128
deviceModelChoiceBox .setEffect (null );
130
- if (Shared .isEmptyOrNull (( String ) newValue )) {
129
+ if (Shared .isEmptyOrNull (newValue )) {
131
130
return ;
132
131
}
133
- String identifier = Devices .getDeviceModelIdentifiersMap ().get (newValue . toString () );
132
+ String identifier = Devices .getDeviceModelIdentifiersMap ().get (newValue );
134
133
requireBoardConfig (identifier );
135
134
requireApnonce (identifier );
136
135
});
@@ -236,7 +235,6 @@ public void versionCheckBoxHandler() {
236
235
}
237
236
}
238
237
239
- @ SuppressWarnings ("unchecked" )
240
238
public void identifierCheckBoxHandler () {
241
239
if (identifierCheckBox .isSelected ()) {
242
240
identifierField .setDisable (false );
@@ -295,7 +293,6 @@ public void filePickerHandler() {
295
293
}
296
294
}
297
295
298
- @ SuppressWarnings ("unchecked" )
299
296
private void loadPreset (int preset ) {
300
297
Preferences prefs = Preferences .userRoot ().node ("airsquared/blobsaver/preset" + preset );
301
298
if (!prefs .getBoolean ("Exists" , false )) {
@@ -370,7 +367,7 @@ public void presetButtonHandler(ActionEvent evt) {
370
367
@ SuppressWarnings ("Duplicates" )
371
368
private void savePreset (int preset ) {
372
369
boolean doReturn = false ;
373
- if (!identifierCheckBox .isSelected () && Shared .isEmptyOrNull (( String ) deviceModelChoiceBox .getValue ())) {
370
+ if (!identifierCheckBox .isSelected () && Shared .isEmptyOrNull (deviceModelChoiceBox .getValue ())) {
374
371
deviceModelChoiceBox .setEffect (errorBorder );
375
372
doReturn = true ;
376
373
}
@@ -404,8 +401,8 @@ private void savePreset(int preset) {
404
401
presetPrefs .put ("Device Model" , "none" );
405
402
presetPrefs .put ("Device Identifier" , identifierField .getText ());
406
403
} 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 ());
409
406
}
410
407
if (getBoardConfig ) {
411
408
presetPrefs .put ("Board Config" , boardConfigField .getText ());
@@ -796,7 +793,6 @@ public void showWiki() {
796
793
openURL ("https://github.com/airsquared/blobsaver/wiki" );
797
794
}
798
795
799
- @ SuppressWarnings ("unchecked" )
800
796
public void readInfo () {
801
797
if (!PlatformUtil .isMac () && !PlatformUtil .isWindows ()) {
802
798
Alert alert = new Alert (Alert .AlertType .CONFIRMATION );
@@ -895,11 +891,11 @@ public void readApnonce() {
895
891
@ SuppressWarnings ("Duplicates" )
896
892
public void goButtonHandler () {
897
893
boolean doReturn = false ;
898
- if (!identifierCheckBox .isSelected () && Shared .isEmptyOrNull (( String ) deviceTypeChoiceBox .getValue ())) {
894
+ if (!identifierCheckBox .isSelected () && Shared .isEmptyOrNull (deviceTypeChoiceBox .getValue ())) {
899
895
deviceTypeChoiceBox .setEffect (errorBorder );
900
896
doReturn = true ;
901
897
}
902
- if (!identifierCheckBox .isSelected () && Shared .isEmptyOrNull (( String ) deviceModelChoiceBox .getValue ())) {
898
+ if (!identifierCheckBox .isSelected () && Shared .isEmptyOrNull (deviceModelChoiceBox .getValue ())) {
903
899
deviceModelChoiceBox .setEffect (errorBorder );
904
900
doReturn = true ;
905
901
}
@@ -913,7 +909,7 @@ public void goButtonHandler() {
913
909
doReturn = doReturn || isTextFieldInvalid (betaCheckBox , ipswField );
914
910
if (doReturn ) return ;
915
911
916
- String deviceModel = ( String ) deviceModelChoiceBox .getValue ();
912
+ String deviceModel = deviceModelChoiceBox .getValue ();
917
913
if (Shared .isEmptyOrNull (deviceModel )) {
918
914
String identifierText = identifierField .getText ();
919
915
try {
0 commit comments