cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h...@apache.org
Subject [4/5] git commit: updated refs/heads/master to 85f38b3
Date Thu, 07 Nov 2013 14:10:17 GMT
Fix CID 1127031 Inefficient Map iterator

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

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

----------------------------------------------------------------------
 server/src/com/cloud/network/vpc/VpcManagerImpl.java | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/831eeeb4/server/src/com/cloud/network/vpc/VpcManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/vpc/VpcManagerImpl.java b/server/src/com/cloud/network/vpc/VpcManagerImpl.java
index 11cbd95..017d38d 100644
--- a/server/src/com/cloud/network/vpc/VpcManagerImpl.java
+++ b/server/src/com/cloud/network/vpc/VpcManagerImpl.java
@@ -22,6 +22,7 @@ import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Map.Entry;
 import java.util.Set;
 import java.util.concurrent.Executors;
 import java.util.concurrent.ScheduledExecutorService;
@@ -351,16 +352,16 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager,
VpcProvis
         svcProviderMap.put(Service.Gateway, defaultProviders);
 
         if (serviceProviders != null) {
-            for (String serviceStr : serviceProviders.keySet()) {
-                Network.Service service = Network.Service.getService(serviceStr);
+            for (Entry<String, List<String>> serviceEntry : serviceProviders.entrySet())
{
+                Network.Service service = Network.Service.getService(serviceEntry.getKey());
                 if (svcProviderMap.containsKey(service)) {
                     Set<Provider> providers = new HashSet<Provider>();
                     // don't allow to specify more than 1 provider per service
-                    if (serviceProviders.get(serviceStr) != null && serviceProviders.get(serviceStr).size()
> 1) {
+                    if (serviceEntry.getValue() != null && serviceEntry.getValue().size()
> 1) {
                         throw new InvalidParameterValueException("In the current release
only one provider can be " +
                                 "specified for the service");
                     }
-                    for (String prvNameStr : serviceProviders.get(serviceStr)) {
+                    for (String prvNameStr : serviceEntry.getValue()) {
                         // check if provider is supported
                         Network.Provider provider = Network.Provider.getProvider(prvNameStr);
                         if (provider == null) {
@@ -371,7 +372,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager,
VpcProvis
                     }
                     svcProviderMap.put(service, providers);
                 } else {
-                    throw new InvalidParameterValueException("Service " + serviceStr + "
is not enabled for the network " +
+                    throw new InvalidParameterValueException("Service " + serviceEntry.getKey()
+ " is not enabled for the network " +
                             "offering, can't add a provider to it");
                 }
             }


Mime
View raw message