Mike Kolesnik has posted comments on this change.

Change subject: core: wrapper of HashMap for counting number of objects
......................................................................


Patch Set 6:

(3 comments)

http://gerrit.ovirt.org/#/c/26402/6/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 25:             return true;
Line 26:         } else if (allowDuplicate) {
Line 27:             counter.increment();
Line 28:             return true;
Line 29:         } else {
> there has to be return false. And constructs which 'returns' making rest of
Not sure what you mean by your explanation..
Line 30:             return false;
Line 31:         }
Line 32:     }
Line 33: 


Line 49:             map.remove(key);
Line 50:             return true;        //key was removed.
Line 51:         }
Line 52: 
Line 53:         return false;   //key is still present with lessened count.
> safety.
Why is return value even necessary? Is it used? Doesn't seem like it..
Line 54: 
Line 55:     }
Line 56: 
Line 57:     public boolean contains(T key) {


Line 74:         }
Line 75: 
Line 76:         public int increment() {
Line 77:             count++;
Line 78:             return count;
> not to have to use getter after incrementation. Nor to client code try to f
You don't use the return value, so I ask again - why do you need it?
Line 79:         }
Line 80: 
Line 81:         public int decrement() {
Line 82:             count--;


-- 
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: 6
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Martin Mucha <[email protected]>
Gerrit-Reviewer: Martin Mucha <[email protected]>
Gerrit-Reviewer: Mike Kolesnik <[email protected]>
Gerrit-Reviewer: Moti Asayag <[email protected]>
Gerrit-Reviewer: Yevgeny Zaspitsky <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to