Bump errorProneVersion from 2.18.0 to 2.19.0 (#8459)
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Lauri Tulmin <ltulmin@splunk.com>
This commit is contained in:
parent
24b65ab1a7
commit
3122897b2e
|
@ -123,6 +123,10 @@ tasks {
|
|||
// Allow underscore in test-type method names
|
||||
disable("MemberName")
|
||||
}
|
||||
if (project.path.endsWith(":testing") || name.contains("Test")) {
|
||||
// This check causes too many failures, ignore the ones in tests
|
||||
disable("CanIgnoreReturnValueSuggester")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ val DEPENDENCY_BOMS = listOf(
|
|||
|
||||
val autoServiceVersion = "1.0.1"
|
||||
val autoValueVersion = "1.10.1"
|
||||
val errorProneVersion = "2.18.0"
|
||||
val errorProneVersion = "2.19.0"
|
||||
val byteBuddyVersion = "1.14.4"
|
||||
val asmVersion = "9.5"
|
||||
val jmhVersion = "1.36"
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
package io.opentelemetry.instrumentation.api.instrumenter.http;
|
||||
|
||||
import java.util.Locale;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
final class ForwardedHeaderParser {
|
||||
|
@ -12,7 +13,7 @@ final class ForwardedHeaderParser {
|
|||
/** Extract proto (aka scheme) from "Forwarded" http header. */
|
||||
@Nullable
|
||||
static String extractProtoFromForwardedHeader(String forwarded) {
|
||||
int start = forwarded.toLowerCase().indexOf("proto=");
|
||||
int start = forwarded.toLowerCase(Locale.ROOT).indexOf("proto=");
|
||||
if (start < 0) {
|
||||
return null;
|
||||
}
|
||||
|
@ -32,7 +33,7 @@ final class ForwardedHeaderParser {
|
|||
/** Extract client IP address from "Forwarded" http header. */
|
||||
@Nullable
|
||||
static String extractClientIpFromForwardedHeader(String forwarded) {
|
||||
int start = forwarded.toLowerCase().indexOf("for=");
|
||||
int start = forwarded.toLowerCase(Locale.ROOT).indexOf("for=");
|
||||
if (start < 0) {
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
package io.opentelemetry.instrumentation.api.instrumenter;
|
||||
|
||||
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
import io.opentelemetry.api.trace.Span;
|
||||
import io.opentelemetry.api.trace.SpanKind;
|
||||
import io.opentelemetry.context.Context;
|
||||
|
@ -20,6 +21,7 @@ final class SpanSuppressors {
|
|||
INSTANCE;
|
||||
|
||||
@Override
|
||||
@CanIgnoreReturnValue
|
||||
public Context storeInContext(Context context, SpanKind spanKind, Span span) {
|
||||
return context;
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ import com.amazonaws.Request;
|
|||
import com.amazonaws.Response;
|
||||
import com.amazonaws.handlers.HandlerContextKey;
|
||||
import com.amazonaws.handlers.RequestHandler2;
|
||||
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
import io.opentelemetry.context.Context;
|
||||
import io.opentelemetry.contrib.awsxray.propagator.AwsXrayPropagator;
|
||||
import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter;
|
||||
|
@ -47,6 +48,7 @@ final class TracingRequestHandler extends RequestHandler2 {
|
|||
}
|
||||
|
||||
@Override
|
||||
@CanIgnoreReturnValue
|
||||
public AmazonWebServiceRequest beforeMarshalling(AmazonWebServiceRequest request) {
|
||||
if (SqsReceiveMessageRequestAccess.isInstance(request)) {
|
||||
if (!SqsReceiveMessageRequestAccess.getAttributeNames(request)
|
||||
|
|
|
@ -18,6 +18,7 @@ import io.opentelemetry.sdk.trace.data.StatusData;
|
|||
import io.opentelemetry.semconv.trace.attributes.SemanticAttributes;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.Function;
|
||||
|
@ -838,7 +839,7 @@ public class SessionTest extends AbstractHibernateTest {
|
|||
equalTo(SemanticAttributes.DB_CONNECTION_STRING, "h2:mem:"),
|
||||
satisfies(
|
||||
SemanticAttributes.DB_STATEMENT,
|
||||
stringAssert -> stringAssert.startsWith(verb.toLowerCase())),
|
||||
stringAssert -> stringAssert.startsWith(verb.toLowerCase(Locale.ROOT))),
|
||||
equalTo(SemanticAttributes.DB_OPERATION, verb),
|
||||
equalTo(SemanticAttributes.DB_SQL_TABLE, "Value"));
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ package io.opentelemetry.javaagent.instrumentation.internal.lambda;
|
|||
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
|
||||
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;
|
||||
import io.opentelemetry.javaagent.extension.instrumentation.TypeTransformer;
|
||||
import net.bytebuddy.asm.AsmVisitorWrapper;
|
||||
|
@ -42,6 +43,7 @@ public class InnerClassLambdaMetafactoryInstrumentation implements TypeInstrumen
|
|||
}
|
||||
|
||||
@Override
|
||||
@CanIgnoreReturnValue
|
||||
public int mergeReader(int flags) {
|
||||
return flags;
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ package io.opentelemetry.javaagent.instrumentation.internal.reflection;
|
|||
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
|
||||
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;
|
||||
import io.opentelemetry.javaagent.extension.instrumentation.TypeTransformer;
|
||||
import net.bytebuddy.asm.AsmVisitorWrapper;
|
||||
|
@ -41,6 +42,7 @@ public class ClassInstrumentation implements TypeInstrumentation {
|
|||
}
|
||||
|
||||
@Override
|
||||
@CanIgnoreReturnValue
|
||||
public int mergeReader(int flags) {
|
||||
return flags;
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
package io.opentelemetry.javaagent.instrumentation.jaxrs;
|
||||
|
||||
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
import io.opentelemetry.context.Context;
|
||||
import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter;
|
||||
import java.util.function.BiFunction;
|
||||
|
@ -22,6 +23,7 @@ public class CompletionStageFinishCallback<T> implements BiFunction<T, Throwable
|
|||
}
|
||||
|
||||
@Override
|
||||
@CanIgnoreReturnValue
|
||||
public T apply(T result, Throwable throwable) {
|
||||
instrumenter.end(context, handlerData, null, throwable);
|
||||
return result;
|
||||
|
|
|
@ -9,6 +9,7 @@ import static io.opentelemetry.instrumentation.jdbc.internal.dbinfo.DbInfo.DEFAU
|
|||
import static java.util.logging.Level.FINE;
|
||||
import static java.util.regex.Pattern.CASE_INSENSITIVE;
|
||||
|
||||
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
import io.opentelemetry.instrumentation.jdbc.internal.dbinfo.DbInfo;
|
||||
import io.opentelemetry.semconv.trace.attributes.SemanticAttributes.DbSystemValues;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
@ -36,6 +37,7 @@ import java.util.regex.Pattern;
|
|||
public enum JdbcConnectionUrlParser {
|
||||
GENERIC_URL_LIKE() {
|
||||
@Override
|
||||
@CanIgnoreReturnValue
|
||||
DbInfo.Builder doParse(String jdbcUrl, DbInfo.Builder builder) {
|
||||
try {
|
||||
// Attempt generic parsing
|
||||
|
@ -78,6 +80,7 @@ public enum JdbcConnectionUrlParser {
|
|||
// see http://jtds.sourceforge.net/faq.html#urlFormat
|
||||
JTDS_URL_LIKE() {
|
||||
@Override
|
||||
@CanIgnoreReturnValue
|
||||
DbInfo.Builder doParse(String jdbcUrl, DbInfo.Builder builder) {
|
||||
String serverName = "";
|
||||
|
||||
|
@ -150,6 +153,7 @@ public enum JdbcConnectionUrlParser {
|
|||
CASE_INSENSITIVE);
|
||||
|
||||
@Override
|
||||
@CanIgnoreReturnValue
|
||||
DbInfo.Builder doParse(String jdbcUrl, DbInfo.Builder builder) {
|
||||
String serverName = "";
|
||||
Integer port = null;
|
||||
|
@ -361,6 +365,7 @@ public enum JdbcConnectionUrlParser {
|
|||
private final Pattern userPattern = Pattern.compile("\\(\\s*user\\s*=\\s*([^ )]+)\\s*\\)");
|
||||
|
||||
@Override
|
||||
@CanIgnoreReturnValue
|
||||
DbInfo.Builder doParse(String jdbcUrl, DbInfo.Builder builder) {
|
||||
int addressEnd = jdbcUrl.indexOf(",address=");
|
||||
if (addressEnd > 0) {
|
||||
|
@ -527,6 +532,7 @@ public enum JdbcConnectionUrlParser {
|
|||
|
||||
ORACLE_AT() {
|
||||
@Override
|
||||
@CanIgnoreReturnValue
|
||||
DbInfo.Builder doParse(String jdbcUrl, DbInfo.Builder builder) {
|
||||
if (jdbcUrl.contains("@(description")) {
|
||||
return ORACLE_AT_DESCRIPTION.doParse(jdbcUrl, builder);
|
||||
|
@ -569,6 +575,7 @@ public enum JdbcConnectionUrlParser {
|
|||
Pattern.compile("\\(\\s*service_name\\s*=\\s*([^ )]+)\\s*\\)");
|
||||
|
||||
@Override
|
||||
@CanIgnoreReturnValue
|
||||
DbInfo.Builder doParse(String jdbcUrl, DbInfo.Builder builder) {
|
||||
String[] atSplit = jdbcUrl.split("@", 2);
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
package io.opentelemetry.instrumentation.jmx.yaml;
|
||||
|
||||
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
import io.opentelemetry.instrumentation.jmx.engine.BeanAttributeExtractor;
|
||||
import io.opentelemetry.instrumentation.jmx.engine.BeanGroup;
|
||||
import io.opentelemetry.instrumentation.jmx.engine.MetricAttribute;
|
||||
|
@ -79,6 +80,7 @@ public class JmxRule extends MetricStructure {
|
|||
this.prefix = validatePrefix(prefix.trim());
|
||||
}
|
||||
|
||||
@CanIgnoreReturnValue
|
||||
private String validatePrefix(String prefix) {
|
||||
// Do not accept empty string.
|
||||
// While it is theoretically acceptable, it probably indicates a user error.
|
||||
|
@ -98,6 +100,7 @@ public class JmxRule extends MetricStructure {
|
|||
this.mapping = validateAttributeMapping(mapping);
|
||||
}
|
||||
|
||||
@CanIgnoreReturnValue
|
||||
private static Map<String, Metric> validateAttributeMapping(Map<String, Metric> mapping) {
|
||||
if (mapping.isEmpty()) {
|
||||
throw new IllegalStateException("No MBean attributes specified");
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
package io.opentelemetry.instrumentation.jmx.yaml;
|
||||
|
||||
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
import io.opentelemetry.instrumentation.jmx.engine.MetricInfo;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
|
@ -28,6 +29,7 @@ public class Metric extends MetricStructure {
|
|||
this.metric = validateMetricName(metric.trim());
|
||||
}
|
||||
|
||||
@CanIgnoreReturnValue
|
||||
private String validateMetricName(String name) {
|
||||
requireNonEmpty(name, "The metric name is empty");
|
||||
return name;
|
||||
|
|
|
@ -5,11 +5,13 @@
|
|||
|
||||
package io.opentelemetry.instrumentation.jmx.yaml;
|
||||
|
||||
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
import io.opentelemetry.instrumentation.jmx.engine.MetricAttribute;
|
||||
import io.opentelemetry.instrumentation.jmx.engine.MetricAttributeExtractor;
|
||||
import io.opentelemetry.instrumentation.jmx.engine.MetricInfo;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
|
@ -37,7 +39,7 @@ abstract class MetricStructure {
|
|||
|
||||
public void setType(String t) {
|
||||
// Do not complain about case variations
|
||||
t = t.trim().toUpperCase();
|
||||
t = t.trim().toUpperCase(Locale.ROOT);
|
||||
this.metricType = MetricInfo.Type.valueOf(t);
|
||||
}
|
||||
|
||||
|
@ -49,6 +51,7 @@ abstract class MetricStructure {
|
|||
this.unit = validateUnit(unit.trim());
|
||||
}
|
||||
|
||||
@CanIgnoreReturnValue
|
||||
private String validateUnit(String unit) {
|
||||
requireNonEmpty(unit, "Metric unit is empty");
|
||||
return unit;
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
package io.opentelemetry.instrumentation.kafkaclients.v2_6;
|
||||
|
||||
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
import io.opentelemetry.api.GlobalOpenTelemetry;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
@ -27,6 +28,7 @@ public class TracingConsumerInterceptor<K, V> implements ConsumerInterceptor<K,
|
|||
private String clientId;
|
||||
|
||||
@Override
|
||||
@CanIgnoreReturnValue
|
||||
public ConsumerRecords<K, V> onConsume(ConsumerRecords<K, V> records) {
|
||||
telemetry.buildAndFinishSpan(records, consumerGroup, clientId);
|
||||
return records;
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
package io.opentelemetry.instrumentation.kafkaclients.v2_6;
|
||||
|
||||
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
import io.opentelemetry.api.GlobalOpenTelemetry;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
@ -26,6 +27,7 @@ public class TracingProducerInterceptor<K, V> implements ProducerInterceptor<K,
|
|||
@Nullable private String clientId;
|
||||
|
||||
@Override
|
||||
@CanIgnoreReturnValue
|
||||
public ProducerRecord<K, V> onSend(ProducerRecord<K, V> producerRecord) {
|
||||
telemetry.buildAndInjectSpan(producerRecord, clientId);
|
||||
return producerRecord;
|
||||
|
|
|
@ -7,6 +7,7 @@ package io.opentelemetry.javaagent.instrumentation.play.v2_6;
|
|||
|
||||
import static io.opentelemetry.javaagent.instrumentation.play.v2_6.Play26Singletons.instrumenter;
|
||||
|
||||
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
import io.opentelemetry.context.Context;
|
||||
import play.api.mvc.Result;
|
||||
import scala.concurrent.ExecutionContext;
|
||||
|
@ -21,6 +22,7 @@ public final class ResponseFutureWrapper {
|
|||
return future.transform(
|
||||
new AbstractFunction1<Result, Result>() {
|
||||
@Override
|
||||
@CanIgnoreReturnValue
|
||||
public Result apply(Result result) {
|
||||
instrumenter().end(context, null, null, null);
|
||||
return result;
|
||||
|
@ -28,6 +30,7 @@ public final class ResponseFutureWrapper {
|
|||
},
|
||||
new AbstractFunction1<Throwable, Throwable>() {
|
||||
@Override
|
||||
@CanIgnoreReturnValue
|
||||
public Throwable apply(Throwable throwable) {
|
||||
instrumenter().end(context, null, null, throwable);
|
||||
return throwable;
|
||||
|
|
|
@ -9,6 +9,7 @@ import io.opentelemetry.api.common.Attributes;
|
|||
import io.opentelemetry.api.common.AttributesBuilder;
|
||||
import io.opentelemetry.sdk.resources.Resource;
|
||||
import io.opentelemetry.semconv.resource.attributes.ResourceAttributes;
|
||||
import java.util.Locale;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/** Factory of a {@link Resource} which provides information about the current operating system. */
|
||||
|
@ -60,7 +61,7 @@ public final class OsResource {
|
|||
|
||||
@Nullable
|
||||
private static String getOs(String os) {
|
||||
os = os.toLowerCase();
|
||||
os = os.toLowerCase(Locale.ROOT);
|
||||
if (os.startsWith("windows")) {
|
||||
return ResourceAttributes.OsTypeValues.WINDOWS;
|
||||
} else if (os.startsWith("linux")) {
|
||||
|
|
|
@ -15,6 +15,7 @@ import java.lang.management.RuntimeMXBean;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/** Factory of a {@link Resource} which provides information about the current running process. */
|
||||
|
@ -72,7 +73,7 @@ public final class ProcessResource {
|
|||
.append("bin")
|
||||
.append(File.separatorChar)
|
||||
.append("java");
|
||||
if (osName != null && osName.toLowerCase().startsWith("windows")) {
|
||||
if (osName != null && osName.toLowerCase(Locale.ROOT).startsWith("windows")) {
|
||||
executablePath.append(".exe");
|
||||
}
|
||||
|
||||
|
|
|
@ -41,6 +41,7 @@ public class ContextPayload {
|
|||
return payload;
|
||||
}
|
||||
|
||||
@SuppressWarnings("BanSerializableRead")
|
||||
public static ContextPayload read(ObjectInput oi) throws IOException {
|
||||
try {
|
||||
Object object = oi.readObject();
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
package io.opentelemetry.instrumentation.spring.integration.v4_1;
|
||||
|
||||
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
import io.opentelemetry.api.trace.Span;
|
||||
import io.opentelemetry.context.Context;
|
||||
import io.opentelemetry.context.propagation.ContextPropagators;
|
||||
|
@ -137,6 +138,7 @@ final class TracingChannelInterceptor implements ExecutorChannelInterceptor {
|
|||
}
|
||||
|
||||
@Override
|
||||
@CanIgnoreReturnValue
|
||||
public Message<?> postReceive(Message<?> message, MessageChannel messageChannel) {
|
||||
return message;
|
||||
}
|
||||
|
@ -146,6 +148,7 @@ final class TracingChannelInterceptor implements ExecutorChannelInterceptor {
|
|||
Message<?> message, MessageChannel messageChannel, Exception e) {}
|
||||
|
||||
@Override
|
||||
@CanIgnoreReturnValue
|
||||
public Message<?> beforeHandle(
|
||||
Message<?> message, MessageChannel channel, MessageHandler handler) {
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@ import io.opentelemetry.instrumentation.testing.junit.http.HttpServerTestOptions
|
|||
import io.opentelemetry.instrumentation.testing.junit.http.ServerEndpoint;
|
||||
import io.opentelemetry.sdk.testing.assertj.SpanDataAssert;
|
||||
import io.opentelemetry.sdk.trace.data.StatusData;
|
||||
import java.util.Locale;
|
||||
|
||||
public abstract class ControllerSpringWebFluxServerTest extends SpringWebFluxServerTest {
|
||||
|
||||
|
@ -26,7 +27,7 @@ public abstract class ControllerSpringWebFluxServerTest extends SpringWebFluxSer
|
|||
protected SpanDataAssert assertHandlerSpan(
|
||||
SpanDataAssert span, String method, ServerEndpoint endpoint) {
|
||||
String handlerSpanName =
|
||||
ServerTestController.class.getSimpleName() + "." + endpoint.name().toLowerCase();
|
||||
ServerTestController.class.getSimpleName() + "." + endpoint.name().toLowerCase(Locale.ROOT);
|
||||
if (endpoint == NOT_FOUND) {
|
||||
handlerSpanName = "ResourceWebHandler.handle";
|
||||
}
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
|
||||
package io.opentelemetry.javaagent.extension.ignore;
|
||||
|
||||
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
|
||||
/**
|
||||
* This interface defines different ways to ignore/allow instrumenting classes or packages.
|
||||
*
|
||||
|
@ -23,6 +25,7 @@ public interface IgnoredTypesBuilder {
|
|||
*
|
||||
* @return {@code this}
|
||||
*/
|
||||
@CanIgnoreReturnValue
|
||||
IgnoredTypesBuilder ignoreClass(String classNameOrPrefix);
|
||||
|
||||
/**
|
||||
|
@ -36,6 +39,7 @@ public interface IgnoredTypesBuilder {
|
|||
*
|
||||
* @return {@code this}
|
||||
*/
|
||||
@CanIgnoreReturnValue
|
||||
IgnoredTypesBuilder allowClass(String classNameOrPrefix);
|
||||
|
||||
/**
|
||||
|
@ -48,6 +52,7 @@ public interface IgnoredTypesBuilder {
|
|||
*
|
||||
* @return {@code this}
|
||||
*/
|
||||
@CanIgnoreReturnValue
|
||||
IgnoredTypesBuilder ignoreClassLoader(String classNameOrPrefix);
|
||||
|
||||
/**
|
||||
|
@ -61,6 +66,7 @@ public interface IgnoredTypesBuilder {
|
|||
*
|
||||
* @return {@code this}
|
||||
*/
|
||||
@CanIgnoreReturnValue
|
||||
IgnoredTypesBuilder allowClassLoader(String classNameOrPrefix);
|
||||
|
||||
/**
|
||||
|
@ -83,5 +89,6 @@ public interface IgnoredTypesBuilder {
|
|||
*
|
||||
* @return {@code this}
|
||||
*/
|
||||
@CanIgnoreReturnValue
|
||||
IgnoredTypesBuilder ignoreTaskClass(String classNameOrPrefix);
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ import static io.opentelemetry.javaagent.tooling.AgentInstaller.JAVAAGENT_ENABLE
|
|||
import static java.util.Collections.emptyList;
|
||||
|
||||
import com.google.auto.service.AutoService;
|
||||
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
import io.opentelemetry.exporter.logging.LoggingSpanExporter;
|
||||
import io.opentelemetry.javaagent.tooling.config.AgentConfig;
|
||||
import io.opentelemetry.sdk.autoconfigure.spi.AutoConfigurationCustomizer;
|
||||
|
@ -27,6 +28,7 @@ public class AgentTracerProviderConfigurer implements AutoConfigurationCustomize
|
|||
AgentTracerProviderConfigurer::configure);
|
||||
}
|
||||
|
||||
@CanIgnoreReturnValue
|
||||
private static SdkTracerProviderBuilder configure(
|
||||
SdkTracerProviderBuilder sdkTracerProviderBuilder, ConfigProperties config) {
|
||||
if (!config.getBoolean(JAVAAGENT_ENABLED_CONFIG, true)) {
|
||||
|
|
|
@ -11,6 +11,7 @@ import static net.bytebuddy.matcher.ElementMatchers.isAbstract;
|
|||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
|
||||
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
import io.opentelemetry.javaagent.bootstrap.InstrumentationHolder;
|
||||
import io.opentelemetry.javaagent.bootstrap.VirtualFieldDetector;
|
||||
import io.opentelemetry.javaagent.bootstrap.internal.InstrumentationConfig;
|
||||
|
@ -256,6 +257,7 @@ final class FieldBackedImplementationInstaller implements VirtualFieldImplementa
|
|||
INSTANCE;
|
||||
|
||||
@Override
|
||||
@CanIgnoreReturnValue
|
||||
public DynamicType.Builder<?> transform(
|
||||
DynamicType.Builder<?> builder,
|
||||
TypeDescription typeDescription,
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
package io.opentelemetry.javaagent.tooling.field;
|
||||
|
||||
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
import net.bytebuddy.agent.builder.AgentBuilder.Identified.Extendable;
|
||||
|
||||
final class NoopVirtualFieldImplementationInstaller implements VirtualFieldImplementationInstaller {
|
||||
|
@ -15,11 +16,13 @@ final class NoopVirtualFieldImplementationInstaller implements VirtualFieldImple
|
|||
private NoopVirtualFieldImplementationInstaller() {}
|
||||
|
||||
@Override
|
||||
@CanIgnoreReturnValue
|
||||
public Extendable rewriteVirtualFieldsCalls(Extendable builder) {
|
||||
return builder;
|
||||
}
|
||||
|
||||
@Override
|
||||
@CanIgnoreReturnValue
|
||||
public Extendable injectFields(Extendable builder) {
|
||||
return builder;
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ import static io.opentelemetry.javaagent.tooling.field.GeneratedVirtualFieldName
|
|||
import static io.opentelemetry.javaagent.tooling.field.GeneratedVirtualFieldNames.getRealGetterName;
|
||||
import static io.opentelemetry.javaagent.tooling.field.GeneratedVirtualFieldNames.getRealSetterName;
|
||||
|
||||
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
import io.opentelemetry.javaagent.bootstrap.VirtualFieldInstalledMarker;
|
||||
import io.opentelemetry.javaagent.tooling.Utils;
|
||||
import java.util.Arrays;
|
||||
|
@ -49,6 +50,7 @@ final class RealFieldInjector implements AsmVisitorWrapper {
|
|||
}
|
||||
|
||||
@Override
|
||||
@CanIgnoreReturnValue
|
||||
public int mergeReader(int flags) {
|
||||
return flags;
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ package io.opentelemetry.javaagent.tooling.field;
|
|||
|
||||
import static java.util.logging.Level.FINEST;
|
||||
|
||||
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
import io.opentelemetry.instrumentation.api.util.VirtualField;
|
||||
import io.opentelemetry.javaagent.tooling.TransformSafeLogger;
|
||||
import io.opentelemetry.javaagent.tooling.Utils;
|
||||
|
@ -64,6 +65,7 @@ final class VirtualFieldFindRewriter implements AsmVisitorWrapper {
|
|||
}
|
||||
|
||||
@Override
|
||||
@CanIgnoreReturnValue
|
||||
public int mergeReader(int flags) {
|
||||
return flags;
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ import static io.opentelemetry.javaagent.tooling.field.GeneratedVirtualFieldName
|
|||
import static io.opentelemetry.javaagent.tooling.field.GeneratedVirtualFieldNames.getRealSetterName;
|
||||
import static io.opentelemetry.javaagent.tooling.field.GeneratedVirtualFieldNames.getVirtualFieldImplementationClassName;
|
||||
|
||||
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
import io.opentelemetry.instrumentation.api.internal.cache.Cache;
|
||||
import io.opentelemetry.instrumentation.api.util.VirtualField;
|
||||
import io.opentelemetry.javaagent.tooling.Utils;
|
||||
|
@ -93,6 +94,7 @@ final class VirtualFieldImplementationsGenerator {
|
|||
}
|
||||
|
||||
@Override
|
||||
@CanIgnoreReturnValue
|
||||
public int mergeReader(int flags) {
|
||||
return flags;
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
package io.opentelemetry.javaagent.tooling.util;
|
||||
|
||||
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/** A prefix tree that maps from the longest matching prefix to a value {@code V}. */
|
||||
|
@ -40,6 +41,7 @@ public interface Trie<V> {
|
|||
interface Builder<V> {
|
||||
|
||||
/** Associate {@code value} with the string {@code str}. */
|
||||
@CanIgnoreReturnValue
|
||||
Builder<V> put(CharSequence str, V value);
|
||||
|
||||
Trie<V> build();
|
||||
|
|
|
@ -8,6 +8,7 @@ package io.opentelemetry.javaagent.tooling;
|
|||
import static java.util.logging.Level.FINE;
|
||||
import static java.util.logging.Level.SEVERE;
|
||||
|
||||
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
import io.opentelemetry.instrumentation.api.internal.cache.Cache;
|
||||
import io.opentelemetry.javaagent.bootstrap.HelperResources;
|
||||
import io.opentelemetry.javaagent.bootstrap.InjectedClassHelper;
|
||||
|
@ -179,6 +180,7 @@ public class HelperInjector implements Transformer {
|
|||
}
|
||||
|
||||
@Override
|
||||
@CanIgnoreReturnValue
|
||||
public DynamicType.Builder<?> transform(
|
||||
DynamicType.Builder<?> builder,
|
||||
TypeDescription typeDescription,
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
package io.opentelemetry.javaagent.tooling.muzzle;
|
||||
|
||||
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
import io.opentelemetry.instrumentation.api.internal.cache.Cache;
|
||||
import io.opentelemetry.javaagent.bootstrap.InstrumentationHolder;
|
||||
import io.opentelemetry.javaagent.bootstrap.VirtualFieldAccessorMarker;
|
||||
|
@ -295,6 +296,7 @@ public class AgentCachingPoolStrategy implements AgentBuilder.PoolStrategy {
|
|||
}
|
||||
|
||||
@Override
|
||||
@CanIgnoreReturnValue
|
||||
public TypePool.Resolution register(String className, TypePool.Resolution resolution) {
|
||||
if (OBJECT_NAME.equals(className)) {
|
||||
return resolution;
|
||||
|
@ -331,6 +333,7 @@ public class AgentCachingPoolStrategy implements AgentBuilder.PoolStrategy {
|
|||
}
|
||||
|
||||
@Override
|
||||
@CanIgnoreReturnValue
|
||||
protected TypePool.Resolution doCache(String name, TypePool.Resolution resolution) {
|
||||
return resolution;
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
package io.opentelemetry.javaagent.tooling.muzzle;
|
||||
|
||||
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
import io.opentelemetry.instrumentation.api.util.VirtualField;
|
||||
|
||||
/**
|
||||
|
@ -26,5 +27,6 @@ public interface VirtualFieldMappingsBuilder {
|
|||
* @return {@code this}.
|
||||
* @see VirtualField
|
||||
*/
|
||||
@CanIgnoreReturnValue
|
||||
VirtualFieldMappingsBuilder register(String typeName, String fieldTypeName);
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ package io.opentelemetry.javaagent.tooling.muzzle.generation;
|
|||
|
||||
import static java.util.logging.Level.INFO;
|
||||
|
||||
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
import io.opentelemetry.javaagent.extension.instrumentation.InstrumentationModule;
|
||||
import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;
|
||||
import io.opentelemetry.javaagent.tooling.muzzle.HelperResource;
|
||||
|
@ -66,6 +67,7 @@ final class MuzzleCodeGenerator implements AsmVisitorWrapper {
|
|||
}
|
||||
|
||||
@Override
|
||||
@CanIgnoreReturnValue
|
||||
public int mergeReader(int flags) {
|
||||
return flags;
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
package io.opentelemetry.smoketest;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.function.Consumer;
|
||||
import org.testcontainers.containers.output.OutputFrame;
|
||||
|
@ -33,6 +34,6 @@ public interface TestContainerManager {
|
|||
|
||||
static boolean useWindowsContainers() {
|
||||
return !"1".equals(System.getenv("USE_LINUX_CONTAINERS"))
|
||||
&& System.getProperty("os.name").toLowerCase().contains("windows");
|
||||
&& System.getProperty("os.name").toLowerCase(Locale.ROOT).contains("windows");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ import static org.assertj.core.api.Assertions.catchThrowable;
|
|||
import static org.junit.Assume.assumeFalse;
|
||||
import static org.junit.jupiter.api.Assumptions.assumeTrue;
|
||||
|
||||
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
import io.opentelemetry.api.common.AttributeKey;
|
||||
import io.opentelemetry.api.trace.Span;
|
||||
import io.opentelemetry.api.trace.SpanKind;
|
||||
|
@ -1010,6 +1011,7 @@ public abstract class AbstractHttpClientTest<REQUEST> implements HttpClientTypeA
|
|||
return null;
|
||||
}
|
||||
|
||||
@CanIgnoreReturnValue
|
||||
protected Throwable clientSpanError(URI uri, Throwable exception) {
|
||||
return exception;
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@ import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.asser
|
|||
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo;
|
||||
import static org.junit.jupiter.api.Assumptions.assumeTrue;
|
||||
|
||||
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
import io.opentelemetry.api.GlobalOpenTelemetry;
|
||||
import io.opentelemetry.api.common.AttributeKey;
|
||||
import io.opentelemetry.api.trace.Span;
|
||||
|
@ -599,6 +600,7 @@ public abstract class AbstractHttpServerTest<SERVER> extends AbstractHttpServerU
|
|||
testing.waitAndAssertTraces(assertions);
|
||||
}
|
||||
|
||||
@CanIgnoreReturnValue
|
||||
protected SpanDataAssert assertControllerSpan(SpanDataAssert span, Throwable expectedException) {
|
||||
span.hasName("controller").hasKind(SpanKind.INTERNAL);
|
||||
if (expectedException != null) {
|
||||
|
@ -626,6 +628,7 @@ public abstract class AbstractHttpServerTest<SERVER> extends AbstractHttpServerU
|
|||
"errorPageSpanAssertions not implemented in " + getClass().getName());
|
||||
}
|
||||
|
||||
@CanIgnoreReturnValue
|
||||
protected SpanDataAssert assertServerSpan(
|
||||
SpanDataAssert span, String method, ServerEndpoint endpoint) {
|
||||
|
||||
|
@ -742,6 +745,7 @@ public abstract class AbstractHttpServerTest<SERVER> extends AbstractHttpServerU
|
|||
return name;
|
||||
}
|
||||
|
||||
@CanIgnoreReturnValue
|
||||
protected SpanDataAssert assertIndexedServerSpan(SpanDataAssert span, int requestId) {
|
||||
ServerEndpoint endpoint = INDEXED_CHILD;
|
||||
String method = "GET";
|
||||
|
@ -755,6 +759,7 @@ public abstract class AbstractHttpServerTest<SERVER> extends AbstractHttpServerU
|
|||
return span;
|
||||
}
|
||||
|
||||
@CanIgnoreReturnValue
|
||||
protected SpanDataAssert assertIndexedControllerSpan(SpanDataAssert span, int requestId) {
|
||||
span.hasName("controller")
|
||||
.hasKind(SpanKind.INTERNAL)
|
||||
|
|
|
@ -144,50 +144,62 @@ public abstract class HttpClientTestOptions {
|
|||
|
||||
Builder setTestErrorWithCallback(boolean value);
|
||||
|
||||
@CanIgnoreReturnValue
|
||||
default Builder disableTestWithClientParent() {
|
||||
return setTestWithClientParent(false);
|
||||
}
|
||||
|
||||
@CanIgnoreReturnValue
|
||||
default Builder disableTestRedirects() {
|
||||
return setTestRedirects(false);
|
||||
}
|
||||
|
||||
@CanIgnoreReturnValue
|
||||
default Builder disableTestCircularRedirects() {
|
||||
return setTestCircularRedirects(false);
|
||||
}
|
||||
|
||||
@CanIgnoreReturnValue
|
||||
default Builder disableTestReusedRequest() {
|
||||
return setTestReusedRequest(false);
|
||||
}
|
||||
|
||||
@CanIgnoreReturnValue
|
||||
default Builder disableTestConnectionFailure() {
|
||||
return setTestConnectionFailure(false);
|
||||
}
|
||||
|
||||
@CanIgnoreReturnValue
|
||||
default Builder enableTestReadTimeout() {
|
||||
return setTestReadTimeout(true);
|
||||
}
|
||||
|
||||
@CanIgnoreReturnValue
|
||||
default Builder disableTestRemoteConnection() {
|
||||
return setTestRemoteConnection(false);
|
||||
}
|
||||
|
||||
@CanIgnoreReturnValue
|
||||
default Builder disableTestHttps() {
|
||||
return setTestHttps(false);
|
||||
}
|
||||
|
||||
@CanIgnoreReturnValue
|
||||
default Builder disableTestCallback() {
|
||||
return setTestCallback(false);
|
||||
}
|
||||
|
||||
@CanIgnoreReturnValue
|
||||
default Builder disableTestCallbackWithParent() {
|
||||
return setTestCallbackWithParent(false);
|
||||
}
|
||||
|
||||
@CanIgnoreReturnValue
|
||||
default Builder disableTestErrorWithCallback() {
|
||||
return setTestErrorWithCallback(false);
|
||||
}
|
||||
|
||||
@CanIgnoreReturnValue
|
||||
default Builder enableTestCallbackWithImplicitParent() {
|
||||
return setTestCallbackWithImplicitParent(true);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue