Source:
<code>public HttpRequest getHttpRequest(Request coapRequest) throws TranslationException { if (coapRequest == null) { throw new IllegalArgumentException("coapRequest == null"); } HttpRequest httpRequest = null; String coapMethod = null; switch (coapRequest.getCode()) { case GET: coapMethod = "GET"; break; case POST: coapMethod = "POST"; break; case PUT: coapMethod = "PUT"; break; case DELETE: coapMethod = "DELETE"; break; } URI proxyUri; try { String proxyUriString = URLDecoder.decode( coapRequest.getOptions().getProxyUri(), "UTF-8"); proxyUri = new URI(proxyUriString); } catch (UnsupportedEncodingException e) { <START> LOGGER.warn("UTF-8 do not support this encoding: {}", e); <END> throw new TranslationException("UTF-8 do not support this encoding", e); } catch (URISyntaxException e) { LOGGER.warn("Cannot translate the server uri {}", e); throw new InvalidFieldException("Cannot get the proxy-uri from the coap message", e); } RequestLine requestLine = new BasicRequestLine(coapMethod, proxyUri.toString(), HttpVersion.HTTP_1_1); HttpEntity httpEntity = getHttpEntity(coapRequest); if (httpEntity == null) { httpRequest = new BasicHttpRequest(requestLine); } else { httpRequest = new BasicHttpEntityEnclosingRequest(requestLine); ((HttpEntityEnclosingRequest) httpRequest).setEntity(httpEntity); ContentType contentType = ContentType.get(httpEntity); httpRequest.setHeader("content-type", contentType.toString()); } Header[] headers = getHttpHeaders(coapRequest.getOptions().asSortedList()); for (Header header : headers) { httpRequest.addHeader(header); } return httpRequest; }</code><technical_language>remove placeholder e.getMessage()</technical_language>

Target:
public HttpRequest getHttpRequest(Request coapRequest) throws TranslationException { if (coapRequest == null) { throw new IllegalArgumentException("coapRequest == null"); } HttpRequest httpRequest = null; String coapMethod = null; switch (coapRequest.getCode()) { case GET: coapMethod = "GET"; break; case POST: coapMethod = "POST"; break; case PUT: coapMethod = "PUT"; break; case DELETE: coapMethod = "DELETE"; break; } URI proxyUri; try { String proxyUriString = URLDecoder.decode( coapRequest.getOptions().getProxyUri(), "UTF-8"); proxyUri = new URI(proxyUriString); } catch (UnsupportedEncodingException e) { LOGGER.warn("UTF-8 do not support this encoding", e); throw new TranslationException("UTF-8 do not support this encoding", e); } catch (URISyntaxException e) { LOGGER.warn("Cannot translate the server uri", e); throw new InvalidFieldException("Cannot get the proxy-uri from the coap message", e); } RequestLine requestLine = new BasicRequestLine(coapMethod, proxyUri.toString(), HttpVersion.HTTP_1_1); HttpEntity httpEntity = getHttpEntity(coapRequest); if (httpEntity == null) { httpRequest = new BasicHttpRequest(requestLine); } else { httpRequest = new BasicHttpEntityEnclosingRequest(requestLine); ((HttpEntityEnclosingRequest) httpRequest).setEntity(httpEntity); ContentType contentType = ContentType.get(httpEntity); httpRequest.setHeader("content-type", contentType.toString()); } Header[] headers = getHttpHeaders(coapRequest.getOptions().asSortedList()); for (Header header : headers) { httpRequest.addHeader(header); } return httpRequest; }