diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2017-04-12 14:13:56 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2017-04-12 16:39:56 +0200 |
commit | 2f5d9eaccf74c99481b284a2a30016fe600978fc (patch) | |
tree | ec4dd3ac31ca6a1748326e3f10d77d2a3adf8045 /sonar-plugin-api | |
parent | 7b341707990b0ab9ab1c51cf19a7675af9507578 (diff) | |
download | sonarqube-2f5d9eaccf74c99481b284a2a30016fe600978fc.tar.gz sonarqube-2f5d9eaccf74c99481b284a2a30016fe600978fc.zip |
Fix Quality flaws
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/security/UserDetails.java | 16 | ||||
-rw-r--r-- | sonar-plugin-api/src/test/java/org/sonar/api/security/UserDetailsTest.java | 2 |
2 files changed, 7 insertions, 11 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/security/UserDetails.java b/sonar-plugin-api/src/main/java/org/sonar/api/security/UserDetails.java index bbd27c3ecb9..5674f365e62 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/security/UserDetails.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/security/UserDetails.java @@ -19,8 +19,6 @@ */ package org.sonar.api.security; -import com.google.common.base.MoreObjects; - /** * This class is not intended to be subclassed by clients. * @@ -33,9 +31,6 @@ public final class UserDetails { private String email = ""; private String userId = ""; - public UserDetails() { - } - public void setEmail(String email) { this.email = email; } @@ -68,10 +63,11 @@ public final class UserDetails { @Override public String toString() { - return MoreObjects.toStringHelper(this) - .add("name", name) - .add("email", email) - .add("userId", userId) - .toString(); + StringBuilder sb = new StringBuilder("UserDetails{"); + sb.append("name='").append(name).append('\''); + sb.append(", email='").append(email).append('\''); + sb.append(", userId='").append(userId).append('\''); + sb.append('}'); + return sb.toString(); } } diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/security/UserDetailsTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/security/UserDetailsTest.java index 95089e4c01c..3c0a6a2da59 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/security/UserDetailsTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/security/UserDetailsTest.java @@ -74,6 +74,6 @@ public class UserDetailsTest { userDetails.setEmail("foo@example.com"); userDetails.setUserId("foo@example"); - assertThat(userDetails.toString()).isEqualTo("UserDetails{name=foo, email=foo@example.com, userId=foo@example}"); + assertThat(userDetails.toString()).isEqualTo("UserDetails{name='foo', email='foo@example.com', userId='foo@example'}"); } } |