Update errorprone (#490)
This commit is contained in:
parent
639cd24b54
commit
425128399e
|
@ -7,6 +7,7 @@ package io.opentelemetry.contrib.awsxray;
|
|||
|
||||
import static java.util.Objects.requireNonNull;
|
||||
|
||||
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
import io.opentelemetry.sdk.common.Clock;
|
||||
import io.opentelemetry.sdk.resources.Resource;
|
||||
import io.opentelemetry.sdk.trace.samplers.Sampler;
|
||||
|
@ -36,6 +37,7 @@ public final class AwsXrayRemoteSamplerBuilder {
|
|||
* OpenTelemetry Collector configured for proxying X-Ray sampling requests. If unset, defaults to
|
||||
* {@value DEFAULT_ENDPOINT}.
|
||||
*/
|
||||
@CanIgnoreReturnValue
|
||||
public AwsXrayRemoteSamplerBuilder setEndpoint(String endpoint) {
|
||||
requireNonNull(endpoint, "endpoint");
|
||||
this.endpoint = endpoint;
|
||||
|
@ -46,6 +48,7 @@ public final class AwsXrayRemoteSamplerBuilder {
|
|||
* Sets the polling interval for configuration updates. If unset, defaults to {@value
|
||||
* DEFAULT_POLLING_INTERVAL_SECS}s. Must be positive.
|
||||
*/
|
||||
@CanIgnoreReturnValue
|
||||
public AwsXrayRemoteSamplerBuilder setPollingInterval(Duration delay) {
|
||||
requireNonNull(delay, "delay");
|
||||
return setPollingInterval(delay.toNanos(), TimeUnit.NANOSECONDS);
|
||||
|
@ -55,6 +58,7 @@ public final class AwsXrayRemoteSamplerBuilder {
|
|||
* Sets the polling interval for configuration updates. If unset, defaults to {@value
|
||||
* DEFAULT_POLLING_INTERVAL_SECS}s. Must be positive.
|
||||
*/
|
||||
@CanIgnoreReturnValue
|
||||
public AwsXrayRemoteSamplerBuilder setPollingInterval(long delay, TimeUnit unit) {
|
||||
requireNonNull(unit, "unit");
|
||||
if (delay < 0) {
|
||||
|
@ -68,6 +72,7 @@ public final class AwsXrayRemoteSamplerBuilder {
|
|||
* Sets the initial sampler that is used before sampling configuration is obtained. If unset,
|
||||
* defaults to a parent-based always-on sampler.
|
||||
*/
|
||||
@CanIgnoreReturnValue
|
||||
public AwsXrayRemoteSamplerBuilder setInitialSampler(Sampler initialSampler) {
|
||||
requireNonNull(initialSampler, "initialSampler");
|
||||
this.initialSampler = initialSampler;
|
||||
|
@ -78,6 +83,7 @@ public final class AwsXrayRemoteSamplerBuilder {
|
|||
* Sets the {@link Clock} used for time measurements for sampling, such as rate limiting or quota
|
||||
* expiry.
|
||||
*/
|
||||
@CanIgnoreReturnValue
|
||||
public AwsXrayRemoteSamplerBuilder setClock(Clock clock) {
|
||||
requireNonNull(clock, "clock");
|
||||
this.clock = clock;
|
||||
|
|
|
@ -103,6 +103,7 @@ dependencies {
|
|||
}
|
||||
|
||||
compileOnly("com.google.code.findbugs:jsr305")
|
||||
compileOnly("com.google.errorprone:error_prone_annotations")
|
||||
}
|
||||
|
||||
testing {
|
||||
|
|
|
@ -32,7 +32,7 @@ val CORE_DEPENDENCIES = listOf(
|
|||
"com.google.auto.value:auto-value:1.9",
|
||||
"com.google.auto.value:auto-value-annotations:1.9",
|
||||
"com.google.errorprone:error_prone_annotations:2.15.0",
|
||||
"com.google.errorprone:error_prone_core:2.14.0",
|
||||
"com.google.errorprone:error_prone_core:2.15.0",
|
||||
"io.prometheus:simpleclient:0.16.0",
|
||||
"io.prometheus:simpleclient_common:0.16.0",
|
||||
"io.prometheus:simpleclient_httpserver:0.16.0",
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
package io.opentelemetry.contrib.metrics.micrometer;
|
||||
|
||||
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
import io.opentelemetry.api.metrics.Meter;
|
||||
import io.opentelemetry.api.metrics.MeterBuilder;
|
||||
import io.opentelemetry.contrib.metrics.micrometer.internal.state.MeterProviderSharedState;
|
||||
|
@ -24,12 +25,14 @@ final class MicrometerMeterBuilder implements MeterBuilder {
|
|||
}
|
||||
|
||||
@Override
|
||||
@CanIgnoreReturnValue
|
||||
public MeterBuilder setSchemaUrl(String schemaUrl) {
|
||||
this.schemaUrl = schemaUrl;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@CanIgnoreReturnValue
|
||||
public MeterBuilder setInstrumentationVersion(String instrumentationScopeVersion) {
|
||||
this.instrumentationScopeVersion = instrumentationScopeVersion;
|
||||
return this;
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
package io.opentelemetry.contrib.metrics.micrometer;
|
||||
|
||||
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
import io.micrometer.core.instrument.MeterRegistry;
|
||||
import io.opentelemetry.contrib.metrics.micrometer.internal.PollingMeterCallbackRegistrar;
|
||||
import java.util.function.Supplier;
|
||||
|
@ -26,6 +27,7 @@ public class MicrometerMeterProviderBuilder {
|
|||
* io.micrometer.core.instrument.Meter} which will poll asynchronous instruments when that meter
|
||||
* is measured.
|
||||
*/
|
||||
@CanIgnoreReturnValue
|
||||
public MicrometerMeterProviderBuilder setCallbackRegistrar(CallbackRegistrar callbackRegistrar) {
|
||||
this.callbackRegistrar = callbackRegistrar;
|
||||
return this;
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
package io.opentelemetry.contrib.metrics.micrometer;
|
||||
|
||||
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
import java.time.Duration;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
|
@ -24,6 +25,7 @@ public final class ScheduledCallbackRegistrarBuilder {
|
|||
}
|
||||
|
||||
/** Sets the period between successive executions of each registered callback */
|
||||
@CanIgnoreReturnValue
|
||||
public ScheduledCallbackRegistrarBuilder setPeriod(long period, TimeUnit unit) {
|
||||
Objects.requireNonNull(unit, "unit");
|
||||
this.period = period;
|
||||
|
@ -32,6 +34,7 @@ public final class ScheduledCallbackRegistrarBuilder {
|
|||
}
|
||||
|
||||
/** Sets the period between successive executions of each registered callback */
|
||||
@CanIgnoreReturnValue
|
||||
public ScheduledCallbackRegistrarBuilder setPeriod(Duration period) {
|
||||
Objects.requireNonNull(period, "period");
|
||||
this.period = period.toMillis();
|
||||
|
@ -43,6 +46,7 @@ public final class ScheduledCallbackRegistrarBuilder {
|
|||
* Sets that the executor should be {@link ScheduledExecutorService#shutdown() shutdown} when the
|
||||
* {@link CallbackRegistrar} is {@link CallbackRegistrar#close() closed}.
|
||||
*/
|
||||
@CanIgnoreReturnValue
|
||||
public ScheduledCallbackRegistrarBuilder setShutdownExecutorOnClose(
|
||||
boolean shutdownExecutorOnClose) {
|
||||
this.shutdownExecutorOnClose = shutdownExecutorOnClose;
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
package io.opentelemetry.contrib.metrics.micrometer.internal.instruments;
|
||||
|
||||
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
import io.opentelemetry.contrib.metrics.micrometer.internal.state.InstrumentState;
|
||||
import io.opentelemetry.contrib.metrics.micrometer.internal.state.MeterSharedState;
|
||||
import javax.annotation.Nullable;
|
||||
|
@ -33,11 +34,13 @@ abstract class AbstractInstrumentBuilder<BUILDER extends AbstractInstrumentBuild
|
|||
|
||||
protected abstract BUILDER self();
|
||||
|
||||
@CanIgnoreReturnValue
|
||||
public BUILDER setDescription(String description) {
|
||||
this.description = description;
|
||||
return self();
|
||||
}
|
||||
|
||||
@CanIgnoreReturnValue
|
||||
public BUILDER setUnit(String unit) {
|
||||
this.unit = unit;
|
||||
return self();
|
||||
|
|
|
@ -7,6 +7,7 @@ package io.opentelemetry.contrib.samplers;
|
|||
|
||||
import static java.util.Objects.requireNonNull;
|
||||
|
||||
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
import io.opentelemetry.api.common.AttributeKey;
|
||||
import io.opentelemetry.api.trace.SpanKind;
|
||||
import io.opentelemetry.sdk.trace.samplers.Sampler;
|
||||
|
@ -23,6 +24,7 @@ public final class RuleBasedRoutingSamplerBuilder {
|
|||
this.defaultDelegate = defaultDelegate;
|
||||
}
|
||||
|
||||
@CanIgnoreReturnValue
|
||||
public RuleBasedRoutingSamplerBuilder drop(AttributeKey<String> attributeKey, String pattern) {
|
||||
rules.add(
|
||||
new SamplingRule(
|
||||
|
@ -32,6 +34,7 @@ public final class RuleBasedRoutingSamplerBuilder {
|
|||
return this;
|
||||
}
|
||||
|
||||
@CanIgnoreReturnValue
|
||||
public RuleBasedRoutingSamplerBuilder recordAndSample(
|
||||
AttributeKey<String> attributeKey, String pattern) {
|
||||
rules.add(
|
||||
|
|
|
@ -8,8 +8,8 @@ package io.opentelemetry.contrib.staticinstrumenter.agent.main;
|
|||
import static io.opentelemetry.contrib.staticinstrumenter.agent.main.JarTestUtil.getResourcePath;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.ArgumentMatchers.anyMap;
|
||||
import static org.mockito.BDDMockito.given;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
@ -24,7 +24,7 @@ public class MainTest {
|
|||
// given
|
||||
ClassArchive.Factory factory = mock(ClassArchive.Factory.class);
|
||||
ClassArchive mockArchive = mock(ClassArchive.class);
|
||||
given(factory.createFor(any(), anyMap())).willReturn(mockArchive);
|
||||
when(factory.createFor(any(), anyMap())).thenReturn(mockArchive);
|
||||
Main underTest = new Main(factory);
|
||||
AdditionalClasses.put("additionalOne.class", new byte[0]);
|
||||
AdditionalClasses.put("additionalTwo.class", new byte[0]);
|
||||
|
|
Loading…
Reference in New Issue