Yevgeny Zaspitsky 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 5: 
Line 6: import org.ovirt.engine.core.utils.log.Log;
Line 7: import org.ovirt.engine.core.utils.log.LogFactory;
Line 8: 
Line 9: class ObjectCounter<T> {
Do you plan to add unit test?
Line 10: 
Line 11:     private static final Log log = 
LogFactory.getLog(ObjectCounter.class);
Line 12: 
Line 13:     private Map<T, ModifiableInteger> map = new HashMap<>();


Line 57:     public boolean contains(T key) {
Line 58:         return map.containsKey(key);
Line 59:     }
Line 60: 
Line 61:     private static class ModifiableInteger {
IMHO Counter is a better name
Line 62:         private int count;
Line 63: 
Line 64:         public ModifiableInteger(int initialValue) {
Line 65:             setCount(initialValue);


Line 60: 
Line 61:     private static class ModifiableInteger {
Line 62:         private int count;
Line 63: 
Line 64:         public ModifiableInteger(int initialValue) {
I'd add a default constructor that sets count to 1
Line 65:             setCount(initialValue);
Line 66:         }
Line 67: 
Line 68:         public int getCount() {


-- 
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: 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