]> source.dussan.org Git - sonarqube.git/commitdiff
[NO-JIRA] Improving logs for when a user is added to a group
authorBelen Pruvost <belen.pruvost@sonarsource.com>
Mon, 7 Feb 2022 13:55:52 +0000 (10:55 -0300)
committersonartech <sonartech@sonarsource.com>
Mon, 7 Feb 2022 20:02:53 +0000 (20:02 +0000)
server/sonar-webserver-auth/src/main/java/org/sonar/server/authentication/UserRegistrarImpl.java

index 84b6fc74481150dac3020ad3bf1eac4d74bfdade..0a7c66a1f9b0d057cb4c25e1f4cda1e26e59d043 100644 (file)
@@ -203,7 +203,7 @@ public class UserRegistrarImpl implements UserRegistrar {
   private void addGroups(DbSession dbSession, UserDto userDto, Collection<String> groupsToAdd, Map<String, GroupDto> groupsByName) {
     groupsToAdd.stream().map(groupsByName::get).filter(Objects::nonNull).forEach(
       groupDto -> {
-        LOGGER.debug("Adding group '{}' to user '{}'", groupDto.getName(), userDto.getLogin());
+        LOGGER.debug("Adding user '{}' to group '{}'", userDto.getLogin(), groupDto.getName());
         dbClient.userGroupDao().insert(dbSession, new UserGroupDto().setGroupUuid(groupDto.getUuid()).setUserUuid(userDto.getUuid()),
           groupDto.getName(), userDto.getLogin());
       });
@@ -250,7 +250,7 @@ public class UserRegistrarImpl implements UserRegistrar {
   }
 
   private static UserDto[] toArray(Optional<UserDto> userDto) {
-    return userDto.map(u -> new UserDto[] {u}).orElse(new UserDto[] {});
+    return userDto.map(u -> new UserDto[]{u}).orElse(new UserDto[]{});
   }
 
   private static AuthenticationException generateExistingEmailError(UserRegistration authenticatorParameters, String email) {