Fixed few issues reproted by coverity.

This commit is contained in:
Likitha Shetty 2014-08-25 16:11:11 +05:30
parent fc20023411
commit 433ec7c856
2 changed files with 8 additions and 8 deletions

View File

@ -3251,11 +3251,11 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
if ((accountName != null) && (domainId != null)) { if ((accountName != null) && (domainId != null)) {
vlanOwner = _accountDao.findActiveAccount(accountName, domainId); vlanOwner = _accountDao.findActiveAccount(accountName, domainId);
if (vlanOwner == null) { }
throw new InvalidParameterValueException("Unable to find account by name " + accountName); if (vlanOwner == null) {
} else if (vlanOwner.getId() == Account.ACCOUNT_ID_SYSTEM) { throw new InvalidParameterValueException("Unable to find account by name " + accountName);
throw new InvalidParameterValueException("Please specify a valid account. Cannot dedicate IP range to system account"); } else if (vlanOwner.getId() == Account.ACCOUNT_ID_SYSTEM) {
} throw new InvalidParameterValueException("Please specify a valid account. Cannot dedicate IP range to system account");
} }
// Check if range is valid // Check if range is valid

View File

@ -3014,9 +3014,9 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService {
if ((accountName != null) && (domainId != null)) { if ((accountName != null) && (domainId != null)) {
vlanOwner = _accountDao.findActiveAccount(accountName, domainId); vlanOwner = _accountDao.findActiveAccount(accountName, domainId);
if (vlanOwner == null) { }
throw new InvalidParameterValueException("Unable to find account by name " + accountName); if (vlanOwner == null) {
} throw new InvalidParameterValueException("Unable to find account by name " + accountName);
} }
vlanOwnerId = vlanOwner.getAccountId(); vlanOwnerId = vlanOwner.getAccountId();