diff options
author | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2017-10-17 15:08:05 +0200 |
---|---|---|
committer | Teryk Bellahsene <teryk@users.noreply.github.com> | 2017-10-19 12:12:11 +0200 |
commit | 2f214e97c7fc833ba08615e62aa6d7f8bf5911e0 (patch) | |
tree | dd3cc039e88333cb26343565af6ca4d14c8d5d7e /server/sonar-db-dao | |
parent | 224b4c237c4383fb9c7eb21758dcb613e801fefe (diff) | |
download | sonarqube-2f214e97c7fc833ba08615e62aa6d7f8bf5911e0.tar.gz sonarqube-2f214e97c7fc833ba08615e62aa6d7f8bf5911e0.zip |
SONAR-9903 Ignore SCM accounts that are duplicates when adding a user
Diffstat (limited to 'server/sonar-db-dao')
-rw-r--r-- | server/sonar-db-dao/src/main/java/org/sonar/db/user/UserDto.java | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/user/UserDto.java b/server/sonar-db-dao/src/main/java/org/sonar/db/user/UserDto.java index fc3dd43df6f..1213e5bc0b7 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/user/UserDto.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/user/UserDto.java @@ -26,7 +26,6 @@ import java.util.List; import javax.annotation.CheckForNull; import javax.annotation.Nullable; import org.apache.commons.codec.digest.DigestUtils; -import org.apache.commons.lang.StringUtils; import org.sonar.core.user.DefaultUser; import static java.util.Objects.requireNonNull; @@ -117,7 +116,7 @@ public class UserDto { return this; } - public UserDto setScmAccounts(@Nullable List list) { + public UserDto setScmAccounts(@Nullable List<String> list) { this.scmAccounts = encodeScmAccounts(list); return this; } @@ -125,7 +124,7 @@ public class UserDto { @CheckForNull public static String encodeScmAccounts(@Nullable List<String> scmAccounts) { if (scmAccounts != null && !scmAccounts.isEmpty()) { - return String.format("%s%s%s", SCM_ACCOUNTS_SEPARATOR, StringUtils.join(scmAccounts, SCM_ACCOUNTS_SEPARATOR), SCM_ACCOUNTS_SEPARATOR); + return String.format("%s%s%s", SCM_ACCOUNTS_SEPARATOR, String.join(String.valueOf(SCM_ACCOUNTS_SEPARATOR), scmAccounts), SCM_ACCOUNTS_SEPARATOR); } return null; } |