reta commented on code in PR #3664:
URL: https://github.com/apache/cxf/pull/3664#discussion_r4442675995


##########
core/src/main/java/org/apache/cxf/interceptor/security/SecureAnnotationsInterceptor.java:
##########
@@ -71,7 +111,20 @@ public void setSecuredObject(Object object) {
                 LOG.fine("Method: " + entry.getKey() + ", roles: " + 
entry.getValue());
             }
         }
+        Map<String, List<String>> previousRoles = new 
HashMap<>(methodRolesMap);
         super.setMethodRolesMap(rolesMap);
+        // Record the entries the annotations added or replaced, using the 
keys as stored
+        // by setMethodRolesMap, and restore any configured entry they replaced
+        for (Map.Entry<String, List<String>> entry : 
methodRolesMap.entrySet()) {
+            if (entry.getValue() != previousRoles.get(entry.getKey())) {

Review Comment:
   ```suggestion
               if (!entry.getValue().equals(previousRoles.get(entry.getKey()))) 
{
   ```



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to