cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject git commit: updated refs/heads/master to 97d296b
Date Tue, 01 Jul 2014 20:06:42 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 667347d17 -> 97d296bfb


Fixed Coverity reported performance issues like inefficient string concatenations, wrong boxing
or unboxing types, inefficent map element retrievals

Signed-off-by: Daan Hoogland <daan@onecht.net>


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

Branch: refs/heads/master
Commit: 97d296bfbd328f2c45e5be22c769447b7aa006df
Parents: 667347d
Author: Santhosh Edukulla <santhosh.edukulla@gmail.com>
Authored: Tue Jul 1 12:24:59 2014 +0530
Committer: Daan Hoogland <daan@onecht.net>
Committed: Tue Jul 1 22:06:25 2014 +0200

----------------------------------------------------------------------
 .../admin/systemvm/ScaleSystemVMCmd.java        |  4 +-
 .../admin/systemvm/UpgradeSystemVMCmd.java      |  4 +-
 .../apache/cloudstack/context/CallContext.java  |  4 +-
 .../virtualnetwork/VirtualRoutingResource.java  | 58 +++++++++++++-------
 .../com/cloud/agent/manager/AgentAttache.java   |  2 +-
 .../xenserver/resource/CitrixResourceBase.java  | 17 +++---
 .../xenserver/resource/XenServerPoolVms.java    |  6 +-
 .../cloud/network/element/NetscalerElement.java |  8 ++-
 .../network/resource/NetscalerResource.java     | 16 +++---
 .../cloudstack/api/command/LDAPConfigCmd.java   |  2 +-
 server/src/com/cloud/api/ApiResponseHelper.java | 16 ++++--
 server/src/com/cloud/api/ApiServer.java         |  4 +-
 .../cloud/api/dispatch/ParamProcessWorker.java  |  6 +-
 .../cloud/api/dispatch/ParamUnpackWorker.java   |  7 ++-
 .../com/cloud/api/query/QueryManagerImpl.java   | 20 +++----
 .../api/query/dao/TemplateJoinDaoImpl.java      |  2 +-
 .../configuration/ConfigurationManagerImpl.java |  5 +-
 .../com/cloud/network/NetworkServiceImpl.java   |  6 +-
 .../com/cloud/network/vpc/VpcManagerImpl.java   |  6 +-
 .../cloud/server/ConfigurationServerImpl.java   |  4 +-
 server/src/com/cloud/server/StatsCollector.java | 10 ++--
 .../com/cloud/storage/VolumeApiServiceImpl.java |  4 +-
 .../storage/snapshot/SnapshotManagerImpl.java   |  2 +-
 .../com/cloud/template/TemplateAdapterBase.java |  6 +-
 .../com/cloud/template/TemplateManagerImpl.java |  6 +-
 25 files changed, 127 insertions(+), 98 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/97d296bf/api/src/org/apache/cloudstack/api/command/admin/systemvm/ScaleSystemVMCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/systemvm/ScaleSystemVMCmd.java
