diff options
author | Julien HENRY <julien.henry@sonarsource.com> | 2014-06-20 14:26:03 +0200 |
---|---|---|
committer | Julien HENRY <julien.henry@sonarsource.com> | 2014-06-20 14:26:03 +0200 |
commit | 865f4ba0b8d9431955bf52b94bdc605e3c8ccb57 (patch) | |
tree | bb34f9c8ffe1e1598fbd81812adb3be2b5321529 /sonar-batch/src | |
parent | 904b462c56317b1fb5a616534bd58aa9c9097d0b (diff) | |
download | sonarqube-865f4ba0b8d9431955bf52b94bdc605e3c8ccb57.tar.gz sonarqube-865f4ba0b8d9431955bf52b94bdc605e3c8ccb57.zip |
Fix UT after previous refactoring
Diffstat (limited to 'sonar-batch/src')
-rw-r--r-- | sonar-batch/src/main/java/org/sonar/batch/index/DefaultIndex.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/index/DefaultIndex.java b/sonar-batch/src/main/java/org/sonar/batch/index/DefaultIndex.java index c5dca91b146..088a0fbda43 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/index/DefaultIndex.java +++ b/sonar-batch/src/main/java/org/sonar/batch/index/DefaultIndex.java @@ -177,17 +177,19 @@ public class DefaultIndex extends SonarIndex { } } + @CheckForNull @Override public Measure getMeasure(Resource resource, org.sonar.api.batch.measure.Metric<?> metric) { return getMeasures(resource, MeasuresFilters.metric(metric)); } + @CheckForNull @Override public <M> M getMeasures(Resource resource, MeasuresFilter<M> filter) { // Reload resource so that effective key is populated Resource indexedResource = getResource(resource); if (indexedResource == null) { - throw new IllegalStateException("Resource is not indexed " + resource); + return null; } Iterable<Measure> unfiltered; if (filter instanceof MeasuresFilters.MetricFilter) { |