Skip to content

Commit c582964

Browse files
author
Chris Wilson
committed
Minor changes to adhere to coding standard
1 parent f12cbc4 commit c582964

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

libs/sparkpost-lib/src/main/java/com/sparkpost/Client.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ public class Client {
3636

3737
private String fromEmail;
3838

39+
private Proxy proxy;
40+
3941
private boolean disconnectAfterRequest = false;
4042

4143
private int httpConnectTimeout = 0; // 0 - system default
@@ -109,10 +111,8 @@ public int getHttpConnectTimeout() {
109111
return this.httpConnectTimeout;
110112
}
111113

112-
private Proxy proxy = null;
113-
114114
public void setProxy(String hostname, int port) {
115-
proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(hostname, port));
115+
this.proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(hostname, port));
116116
}
117117

118118
public Proxy getProxy() {

libs/sparkpost-lib/src/main/java/com/sparkpost/transport/RestConnection.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,13 @@ private HttpURLConnection createConnectionObject(String path, Method method) thr
113113
url = new URL(this.baseUrl + path);
114114

115115
/*
116+
* Retrieve the URLConnection object (but doesn't actually connect):
117+
* (HttpUrlConnection doesn't connect to the server until we've
118+
* got one of its streams)
119+
* Enable Client to set up proxy if need be
120+
*/
116121

117-
Retrieve the URLConnection object (but doesn't actually connect):
118-
(HttpUrlConnection doesn't connect to the server until we've
119-
got one of its streams)
120-
Enable Client to set up proxy if need be
121-
*/
122-
123-
if(this.client.getProxy() != null) {
122+
if (this.client.getProxy() != null) {
124123
conn = (HttpURLConnection) url.openConnection(this.client.getProxy());
125124
} else {
126125
conn = (HttpURLConnection) url.openConnection();

0 commit comments

Comments
 (0)