cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h...@apache.org
Subject [3/5] git commit: updated refs/heads/master to 85f38b3
Date Thu, 07 Nov 2013 14:10:16 GMT
Fix CID 1127030, 1127029 Questionable Boxing of primitive value
Fix CID 1127028 Fix Inefficient Map Iterator
Fix bug.

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

Branch: refs/heads/master
Commit: f00bfea61eea50d5d9d7669705a934e33f306f64
Parents: b736cbd
Author: Hugo Trippaers <htrippaers@schubergphilis.com>
Authored: Thu Nov 7 14:59:03 2013 +0100
Committer: Hugo Trippaers <htrippaers@schubergphilis.com>
Committed: Thu Nov 7 14:59:03 2013 +0100

----------------------------------------------------------------------
 server/src/com/cloud/vm/UserVmManagerImpl.java | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f00bfea6/server/src/com/cloud/vm/UserVmManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java
index 2d537bf..ca10b06 100755
--- a/server/src/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/com/cloud/vm/UserVmManagerImpl.java
@@ -23,6 +23,7 @@ import java.util.HashSet;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Map.Entry;
 import java.util.Set;
 import java.util.UUID;
 import java.util.concurrent.Executors;
@@ -2282,7 +2283,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager,
Vir
                 throw new InvalidParameterValueException("Only support one network per VM
if security group enabled");
             }
 
-            NetworkVO network = _networkDao.findById(networkIdList.get(0).longValue());
+            NetworkVO network = _networkDao.findById(networkIdList.get(0));
 
             if (network == null) {
                 throw new InvalidParameterValueException(
@@ -2549,7 +2550,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager,
Vir
         }
         _resourceLimitMgr.checkResourceLimit(owner, ResourceType.volume, (isIso
                 || diskOfferingId == null ? 1 : 2));
-        _resourceLimitMgr.checkResourceLimit(owner, ResourceType.primary_storage, new Long
(size));
+        _resourceLimitMgr.checkResourceLimit(owner, ResourceType.primary_storage, size);
 
         // verify security group ids
         if (securityGroupIdList != null) {
@@ -2811,14 +2812,13 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager,
Vir
             }
         }
 
-        for (String ntwkDomain : ntwkDomains.keySet()) {
-            for (Long ntwkId : ntwkDomains.get(ntwkDomain)) {
+        for (Entry<String, List<Long>> ntwkDomain : ntwkDomains.entrySet()) {
+            for (Long ntwkId : ntwkDomain.getValue()) {
                 // * get all vms hostNames in the network
                 List<String> hostNames = _vmInstanceDao.listDistinctHostNames(ntwkId);
                 // * verify that there are no duplicates
                 if (hostNames.contains(hostName)) {
-                    throw new InvalidParameterValueException("The vm with hostName " + hostName
-                            + " already exists in the network domain: " + ntwkDomain + ";
network="
+                    throw new InvalidParameterValueException("The vm with hostName " + hostName
+ " already exists in the network domain: " + ntwkDomain.getKey() + "; network="
                             + _networkModel.getNetwork(ntwkId));
                 }
             }


Mime
View raw message