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


##########
rt/features/logging/src/main/java/org/apache/cxf/ext/logging/event/DefaultLogEventMapper.java:
##########
@@ -125,31 +126,36 @@ private String getPrincipal(Message message) {
         return null;
     }
 
-    private String getJAASPrincipal() {
-        StringBuilder principals = new StringBuilder();
-        Iterator<? extends Object> principalIt = getJAASPrincipals();
-        while (principalIt.hasNext()) {
-            principals.append(principalIt.next());
-            if (principalIt.hasNext()) {
-                principals.append(',');
+    public String getConcatenatedJAASPrincipals() {
+        StringBuilder principalsStringBuilder = new StringBuilder();
+        Set<Principal> principals = getJAASPrincipals();

Review Comment:
   I believe we could do:
   
   ```
   if (principals.isEmpty()){
       return null;
   }
   ```
   
   since `getJAASPrincipals()` may return the empty set which does not need 
synchronization (moreover, it is backed by static instance).



-- 
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: dev-unsubscr...@cxf.apache.org

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

Reply via email to