Allon Mureinik has posted comments on this change.

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


Patch Set 1: Looks good to me, but someone else must approve

(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);
As far as I understand the code, there is no flow that puts null in the map.
The only way null can be returned from it is if the key is not present.
In this case, putIfAbsent will return the /new/ value, which is what we need 
anyway.
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