Skip to content

Commit 4d981f8

Browse files
committed
Minor tweaks to make the compiler happier. No logical changes
1 parent b95aa5a commit 4d981f8

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

java/src/org/openqa/selenium/firefox/FirefoxOptions.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)