Moti Asayag has posted comments on this change. Change subject: core: wrapper of HashMap for counting number of objects ......................................................................
Patch Set 5: (3 comments) http://gerrit.ovirt.org/#/c/26402/5//COMMIT_MSG Commit Message: Line 9: deal s/ot/to http://gerrit.ovirt.org/#/c/26402/5/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/ObjectCounter.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/ObjectCounter.java: Line 38: //it's not there, ignore; Line 39: return false; //key was not there! So it was not removed. Line 40: } Line 41: Line 42: please remove the extra space line Line 43: int count = counter.decrement(); Line 44: if (count == 0) { Line 45: map.remove(key); Line 46: return true; //key was removed; Line 43: int count = counter.decrement(); Line 44: if (count == 0) { Line 45: map.remove(key); Line 46: return true; //key was removed; Line 47: } else if (count < 0) { in which cases do you anticipate this condition to occur ? In a non-safe thread ? in addition, the warning is too general - having the key will allow debugging the flow which brought us to this condition (which doesn't suppose to happen). Line 48: log.warn("count underflow."); Line 49: map.remove(key); Line 50: return true; //key was removed. Line 51: } -- To view, visit http://gerrit.ovirt.org/26402 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I38b9ead37a8ebfc56103b87c65ba582a84f4dda6 Gerrit-PatchSet: 5 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Martin Mucha <mmu...@redhat.com> Gerrit-Reviewer: Moti Asayag <masa...@redhat.com> Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches