File: 01-upgrade-httpclient-dependency.patch

package info (click to toggle)
lightcouch 0.0.6-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, stretch
  • size: 472 kB
  • ctags: 833
  • sloc: java: 3,470; xml: 833; makefile: 5
file content (23 lines) | stat: -rw-r--r-- 929 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Description: Ensures the compatibility with the newer version of httpclient available in Debian.
Author: Emmanuel Bourg <ebourg@apache.org>
Forwarded: https://github.com/lightcouch/LightCouch/pull/30
--- a/src/main/java/org/lightcouch/CouchDbClientBase.java
+++ b/src/main/java/org/lightcouch/CouchDbClientBase.java
@@ -409,14 +409,9 @@
 	 * @param json The JSON String to set.
 	 */
 	protected void setEntity(HttpEntityEnclosingRequestBase httpRequest, String json) {
-		try {
-			StringEntity entity = new StringEntity(json, "UTF-8");
-			entity.setContentType("application/json");
-			httpRequest.setEntity(entity);
-		} catch (UnsupportedEncodingException e) {
-			log.error("Error setting request data. " + e.getMessage());
-			throw new IllegalArgumentException(e);
-		}
+		StringEntity entity = new StringEntity(json, "UTF-8");
+		entity.setContentType("application/json");
+		httpRequest.setEntity(entity);
 	}
 	
 	/**