import org.sonar.server.computation.component.Component;
import org.sonar.server.computation.component.ComponentProvider;
import org.sonar.server.computation.component.Developer;
+import org.sonar.server.computation.component.DumbDeveloper;
import org.sonar.server.computation.component.NoComponentProvider;
import org.sonar.server.computation.component.TreeComponentProvider;
import org.sonar.server.computation.component.TreeRootHolder;
checkAndInitProvidersState();
InternalKey internalKey = new InternalKey(componentProvider.getByRef(componentRef), metricRepositoryRule.getByKey(metricKey), measure.getRuleId(),
- measure.getCharacteristicId());
+ measure.getCharacteristicId(), measure.getDeveloper());
checkState(!rawMeasures.containsKey(internalKey), format(
"A measure can only be set once for Component (ref=%s), Metric (key=%s), ruleId=%s, characteristicId=%s",
componentRef, metricKey, measure.getRuleId(), measure.getCharacteristicId()));
return Optional.fromNullable(rawMeasures.get(new InternalKey(component, metric)));
}
+ public Optional<Measure> getRawMeasure(Component component, Metric metric, DumbDeveloper developer) {
+ return Optional.fromNullable(rawMeasures.get(new InternalKey(component, metric, null, null, developer)));
+ }
+
public Optional<Measure> getRawRuleMeasure(Component component, Metric metric, int ruleId) {
return Optional.fromNullable(rawMeasures.get(new InternalKey(component, metric, ruleId, null)));
}
this(getRef(component), metric.getKey(), ruleId, characteristicId, null);
}
- public InternalKey(String componentRef, String metricKey, @Nullable Integer ruleId, @Nullable Integer characteristicId, @Nullable Developer developer) {
+ public InternalKey(Component component, Metric metric, @Nullable Integer ruleId, @Nullable Integer characteristicId, @Nullable Developer developer) {
+ this(getRef(component), metric.getKey(), ruleId, characteristicId, null);
+ }
+
+ private InternalKey(String componentRef, String metricKey, @Nullable Integer ruleId, @Nullable Integer characteristicId, @Nullable Developer developer) {
this.componentRef = componentRef;
this.metricKey = metricKey;
this.ruleId = ruleId == null ? DEFAULT_VALUE : ruleId;