Skip to content

Commit 7ece09d

Browse files
committed
remove changing global JVM property http.keepAlive, deprecate controlling this property inside of ScribeJava (thanks to wldaunfr and rockihack)
1 parent 12d7a0d commit 7ece09d

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

changelog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[SNAPSHOT]
22
* create abstract HTTP Client layer to support different HTTP clients as plugins (AHC and Ning support becames maven submodules)
3+
* remove changing global JVM property http.keepAlive, deprecate controlling this property inside of ScribeJava (thanks to wldaunfr and rockihack)
34

45
[2.8.1]
56
* add Salesforce sandbox API support

scribejava-core/src/main/java/com/github/scribejava/core/model/AbstractRequest.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ public abstract class AbstractRequest {
2424
private final ParameterList querystringParams = new ParameterList();
2525
private final ParameterList bodyParams = new ParameterList();
2626
private final Map<String, String> headers = new HashMap<>();
27-
private boolean connectionKeepAlive;
2827
private boolean followRedirects = true;
2928
private final OAuthService service;
3029

@@ -262,9 +261,11 @@ public void setCharset(String charsetName) {
262261
*
263262
* @see <a
264263
* href="http://download.oracle.com/javase/1.5.0/docs/guide/net/http-keepalive.html">http://download.oracle.com/javase/1.5.0/docs/guide/net/http-keepalive.html</a>
264+
* @deprecated does nothing - JVM default is left untouched. Set {@code http.keepAlive} system property to
265+
* {@code false} for pre-deprecation behavior.
265266
*/
267+
@Deprecated
266268
public void setConnectionKeepAlive(boolean connectionKeepAlive) {
267-
this.connectionKeepAlive = connectionKeepAlive;
268269
}
269270

270271
/**
@@ -280,10 +281,6 @@ public void setFollowRedirects(boolean followRedirects) {
280281
this.followRedirects = followRedirects;
281282
}
282283

283-
public boolean isConnectionKeepAlive() {
284-
return connectionKeepAlive;
285-
}
286-
287284
public boolean isFollowRedirects() {
288285
return followRedirects;
289286
}

scribejava-core/src/main/java/com/github/scribejava/core/model/OAuthRequest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ Response doSend() throws IOException {
6060
private void createConnection() throws IOException {
6161
final String completeUrl = getCompleteUrl();
6262
if (connection == null) {
63-
System.setProperty("http.keepAlive", isConnectionKeepAlive() ? "true" : "false");
6463
connection = (HttpURLConnection) new URL(completeUrl).openConnection();
6564
connection.setInstanceFollowRedirects(isFollowRedirects());
6665
}

0 commit comments

Comments
 (0)