cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wid...@apache.org
Subject [17/50] [abbrv] git commit: updated refs/heads/kvm-vnc-listen to 895c51d
Date Mon, 16 Sep 2013 09:11:15 GMT
simplified casting

double values do not need a Double object to be casted to long

Signed-off-by: Laszlo Hornyak <laszlo.hornyak@gmail.com>
Signed-off-by: Min Chen <min.chen@citrix.com>


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

Branch: refs/heads/kvm-vnc-listen
Commit: d3237e75b2b2d4ba9872c76a5666f7cd2c44db03
Parents: 4adf131
Author: Laszlo Hornyak <laszlo.hornyak@gmail.com>
Authored: Thu Aug 29 09:23:06 2013 +0200
Committer: Min Chen <min.chen@citrix.com>
Committed: Wed Sep 11 18:27:54 2013 -0700

----------------------------------------------------------------------
 .../cloud/api/query/dao/UserVmJoinDaoImpl.java   | 19 ++++++-------------
 1 file changed, 6 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d3237e75/server/src/com/cloud/api/query/dao/UserVmJoinDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/dao/UserVmJoinDaoImpl.java b/server/src/com/cloud/api/query/dao/UserVmJoinDaoImpl.java
index 7f16974..55726a2 100644
--- a/server/src/com/cloud/api/query/dao/UserVmJoinDaoImpl.java
+++ b/server/src/com/cloud/api/query/dao/UserVmJoinDaoImpl.java
@@ -45,7 +45,6 @@ import com.cloud.uservm.UserVm;
 import com.cloud.utils.db.GenericDaoBase;
 import com.cloud.utils.db.SearchBuilder;
 import com.cloud.utils.db.SearchCriteria;
-import com.cloud.vm.UserVmVO;
 import com.cloud.vm.VmStats;
 import com.cloud.vm.VirtualMachine.State;
 
@@ -176,26 +175,20 @@ public class UserVmJoinDaoImpl extends GenericDaoBase<UserVmJoinVO,
Long> implem
                 cpuUsed = decimalFormat.format(cpuUtil) + "%";
                 userVmResponse.setCpuUsed(cpuUsed);
 
-                Double networkKbRead = Double.valueOf(vmStats.getNetworkReadKBs());
-                userVmResponse.setNetworkKbsRead(networkKbRead.longValue());
+                userVmResponse.setNetworkKbsRead((long) vmStats.getNetworkReadKBs());
 
-                Double networkKbWrite = Double.valueOf(vmStats.getNetworkWriteKBs());
-                userVmResponse.setNetworkKbsWrite(networkKbWrite.longValue());
+                userVmResponse.setNetworkKbsWrite((long) vmStats.getNetworkWriteKBs());
 
                 if ((userVm.getHypervisorType() != null) 
                         && (userVm.getHypervisorType().equals(HypervisorType.KVM)
                         || userVm.getHypervisorType().equals(HypervisorType.XenServer)))
{ // support KVM and XenServer only util 2013.06.25
-                    Double diskKbsRead = Double.valueOf(vmStats.getDiskReadKBs());
-                    userVmResponse.setDiskKbsRead(diskKbsRead.longValue());
+                    userVmResponse.setDiskKbsRead((long) vmStats.getDiskReadKBs());
 
-                    Double diskKbsWrite = Double.valueOf(vmStats.getDiskWriteKBs());
-                    userVmResponse.setDiskKbsWrite(diskKbsWrite.longValue());
+                    userVmResponse.setDiskKbsWrite((long) vmStats.getDiskWriteKBs());
 
-                    Double diskIORead = Double.valueOf(vmStats.getDiskReadIOs());
-                    userVmResponse.setDiskIORead(diskIORead.longValue());
+                    userVmResponse.setDiskIORead((long) vmStats.getDiskReadIOs());
 
-                    Double diskIOWrite = Double.valueOf(vmStats.getDiskWriteIOs());
-                    userVmResponse.setDiskIOWrite(diskIOWrite.longValue());
+                    userVmResponse.setDiskIOWrite((long) vmStats.getDiskWriteIOs());
                 }
             }
         }


Mime
View raw message