diff options
author | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2015-11-30 16:51:26 +0100 |
---|---|---|
committer | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2015-12-02 10:46:22 +0100 |
commit | f463897daea037addd0ee5d1a45c046b784e1fc5 (patch) | |
tree | 1b6b15d96676126561432cd90074641af6075242 /sonar-batch-protocol/src | |
parent | b7555709cf2e71c76749b5d7780c98c1ac7d1d5d (diff) | |
download | sonarqube-f463897daea037addd0ee5d1a45c046b784e1fc5.tar.gz sonarqube-f463897daea037addd0ee5d1a45c046b784e1fc5.zip |
SONAR-7084 Analysis do not fail when a component do not have a path
Diffstat (limited to 'sonar-batch-protocol/src')
-rw-r--r-- | sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/input/ProjectRepositories.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/input/ProjectRepositories.java b/sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/input/ProjectRepositories.java index 7d87cb0fd1b..2c575bbd8c4 100644 --- a/sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/input/ProjectRepositories.java +++ b/sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/input/ProjectRepositories.java @@ -60,7 +60,7 @@ public class ProjectRepositories { public boolean exists() { return exists; } - + public Map<String, Map<String, FileData>> fileDataByModuleAndPath() { return fileDataByModuleAndPath; } @@ -69,7 +69,11 @@ public class ProjectRepositories { return fileDataByModuleAndPath.containsKey(moduleKey) ? fileDataByModuleAndPath.get(moduleKey) : Collections.<String, FileData>emptyMap(); } - public ProjectRepositories addFileData(String moduleKey, String path, FileData fileData) { + public ProjectRepositories addFileData(String moduleKey, @Nullable String path, FileData fileData) { + if (path == null || (fileData.hash() == null && fileData.revision() == null)) { + return this; + } + Map<String, FileData> existingFileDataByPath = fileDataByModuleAndPath.get(moduleKey); if (existingFileDataByPath == null) { existingFileDataByPath = new HashMap<>(); |