Asaf Shakarchi has uploaded a new change for review.

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

engine: putIfAbsent in EnumUtils.valueOf is ignored.

The return value of cacheEnumValuesInCapitalLetters.putIfAbsent in
EnumUtils.valueOf method is ignored.

Ignoring the return value (X) of putInAbsent and retain a reference to
the value passed in (Y) may cause incorrect behavior (as X may be
different from Y)

Change-Id: I41591e5da72b84bdb497b9ee7c88fbd72ecda827
Signed-off-by: Asaf Shakarchi <[email protected]>
---
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/EnumUtils.java
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/56/10956/1

diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/EnumUtils.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/EnumUtils.java
index 41bded6..6a012d0 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/EnumUtils.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/EnumUtils.java
@@ -31,7 +31,7 @@
             for (E e : universe) {
                 map.put(e.name().toUpperCase(), e);
             }
-            cacheEnumValuesInCapitalLetters.putIfAbsent(c, map);
+            map = cacheEnumValuesInCapitalLetters.putIfAbsent(c, map);
         }
 
         E result = map.get(name.toUpperCase());


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I41591e5da72b84bdb497b9ee7c88fbd72ecda827
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Asaf Shakarchi <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to