aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-server
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2015-02-23 21:51:43 +0100
committerSimon Brandhof <simon.brandhof@sonarsource.com>2015-02-23 21:51:43 +0100
commitec5c44dd34ba4e77d43a0f6b67c9326a38c243dc (patch)
treeab0007c9768c6f8f3550a8686e7c0d8742c7d4b5 /server/sonar-server
parent1b2791924ef45c4b6a09d405deb3b1cfd5076798 (diff)
downloadsonarqube-ec5c44dd34ba4e77d43a0f6b67c9326a38c243dc.tar.gz
sonarqube-ec5c44dd34ba4e77d43a0f6b67c9326a38c243dc.zip
Fix quality flaws
Diffstat (limited to 'server/sonar-server')
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/computation/step/ParseReportStep.java9
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java5
2 files changed, 8 insertions, 6 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/step/ParseReportStep.java b/server/sonar-server/src/main/java/org/sonar/server/computation/step/ParseReportStep.java
index 042f13e7c4a..9d6f4a547e4 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/step/ParseReportStep.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/step/ParseReportStep.java
@@ -92,10 +92,11 @@ public class ParseReportStep implements ComputationStep {
private void recursivelyProcessComponent(BatchOutputReader reportReader, ComputationContext context, int componentRef) {
BatchReport.Component component = reportReader.readComponent(componentRef);
- issueComputation.processComponentIssues(context, component.getUuid(), reportReader.readComponentIssues(componentRef));
-
- for (Integer childRef : component.getChildRefsList()) {
- recursivelyProcessComponent(reportReader, context, childRef);
+ if (component != null) {
+ issueComputation.processComponentIssues(context, component.getUuid(), reportReader.readComponentIssues(componentRef));
+ for (Integer childRef : component.getChildRefsList()) {
+ recursivelyProcessComponent(reportReader, context, childRef);
+ }
}
}
diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java b/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java
index eb1a6f9b7c7..b719d076766 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java
@@ -45,6 +45,7 @@ import org.sonar.api.issue.Issue;
import org.sonar.api.rule.Severity;
import org.sonar.api.utils.DateUtils;
import org.sonar.api.utils.System2;
+import org.sonar.core.util.NonNullInputFunction;
import org.sonar.server.es.*;
import org.sonar.server.exceptions.NotFoundException;
import org.sonar.server.issue.IssueQuery;
@@ -101,9 +102,9 @@ public class IssueIndex extends BaseIndex {
* Convert an Elasticsearch result (a map) to an {@link org.sonar.server.issue.index.IssueDoc}. It's
* used for {@link org.sonar.server.es.SearchResult}.
*/
- private static final Function<Map<String, Object>, IssueDoc> DOC_CONVERTER = new Function<Map<String, Object>, IssueDoc>() {
+ private static final Function<Map<String, Object>, IssueDoc> DOC_CONVERTER = new NonNullInputFunction<Map<String,Object>, IssueDoc>() {
@Override
- public IssueDoc apply(Map<String, Object> input) {
+ protected IssueDoc doApply(Map<String, Object> input) {
return new IssueDoc(input);
}
};