b/api/src/org/apache/cloudstack/api/command/admin/systemvm/ScaleSystemVMCmd.java
index 68e9f94..c4b2e99 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/systemvm/ScaleSystemVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/systemvm/ScaleSystemVMCmd.java
@@ -86,8 +86,8 @@ public class ScaleSystemVMCmd extends BaseAsyncCmd {
             Iterator iter = parameterCollection.iterator();
             while (iter.hasNext()) {
                 HashMap<String, String> value = (HashMap<String, String>)iter.next();
-                for (String key : value.keySet()) {
-                    customparameterMap.put(key, value.get(key));
+                for (Map.Entry<String, String> entry : value.entrySet()) {
+                    customparameterMap.put(entry.getKey(), entry.getValue());
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/97d296bf/api/src/org/apache/cloudstack/api/command/admin/systemvm/UpgradeSystemVMCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/systemvm/UpgradeSystemVMCmd.java
b/api/src/org/apache/cloudstack/api/command/admin/systemvm/UpgradeSystemVMCmd.java
index d71ef03..f087077 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/systemvm/UpgradeSystemVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/systemvm/UpgradeSystemVMCmd.java
@@ -81,8 +81,8 @@ public class UpgradeSystemVMCmd extends BaseCmd {
             Iterator iter = parameterCollection.iterator();
             while (iter.hasNext()) {
                 HashMap<String, String> value = (HashMap<String, String>)iter.next();
-                for (String key : value.keySet()) {
-                    customparameterMap.put(key, value.get(key));
+                for (Map.Entry<String,String>entry : value.entrySet()) {
+                    customparameterMap.put(entry.getKey(), entry.getValue());
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/97d296bf/api/src/org/apache/cloudstack/context/CallContext.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/context/CallContext.java b/api/src/org/apache/cloudstack/context/CallContext.java
index f29ae96..73da826 100644
--- a/api/src/org/apache/cloudstack/context/CallContext.java
+++ b/api/src/org/apache/cloudstack/context/CallContext.java
@@ -332,8 +332,8 @@ public class CallContext {
 
     public void putContextParameters(Map<Object, Object> details){
         if (details == null) return;
-        for(Object key : details.keySet()){
-            putContextParameter(key, details.get(key));
+        for(Map.Entry<Object,Object>entry : details.entrySet()){
+            putContextParameter(entry.getKey(), entry.getValue());
         }
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/97d296bf/core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java
b/core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java
index 7bb6f5e..de1049b 100755
--- a/core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java
+++ b/core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java
@@ -476,15 +476,14 @@ public class VirtualRoutingResource {
         LoadBalancerConfigurator cfgtr = new HAProxyConfigurator();
 
         String[] config = cfgtr.generateConfiguration(cmd);
-        String tmpCfgFileContents = "";
+        StringBuffer buff = new StringBuffer();
         for (int i = 0; i < config.length; i++) {
-            tmpCfgFileContents += config[i];
-            tmpCfgFileContents += "\n";
+            buff.append(config[i]);
+            buff.append("\n");
         }
-
         String tmpCfgFilePath = "/etc/haproxy/";
         String tmpCfgFileName = "haproxy.cfg.new." + String.valueOf(System.currentTimeMillis());
-        cfg.add(new ConfigItem(tmpCfgFilePath, tmpCfgFileName, tmpCfgFileContents));
+        cfg.add(new ConfigItem(tmpCfgFilePath, tmpCfgFileName, buff.toString()));
 
         String[][] rules = cfgtr.generateFwRules(cmd);
 
@@ -610,18 +609,28 @@ public class VirtualRoutingResource {
         LinkedList<ConfigItem> cfg = new LinkedList<>();
 
         String args = "";
+        StringBuffer buff = new StringBuffer();
         List<IpAliasTO> revokedIpAliasTOs = cmd.getDeleteIpAliasTos();
         for (IpAliasTO ipAliasTO : revokedIpAliasTOs) {
-            args = args + ipAliasTO.getAlias_count() + ":" + ipAliasTO.getRouterip() + ":"
+ ipAliasTO.getNetmask() + "-";
-        }
+            buff.append(ipAliasTO.getAlias_count());
+            buff.append(":");
+            buff.append(ipAliasTO.getRouterip());
+            buff.append(":");
+            buff.append(ipAliasTO.getNetmask());
+            buff.append("-");
+         }
         //this is to ensure that thre is some argument passed to the deleteipAlias script
 when there are no revoked rules.
-        args = args + "- ";
+        buff.append("- ");
         List<IpAliasTO> activeIpAliasTOs = cmd.getCreateIpAliasTos();
         for (IpAliasTO ipAliasTO : activeIpAliasTOs) {
-            args = args + ipAliasTO.getAlias_count() + ":" + ipAliasTO.getRouterip() + ":"
+ ipAliasTO.getNetmask() + "-";
-        }
-
-        cfg.add(new ConfigItem(VRScripts.IPALIAS_DELETE, args));
+            buff.append(ipAliasTO.getAlias_count());
+            buff.append(":");
+            buff.append(ipAliasTO.getRouterip());
+            buff.append(":");
+            buff.append(ipAliasTO.getNetmask());
+            buff.append("-");
+        }
+        cfg.add(new ConfigItem(VRScripts.IPALIAS_DELETE, buff.toString()));
         return cfg;
     }
 
@@ -629,22 +638,29 @@ public class VirtualRoutingResource {
         LinkedList<ConfigItem> cfg = new LinkedList<>();
 
         List<DhcpTO> dhcpTos = cmd.getIps();
-        String args = "";
+        StringBuffer buff = new StringBuffer();
         for (DhcpTO dhcpTo : dhcpTos) {
-            args = args + dhcpTo.getRouterIp() + ":" + dhcpTo.getGateway() + ":" + dhcpTo.getNetmask()
+ ":" + dhcpTo.getStartIpOfSubnet() + "-";
-        }
-
-        cfg.add(new ConfigItem(VRScripts.DNSMASQ_CONFIG, args));
+            buff.append(dhcpTo.getRouterIp());
+            buff.append(":");
+            buff.append(dhcpTo.getGateway());
+            buff.append(":");
+            buff.append(dhcpTo.getNetmask());
+            buff.append(":");
+            buff.append(dhcpTo.getStartIpOfSubnet());
+            buff.append("-");
+        }
+        cfg.add(new ConfigItem(VRScripts.DNSMASQ_CONFIG, buff.toString()));
         return cfg;
     }
 
     private CheckS2SVpnConnectionsAnswer execute(CheckS2SVpnConnectionsCommand cmd) {
-        String args = "";
+
+        StringBuffer buff = new StringBuffer();
         for (String ip : cmd.getVpnIps()) {
-            args += ip + " ";
+            buff.append(ip);
+            buff.append(" ");
         }
-
-        ExecutionResult result = _vrDeployer.executeInVR(cmd.getRouterAccessIp(), VRScripts.S2SVPN_CHECK,
args);
+        ExecutionResult result = _vrDeployer.executeInVR(cmd.getRouterAccessIp(), VRScripts.S2SVPN_CHECK,
buff.toString());
         return new CheckS2SVpnConnectionsAnswer(cmd, result.isSuccess(), result.getDetails());
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/97d296bf/engine/orchestration/src/com/cloud/agent/manager/AgentAttache.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/com/cloud/agent/manager/AgentAttache.java b/engine/orchestration/src/com/cloud/agent/manager/AgentAttache.java
index f11f69f..0f02792 100755
--- a/engine/orchestration/src/com/cloud/agent/manager/AgentAttache.java
+++ b/engine/orchestration/src/com/cloud/agent/manager/AgentAttache.java
@@ -126,7 +126,7 @@ public abstract class AgentAttache {
         _maintenance = maintenance;
         _requests = new LinkedList<Request>();
         _agentMgr = agentMgr;
-        _nextSequence = new Long(s_rand.nextInt(Short.MAX_VALUE)) << 48;
+        _nextSequence = new Long(s_rand.nextInt(Short.MAX_VALUE)).longValue() << 48;
     }
 
     public synchronized long getNextSequence() {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/97d296bf/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
index f79edc4..a9840bd 100644
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
+++ b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
@@ -643,8 +643,8 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
         Map<String, String> args = new HashMap<String, String>();
         Task task = null;
         try {
-            for (String key : params.keySet()) {
-                args.put(key, params.get(key));
+            for (Map.Entry< String, String > entry  : params.entrySet()) {
+                args.put(entry.getKey(), entry.getValue());
             }
             if (s_logger.isTraceEnabled()) {
                 s_logger.trace("callHostPlugin executing for command " + cmd
@@ -2313,8 +2313,8 @@ public abstract class CitrixResourceBase implements ServerResource,
HypervisorRe
                 return new GetVmStatsAnswer(cmd, vmStatsNameMap);
             }
 
-            for (String vmUUID : vmStatsUUIDMap.keySet()) {
-                vmStatsNameMap.put(vmNames.get(vmUUIDs.indexOf(vmUUID)), vmStatsUUIDMap.get(vmUUID));
+            for (Map.Entry<String,VmStatsEntry>entry : vmStatsUUIDMap.entrySet()) {
+                vmStatsNameMap.put(vmNames.get(vmUUIDs.indexOf(entry.getKey())), entry.getValue());
             }
 
             return new GetVmStatsAnswer(cmd, vmStatsNameMap);
@@ -2387,8 +2387,8 @@ public abstract class CitrixResourceBase implements ServerResource,
HypervisorRe
 
         }
 
-        for (String vmUUID : vmResponseMap.keySet()) {
-            VmStatsEntry vmStatsAnswer = vmResponseMap.get(vmUUID);
+        for (Map.Entry<String, VmStatsEntry> entry: vmResponseMap.entrySet()) {
+            VmStatsEntry vmStatsAnswer = entry.getValue();
 
             if (vmStatsAnswer.getNumCPUs() != 0) {
                 vmStatsAnswer.setCPUUtilization(vmStatsAnswer.getCPUUtilization() / vmStatsAnswer.getNumCPUs());
@@ -6533,8 +6533,9 @@ public abstract class CitrixResourceBase implements ServerResource,
HypervisorRe
                 s_logger.warn("Unable to find vdi by uuid: " + vdiUuid + ", skip it");
             }
         }
-        for (VDI vdi : vdiMap.keySet()) {
-            VolumeObjectTO volumeTO = vdiMap.get(vdi);
+        for (Map.Entry<VDI, VolumeObjectTO>entry : vdiMap.entrySet()) {
+            VDI vdi = entry.getKey();
+            VolumeObjectTO volumeTO = entry.getValue();
             VBD.Record vbdr = new VBD.Record();
             vbdr.VM = vm;
             vbdr.VDI = vdi;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/97d296bf/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServerPoolVms.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServerPoolVms.java
b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServerPoolVms.java
index 8042209..9cbf71f 100644
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServerPoolVms.java
+++ b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServerPoolVms.java
@@ -80,8 +80,10 @@ public class XenServerPoolVms {
     public String toString() {
         StringBuilder sbuf = new StringBuilder("PoolVms=");
         for (HashMap<String/* vm name */, Pair<String/* host uuid */, State/* vm state
*/>> clusterVM : _clusterVms.values()) {
-            for (String vmname : clusterVM.keySet()) {
-                sbuf.append(vmname).append("-").append(clusterVM.get(vmname).second()).append(",");
+            for (Map.Entry<String,Pair<String,State>> entry: clusterVM.entrySet())
{
+                String vmname = entry.getKey();
+                Pair<String,State> vmstate= entry.getValue();
+                sbuf.append(vmname).append("-").append(vmstate.second()).append(",");
             }
         }
         return sbuf.toString();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/97d296bf/plugins/network-elements/netscaler/src/com/cloud/network/element/NetscalerElement.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/netscaler/src/com/cloud/network/element/NetscalerElement.java
b/plugins/network-elements/netscaler/src/com/cloud/network/element/NetscalerElement.java
index 5199f60..9e679f6 100644
--- a/plugins/network-elements/netscaler/src/com/cloud/network/element/NetscalerElement.java
+++ b/plugins/network-elements/netscaler/src/com/cloud/network/element/NetscalerElement.java
@@ -677,11 +677,13 @@ public class NetscalerElement extends ExternalLoadBalancerDeviceManagerImpl
impl
         // NetScaler can only act as Lb and Static Nat service provider
         if (services != null && !services.isEmpty() && !netscalerServices.containsAll(services))
{
             s_logger.warn("NetScaler network element can only support LB and Static NAT services
and service combination " + services + " is not supported.");
-            String servicesList = "";
+
+            StringBuffer buff = new StringBuffer();
             for (Service service : services) {
-                servicesList += service.getName() + " ";
+                buff.append(service.getName());
+                buff.append(" ");
             }
-            s_logger.warn("NetScaler network element can only support LB and Static NAT services
and service combination " + servicesList + " is not supported.");
+            s_logger.warn("NetScaler network element can only support LB and Static NAT services
and service combination " + buff.toString() + " is not supported.");
             s_logger.warn("NetScaler network element can only support LB and Static NAT services
and service combination " + services + " is not supported.");
             return false;
         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/97d296bf/plugins/network-elements/netscaler/src/com/cloud/network/resource/NetscalerResource.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/netscaler/src/com/cloud/network/resource/NetscalerResource.java
b/plugins/network-elements/netscaler/src/com/cloud/network/resource/NetscalerResource.java
index 8c5aa1f..93b084e 100644
--- a/plugins/network-elements/netscaler/src/com/cloud/network/resource/NetscalerResource.java
+++ b/plugins/network-elements/netscaler/src/com/cloud/network/resource/NetscalerResource.java
@@ -1763,14 +1763,14 @@ public class NetscalerResource implements ServerResource {
         }
 
         private static String genGslbObjectName(Object... args) {
-            String objectName = "";
+            StringBuffer buff = new StringBuffer();
             for (int i = 0; i < args.length; i++) {
-                objectName += args[i];
+                buff.append(args[i]);
                 if (i != args.length - 1) {
-                    objectName += "-";
+                    buff.append("-");
                 }
             }
-            return objectName;
+            return buff.toString();
         }
     }
 
@@ -3767,14 +3767,14 @@ public class NetscalerResource implements ServerResource {
     }
 
     private String genObjectName(Object... args) {
-        String objectName = "";
+        StringBuffer buff = new StringBuffer();
         for (int i = 0; i < args.length; i++) {
-            objectName += args[i];
+            buff.append(args[i]);
             if (i != args.length - 1) {
-                objectName += _objectNamePathSep;
+                buff.append(_objectNamePathSep);
             }
         }
-        return objectName;
+        return buff.toString();
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/97d296bf/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/command/LDAPConfigCmd.java
----------------------------------------------------------------------
diff --git a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/command/LDAPConfigCmd.java
b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/command/LDAPConfigCmd.java
index 619280d..a586ae8 100644
--- a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/command/LDAPConfigCmd.java
+++ b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/command/LDAPConfigCmd.java
@@ -155,7 +155,7 @@ public class LDAPConfigCmd extends BaseCmd {
     }
 
     public Integer getPort() {
-        return port <= 0 ? 389 : port;
+        return (Integer)(port.intValue() <= 0 ? 389 : port.intValue());
     }
 
     public void setPort(Integer port) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/97d296bf/server/src/com/cloud/api/ApiResponseHelper.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java
index ed48d0b..51122e0 100755
--- a/server/src/com/cloud/api/ApiResponseHelper.java
+++ b/server/src/com/cloud/api/ApiResponseHelper.java
@@ -1906,7 +1906,8 @@ public class ApiResponseHelper implements ResponseGenerator {
         Map<Service, Map<Capability, String>> serviceCapabilitiesMap = ApiDBUtils.getNetworkCapabilities(network.getId(),
network.getDataCenterId());
         List<ServiceResponse> serviceResponses = new ArrayList<ServiceResponse>();
         if (serviceCapabilitiesMap != null) {
-            for (Service service : serviceCapabilitiesMap.keySet()) {
+            for (Map.Entry<Service, Map<Capability, String>>entry : serviceCapabilitiesMap.entrySet())
{
+                Service service = entry.getKey();
                 ServiceResponse serviceResponse = new ServiceResponse();
                 // skip gateway service
                 if (service == Service.Gateway) {
@@ -1916,11 +1917,12 @@ public class ApiResponseHelper implements ResponseGenerator {
 
                 // set list of capabilities for the service
                 List<CapabilityResponse> capabilityResponses = new ArrayList<CapabilityResponse>();
-                Map<Capability, String> serviceCapabilities = serviceCapabilitiesMap.get(service);
+                Map<Capability, String> serviceCapabilities = entry.getValue();
                 if (serviceCapabilities != null) {
-                    for (Capability capability : serviceCapabilities.keySet()) {
+                    for (Map.Entry<Capability,String> ser_cap_entries : serviceCapabilities.entrySet())
{
+                        Capability capability = ser_cap_entries.getKey();
                         CapabilityResponse capabilityResponse = new CapabilityResponse();
-                        String capabilityValue = serviceCapabilities.get(capability);
+                        String capabilityValue = ser_cap_entries.getValue();
                         capabilityResponse.setName(capability.getName());
                         capabilityResponse.setValue(capabilityValue);
                         capabilityResponse.setObjectName("capability");
@@ -2605,7 +2607,9 @@ public class ApiResponseHelper implements ResponseGenerator {
 
         Map<Service, Set<Provider>> serviceProviderMap = ApiDBUtils.listVpcOffServices(vpc.getVpcOfferingId());
         List<ServiceResponse> serviceResponses = new ArrayList<ServiceResponse>();
-        for (Service service : serviceProviderMap.keySet()) {
+        for (Map.Entry<Service,Set<Provider>>entry : serviceProviderMap.entrySet())
{
+            Service service = entry.getKey();
+            Set<Provider> serviceProviders = entry.getValue();
             ServiceResponse svcRsp = new ServiceResponse();
             // skip gateway service
             if (service == Service.Gateway) {
@@ -2613,7 +2617,7 @@ public class ApiResponseHelper implements ResponseGenerator {
             }
             svcRsp.setName(service.getName());
             List<ProviderResponse> providers = new ArrayList<ProviderResponse>();
-            for (Provider provider : serviceProviderMap.get(service)) {
+            for (Provider provider : serviceProviders) {
                 if (provider != null) {
                     ProviderResponse providerRsp = new ProviderResponse();
                     providerRsp.setName(provider.getName());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/97d296bf/server/src/com/cloud/api/ApiServer.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/ApiServer.java b/server/src/com/cloud/api/ApiServer.java
index 2ce6281..f5f5c81 100755
--- a/server/src/com/cloud/api/ApiServer.java
+++ b/server/src/com/cloud/api/ApiServer.java
@@ -478,7 +478,7 @@ public class ApiServer extends ManagerBase implements HttpRequestHandler,
ApiSer
                 s_logger.error("invalid request, no command sent");
                 if (s_logger.isTraceEnabled()) {
                     s_logger.trace("dumping request parameters");
-                    for (final Object key : params.keySet()) {
+                    for (final  Object key : params.keySet()) {
                         final String keyStr = (String)key;
                         final String[] value = (String[])params.get(key);
                         s_logger.trace("   key: " + keyStr + ", value: " + ((value == null)
? "'null'" : value[0]));
@@ -652,7 +652,7 @@ public class ApiServer extends ManagerBase implements HttpRequestHandler,
ApiSer
 
             // save the scheduled event
             final Long eventId =
-                    ActionEventUtils.onScheduledActionEvent((callerUserId == null) ? User.UID_SYSTEM
: callerUserId, asyncCmd.getEntityOwnerId(), asyncCmd.getEventType(),
+                    ActionEventUtils.onScheduledActionEvent((callerUserId == null) ? (Long)User.UID_SYSTEM
: callerUserId, asyncCmd.getEntityOwnerId(), asyncCmd.getEventType(),
                             asyncCmd.getEventDescription(), asyncCmd.isDisplay(), startEventId);
             if (startEventId == 0) {
                 // There was no create event before, set current event id as start eventId

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/97d296bf/server/src/com/cloud/api/dispatch/ParamProcessWorker.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/dispatch/ParamProcessWorker.java b/server/src/com/cloud/api/dispatch/ParamProcessWorker.java
index 1592b93..07c45ba 100644
--- a/server/src/com/cloud/api/dispatch/ParamProcessWorker.java
+++ b/server/src/com/cloud/api/dispatch/ParamProcessWorker.java
@@ -33,6 +33,7 @@ import java.util.regex.Matcher;
 
 import javax.inject.Inject;
 
+
 import org.apache.log4j.Logger;
 
 import org.apache.cloudstack.acl.ControlledEntity;
@@ -229,9 +230,10 @@ public class ParamProcessWorker implements DispatchWorker {
         if (!entitiesToAccess.isEmpty()) {
             // check that caller can access the owner account.
             _accountMgr.checkAccess(caller, null, true, owner);
-            for (Object entity : entitiesToAccess.keySet()) {
+            for (Map.Entry<Object,AccessType>entry : entitiesToAccess.entrySet()) {
+                Object entity = entry.getKey();
                 if (entity instanceof ControlledEntity) {
-                    _accountMgr.checkAccess(caller, entitiesToAccess.get(entity), true, (ControlledEntity)
entity);
+                    _accountMgr.checkAccess(caller, entry.getValue(), true, (ControlledEntity)
entity);
                 } else if (entity instanceof InfrastructureEntity) {
                     // FIXME: Move this code in adapter, remove code from
                     // Account manager

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/97d296bf/server/src/com/cloud/api/dispatch/ParamUnpackWorker.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/dispatch/ParamUnpackWorker.java b/server/src/com/cloud/api/dispatch/ParamUnpackWorker.java
index 12e1226..c9bad2c 100644
--- a/server/src/com/cloud/api/dispatch/ParamUnpackWorker.java
+++ b/server/src/com/cloud/api/dispatch/ParamUnpackWorker.java
@@ -33,7 +33,8 @@ public class ParamUnpackWorker implements DispatchWorker {
     public void handle(final DispatchTask task) throws ServerApiException {
         final Map<String, Object> lowercaseParams = new HashMap<String, Object>();
         final Map<String, String> params = task.getParams();
-        for (final String key : params.keySet()) {
+        for (final Map.Entry<String,String> entry : params.entrySet()) {
+            final String key = entry.getKey();
             final int arrayStartIndex = key.indexOf('[');
             final int arrayStartLastIndex = key.lastIndexOf('[');
             if (arrayStartIndex != arrayStartLastIndex) {
@@ -99,11 +100,11 @@ public class ParamUnpackWorker implements DispatchWorker {
                 }
 
                 // we are ready to store the value for a particular field into the map for
this object
-                mapValue.put(fieldName, params.get(key));
+                mapValue.put(fieldName, entry.getValue());
 
                 lowercaseParams.put(paramName, mapArray);
             } else {
-                lowercaseParams.put(key.toLowerCase(), params.get(key));
+                lowercaseParams.put(key.toLowerCase(), entry.getValue());
             }
         }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/97d296bf/server/src/com/cloud/api/query/QueryManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/QueryManagerImpl.java b/server/src/com/cloud/api/query/QueryManagerImpl.java
index 1182be5..b09bb0f 100644
--- a/server/src/com/cloud/api/query/QueryManagerImpl.java
+++ b/server/src/com/cloud/api/query/QueryManagerImpl.java
@@ -857,10 +857,10 @@ public class QueryManagerImpl extends ManagerBase implements QueryService
{
 
         if (tags != null && !tags.isEmpty()) {
             SearchCriteria<UserVmJoinVO> tagSc = _userVmJoinDao.createSearchCriteria();
-            for (String key : tags.keySet()) {
+            for (Map.Entry<String,String> entry : tags.entrySet()) {
                 SearchCriteria<UserVmJoinVO> tsc = _userVmJoinDao.createSearchCriteria();
-                tsc.addAnd("tagKey", SearchCriteria.Op.EQ, key);
-                tsc.addAnd("tagValue", SearchCriteria.Op.EQ, tags.get(key));
+                tsc.addAnd("tagKey", SearchCriteria.Op.EQ,entry.getKey());
+                tsc.addAnd("tagValue", SearchCriteria.Op.EQ, entry.getValue());
                 tagSc.addOr("tagKey", SearchCriteria.Op.SC, tsc);
             }
             sc.addAnd("tagKey", SearchCriteria.Op.SC, tagSc);
@@ -2739,9 +2739,9 @@ public class QueryManagerImpl extends ManagerBase implements QueryService
{
         if (resourceTags != null && !resourceTags.isEmpty()) {
             int count = 0;
             sc.setJoinParameters("tagSearch", "resourceType", ResourceObjectType.Zone.toString());
-            for (String key : resourceTags.keySet()) {
-                sc.setJoinParameters("tagSearch", "key" + String.valueOf(count), key);
-                sc.setJoinParameters("tagSearch", "value" + String.valueOf(count), resourceTags.get(key));
+            for (Map.Entry<String,String> entry : resourceTags.entrySet()) {
+                sc.setJoinParameters("tagSearch", "key" + String.valueOf(count), entry.getKey());
+                sc.setJoinParameters("tagSearch", "value" + String.valueOf(count), entry.getValue());
                 count++;
             }
         }
@@ -2859,7 +2859,7 @@ public class QueryManagerImpl extends ManagerBase implements QueryService
{
         VMTemplateVO template = null;
 
         Boolean isAscending = Boolean.parseBoolean(_configDao.getValue("sortkey.algorithm"));
-        isAscending = (isAscending == null ? true : isAscending);
+        isAscending = (isAscending == null ? Boolean.TRUE : isAscending);
         Filter searchFilter = new Filter(TemplateJoinVO.class, "sortKey", isAscending, startIndex,
pageSize);
 
         SearchBuilder<TemplateJoinVO> sb = _templateJoinDao.createSearchBuilder();
@@ -2999,10 +2999,10 @@ public class QueryManagerImpl extends ManagerBase implements QueryService
{
             // add tags criteria
             if (tags != null && !tags.isEmpty()) {
                 SearchCriteria<TemplateJoinVO> scc = _templateJoinDao.createSearchCriteria();
-                for (String key : tags.keySet()) {
+                for (Map.Entry<String,String>entry : tags.entrySet()) {
                     SearchCriteria<TemplateJoinVO> scTag = _templateJoinDao.createSearchCriteria();
-                    scTag.addAnd("tagKey", SearchCriteria.Op.EQ, key);
-                    scTag.addAnd("tagValue", SearchCriteria.Op.EQ, tags.get(key));
+                    scTag.addAnd("tagKey", SearchCriteria.Op.EQ, entry.getKey());
+                    scTag.addAnd("tagValue", SearchCriteria.Op.EQ, entry.getValue());
                     if (isIso) {
                         scTag.addAnd("tagResourceType", SearchCriteria.Op.EQ, ResourceObjectType.ISO);
                     } else {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/97d296bf/server/src/com/cloud/api/query/dao/TemplateJoinDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/dao/TemplateJoinDaoImpl.java b/server/src/com/cloud/api/query/dao/TemplateJoinDaoImpl.java
index 80ef0f6..4c8ada1 100644
--- a/server/src/com/cloud/api/query/dao/TemplateJoinDaoImpl.java
+++ b/server/src/com/cloud/api/query/dao/TemplateJoinDaoImpl.java
@@ -380,7 +380,7 @@ public class TemplateJoinDaoImpl extends GenericDaoBase<TemplateJoinVO,
Long> im
         }
         // query details by batches
         Boolean isAscending = Boolean.parseBoolean(_configDao.getValue("sortkey.algorithm"));
-        isAscending = (isAscending == null ? true : isAscending);
+        isAscending = (isAscending == null ? Boolean.TRUE : isAscending);
         Filter searchFilter = new Filter(TemplateJoinVO.class, "sortKey", isAscending, null,
null);
         List<TemplateJoinVO> uvList = new ArrayList<TemplateJoinVO>();
         // query details by batches

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/97d296bf/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
index bb32c37..897f8e1 100755
--- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
+++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
@@ -4004,9 +4004,10 @@ public class ConfigurationManagerImpl extends ManagerBase implements
Configurati
 
     void validateConnectivityServiceCapablities(Set<Provider> providers, Map<Capability,
String> connectivityServiceCapabilityMap) {
         if (connectivityServiceCapabilityMap != null && !connectivityServiceCapabilityMap.isEmpty())
{
-            for (Capability capability: connectivityServiceCapabilityMap.keySet()) {
+            for (Map.Entry<Capability, String>entry: connectivityServiceCapabilityMap.entrySet())
{
+                Capability capability = entry.getKey();
                 if (capability == Capability.StretchedL2Subnet) {
-                    String value = connectivityServiceCapabilityMap.get(capability).toLowerCase();
+                    String value = entry.getValue().toLowerCase();
                     if (!(value.contains("true") ^ value.contains("false"))) {
                         throw new InvalidParameterValueException("Invalid value (" + value
+ ") for " + capability +
                         " should be true/false");

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/97d296bf/server/src/com/cloud/network/NetworkServiceImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkServiceImpl.java b/server/src/com/cloud/network/NetworkServiceImpl.java
index a574f10..b3de9e3 100755
--- a/server/src/com/cloud/network/NetworkServiceImpl.java
+++ b/server/src/com/cloud/network/NetworkServiceImpl.java
@@ -1693,9 +1693,9 @@ public class NetworkServiceImpl extends ManagerBase implements  NetworkService
{
         if (tags != null && !tags.isEmpty()) {
             int count = 0;
             sc.setJoinParameters("tagSearch", "resourceType", ResourceObjectType.Network.toString());
-            for (String key : tags.keySet()) {
-                sc.setJoinParameters("tagSearch", "key" + String.valueOf(count), key);
-                sc.setJoinParameters("tagSearch", "value" + String.valueOf(count), tags.get(key));
+            for ( Map.Entry<String,String> entry: tags.entrySet()) {
+                sc.setJoinParameters("tagSearch", "key" + String.valueOf(count), entry.getKey());
+                sc.setJoinParameters("tagSearch", "value" + String.valueOf(count), entry.getValue());
                 count++;
             }
         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/97d296bf/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 71f2316..a1029ee 100644
--- a/server/src/com/cloud/network/vpc/VpcManagerImpl.java
+++ b/server/src/com/cloud/network/vpc/VpcManagerImpl.java
@@ -1051,9 +1051,9 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager,
VpcProvis
         if (tags != null && !tags.isEmpty()) {
             int count = 0;
             sc.setJoinParameters("tagSearch", "resourceType", ResourceObjectType.Vpc.toString());
-            for (String key : tags.keySet()) {
-                sc.setJoinParameters("tagSearch", "key" + String.valueOf(count), key);
-                sc.setJoinParameters("tagSearch", "value" + String.valueOf(count), tags.get(key));
+            for (Map.Entry<String,String>entry : tags.entrySet()) {
+                sc.setJoinParameters("tagSearch", "key" + String.valueOf(count), entry.getKey());
+                sc.setJoinParameters("tagSearch", "value" + String.valueOf(count), entry.getValue());
                 count++;
             }
        }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/97d296bf/server/src/com/cloud/server/ConfigurationServerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/server/ConfigurationServerImpl.java b/server/src/com/cloud/server/ConfigurationServerImpl.java
index 694f3cd..1469048 100755
--- a/server/src/com/cloud/server/ConfigurationServerImpl.java
+++ b/server/src/com/cloud/server/ConfigurationServerImpl.java
@@ -1248,9 +1248,9 @@ public class ConfigurationServerImpl extends ManagerBase implements
Configuratio
                 defaultVpcNetworkOfferingProvidersNoLB.put(Service.PortForwarding, Provider.VPCVirtualRouter);
                 defaultVpcNetworkOfferingProvidersNoLB.put(Service.Vpn, Provider.VPCVirtualRouter);
 
-                for (Service service : defaultVpcNetworkOfferingProvidersNoLB.keySet()) {
+                for (Map.Entry<Service,Provider> entry : defaultVpcNetworkOfferingProvidersNoLB.entrySet())
{
                     NetworkOfferingServiceMapVO offService =
-                            new NetworkOfferingServiceMapVO(defaultNetworkOfferingForVpcNetworksNoLB.getId(),
service, defaultVpcNetworkOfferingProvidersNoLB.get(service));
+                            new NetworkOfferingServiceMapVO(defaultNetworkOfferingForVpcNetworksNoLB.getId(),
entry.getKey(), entry.getValue());
                     _ntwkOfferingServiceMapDao.persist(offService);
                     s_logger.trace("Added service for the network offering: " + offService);
                 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/97d296bf/server/src/com/cloud/server/StatsCollector.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/server/StatsCollector.java b/server/src/com/cloud/server/StatsCollector.java
index 29ace93..9f4c14e 100755
--- a/server/src/com/cloud/server/StatsCollector.java
+++ b/server/src/com/cloud/server/StatsCollector.java
@@ -912,15 +912,17 @@ public class StatsCollector extends ManagerBase implements ComponentMethodInterc
                 AutoScalePolicyVO policyVo = _asPolicyDao.findById(gpMap.getPolicyId());
                 Integer duration = policyVo.getDuration();
                 //get collection of counter name
-                String counterNames = "";
+
+                StringBuffer buff = new StringBuffer();
                 List<AutoScalePolicyConditionMapVO> lstPCmap = _asConditionMapDao.findByPolicyId(policyVo.getId());
                 for (AutoScalePolicyConditionMapVO pcMap : lstPCmap) {
                     String counterName = getCounternamebyCondition(pcMap.getConditionId());
-
-                    counterNames += counterName + "," + pcMap.getConditionId();
+                    buff.append(counterName);
+                    buff.append(",");
+                    buff.append(pcMap.getConditionId());
                 }
                 // add to result
-                Pair<String, Integer> pair = new Pair<String, Integer>(counterNames,
duration);
+                Pair<String, Integer> pair = new Pair<String, Integer>(buff.toString(),
duration);
                 result.add(pair);
             }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/97d296bf/server/src/com/cloud/storage/VolumeApiServiceImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/VolumeApiServiceImpl.java b/server/src/com/cloud/storage/VolumeApiServiceImpl.java
index 7af404e..a557c0e 100644
--- a/server/src/com/cloud/storage/VolumeApiServiceImpl.java
+++ b/server/src/com/cloud/storage/VolumeApiServiceImpl.java
@@ -820,7 +820,7 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
         if (!shrinkOk) {
             /* Check resource limit for this account on primary storage resource */
             _resourceLimitMgr.checkResourceLimit(_accountMgr.getAccount(volume.getAccountId()),
ResourceType.primary_storage, volume.isDisplayVolume(), new Long(newSize
-                    - currentSize));
+                    - currentSize).longValue());
         }
 
         /* If this volume has never been beyond allocated state, short circuit everything
and simply update the database */
@@ -1667,7 +1667,7 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
 
                 // retrieve the migrated new volume from job result
                 if (jobResult != null && jobResult instanceof Long) {
-                    return _entityMgr.findById(VolumeVO.class, ((Long)jobResult).longValue());
+                    return _entityMgr.findById(VolumeVO.class, ((Long)jobResult));
                 }
                 return null;
             }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/97d296bf/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java b/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java
index 71cf083..11362e4 100755
--- a/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java
+++ b/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java
@@ -1079,7 +1079,7 @@ public class SnapshotManagerImpl extends ManagerBase implements SnapshotManager,
 
         try {
             _resourceLimitMgr.checkResourceLimit(owner, ResourceType.snapshot);
-                _resourceLimitMgr.checkResourceLimit(owner, ResourceType.secondary_storage,
new Long(volume.getSize()));
+                _resourceLimitMgr.checkResourceLimit(owner, ResourceType.secondary_storage,
new Long(volume.getSize()).longValue());
         } catch (ResourceAllocationException e) {
             if (snapshotType != Type.MANUAL) {
                 String msg = "Snapshot resource limit exceeded for account id : " + owner.getId()
+ ". Failed to create recurring snapshots";

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/97d296bf/server/src/com/cloud/template/TemplateAdapterBase.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/template/TemplateAdapterBase.java b/server/src/com/cloud/template/TemplateAdapterBase.java
index e2204da..92383a0 100755
--- a/server/src/com/cloud/template/TemplateAdapterBase.java
+++ b/server/src/com/cloud/template/TemplateAdapterBase.java
@@ -363,7 +363,7 @@ public abstract class TemplateAdapterBase extends AdapterBase implements
Templat
         Account account = CallContext.current().getCallingAccount();
         Long zoneId = cmd.getZoneId();
 
-        VMTemplateVO template = _tmpltDao.findById(templateId.longValue());
+        VMTemplateVO template = _tmpltDao.findById(templateId);
         if (template == null) {
             throw new InvalidParameterValueException("unable to find template with id " +
templateId);
         }
@@ -388,7 +388,7 @@ public abstract class TemplateAdapterBase extends AdapterBase implements
Templat
         Long userId = CallContext.current().getCallingUserId();
         Long zoneId = cmd.getZoneId();
 
-        VMTemplateVO template = _tmpltDao.findById(templateId.longValue());
+        VMTemplateVO template = _tmpltDao.findById(templateId);
         if (template == null) {
             throw new InvalidParameterValueException("unable to find template with id " +
templateId);
         }
@@ -402,7 +402,7 @@ public abstract class TemplateAdapterBase extends AdapterBase implements
Templat
         Account account = CallContext.current().getCallingAccount();
         Long zoneId = cmd.getZoneId();
 
-        VMTemplateVO template = _tmpltDao.findById(templateId.longValue());
+        VMTemplateVO template = _tmpltDao.findById(templateId);
         if (template == null) {
             throw new InvalidParameterValueException("unable to find iso with id " + templateId);
         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/97d296bf/server/src/com/cloud/template/TemplateManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/template/TemplateManagerImpl.java b/server/src/com/cloud/template/TemplateManagerImpl.java
index 694bd03..7876a5a 100755
--- a/server/src/com/cloud/template/TemplateManagerImpl.java
+++ b/server/src/com/cloud/template/TemplateManagerImpl.java
@@ -381,8 +381,6 @@ public class TemplateManagerImpl extends ManagerBase implements TemplateManager,
         if (isISO) {
             desc = Upload.Type.ISO.toString();
         }
-        eventId = eventId == null ? 0 : eventId;
-
         if (!_accountMgr.isRootAdmin(caller.getId()) && _disableExtraction) {
             throw new PermissionDeniedException("Extraction has been disabled by admin");
         }
@@ -628,7 +626,7 @@ public class TemplateManagerImpl extends ManagerBase implements TemplateManager,
         TemplateDataStoreVO srcTmpltStore = _tmplStoreDao.findByStoreTemplate(srcSecStore.getId(),
tmpltId);
 
         _resourceLimitMgr.checkResourceLimit(account, ResourceType.template);
-        _resourceLimitMgr.checkResourceLimit(account, ResourceType.secondary_storage, new
Long(srcTmpltStore.getSize()));
+        _resourceLimitMgr.checkResourceLimit(account, ResourceType.secondary_storage, new
Long(srcTmpltStore.getSize()).longValue());
 
         // Event details
         String copyEventType;
@@ -1593,7 +1591,7 @@ public class TemplateManagerImpl extends ManagerBase implements TemplateManager,
         }
 
         _resourceLimitMgr.checkResourceLimit(templateOwner, ResourceType.template);
-        _resourceLimitMgr.checkResourceLimit(templateOwner, ResourceType.secondary_storage,
new Long(volume != null ? volume.getSize() : snapshot.getSize()));
+        _resourceLimitMgr.checkResourceLimit(templateOwner, ResourceType.secondary_storage,
new Long(volume != null ? volume.getSize() : snapshot.getSize()).longValue());
 
         if (!isAdmin || featured == null) {
             featured = Boolean.FALSE;


Mime
View raw message