<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div></div><div>Not sure who touched that, but since it's a NPE - Tal, can you doublecheck please?<br><br><br>Begin forwarded message:<br><br></div><blockquote type="cite"><div><b>From:</b> <a href="mailto:scan-admin@coverity.com">scan-admin@coverity.com</a><br><b>Date:</b> 21 November 2016 at 21:13:22 GMT+1<br><b>To:</b> <a href="mailto:mskrivan@redhat.com">mskrivan@redhat.com</a><br><b>Subject:</b> <b>New Defects reported by Coverity Scan for ovirt-engine</b><br><br></div></blockquote><blockquote type="cite"><div><span></span><br><span>Hi,</span><br><span></span><br><span>Please find the latest report on new defect(s) introduced to ovirt-engine found with Coverity Scan.</span><br><span></span><br><span>2 new defect(s) introduced to ovirt-engine found with Coverity Scan.</span><br><span>1 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent build analyzed by Coverity Scan.</span><br><span></span><br><span>New defect(s) Reported-by: Coverity Scan</span><br><span>Showing 2 of 2 defect(s)</span><br><span></span><br><span></span><br><span>** CID 1366189: Null pointer dereferences (NULL_RETURNS)</span><br><span>/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/GetDeviceListVDSCommand.java: 112 in org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.parseLunFromXmlRpc(java.util.Map, org.ovirt.engine.core.compat.Version)()</span><br><span></span><br><span></span><br><span>________________________________________________________________________________________________________</span><br><span>*** CID 1366189: Null pointer dereferences (NULL_RETURNS)</span><br><span>/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/GetDeviceListVDSCommand.java: 112 in org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.parseLunFromXmlRpc(java.util.Map, org.ovirt.engine.core.compat.Version)()</span><br><span>106 .put(xcon.get(PHYSICAL_DEVICE_FIELD).toString(),</span><br><span>107 DEVICE_ACTIVE_VALUE.equals(xcon.get(DEVICE_STATE_FIELD).toString()));</span><br><span>108 }</span><br><span>109 if (xcon.containsKey(PHYSICAL_DEVICE_FIELD) && xcon.containsKey(DEVICE_PATH_CAPACITY_FIELD)) {</span><br><span>110 // set name and capacity</span><br><span>111 Long size = IrsBrokerCommand.assignLongValue(xcon, DEVICE_PATH_CAPACITY_FIELD);</span><br><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span> CID 1366189: Null pointer dereferences (NULL_RETURNS)</span><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span> Unboxing null object "size".</span><br></blockquote></blockquote></blockquote><span>112 lun.getPathsCapacity()</span><br><span>113 .put(xcon.get(PHYSICAL_DEVICE_FIELD).toString(),</span><br><span>114 SizeConverter.convert(size,</span><br><span>115 SizeConverter.SizeUnit.BYTES, SizeConverter.SizeUnit.GiB).intValue());</span><br><span>116 }</span><br><span>117 }</span><br><span></span><br><span>** CID 1366190: Resource leaks (RESOURCE_LEAK)</span><br><span>/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/CommandsWeightsUtilsTest.java: 37 in org.ovirt.engine.core.bll.storage.CommandsWeightsUtilsTest.adjustWeights(java.util.List, java.util.List, int)()</span><br><span></span><br><span></span><br><span>________________________________________________________________________________________________________</span><br><span>*** CID 1366190: Resource leaks (RESOURCE_LEAK)</span><br><span>/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/CommandsWeightsUtilsTest.java: 37 in org.ovirt.engine.core.bll.storage.CommandsWeightsUtilsTest.adjustWeights(java.util.List, java.util.List, int)()</span><br><span>31 adjustWeights(Arrays.<Double> asList(0.33, 0.37, 0.3), Arrays.<Integer> asList(3, 3, 4), 10);</span><br><span>32 }</span><br><span>33 </span><br><span>34 public void adjustWeights(List<Double> weightParts, List<Integer> expectedWeightsSorted, int totalWeight) {</span><br><span>35 assertFalse(weightsUtils == null);</span><br><span>36 Map<String, Double> map = new HashMap<>();</span><br><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span> CID 1366190: Resource leaks (RESOURCE_LEAK)</span><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span> Failing to save or close resource created by "java.util.stream.IntStream.range(0, weightParts.size())" leaks it.</span><br></blockquote></blockquote></blockquote><span>37 IntStream.range(0, weightParts.size()).forEach(i -> map.put(String.valueOf(i), weightParts.get(i)));</span><br><span>38 Map<String, Integer> res = weightsUtils.adjust(map, totalWeight);</span><br><span>39 assertEquals("adjusted weights sum should be equal to the total weight",</span><br><span>40 totalWeight,</span><br><span>41 res.values().stream().mapToInt(x -> x).sum());</span><br><span>42 </span><br><span></span><br><span></span><br><span>________________________________________________________________________________________________________</span><br><span>To view the defects in Coverity Scan visit, <a href="https://u2389337.ct.sendgrid.net/wf/click?upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-2Bd2MGckcRY9v3SZ-2BLqhn66fucWz5NChdV2QNZzLQCPY1fjqQGlAKjFKQ4pnDnQ8dtAwvCE2G0E-3D_xDvy9aTtFVlNgNTFLiCVD0cicL2K6Y3d-2BJIBr-2FpAeMq2Gor5C1ZEiQuot3av2-2FBnTXIjnZdjb0Cw-2FiZV5z3DRotm2ow-2BiwdoVplKeuk7nRFrRXzS4jJb3IZXBSxeZC0bc8KPnuElHCtQryUJ5u-2FY6QjMUnZuFDu-2BC21coRtHfPr1uF9ZCvkTQAT-2Bg5drHSbNPaszp0YnZzvaUGArGUlXQkPt48dc-2FNZaixgGomwsPPQ-3D">https://u2389337.ct.sendgrid.net/wf/click?upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-2Bd2MGckcRY9v3SZ-2BLqhn66fucWz5NChdV2QNZzLQCPY1fjqQGlAKjFKQ4pnDnQ8dtAwvCE2G0E-3D_xDvy9aTtFVlNgNTFLiCVD0cicL2K6Y3d-2BJIBr-2FpAeMq2Gor5C1ZEiQuot3av2-2FBnTXIjnZdjb0Cw-2FiZV5z3DRotm2ow-2BiwdoVplKeuk7nRFrRXzS4jJb3IZXBSxeZC0bc8KPnuElHCtQryUJ5u-2FY6QjMUnZuFDu-2BC21coRtHfPr1uF9ZCvkTQAT-2Bg5drHSbNPaszp0YnZzvaUGArGUlXQkPt48dc-2FNZaixgGomwsPPQ-3D</a></span><br><span></span><br><span>To manage Coverity Scan email notifications for "<a href="mailto:mskrivan@redhat.com">mskrivan@redhat.com</a>", click <a href="https://u2389337.ct.sendgrid.net/wf/click?upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-2Bd2MGckcRbVDbis712qZDP-2FA8y06Nq4QYNJdvz3-2Bo6D7kzKGM4BieGXcFZeVj8bblbpPZS135zo-2F9pagiHHlVMtL1t-2BQNkdMMpi2fcAFj8yWlY6sxZhzNUWHvSkeP6LdDHUGDSs8PI-3D_xDvy9aTtFVlNgNTFLiCVD0cicL2K6Y3d-2BJIBr-2FpAeMq2Gor5C1ZEiQuot3av2-2FBnYwmACJZZa-2BkRa13JTRgm4K6JnogNoqDZTzNvLRxP6Val1P03EDtJ3QxTG8urJ-2FCTuXNzEDZ24au9cRqVgy9YVPOiVSvw7tAY4dzssRc8ERmy1mCzlCbU6-2B9s01kYf0EYko6e7QKj2VpVxVJD8bRNr-2FNXcUSv-2Bu1fA612id1LcCM-3D">https://u2389337.ct.sendgrid.net/wf/click?upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-2Bd2MGckcRbVDbis712qZDP-2FA8y06Nq4QYNJdvz3-2Bo6D7kzKGM4BieGXcFZeVj8bblbpPZS135zo-2F9pagiHHlVMtL1t-2BQNkdMMpi2fcAFj8yWlY6sxZhzNUWHvSkeP6LdDHUGDSs8PI-3D_xDvy9aTtFVlNgNTFLiCVD0cicL2K6Y3d-2BJIBr-2FpAeMq2Gor5C1ZEiQuot3av2-2FBnYwmACJZZa-2BkRa13JTRgm4K6JnogNoqDZTzNvLRxP6Val1P03EDtJ3QxTG8urJ-2FCTuXNzEDZ24au9cRqVgy9YVPOiVSvw7tAY4dzssRc8ERmy1mCzlCbU6-2B9s01kYf0EYko6e7QKj2VpVxVJD8bRNr-2FNXcUSv-2Bu1fA612id1LcCM-3D</a></span><br><span></span><br></div></blockquote></body></html>