@@ -81,7 +81,7 @@ public FirefoxOptions(Capabilities source) {
8181 if (rawOptions != null ) {
8282 // If `source` contains the keys we care about, then make sure they're good.
8383 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 ;
8585 Map <String , Object > options = new TreeMap <>();
8686 for (Keys key : Keys .values ()) {
8787 key .amend (sourceOptions , options );
@@ -261,9 +261,8 @@ public FirefoxOptions addPreference(String key, Object value) {
261261 Object rawPrefs = firefoxOptions .getOrDefault (Keys .PREFS .key (), new HashMap <>());
262262 Require .stateCondition (rawPrefs instanceof Map , "Prefs are of unexpected type: %s" , rawPrefs );
263263
264- Map <String , Object > newPrefs = new TreeMap <>();
265264 @ SuppressWarnings ("unchecked" ) Map <String , Object > prefs = (Map <String , Object >) rawPrefs ;
266- newPrefs . putAll (prefs );
265+ Map < String , Object > newPrefs = new TreeMap <> (prefs );
267266 newPrefs .put (key , value );
268267
269268 return setFirefoxOption (Keys .PREFS , Collections .unmodifiableMap (newPrefs ));
0 commit comments