* @throws IllegalStateException if there is no id for the specified Component
*/
long getComponentId(Component component);
-
- /**
- * @throws IllegalStateException if there is no id for the specified Developer
- */
- long getDeveloperId(Developer developer);
}
return delegate.getComponentId(component);
}
- @Override
- public DbIdsRepository setDeveloperId(Developer developer, long developerId) {
- return delegate.setDeveloperId(developer, developerId);
- }
-
- @Override
- public long getDeveloperId(Developer developer) {
- return delegate.getDeveloperId(developer);
- }
}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2019 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.sonar.ce.task.projectanalysis.component;
-
-/**
- * Developers are created by the Developer Cockpit plugin
- */
-public interface Developer {
-
-}
private final Function<Component, T> componentToKey;
private final Map<T, Long> componentIdsByRef = new HashMap<>();
- private final Map<Developer, Long> developerIdsByKey = new HashMap<>();
public MapBasedDbIdsRepository(Function<Component, T> componentToKey) {
this.componentToKey = componentToKey;
return componentId;
}
- @Override
- public DbIdsRepository setDeveloperId(Developer developer, long developerId) {
- Long existingId = developerIdsByKey.get(developer);
- checkState(existingId == null, "Id '%s' is already registered in repository for Developer '%s', can not set new id '%s'", existingId, developer, developerId);
- developerIdsByKey.put(developer, developerId);
- return this;
- }
-
- @Override
- public long getDeveloperId(Developer developer) {
- Long devId = developerIdsByKey.get(developer);
- checkState(devId != null, "No id registered in repository for Developer '%s'", developer);
- return devId;
- }
}
* @throws IllegalStateException if the component id for the specified component has already been set
*/
DbIdsRepository setComponentId(Component component, long componentId);
-
- /**
- * @throws IllegalStateException if the id for the specified developer has already been set
- */
- DbIdsRepository setDeveloperId(Developer developer, long developerId);
}
requireNonNull(component);
checkValueTypeConsistency(metric, measure);
- Optional<Measure> existingMeasure = find(component, metric, measure);
+ Optional<Measure> existingMeasure = find(component, metric);
if (existingMeasure.isPresent()) {
throw new UnsupportedOperationException(
format(
requireNonNull(component);
checkValueTypeConsistency(metric, measure);
- Optional<Measure> existingMeasure = find(component, metric, measure);
+ Optional<Measure> existingMeasure = find(component, metric);
if (!existingMeasure.isPresent()) {
throw new UnsupportedOperationException(
format(
if (measuresPerMetric == null) {
return Optional.empty();
}
- return Optional.ofNullable(measuresPerMetric.get(new MeasureKey(metric.getKey(), null)));
- }
-
- private Optional<Measure> find(Component component, Metric metric, Measure measure) {
- T componentKey = componentToKey.apply(component);
- Map<MeasureKey, Measure> measuresPerMetric = measures.get(componentKey);
- if (measuresPerMetric == null) {
- return Optional.empty();
- }
- return Optional.ofNullable(measuresPerMetric.get(new MeasureKey(metric.getKey(), measure.getDeveloper())));
+ return Optional.ofNullable(measuresPerMetric.get(new MeasureKey(metric.getKey())));
}
public void add(Component component, Metric metric, Measure measure, OverridePolicy overridePolicy) {
T componentKey = componentToKey.apply(component);
Map<MeasureKey, Measure> measuresPerMetric = measures.computeIfAbsent(componentKey, key -> new HashMap<>());
- MeasureKey key = new MeasureKey(metric.getKey(), measure.getDeveloper());
+ MeasureKey key = new MeasureKey(metric.getKey());
if (!measuresPerMetric.containsKey(key) || overridePolicy == OverridePolicy.OVERRIDE) {
measuresPerMetric.put(key, measure);
}
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Locale;
-import java.util.Objects;
import java.util.Optional;
import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
-import org.sonar.ce.task.projectanalysis.component.Developer;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkState;
private final ValueType valueType;
@CheckForNull
- private final Developer developer;
- @CheckForNull
private final Double value;
@CheckForNull
private final String data;
@CheckForNull
private final Double variation;
- private Measure(ValueType valueType, @Nullable Developer developer,
+ private Measure(ValueType valueType,
@Nullable Double value, @Nullable String data, @Nullable Level dataLevel,
@Nullable QualityGateStatus qualityGateStatus, @Nullable Double variation) {
this.valueType = valueType;
- this.developer = developer;
this.value = value;
this.data = data;
this.dataLevel = dataLevel;
}
public static final class NewMeasureBuilder {
- private Developer developer;
private QualityGateStatus qualityGateStatus;
private Double variation;
- /**
- * Sets the developer this measure is associated to.
- *
- */
- public NewMeasureBuilder forDeveloper(Developer developer) {
- this.developer = developer;
- return this;
- }
-
public NewMeasureBuilder setQualityGateStatus(QualityGateStatus qualityGateStatus) {
this.qualityGateStatus = requireNonNull(qualityGateStatus, "QualityGateStatus can not be set to null");
return this;
}
public Measure create(boolean value, @Nullable String data) {
- return new Measure(ValueType.BOOLEAN, developer, value ? 1.0D : 0.0D, data, null, qualityGateStatus, variation);
+ return new Measure(ValueType.BOOLEAN, value ? 1.0D : 0.0D, data, null, qualityGateStatus, variation);
}
public Measure create(boolean value) {
}
public Measure create(int value, @Nullable String data) {
- return new Measure(ValueType.INT, developer, (double) value, data, null, qualityGateStatus, variation);
+ return new Measure(ValueType.INT, (double) value, data, null, qualityGateStatus, variation);
}
public Measure create(int value) {
}
public Measure create(long value, @Nullable String data) {
- return new Measure(ValueType.LONG, developer, (double) value, data, null, qualityGateStatus, variation);
+ return new Measure(ValueType.LONG, (double) value, data, null, qualityGateStatus, variation);
}
public Measure create(long value) {
public Measure create(double value, int decimalScale, @Nullable String data) {
checkArgument(!Double.isNaN(value), "NaN is not allowed as a Measure value");
double scaledValue = scale(value, decimalScale);
- return new Measure(ValueType.DOUBLE, developer, scaledValue, data, null, qualityGateStatus, variation);
+ return new Measure(ValueType.DOUBLE, scaledValue, data, null, qualityGateStatus, variation);
}
public Measure create(double value, int decimalScale) {
}
public Measure create(String value) {
- return new Measure(ValueType.STRING, developer, null, requireNonNull(value), null, qualityGateStatus, variation);
+ return new Measure(ValueType.STRING, null, requireNonNull(value), null, qualityGateStatus, variation);
}
public Measure create(Level level) {
- return new Measure(ValueType.LEVEL, developer, null, null, requireNonNull(level), qualityGateStatus, variation);
+ return new Measure(ValueType.LEVEL, null, null, requireNonNull(level), qualityGateStatus, variation);
}
public Measure createNoValue() {
- return new Measure(ValueType.NO_VALUE, developer, null, null, null, qualityGateStatus, variation);
+ return new Measure(ValueType.NO_VALUE, null, null, null, qualityGateStatus, variation);
}
private static double scale(double value, int decimalScale) {
}
public Measure create() {
- return new Measure(source.valueType, source.developer,
+ return new Measure(source.valueType,
source.value, source.data, source.dataLevel,
source.qualityGateStatus == null ? qualityGateStatus : source.qualityGateStatus,
source.variation == null ? variation : source.variation);
}
}
- @CheckForNull
- public Developer getDeveloper() {
- return developer;
- }
-
/**
* The type of value stored in the measure.
*/
return variation;
}
- /**
- * a Metric is equal to another Metric if it has the same ruleId/characteristicId paar (both being potentially
- * {@code null} but only one of them can be non {@code null}).
- */
- @Override
- public boolean equals(@Nullable Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- Measure measure = (Measure) o;
- return Objects.equals(developer, measure.developer);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(developer);
- }
-
@Override
public String toString() {
return com.google.common.base.MoreObjects.toStringHelper(this)
.add("valueType", valueType)
- .add("developer", developer)
.add("value", value)
.add("data", data)
.add("dataLevel", dataLevel)
package org.sonar.ce.task.projectanalysis.measure;
import java.util.Objects;
-import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
import javax.annotation.concurrent.Immutable;
-import org.sonar.ce.task.projectanalysis.component.Developer;
-import org.sonar.ce.task.projectanalysis.component.Developer;
import static java.util.Objects.requireNonNull;
public final class MeasureKey {
private final String metricKey;
- @CheckForNull
- private final Developer developer;
- public MeasureKey(String metricKey, @Nullable Developer developer) {
+ public MeasureKey(String metricKey) {
this.metricKey = requireNonNull(metricKey, "MetricKey can not be null");
- this.developer = developer;
}
public String getMetricKey() {
return metricKey;
}
- @CheckForNull
- public Developer getDeveloper() {
- return developer;
- }
-
@Override
public boolean equals(@Nullable Object o) {
if (this == o) {
return false;
}
MeasureKey that = (MeasureKey) o;
- return metricKey.equals(that.metricKey)
- && developer == that.developer;
+ return metricKey.equals(that.metricKey);
}
@Override
public String toString() {
return "MeasureKey{" +
"metricKey='" + metricKey + '\'' +
- ", developer=" + developer +
'}';
}
}
private static final String SOME_COMPONENT_KEY = "SOME_COMPONENT_KEY";
private static final Component SOME_COMPONENT = ReportComponent.builder(PROJECT, 1).setKey(SOME_COMPONENT_KEY).build();
- private static final Developer SOME_DEVELOPER = new DumbDeveloper("DEV1");
@Test
public void add_and_get_component_id() {
cache.setComponentId(SOME_COMPONENT, 11L);
}
- @Test
- public void add_and_get_developer_id() {
- DbIdsRepositoryImpl cache = new DbIdsRepositoryImpl();
- cache.setDeveloperId(SOME_DEVELOPER, 100L);
-
- assertThat(cache.getDeveloperId(SOME_DEVELOPER)).isEqualTo(100L);
- }
-
- @Test
- public void fail_to_get_developer_id_on_unknown_developer() {
- thrown.expect(IllegalStateException.class);
- thrown.expectMessage("No id registered in repository for Developer '" + SOME_DEVELOPER + "'");
-
- new DbIdsRepositoryImpl().getDeveloperId(SOME_DEVELOPER);
- }
-
- @Test
- public void fail_if_developer_id_already_set() {
- DbIdsRepositoryImpl cache = new DbIdsRepositoryImpl();
- cache.setDeveloperId(SOME_DEVELOPER, 10L);
-
- thrown.expect(IllegalStateException.class);
- thrown.expectMessage("Id '10' is already registered in repository for Developer '" + SOME_DEVELOPER + "', can not set new id '11'");
- cache.setDeveloperId(SOME_DEVELOPER, 11L);
- }
-
}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2019 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.sonar.ce.task.projectanalysis.component;
-
-/**
- * Implementation od {@link Developer} only used for test
- */
-public class DumbDeveloper implements Developer {
-
- private final String key;
-
- public DumbDeveloper(String key) {
- this.key = key;
- }
-
- public String getKey() {
- return key;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
-
- DumbDeveloper that = (DumbDeveloper) o;
-
- return key.equals(that.key);
-
- }
-
- @Override
- public int hashCode() {
- return key.hashCode();
- }
-
- @Override
- public String toString() {
- return "Developer{" +
- "key='" + key + '\'' +
- '}';
- }
-}
return delegate.setComponentId(component, componentId);
}
- @Override
- public DbIdsRepository setDeveloperId(Developer developer, long developerId) {
- return delegate.setDeveloperId(developer, developerId);
- }
-
- @Override
- public long getDeveloperId(Developer developer) {
- return delegate.getDeveloperId(developer);
- }
-
@Override
public long getComponentId(Component component) {
return delegate.getComponentId(component);
import com.tngtech.java.junit.dataprovider.UseDataProvider;
import java.util.List;
import java.util.Optional;
-import java.util.Set;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.sonar.api.utils.System2;
import org.sonar.ce.task.projectanalysis.batch.BatchReportReader;
import org.sonar.ce.task.projectanalysis.component.Component;
-import org.sonar.ce.task.projectanalysis.component.Developer;
-import org.sonar.ce.task.projectanalysis.component.DumbDeveloper;
import org.sonar.ce.task.projectanalysis.component.ReportComponent;
import org.sonar.ce.task.projectanalysis.metric.Metric;
import org.sonar.ce.task.projectanalysis.metric.MetricImpl;
private static final Measure SOME_MEASURE = Measure.newMeasureBuilder().create("some value");
private static final RuleDto SOME_RULE = RuleDto.createFor(RuleKey.of("A", "1")).setId(963);
- private static final Developer SOME_DEVELOPER = new DumbDeveloper("DEV1");
private ReportMetricValidator reportMetricValidator = mock(ReportMetricValidator.class);
Measure.newMeasureBuilder().create(false),
Measure.newMeasureBuilder().create("sds"),
Measure.newMeasureBuilder().create(Measure.Level.OK),
- Measure.newMeasureBuilder().createNoValue()
- );
+ Measure.newMeasureBuilder().createNoValue());
@DataProvider
public static Object[][] measures() {
assertThat(underTest.getRawMeasures(FILE_COMPONENT, metric1)).isEmpty();
}
- @Test
- public void getRawMeasures_for_metric_returns_developer_measure() {
- Measure devMeasure = Measure.newMeasureBuilder().forDeveloper(SOME_DEVELOPER).createNoValue();
-
- underTest.add(FILE_COMPONENT, metric1, devMeasure);
-
- Set<Measure> measures = underTest.getRawMeasures(FILE_COMPONENT, metric1);
- assertThat(measures).hasSize(1);
- assertThat(measures.iterator().next()).isSameAs(devMeasure);
- }
-
}
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
-import org.sonar.ce.task.projectanalysis.component.Developer;
-import org.sonar.ce.task.projectanalysis.component.DumbDeveloper;
import static org.assertj.core.api.Assertions.assertThat;
@Rule
public ExpectedException thrown = ExpectedException.none();
- static final Developer DEVELOPER = new DumbDeveloper("DEV1");
-
@Test
public void fail_with_NPE_when_metric_key_is_null() {
thrown.expect(NullPointerException.class);
- new MeasureKey(null, DEVELOPER);
+ new MeasureKey(null);
}
@Test
public void test_equals_and_hashcode() {
- MeasureKey measureKey = new MeasureKey("metricKey", null);
- MeasureKey measureKey2 = new MeasureKey("metricKey", null);
- MeasureKey anotherMeasureKey = new MeasureKey("anotherMetricKey", null);
-
- MeasureKey developerMeasureKey = new MeasureKey("metricKey", DEVELOPER);
- MeasureKey developerMeasureKey2 = new MeasureKey("metricKey", DEVELOPER);
+ MeasureKey measureKey = new MeasureKey("metricKey");
+ MeasureKey measureKey2 = new MeasureKey("metricKey");
+ MeasureKey anotherMeasureKey = new MeasureKey("anotherMetricKey");
assertThat(measureKey).isEqualTo(measureKey);
assertThat(measureKey).isEqualTo(measureKey2);
assertThat(measureKey).isNotEqualTo(null);
assertThat(measureKey).isNotEqualTo(anotherMeasureKey);
- assertThat(developerMeasureKey).isEqualTo(developerMeasureKey2);
assertThat(measureKey.hashCode()).isEqualTo(measureKey.hashCode());
assertThat(measureKey.hashCode()).isEqualTo(measureKey2.hashCode());
assertThat(measureKey.hashCode()).isNotEqualTo(anotherMeasureKey.hashCode());
-
- assertThat(developerMeasureKey.hashCode()).isEqualTo(developerMeasureKey2.hashCode());
}
@Test
public void to_string() {
- assertThat(new MeasureKey("metricKey", DEVELOPER).toString()).isEqualTo(
- "MeasureKey{metricKey='metricKey', developer=Developer{key='DEV1'}}");
- assertThat(new MeasureKey("metricKey", null).toString()).isEqualTo("MeasureKey{metricKey='metricKey', developer=null}");
+ assertThat(new MeasureKey("metricKey").toString()).isEqualTo(
+ "MeasureKey{metricKey='metricKey'}");
+ assertThat(new MeasureKey("metricKey").toString()).isEqualTo("MeasureKey{metricKey='metricKey'}");
}
}
}
public static boolean deepEquals(Measure measure, Measure measure1) {
- return Objects.equals(measure, measure1)
- && measure.getValueType() == measure1.getValueType()
+ return measure.getValueType() == measure1.getValueType()
&& equalsByValue(measure, measure1)
&& equalsByVariation(measure, measure1)
&& equalsByQualityGateStatus(measure, measure1)
assertThat(rawMeasures.keySet()).hasSize(2);
assertThat(rawMeasures.get(METRIC_KEY_1)).containsOnly(addedMeasure);
- assertThat(rawMeasures.get(METRIC_KEY_2)).containsOnly(Measure.newMeasureBuilder().create("some value"));
+ assertThat(rawMeasures.get(METRIC_KEY_2)).extracting(Measure::getStringValue).containsOnly("some value");
}
private static MeasureDto createMeasureDto(int metricId, String componentUuid, String analysisUuid) {
import org.junit.rules.ExternalResource;
import org.sonar.ce.task.projectanalysis.component.Component;
import org.sonar.ce.task.projectanalysis.component.ComponentProvider;
-import org.sonar.ce.task.projectanalysis.component.Developer;
-import org.sonar.ce.task.projectanalysis.component.DumbDeveloper;
import org.sonar.ce.task.projectanalysis.component.NoComponentProvider;
import org.sonar.ce.task.projectanalysis.component.TreeComponentProvider;
import org.sonar.ce.task.projectanalysis.component.TreeRootHolder;
public MeasureRepositoryRule addRawMeasure(int componentRef, String metricKey, Measure measure) {
checkAndInitProvidersState();
- InternalKey internalKey = new InternalKey(componentProvider.getByRef(componentRef), metricRepositoryRule.getByKey(metricKey), measure.getDeveloper());
+ InternalKey internalKey = new InternalKey(componentProvider.getByRef(componentRef), metricRepositoryRule.getByKey(metricKey));
checkState(!rawMeasures.containsKey(internalKey), format(
"A measure can only be set once for Component (ref=%s), Metric (key=%s)",
componentRef, metricKey));
return Optional.ofNullable(rawMeasures.get(new InternalKey(component, metric)));
}
- public Optional<Measure> getRawMeasure(Component component, Metric metric, DumbDeveloper developer) {
- return Optional.ofNullable(rawMeasures.get(new InternalKey(component, metric, developer)));
- }
-
public Optional<Measure> getRawRuleMeasure(Component component, Metric metric, int ruleId) {
- return Optional.ofNullable(rawMeasures.get(new InternalKey(component, metric, null)));
+ return Optional.ofNullable(rawMeasures.get(new InternalKey(component, metric)));
}
@Override
@Override
public void add(Component component, Metric metric, Measure measure) {
String ref = getRef(component);
- InternalKey internalKey = new InternalKey(ref, metric.getKey(), measure.getDeveloper());
+ InternalKey internalKey = new InternalKey(ref, metric.getKey());
if (rawMeasures.containsKey(internalKey)) {
throw new UnsupportedOperationException(format(
"A measure can only be set once for Component (ref=%s), Metric (key=%s)",
@Override
public void update(Component component, Metric metric, Measure measure) {
String componentRef = getRef(component);
- InternalKey internalKey = new InternalKey(componentRef, metric.getKey(), measure.getDeveloper());
+ InternalKey internalKey = new InternalKey(componentRef, metric.getKey());
if (!rawMeasures.containsKey(internalKey)) {
throw new UnsupportedOperationException(format(
"A measure can only be updated if it has been added first for Component (ref=%s), Metric (key=%s)",
private static final class InternalKey {
private final String componentRef;
private final String metricKey;
- @Nullable
- private final Developer developer;
public InternalKey(Component component, Metric metric) {
- this(getRef(component), metric.getKey(), null);
- }
-
- public InternalKey(Component component, Metric metric, @Nullable Developer developer) {
- this(getRef(component), metric.getKey(), developer);
+ this(getRef(component), metric.getKey());
}
- private InternalKey(String componentRef, String metricKey, @Nullable Developer developer) {
+ private InternalKey(String componentRef, String metricKey) {
this.componentRef = componentRef;
this.metricKey = metricKey;
- this.developer = developer;
}
public String getComponentRef() {
}
InternalKey that = (InternalKey) o;
return Objects.equals(componentRef, that.componentRef) &&
- Objects.equals(metricKey, that.metricKey) &&
- Objects.equals(developer, that.developer);
+ Objects.equals(metricKey, that.metricKey);
}
@Override
public int hashCode() {
- return Objects.hash(componentRef, metricKey, developer);
+ return Objects.hash(componentRef, metricKey);
}
@Override
return "InternalKey{" +
"component=" + componentRef +
", metric='" + metricKey + '\'' +
- ", developer=" + developer +
'}';
}
}
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
-import org.sonar.ce.task.projectanalysis.component.Developer;
-import org.sonar.ce.task.projectanalysis.component.DumbDeveloper;
import org.sonar.ce.task.projectanalysis.measure.Measure.ValueType;
import org.sonar.server.util.WrapInSingleElementArray;
private static final List<Measure> MEASURES = ImmutableList.of(
INT_MEASURE, LONG_MEASURE, DOUBLE_MEASURE, STRING_MEASURE, TRUE_MEASURE, FALSE_MEASURE, NO_VALUE_MEASURE, LEVEL_MEASURE);
- private static final Developer SOME_DEVELOPER = new DumbDeveloper("DEV1");
@Rule
public final ExpectedException expectedException = ExpectedException.none();
.toArray(Object[][]::new);
}
- @Test
- public void getDeveloper_returns_dev_set_in_builder() {
- assertThat(newMeasureBuilder().forDeveloper(SOME_DEVELOPER).createNoValue().getDeveloper()).isEqualTo(SOME_DEVELOPER);
- }
-
- @Test
- public void create_measure_for_dev() {
- Measure measure = newMeasureBuilder()
- .forDeveloper(SOME_DEVELOPER)
- .createNoValue();
- assertThat(measure.getDeveloper()).isEqualTo(SOME_DEVELOPER);
- }
-
@Test(expected = NullPointerException.class)
public void create_from_String_throws_NPE_if_arg_is_null() {
newMeasureBuilder().create((String) null);