Skip to content

Commit c1f4989

Browse files
committed
You'd imagine we'd have cracked the duplicate key problem now
In ProtocolHandshake.
1 parent 5457e21 commit c1f4989

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

java/client/src/org/openqa/selenium/remote/ProtocolHandshake.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,14 +173,14 @@ private void streamW3CProtocolParameters(
173173
("browserName".equals(entry.getKey()) && CHROME.equals(entry.getValue().getAsString())) ||
174174
"chromeOptions".equals(entry.getKey()))
175175
.distinct()
176-
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
176+
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (left, right) -> right));
177177

178178
Map<String, ?> edge = Stream.of(des, req)
179179
.map(JsonObject::entrySet)
180180
.flatMap(Collection::stream)
181181
.filter(entry -> ("browserName".equals(entry.getKey()) && EDGE.equals(entry.getValue().getAsString())))
182182
.distinct()
183-
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
183+
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (left, right) -> right));
184184

185185
Map<String, ?> firefox = Stream.of(des, req)
186186
.map(JsonObject::entrySet)
@@ -190,7 +190,7 @@ private void streamW3CProtocolParameters(
190190
entry.getKey().startsWith("firefox_") ||
191191
entry.getKey().startsWith("moz:"))
192192
.distinct()
193-
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
193+
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (left, right) -> right));
194194

195195
Map<String, ?> ie = Stream.of(req, des)
196196
.map(JsonObject::entrySet)
@@ -210,7 +210,7 @@ private void streamW3CProtocolParameters(
210210
"silent".equals(entry.getKey()) ||
211211
entry.getKey().startsWith("ie."))
212212
.distinct()
213-
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
213+
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (left, right) -> right));
214214

215215
Map<String, ?> opera = Stream.of(des, req)
216216
.map(JsonObject::entrySet)
@@ -220,7 +220,7 @@ private void streamW3CProtocolParameters(
220220
("browserName".equals(entry.getKey()) && OPERA.equals(entry.getValue().getAsString())) ||
221221
"operaOptions".equals(entry.getKey()))
222222
.distinct()
223-
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
223+
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (left, right) -> right));
224224

225225
Map<String, ?> safari = Stream.of(des, req)
226226
.map(JsonObject::entrySet)
@@ -229,7 +229,7 @@ private void streamW3CProtocolParameters(
229229
("browserName".equals(entry.getKey()) && SAFARI.equals(entry.getValue().getAsString())) ||
230230
"safari.options".equals(entry.getKey()))
231231
.distinct()
232-
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
232+
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (left, right) -> right));
233233

234234
Set<String> excludedKeys = Stream.of(chrome, edge, firefox, ie, opera, safari)
235235
.map(Map::keySet)

0 commit comments

Comments
 (0)