This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository observe. See http://git.codelutin.com/observe.git commit 9ee40dc36d9fcee6030cdbb510277e77bf7d53c6 Author: Tony CHEMIT <chemit@codelutin.com> Date: Sun Nov 8 21:19:16 2015 +0100 Suppression code mort --- .../services/http/ObserveRequestBuilder.java | 18 +++---- .../ird/observe/services/http/ObserveResponse.java | 56 ---------------------- 2 files changed, 9 insertions(+), 65 deletions(-) diff --git a/observe-services-rest/src/main/java/fr/ird/observe/services/http/ObserveRequestBuilder.java b/observe-services-rest/src/main/java/fr/ird/observe/services/http/ObserveRequestBuilder.java index ba4668f..cbfa712 100644 --- a/observe-services-rest/src/main/java/fr/ird/observe/services/http/ObserveRequestBuilder.java +++ b/observe-services-rest/src/main/java/fr/ird/observe/services/http/ObserveRequestBuilder.java @@ -103,15 +103,15 @@ public class ObserveRequestBuilder { return this; } - public ObserveRequestBuilder addParameter(String parameterName, int value) { - return addParameter(parameterName, String.valueOf(value)); - } - - public ObserveRequestBuilder addParameter(String parameterName, File file) { - checkParameterNotNull(parameterName, file); - files.put(parameterName, file); - return this; - } +// public ObserveRequestBuilder addParameter(String parameterName, int value) { +// return addParameter(parameterName, String.valueOf(value)); +// } +// +// public ObserveRequestBuilder addParameter(String parameterName, File file) { +// checkParameterNotNull(parameterName, file); +// files.put(parameterName, file); +// return this; +// } public ObserveRequestBuilder addParameter(String parameterName, Object toJson) throws IOException { String json = gson.toJson(toJson); diff --git a/observe-services-rest/src/main/java/fr/ird/observe/services/http/ObserveResponse.java b/observe-services-rest/src/main/java/fr/ird/observe/services/http/ObserveResponse.java index c94b996..730d7aa 100644 --- a/observe-services-rest/src/main/java/fr/ird/observe/services/http/ObserveResponse.java +++ b/observe-services-rest/src/main/java/fr/ird/observe/services/http/ObserveResponse.java @@ -22,14 +22,11 @@ package fr.ird.observe.services.http; * #L% */ -import com.google.common.base.Preconditions; -import com.google.gson.Gson; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.http.Header; import java.io.IOException; -import java.lang.reflect.Type; /** * @author Arnaud Thimel - thimel@codelutin.com @@ -93,59 +90,6 @@ public class ObserveResponse<T> { return resultObject; } - public static <T> T convertJson(String json, Type type, Gson gson) throws IOException { - - Preconditions.checkNotNull(json); - Preconditions.checkNotNull(gson); - - // we must try to convert json to a T instance - T result = null; - -// try { - - // let's first try to convert json to T - if (!Void.TYPE.equals(type)) { - result = gson.fromJson(json, type); - } - -// } catch (IOException e) { -// -// // conversion to T failed, we will throw a json exception -// RemoteCallUnexpectedJsonException remoteCallUnexpectedJsonException; -// -// try { -// -// // before, try to read json as an error message -// remoteCallUnexpectedJsonException = RemoteCallUnexpectedJsonException.newFromJson(json); -// -// if (log.isInfoEnabled()) { -// log.info("service returned a json showing an error occurred ", remoteCallUnexpectedJsonException); -// } -// -// } catch (IOException ee) { -// -// if (log.isErrorEnabled()) { -// log.error("json parsing failed, json=" + json, e); -// } -// -// // json is not of type T and not an error message, -// // throw the exception with e as cause cause it may be the real problem -// remoteCallUnexpectedJsonException = RemoteCallUnexpectedJsonException.newFromParsingException(e); -// -// } -// -// throw remoteCallUnexpectedJsonException; -// -// } - - if (log.isTraceEnabled()) { - log.trace("parsing json " + json + " returns " + result); - } - - - return result; - } - @Override public String toString() { StringBuilder buffer = new StringBuilder(). -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@list.forge.codelutin.com>.