aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2015-02-26 14:50:46 +0100
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2015-02-26 14:50:46 +0100
commitd0242d114bc3b9c7c4ddc304e28316d20d8caadc (patch)
tree727826451c98fe15e1e28e60e3d7253a2f8db56e
parent1d9b3e913aefa8b7d54761dd556d5565122bbaaf (diff)
downloadsonarqube-d0242d114bc3b9c7c4ddc304e28316d20d8caadc.tar.gz
sonarqube-d0242d114bc3b9c7c4ddc304e28316d20d8caadc.zip
fix default assignee when property is null - SONAR-6154
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/computation/issue/IssueComputation.java15
1 files changed, 9 insertions, 6 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/issue/IssueComputation.java b/server/sonar-server/src/main/java/org/sonar/server/computation/issue/IssueComputation.java
index 6e4a6c44349..6400979ffb4 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/issue/IssueComputation.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/issue/IssueComputation.java
@@ -19,6 +19,7 @@
*/
package org.sonar.server.computation.issue;
+import com.google.common.base.Strings;
import com.google.common.collect.Sets;
import org.sonar.api.CoreProperties;
import org.sonar.api.issue.internal.DefaultIssue;
@@ -143,17 +144,19 @@ public class IssueComputation {
issue.setTags(Sets.union(rule.getTags(), rule.getSystemTags()));
}
- private void computeDefaultAssignee(String login) {
+ private void computeDefaultAssignee(@Nullable String login) {
if (hasAssigneeBeenComputed) {
return;
}
hasAssigneeBeenComputed = true;
- UserDoc user = userIndex.getNullableByLogin(login);
- if (user == null) {
- LOG.info("the {} property was set with an unknown login: {}", CoreProperties.DEFAULT_ISSUE_ASSIGNEE, login);
- } else {
- defaultAssignee = login;
+ if (!Strings.isNullOrEmpty(login)) {
+ UserDoc user = userIndex.getNullableByLogin(login);
+ if (user == null) {
+ LOG.info("the {} property was set with an unknown login: {}", CoreProperties.DEFAULT_ISSUE_ASSIGNEE, login);
+ } else {
+ defaultAssignee = login;
+ }
}
}
}