From d0242d114bc3b9c7c4ddc304e28316d20d8caadc Mon Sep 17 00:00:00 2001 From: Teryk Bellahsene Date: Thu, 26 Feb 2015 14:50:46 +0100 Subject: [PATCH] fix default assignee when property is null - SONAR-6154 --- .../computation/issue/IssueComputation.java | 15 +++++++++------ 1 file 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; + } } } } -- 2.39.5