Yair Zaslavsky has posted comments on this change.

Change subject: engine: putIfAbsent in EnumUtils.valueOf is ignored.
......................................................................


Patch Set 1: (1 inline comment)

....................................................
File 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/EnumUtils.java
Line 30: 
Line 31:             for (E e : universe) {
Line 32:                 map.put(e.name().toUpperCase(), e);
Line 33:             }
Line 34:             map = cacheEnumValuesInCapitalLetters.putIfAbsent(c, map);
I think I am missing here something - this is done if get for c returns null.
If you look at javadoc you will see putIfAbsent returns the old value - which 
is null.
Later on you perform ma.get( ...) - but isnt map null now, as the result of 
putIfAbsent was set to map?
Line 35:         }
Line 36: 
Line 37:         E result = map.get(name.toUpperCase());
Line 38:         if (result == null) {


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I41591e5da72b84bdb497b9ee7c88fbd72ecda827
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Asaf Shakarchi <a...@redhat.com>
Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com>
Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to