sebwrede commented on a change in pull request #946:
URL: https://github.com/apache/systemml/pull/946#discussion_r441442854



##########
File path: 
src/main/java/org/apache/sysds/runtime/controlprogram/federated/FederatedResponse.java
##########
@@ -94,10 +94,11 @@ public void throwExceptionFromResponse() throws Exception {
         * If the map is empty, it means that no privacy constraints were found.
         * @param checkedConstraints map of checked constraints from the 
PrivacyMonitor
         */
-       public void 
setCheckedConstraints(ConcurrentHashMap<PrivacyLevel,LongAdder> 
checkedConstraints){
+       public void setCheckedConstraints(HashMap<PrivacyLevel,LongAdder> 
checkedConstraints){
                if ( checkedConstraints != null && 
!checkedConstraints.isEmpty() ){
-                       this.checkedConstraints = checkedConstraints;
-               }
+                       this.checkedConstraints = new HashMap<PrivacyLevel, 
LongAdder>();
+                       this.checkedConstraints.putAll(checkedConstraints);
+               }       

Review comment:
       It is not necessary for it to be concurrent. An enum should have the 
same hash value and it is unlikely to conflict with other enums. I could also 
have used EnumMap, but it is not necessary. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to