Lior Vernia has posted comments on this change.

Change subject: core: coverity issue fix.
......................................................................


Patch Set 1: Code-Review-2

(1 comment)

http://gerrit.ovirt.org/#/c/31206/1/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/macpoolmanager/MacsStorage.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/macpoolmanager/MacsStorage.java:

Line 64:         final List<Long> result = new ArrayList<>(numberOfMacs);
Line 65:         int remainingMacs = numberOfMacs;
Line 66:         while (remainingMacs > 0) {
Line 67: 
Line 68:             /*this is not needed, rangeWithAvailableMac won't be null, 
unless there's an error for which NPE should be
1. If it really is impossible for this to be null, then I would not change 
production code just to please Coverity. I would mark the defect as ignored on 
Coverity (possible by logging in, looking for it by CID, clicking on the defect 
in the main view and mark "ignore" under "action" in the right-hand panel). And 
then abandon this patch. But ONLY if it really can't happen.

2. Won't this "fix" to please Coverity result in an infinite loop?
Line 69:             thrown, but Coverity detects dereferencing hypothetical 
null as a problem.*/
Line 70:             final Range rangeWithAvailableMac = 
getRangeWithAvailableMac();
Line 71:             if (rangeWithAvailableMac == null) {
Line 72:                 continue;


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Id8a06231c6151530ff6c0fee9614b45f39c3a1dd
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Martin Mucha <[email protected]>
Gerrit-Reviewer: Alona Kaplan <[email protected]>
Gerrit-Reviewer: Lior Vernia <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to