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 8895405
Date Thu, 19 Sep 2013 15:08:53 GMT
Updated Branches:
  refs/heads/master 3f18f182b -> 88954053c


do not instantiate Long just for toString

replaced Long object instantiation with static call to Long.toString in case it was only to
generate a string

Signed-off-by: Laszlo Hornyak <laszlo.hornyak@gmail.com>


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

Branch: refs/heads/master
Commit: 88954053c344232189c130684c8dd3a495570045
Parents: 3f18f18
Author: Laszlo Hornyak <laszlo.hornyak@gmail.com>
Authored: Mon Sep 16 18:15:31 2013 +0200
Committer: Daan Hoogland <dhoogland@schubergphilis.com>
Committed: Thu Sep 19 16:58:59 2013 +0200

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


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/88954053/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 ea9c540..9b694e1 100755
--- a/server/src/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/com/cloud/vm/UserVmManagerImpl.java
@@ -715,7 +715,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager,
Vir
         User user = _userDao.findById(userId);
         try {
             VirtualMachineEntity vmEntity = _orchSrvc.getVirtualMachine(vm.getUuid());
-            status = vmEntity.stop(new Long(userId).toString());
+            status = vmEntity.stop(Long.toString(userId));
         } catch (ResourceUnavailableException e) {
             s_logger.debug("Unable to stop due to ", e);
             status = false;
@@ -2826,9 +2826,9 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager,
Vir
         rootDiskTags.add(offering.getTags());
 
         if(isIso){
-            VirtualMachineEntity vmEntity = _orchSrvc.createVirtualMachineFromScratch(vm.getUuid(),
new Long(owner.getAccountId()).toString(), vm.getIsoId().toString(), hostName, displayName,
hypervisor.name(), guestOSCategory.getName(), offering.getCpu(), offering.getSpeed(), offering.getRamSize(),
diskSize,  computeTags, rootDiskTags, networkNicMap, plan);
+            VirtualMachineEntity vmEntity = _orchSrvc.createVirtualMachineFromScratch(vm.getUuid(),
Long.toString(owner.getAccountId()), vm.getIsoId().toString(), hostName, displayName, hypervisor.name(),
guestOSCategory.getName(), offering.getCpu(), offering.getSpeed(), offering.getRamSize(),
diskSize,  computeTags, rootDiskTags, networkNicMap, plan);
         }else {
-            VirtualMachineEntity vmEntity = _orchSrvc.createVirtualMachine(vm.getUuid(),
new Long(owner.getAccountId()).toString(), new Long(template.getId()).toString(), hostName,
displayName, hypervisor.name(), offering.getCpu(),  offering.getSpeed(), offering.getRamSize(),
diskSize, computeTags, rootDiskTags, networkNicMap, plan);
+            VirtualMachineEntity vmEntity = _orchSrvc.createVirtualMachine(vm.getUuid(),
Long.toString(owner.getAccountId()), Long.toString(template.getId()), hostName, displayName,
hypervisor.name(), offering.getCpu(),  offering.getSpeed(), offering.getRamSize(), diskSize,
computeTags, rootDiskTags, networkNicMap, plan);
         }
 
 
@@ -3169,7 +3169,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager,
Vir
         boolean status = false;
         try {
             VirtualMachineEntity vmEntity = _orchSrvc.getVirtualMachine(vm.getUuid());
-            status = vmEntity.stop(new Long(userId).toString());
+            status = vmEntity.stop(Long.toString(userId));
             if (status) {
                return _vmDao.findById(vmId);
             } else {
@@ -3345,8 +3345,8 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager,
Vir
             }
         }
 
-        String reservationId = vmEntity.reserve(plannerName, plan, new ExcludeList(), new
Long(callerUser.getId()).toString());
-        vmEntity.deploy(reservationId, new Long(callerUser.getId()).toString(), params);
+        String reservationId = vmEntity.reserve(plannerName, plan, new ExcludeList(), Long.toString(callerUser.getId()));
+        vmEntity.deploy(reservationId, Long.toString(callerUser.getId()), params);
 
         Pair<UserVmVO, Map<VirtualMachineProfile.Param, Object>> vmParamPair
= new Pair(vm, params);
         if (vm != null && vm.isUpdateParameters()) {
@@ -3390,7 +3390,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager,
Vir
 
         try {
             VirtualMachineEntity vmEntity = _orchSrvc.getVirtualMachine(vm.getUuid());
-            status = vmEntity.destroy(new Long(userId).toString());
+            status = vmEntity.destroy(Long.toString(userId));
         } catch (CloudException e) {
             CloudRuntimeException ex = new CloudRuntimeException(
                     "Unable to destroy with specified vmId", e);


Mime
View raw message