]> source.dussan.org Git - sonarqube.git/commitdiff
Fix UT after previous refactoring
authorJulien HENRY <julien.henry@sonarsource.com>
Fri, 20 Jun 2014 12:26:03 +0000 (14:26 +0200)
committerJulien HENRY <julien.henry@sonarsource.com>
Fri, 20 Jun 2014 12:26:03 +0000 (14:26 +0200)
sonar-batch/src/main/java/org/sonar/batch/index/DefaultIndex.java

index c5dca91b146d8288a897ec7a13a16ca71350ac97..088a0fbda43219a37be877672ad53964f14d1cbf 100644 (file)
@@ -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) {