Fix small compilation issue encountered when building with maven

This commit is contained in:
Darren Shepherd 2012-08-17 13:39:45 -07:00 committed by Kelven Yang
parent f826971fea
commit 490e87a617
3 changed files with 4 additions and 4 deletions

View File

@ -30,7 +30,7 @@ import java.util.Map;
import java.util.Properties; import java.util.Properties;
import java.util.concurrent.Executor; import java.util.concurrent.Executor;
import org.apache.axis.encoding.Base64; import org.apache.commons.codec.binary.Base64;
import org.apache.log4j.xml.DOMConfigurator; import org.apache.log4j.xml.DOMConfigurator;
import com.cloud.consoleproxy.util.Logger; import com.cloud.consoleproxy.util.Logger;
@ -77,7 +77,7 @@ public class ConsoleProxy {
byte[] randomBytes = new byte[16]; byte[] randomBytes = new byte[16];
random.nextBytes(randomBytes); random.nextBytes(randomBytes);
return Base64.encode(randomBytes); return Base64.encodeBase64String(randomBytes);
} catch (NoSuchAlgorithmException e) { } catch (NoSuchAlgorithmException e) {
s_logger.error("Unexpected exception ", e); s_logger.error("Unexpected exception ", e);
assert(false); assert(false);

View File

@ -255,7 +255,7 @@ public class NiciraNvpApi {
T result; T result;
try { try {
result = gson.fromJson(pm.getResponseBodyAsString(), TypeToken.get(newObject.getClass()).getType()); result = (T)gson.fromJson(pm.getResponseBodyAsString(), TypeToken.get(newObject.getClass()).getType());
} catch (IOException e) { } catch (IOException e) {
throw new NiciraNvpApiException("Failed to decode json response body", e); throw new NiciraNvpApiException("Failed to decode json response body", e);
} }
@ -314,7 +314,7 @@ public class NiciraNvpApi {
Gson gson = new Gson(); Gson gson = new Gson();
T returnValue; T returnValue;
try { try {
returnValue = gson.fromJson(gm.getResponseBodyAsString(), returnObjectType); returnValue = (T)gson.fromJson(gm.getResponseBodyAsString(), returnObjectType);
} catch (IOException e) { } catch (IOException e) {
s_logger.error("IOException while retrieving response body",e); s_logger.error("IOException while retrieving response body",e);
throw new NiciraNvpApiException(e); throw new NiciraNvpApiException(e);