Skip to content

Commit c006b72

Browse files
committed
remove more reflection
1 parent 35bf3af commit c006b72

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

changelog.org

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@
304304
weirdness around body streams and inflation
305305
- streams everywhere, all bodies coming out of core.clj are now streams, so
306306
{:as :stream} truly streams the response, keeping it out of memory
307+
- remove some more reflection
307308
** Released 0.7.3
308309
** 2013-06-22
309310
- correctly close single client connection manager if {:as :stream} is used, fixes #142

src/clj_http/conn_mgr.clj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44
(:import (java.security KeyStore)
55
(java.security.cert X509Certificate)
66
(javax.net.ssl SSLSession SSLSocket)
7+
(org.apache.http.conn ClientConnectionManager)
8+
(org.apache.http.conn.params ConnPerRouteBean)
79
(org.apache.http.conn.ssl AllowAllHostnameVerifier SSLSocketFactory
810
TrustStrategy X509HostnameVerifier)
911
(org.apache.http.conn.scheme PlainSocketFactory
1012
SchemeRegistry Scheme)
1113
(org.apache.http.impl.conn BasicClientConnectionManager
1214
SchemeRegistryFactory)
13-
(org.apache.http.impl.conn PoolingClientConnectionManager)
14-
(org.apache.http.conn.params ConnPerRouteBean)))
15+
(org.apache.http.impl.conn PoolingClientConnectionManager)))
1516

1617
(def ^SSLSocketFactory insecure-socket-factory
1718
(SSLSocketFactory. (reify TrustStrategy
@@ -138,7 +139,7 @@
138139

139140
(defn shutdown-manager
140141
"Define function to shutdown manager"
141-
[manager]
142+
[^ClientConnectionManager manager]
142143
(and manager (.shutdown manager)))
143144

144145
(def ^{:dynamic true

src/clj_http/core.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109

110110
(defn add-client-params!
111111
"Add various client params to the http-client object, if needed."
112-
[http-client kvs]
112+
[^DefaultHttpClient http-client kvs]
113113
(let [cookie-policy (:cookie-policy kvs)
114114
cookie-policy-name (str (type cookie-policy))
115115
kvs (dissoc kvs :cookie-policy)]

src/clj_http/util.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"force b as byte array if it is an InputStream."
6161
[b]
6262
(if (instance? java.io.InputStream b)
63-
(IOUtils/toByteArray b)
63+
(IOUtils/toByteArray ^java.io.InputStream b)
6464
b))
6565

6666
(defn inflate

0 commit comments

Comments
 (0)