anchela commented on a change in pull request #2:
URL: 
https://github.com/apache/sling-org-apache-sling-serviceusermapper/pull/2#discussion_r566129215



##########
File path: 
src/main/java/org/apache/sling/serviceusermapping/impl/ServiceUserMapperImpl.java
##########
@@ -487,18 +487,24 @@ private boolean isValidUser(final String userId, final 
String serviceName, final
             return false;
         }
         List<ServiceUserValidator> validators = getUserValidators();
-        if (!validators.isEmpty()) {
+        if (validators.isEmpty()) {
+            if (require) {
+                log.debug("isValidUser: No active validators for userId [{}] 
and require -> invalid", userId);
+                return false;
+            } else {
+                log.debug("isValidUser: No active validators for userId [{}] 
-> valid", userId);

Review comment:
       same here:
   `"isValidUser: No active validators for userId '{}' -> valid", userId`
   instead of [] around the id.

##########
File path: 
src/main/java/org/apache/sling/serviceusermapping/impl/ServiceUserMapperImpl.java
##########
@@ -487,18 +487,24 @@ private boolean isValidUser(final String userId, final 
String serviceName, final
             return false;
         }
         List<ServiceUserValidator> validators = getUserValidators();
-        if (!validators.isEmpty()) {
+        if (validators.isEmpty()) {
+            if (require) {
+                log.debug("isValidUser: No active validators for userId [{}] 
and require -> invalid", userId);

Review comment:
       i would put the userid in single quotes '{}' instead of using the [] 
brackets.




----------------------------------------------------------------
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:
[email protected]


Reply via email to