aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/DefaultIssueCallback.java
diff options
context:
space:
mode:
Diffstat (limited to 'sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/DefaultIssueCallback.java')
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/DefaultIssueCallback.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/DefaultIssueCallback.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/DefaultIssueCallback.java
index 20f628c4216..d6afff29173 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/DefaultIssueCallback.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/DefaultIssueCallback.java
@@ -28,6 +28,8 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
+import java.util.stream.Collectors;
+
import org.sonar.scanner.issue.tracking.TrackedIssue;
import org.sonar.scanner.protocol.input.ScannerInput.User;
import org.sonar.scanner.repository.user.UserRepositoryLoader;
@@ -104,12 +106,10 @@ public class DefaultIssueCallback implements IssueCallback {
}
private void getUsers() {
- for (String loginName : userLoginNames) {
- User user = userRepository.load(loginName);
- if (user != null) {
- userMap.put(user.getLogin(), user.getName());
- }
- }
+ Map<String, User> map = userRepository.map(userLoginNames);
+
+ userMap = map.entrySet().stream()
+ .collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue().getName()));
}
private String getRuleName(RuleKey ruleKey) {