Oved Ourfali has posted comments on this change.

Change subject: findbugs: fixing boxing-unboxing issues
......................................................................


Patch Set 1: (2 inline comments)

minor comments.

....................................................
File 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VM.java
Line 1181:         // -------- cpu --------------
Line 1182:         setCpuSys(vmStatistics.getcpu_sys());
Line 1183:         setCpuUser(vmStatistics.getcpu_user());
Line 1184:         if ((getCpuSys() != null) && (getCpuUser() != null)) {
Line 1185:             Double percent = (getCpuSys() + getCpuUser()) / 
vm.getNumOfCpus();
won't it have an effect on the result, because int/int = int rather than a 
double?
Line 1186:             setUsageCpuPercent(percent.intValue());
Line 1187:             if (getUsageCpuPercent() != null && getUsageCpuPercent() 
> 100) {
Line 1188:                 setUsageCpuPercent(100);
Line 1189:             }


....................................................
File 
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/VmStatisticalQuery.java
Line 29:         long mem = entity.getMemSizeMb() * Mb;
Line 30:         long memUsedByCent = s.getusage_mem_percent()==null ? 0 : mem 
* s.getusage_mem_percent();
Line 31:         Double zero = 0.0;
Line 32:         Double cpuUser = s.getcpu_user()==null ? zero : 
s.getcpu_user();
Line 33:         Double cpuSys = s.getcpu_sys()==null ? zero : s.getcpu_sys();
consider using 0.0 instead of another variable called zero.
Line 34:         return asList(setDatum(clone(MEM_CONFIG),   mem),
Line 35:                       setDatum(clone(MEM_USED),     
(int)(memUsedByCent/100)),
Line 36:                       setDatum(clone(CPU_GUEST),    cpuUser),
Line 37:                       setDatum(clone(CPU_OVERHEAD), cpuSys),


--
To view, visit http://gerrit.ovirt.org/13974
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ibcec12523c2d09b15c2322e3b82ee47e27d03836
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Oved Ourfali <[email protected]>
Gerrit-Reviewer: Shahar Havivi <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to