diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2015-01-14 14:45:42 +0100 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2015-01-14 14:45:42 +0100 |
commit | f1f058b9ce1c9793c70dcd7f8e83c3a6bb372f9d (patch) | |
tree | e55169f5d1b9009fbc9f3f7ba1edcdec94ed0162 /sonar-batch-protocol | |
parent | 6a98bef3e60ad8d656c329c417e82d35d00abdd4 (diff) | |
download | sonarqube-f1f058b9ce1c9793c70dcd7f8e83c3a6bb372f9d.tar.gz sonarqube-f1f058b9ce1c9793c70dcd7f8e83c3a6bb372f9d.zip |
SONAR-5883 /batch/project WS now returns file hashes
Diffstat (limited to 'sonar-batch-protocol')
-rw-r--r-- | sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/input/ProjectReferentials.java | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/input/ProjectReferentials.java b/sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/input/ProjectReferentials.java index b945da6f7b8..8e83d0fabf5 100644 --- a/sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/input/ProjectReferentials.java +++ b/sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/input/ProjectReferentials.java @@ -24,12 +24,7 @@ import org.sonar.batch.protocol.GsonHelper; import javax.annotation.CheckForNull; import javax.annotation.Nullable; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.Date; -import java.util.HashMap; -import java.util.Map; +import java.util.*; /** * Container for all project data going from server to batch. @@ -44,15 +39,15 @@ public class ProjectReferentials { private Map<String, Map<String, FileData>> fileDataByModuleAndPath = new HashMap<String, Map<String, FileData>>(); private Date lastAnalysisDate; - public Map<String, String> settings(String projectKey) { - return settingsByModule.containsKey(projectKey) ? settingsByModule.get(projectKey) : Collections.<String, String>emptyMap(); + public Map<String, String> settings(String moduleKey) { + return settingsByModule.containsKey(moduleKey) ? settingsByModule.get(moduleKey) : Collections.<String, String>emptyMap(); } - public ProjectReferentials addSettings(String projectKey, Map<String, String> settings) { - Map<String, String> existingSettings = settingsByModule.get(projectKey); + public ProjectReferentials addSettings(String moduleKey, Map<String, String> settings) { + Map<String, String> existingSettings = settingsByModule.get(moduleKey); if (existingSettings == null) { - existingSettings = new HashMap<String, String>(); - settingsByModule.put(projectKey, existingSettings); + existingSettings = new HashMap<>(); + settingsByModule.put(moduleKey, existingSettings); } existingSettings.putAll(settings); return this; @@ -76,15 +71,15 @@ public class ProjectReferentials { return this; } - public Map<String, FileData> fileDataByPath(String projectKey) { - return fileDataByModuleAndPath.containsKey(projectKey) ? fileDataByModuleAndPath.get(projectKey) : Collections.<String, FileData>emptyMap(); + public Map<String, FileData> fileDataByPath(String moduleKey) { + return fileDataByModuleAndPath.containsKey(moduleKey) ? fileDataByModuleAndPath.get(moduleKey) : Collections.<String, FileData>emptyMap(); } - public ProjectReferentials addFileData(String projectKey, String path, FileData fileData) { - Map<String, FileData> existingFileDataByPath = fileDataByModuleAndPath.get(projectKey); + public ProjectReferentials addFileData(String moduleKey, String path, FileData fileData) { + Map<String, FileData> existingFileDataByPath = fileDataByModuleAndPath.get(moduleKey); if (existingFileDataByPath == null) { - existingFileDataByPath = new HashMap<String, FileData>(); - fileDataByModuleAndPath.put(projectKey, existingFileDataByPath); + existingFileDataByPath = new HashMap<>(); + fileDataByModuleAndPath.put(moduleKey, existingFileDataByPath); } existingFileDataByPath.put(path, fileData); return this; |