cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [1/5] git commit: updated refs/heads/master to 509c83b
Date Mon, 15 Jun 2015 09:04:12 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 019f246b3 -> 509c83bc7


Fix findbugs encoding issue This is done by calling HttpMethodBase's getResponseBodyAsString()
which properly lookup the specified encoding in the request's Content-Type header This also
avoids instantiation of two extra strings on the println() and return statements

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #394


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/aeccd8af
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/aeccd8af
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/aeccd8af

Branch: refs/heads/master
Commit: aeccd8afdf62ac9c089916b19138f565bb090d90
Parents: 019f246
Author: Rafael da Fonseca <rsafonseca@gmail.com>
Authored: Fri Jun 12 22:07:20 2015 +0200
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Mon Jun 15 11:59:09 2015 +0300

----------------------------------------------------------------------
 .../src/com/cloud/network/cisco/CiscoVnmcConnectionImpl.java | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/aeccd8af/plugins/network-elements/cisco-vnmc/src/com/cloud/network/cisco/CiscoVnmcConnectionImpl.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/src/com/cloud/network/cisco/CiscoVnmcConnectionImpl.java
b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/cisco/CiscoVnmcConnectionImpl.java
index 0057e2e..6481a28 100644
--- a/plugins/network-elements/cisco-vnmc/src/com/cloud/network/cisco/CiscoVnmcConnectionImpl.java
+++ b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/cisco/CiscoVnmcConnectionImpl.java
@@ -1229,7 +1229,7 @@ public class CiscoVnmcConnectionImpl implements CiscoVnmcConnection
{
 
     private String sendRequest(String service, String xmlRequest) throws ExecutionException
{
         HttpClient client = new HttpClient();
-        byte[] response = null;
+        String response = null;
         PostMethod method = new PostMethod("/xmlIM/" + service);
         method.setRequestBody(xmlRequest);
 
@@ -1241,13 +1241,13 @@ public class CiscoVnmcConnectionImpl implements CiscoVnmcConnection
{
             if (statusCode != HttpStatus.SC_OK) {
                 throw new Exception("Error code : " + statusCode);
             }
-            response = method.getResponseBody();
+            response = method.getResponseBodyAsString();
         } catch (Exception e) {
             System.out.println(e.getMessage());
             throw new ExecutionException(e.getMessage());
         }
-        System.out.println(new String(response));
-        return new String(response);
+        System.out.println(response);
+        return response;
     }
 
     private Map<String, String> checkResponse(String xmlResponse, String... keys) throws
ExecutionException {


Mime
View raw message