Fixed few coverity issues

This commit is contained in:
Wei Zhou 2014-12-16 09:21:28 +01:00
parent b7ab955610
commit ff2ed33645
3 changed files with 14 additions and 5 deletions

View File

@ -66,14 +66,26 @@ public class SSHKeyPairResponse extends BaseResponse {
this.fingerprint = fingerprint;
}
public String getAccountName() {
return accountName;
}
public void setAccountName(String accountName) {
this.accountName = accountName;
}
public String getDomainId() {
return domainId;
}
public void setDomainId(String domainId) {
this.domainId = domainId;
}
public String getDomainName() {
return domain;
}
public void setDomainName(String domain) {
this.domain = domain;
}

View File

@ -1527,7 +1527,7 @@ public class RulesManagerImpl extends ManagerBase implements RulesManager, Rules
rule.setDisplay(forDisplay);
}
if (rule.getSourcePortStart() != rule.getSourcePortEnd() && privatePort != null) {
if (!rule.getSourcePortStart().equals(rule.getSourcePortEnd()) && privatePort != null) {
throw new InvalidParameterValueException("Unable to update the private port of port forwarding rule as the rule has port range : " + rule.getSourcePortStart() + " to " + rule.getSourcePortEnd());
}
if (virtualMachineId == null && vmGuestIp != null) {

View File

@ -3611,11 +3611,8 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
String name = cmd.getName();
String key = cmd.getPublicKey();
try {
if (key != null) {
key = URLDecoder.decode(key, "UTF-8");
}
key = URLDecoder.decode(key, "UTF-8");
} catch (UnsupportedEncodingException e) {
} finally {
}
String publicKey = SSHKeysHelper.getPublicKeyFromKeyMaterial(key);