Skip to content

Commit

Permalink
Minor tweaks to make the compiler happier. No logical changes
Browse files Browse the repository at this point in the history
  • Loading branch information
shs96c committed Sep 30, 2021
1 parent b95aa5a commit 4d981f8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions java/src/org/openqa/selenium/firefox/FirefoxOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public FirefoxOptions(Capabilities source) {
if (rawOptions != null) {
// If `source` contains the keys we care about, then make sure they're good.
Require.stateCondition(rawOptions instanceof Map, "Expected options to be a map: %s", rawOptions);
Map<String, Object> sourceOptions = (Map<String, Object>) rawOptions;
@SuppressWarnings("unchecked") Map<String, Object> sourceOptions = (Map<String, Object>) rawOptions;
Map<String, Object> options = new TreeMap<>();
for (Keys key : Keys.values()) {
key.amend(sourceOptions, options);
Expand Down Expand Up @@ -261,9 +261,8 @@ public FirefoxOptions addPreference(String key, Object value) {
Object rawPrefs = firefoxOptions.getOrDefault(Keys.PREFS.key(), new HashMap<>());
Require.stateCondition(rawPrefs instanceof Map, "Prefs are of unexpected type: %s", rawPrefs);

Map<String, Object> newPrefs = new TreeMap<>();
@SuppressWarnings("unchecked") Map<String, Object> prefs = (Map<String, Object>) rawPrefs;
newPrefs.putAll(prefs);
Map<String, Object> newPrefs = new TreeMap<>(prefs);
newPrefs.put(key, value);

return setFirefoxOption(Keys.PREFS, Collections.unmodifiableMap(newPrefs));
Expand Down

0 comments on commit 4d981f8

Please sign in to comment.