@@ -62,9 +62,9 @@ public Result createSession(HttpHandler client, Command command) throws IOExcept
62
62
int threshold = (int ) Math .min (Runtime .getRuntime ().freeMemory () / 10 , Integer .MAX_VALUE );
63
63
FileBackedOutputStream os = new FileBackedOutputStream (threshold );
64
64
try (
65
- CountingOutputStream counter = new CountingOutputStream (os );
66
- Writer writer = new OutputStreamWriter (counter , UTF_8 );
67
- NewSessionPayload payload = NewSessionPayload .create (desired )) {
65
+ CountingOutputStream counter = new CountingOutputStream (os );
66
+ Writer writer = new OutputStreamWriter (counter , UTF_8 );
67
+ NewSessionPayload payload = NewSessionPayload .create (desired )) {
68
68
69
69
payload .writeTo (writer );
70
70
@@ -83,10 +83,10 @@ public Result createSession(HttpHandler client, Command command) throws IOExcept
83
83
}
84
84
85
85
throw new SessionNotCreatedException (
86
- String .format (
87
- "Unable to create new remote session. " +
88
- "desired capabilities = %s" ,
89
- desired ));
86
+ String .format (
87
+ "Unable to create new remote session. " +
88
+ "desired capabilities = %s" ,
89
+ desired ));
90
90
}
91
91
92
92
Optional <Result > createSession (HttpHandler client , InputStream newSessionBlob , long size ) {
@@ -110,25 +110,25 @@ Optional<Result> createSession(HttpHandler client, InputStream newSessionBlob, l
110
110
blob = new Json ().toType (string (response ), Map .class );
111
111
} catch (JsonException e ) {
112
112
throw new WebDriverException (
113
- "Unable to parse remote response: " + string (response ), e );
113
+ "Unable to parse remote response: " + string (response ), e );
114
114
}
115
115
116
116
InitialHandshakeResponse initialResponse = new InitialHandshakeResponse (
117
- time ,
118
- response .getStatus (),
119
- blob );
117
+ time ,
118
+ response .getStatus (),
119
+ blob );
120
120
121
121
return Stream .of (
122
- new W3CHandshakeResponse ().getResponseFunction (),
123
- new JsonWireProtocolResponse ().getResponseFunction ())
124
- .map (func -> func .apply (initialResponse ))
125
- .filter (Objects ::nonNull )
126
- .findFirst ();
122
+ new W3CHandshakeResponse ().getResponseFunction (),
123
+ new JsonWireProtocolResponse ().getResponseFunction ())
124
+ .map (func -> func .apply (initialResponse ))
125
+ .filter (Objects ::nonNull )
126
+ .findFirst ();
127
127
}
128
128
129
129
public static class Result {
130
130
131
- private static Function <Object , Proxy > massageProxy = obj -> {
131
+ private static final Function <Object , Proxy > massageProxy = obj -> {
132
132
if (obj instanceof Proxy ) {
133
133
return (Proxy ) obj ;
134
134
}
@@ -161,7 +161,7 @@ public static class Result {
161
161
if (capabilities .containsKey (PROXY )) {
162
162
//noinspection unchecked
163
163
((Map <String , Object >) capabilities )
164
- .put (PROXY , massageProxy .apply (capabilities .get (PROXY )));
164
+ .put (PROXY , massageProxy .apply (capabilities .get (PROXY )));
165
165
}
166
166
}
167
167
0 commit comments