@@ -81,7 +81,7 @@ public FirefoxOptions(Capabilities source) {
81
81
if (rawOptions != null ) {
82
82
// If `source` contains the keys we care about, then make sure they're good.
83
83
Require .stateCondition (rawOptions instanceof Map , "Expected options to be a map: %s" , rawOptions );
84
- Map <String , Object > sourceOptions = (Map <String , Object >) rawOptions ;
84
+ @ SuppressWarnings ( "unchecked" ) Map <String , Object > sourceOptions = (Map <String , Object >) rawOptions ;
85
85
Map <String , Object > options = new TreeMap <>();
86
86
for (Keys key : Keys .values ()) {
87
87
key .amend (sourceOptions , options );
@@ -261,9 +261,8 @@ public FirefoxOptions addPreference(String key, Object value) {
261
261
Object rawPrefs = firefoxOptions .getOrDefault (Keys .PREFS .key (), new HashMap <>());
262
262
Require .stateCondition (rawPrefs instanceof Map , "Prefs are of unexpected type: %s" , rawPrefs );
263
263
264
- Map <String , Object > newPrefs = new TreeMap <>();
265
264
@ SuppressWarnings ("unchecked" ) Map <String , Object > prefs = (Map <String , Object >) rawPrefs ;
266
- newPrefs . putAll (prefs );
265
+ Map < String , Object > newPrefs = new TreeMap <> (prefs );
267
266
newPrefs .put (key , value );
268
267
269
268
return setFirefoxOption (Keys .PREFS , Collections .unmodifiableMap (newPrefs ));
0 commit comments