Skip to content

Commit fc3c0d3

Browse files
harshitvasuArchish Thakkar
andauthored
Apply suggestions from code review
Making variables final Co-authored-by: Archish Thakkar <archish@browserstack.com>
1 parent e12e5b9 commit fc3c0d3

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/main/java/com/browserstack/client/BrowserStackClient.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,15 @@ public void setProxy(String proxyHost, int proxyPort, String proxyUsername, Stri
111111
return;
112112
}
113113

114-
BasicCredentialsProvider basicCredentialsProvider = new BasicCredentialsProvider();
115-
AuthScope proxyAuthScope = new AuthScope(proxyHost, proxyPort);
114+
final BasicCredentialsProvider basicCredentialsProvider = new BasicCredentialsProvider();
115+
final AuthScope proxyAuthScope = new AuthScope(proxyHost, proxyPort);
116116
UsernamePasswordCredentials proxyAuthentication =
117117
new UsernamePasswordCredentials(proxyUsername, proxyPassword);
118118
basicCredentialsProvider.setCredentials(proxyAuthScope, proxyAuthentication);
119119

120-
HttpHost proxy = new HttpHost(proxyHost, proxyPort);
121-
HttpClient client = HttpClientBuilder.create().setProxy(proxy).setDefaultCredentialsProvider(basicCredentialsProvider).build();
122-
ApacheHttpTransport transport = new ApacheHttpTransport(client);
120+
final HttpHost proxy = new HttpHost(proxyHost, proxyPort);
121+
final HttpClient client = HttpClientBuilder.create().setProxy(proxy).setDefaultCredentialsProvider(basicCredentialsProvider).build();
122+
final ApacheHttpTransport transport = new ApacheHttpTransport(client);
123123
this.HTTP_TRANSPORT = transport;
124124
this.requestFactory = newRequestFactory();
125125
}
@@ -258,10 +258,10 @@ protected BrowserStackRequest newRequest(final Method method, final String path,
258258

259259
protected BrowserStackRequest signRequest(final HttpRequest request) {
260260
checkAuthState();
261-
HttpHeaders header = new HttpHeaders();
262-
String combined = this.username + ":" + this.accessKey;
263-
String encoded = new String(Base64.encodeBase64(combined.getBytes()));
264-
String credential = "Basic " + encoded;
261+
final HttpHeaders header = new HttpHeaders();
262+
final String combined = this.username + ":" + this.accessKey;
263+
final String encoded = new String(Base64.encodeBase64(combined.getBytes()));
264+
final String credential = "Basic " + encoded;
265265
header.set("Authorization", credential);
266266
request.setHeaders(header);
267267
return new BrowserStackRequest(request);

0 commit comments

Comments
 (0)