@@ -241,7 +241,7 @@ public void writeTo(Appendable appendable) throws IOException {
241
241
json .name ("firstMatch" );
242
242
json .beginArray ();
243
243
//noinspection unchecked
244
- getW3C ().forEach (map -> json . write ( map ) );
244
+ getW3C ().forEach (json :: write );
245
245
json .endArray ();
246
246
247
247
json .endObject (); // Close "capabilities" object
@@ -275,28 +275,6 @@ private void writeMetaData(JsonOutput out) throws IOException {
275
275
}
276
276
}
277
277
278
- private void streamW3CProtocolParameters (JsonOutput out , Map <String , Object > des ) {
279
- // Technically we should be building up a combination of "alwaysMatch" and "firstMatch" options.
280
- // We're going to do a little processing to figure out what we might be able to do, and assume
281
- // that people don't really understand the difference between required and desired (which is
282
- // commonly the case). Wish us luck. Looking at the current implementations, people may have
283
- // set options for multiple browsers, in which case a compliant W3C remote end won't start
284
- // a session. If we find this, then we create multiple firstMatch capabilities. Furrfu.
285
- // The table of options are:
286
- //
287
- // Chrome: chromeOptions
288
- // Firefox: moz:.*, firefox_binary, firefox_profile, marionette
289
- // Edge: none given
290
- // IEDriver: ignoreZoomSetting, initialBrowserUrl, enableElementCacheCleanup,
291
- // browserAttachTimeout, enablePersistentHover, requireWindowFocus, logFile, logLevel, host,
292
- // extractPath, silent, ie.*
293
- // Opera: operaOptions
294
- // SafariDriver: safari.options
295
- //
296
- // We can't use the constants defined in the classes because it would introduce circular
297
- // dependencies between the remote library and the implementations. Yay!
298
- }
299
-
300
278
/**
301
279
* Stream the {@link Capabilities} encoded in the payload used to create this instance. The
302
280
* {@link Stream} will start with a {@link Capabilities} object matching the OSS capabilities, and
@@ -388,13 +366,12 @@ private Stream<Map<String, Object>> getW3C() throws IOException {
388
366
.map (this ::applyTransforms )
389
367
.map (map -> map .entrySet ().stream ()
390
368
.filter (entry -> ACCEPTED_W3C_PATTERNS .test (entry .getKey ()))
391
- .collect (ImmutableMap .toImmutableMap (Map .Entry ::getKey , Map .Entry ::getValue )))
392
- .map (map -> (Map <String , Object >) map );
369
+ .collect (ImmutableMap .toImmutableMap (Map .Entry ::getKey , Map .Entry ::getValue )));
393
370
} else {
394
371
fromOss = Stream .of ();
395
372
}
396
373
397
- Stream <Map <String , Object >> fromW3c = null ;
374
+ Stream <Map <String , Object >> fromW3c ;
398
375
Map <String , Object > alwaysMatch = getAlwaysMatch ();
399
376
Collection <Map <String , Object >> firsts = getFirstMatches ();
400
377
0 commit comments