Michael Pasternak has posted comments on this change.

Change subject: findbugs: Boxed value is unboxed and then immediately reboxed
......................................................................


Patch Set 6: I would prefer that you didn't submit this

(3 inline comments)

....................................................
File 
backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/HostMapperTest.java
Line 61:         vds.setCpuModel("some cpu model");
Line 62:         vds.setCpuSpeedMh(5.5);
Line 63:         Host host = HostMapper.map(vds, (Host) null);
Line 64:         assertNotNull(host.getCpu());
Line 65:         
assertEquals(host.getCpu().getTopology().getCores().intValue(), 2);
what if host.getCpu().getTopology().getCores() is null? you'll get NPE ...,

the change that you had to do is to remove Integer.valueOf() from 

host.getCpu().getTopology().getCores() as it's already Integer, and 

what it causing is Integer->int->Integer
Line 66:         
assertEquals(host.getCpu().getTopology().getSockets().intValue(), 3);
Line 67:         
assertEquals(host.getCpu().getTopology().getThreads().intValue(), 2);
Line 68:         assertEquals(host.getCpu().getName(), "some cpu model");
Line 69:         assertEquals(host.getCpu().getSpeed(), new BigDecimal(5.5));


Line 62:         vds.setCpuSpeedMh(5.5);
Line 63:         Host host = HostMapper.map(vds, (Host) null);
Line 64:         assertNotNull(host.getCpu());
Line 65:         
assertEquals(host.getCpu().getTopology().getCores().intValue(), 2);
Line 66:         
assertEquals(host.getCpu().getTopology().getSockets().intValue(), 3);
same
Line 67:         
assertEquals(host.getCpu().getTopology().getThreads().intValue(), 2);
Line 68:         assertEquals(host.getCpu().getName(), "some cpu model");
Line 69:         assertEquals(host.getCpu().getSpeed(), new BigDecimal(5.5));
Line 70:     }


Line 63:         Host host = HostMapper.map(vds, (Host) null);
Line 64:         assertNotNull(host.getCpu());
Line 65:         
assertEquals(host.getCpu().getTopology().getCores().intValue(), 2);
Line 66:         
assertEquals(host.getCpu().getTopology().getSockets().intValue(), 3);
Line 67:         
assertEquals(host.getCpu().getTopology().getThreads().intValue(), 2);
same
Line 68:         assertEquals(host.getCpu().getName(), "some cpu model");
Line 69:         assertEquals(host.getCpu().getSpeed(), new BigDecimal(5.5));
Line 70:     }
Line 71: 


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I28465ef80d706a5e8c08b3e3a92bd00f4a7de94f
Gerrit-PatchSet: 6
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Michael Pasternak <[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