From 0a045e3a0053aed1edbd39fdafa3a59262a6553e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Jan 2023 11:49:41 -0800 Subject: [PATCH] Bump errorProneVersion from 2.16 to 2.17.0 (#7489) Bumps `errorProneVersion` from 2.16 to 2.17.0. Updates `error_prone_annotations` from 2.16 to 2.17.0
Release notes

Sourced from error_prone_annotations's releases.

Error Prone 2.17.0

New Checkers:

Fixed issues: #2321, #3144, #3297, #3428, #3437, #3462, #3482, #3494

Full Changelog: https://github.com/google/error-prone/compare/v2.16...v2.17.0

Commits

Updates `error_prone_core` from 2.16 to 2.17.0
Release notes

Sourced from error_prone_core's releases.

Error Prone 2.17.0

New Checkers:

Fixed issues: #2321, #3144, #3297, #3428, #3437, #3462, #3482, #3494

Full Changelog: https://github.com/google/error-prone/compare/v2.16...v2.17.0

Commits

Updates `error_prone_test_helpers` from 2.16 to 2.17.0
Release notes

Sourced from error_prone_test_helpers's releases.

Error Prone 2.17.0

New Checkers:

Fixed issues: #2321, #3144, #3297, #3428, #3437, #3462, #3482, #3494

Full Changelog: https://github.com/google/error-prone/compare/v2.16...v2.17.0

Commits

You can trigger a rebase of this PR by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Mateusz Rzeszutek --- .../src/main/kotlin/otel.errorprone-conventions.gradle.kts | 3 +++ dependencyManagement/build.gradle.kts | 2 +- .../instrumentation/api/instrumenter/SpanLinksBuilder.java | 3 +++ .../instrumentation/api/instrumenter/SpanStatusBuilder.java | 3 +++ .../log4j/appender/v2_17/OpenTelemetryAppender.java | 5 +++++ .../tooling/bootstrap/BootstrapPackagesBuilder.java | 3 +++ .../io/opentelemetry/instrumentation/TestHelperClasses.java | 2 +- .../java/io/opentelemetry/test/AnotherTestInterface.java | 2 +- 8 files changed, 20 insertions(+), 3 deletions(-) diff --git a/conventions/src/main/kotlin/otel.errorprone-conventions.gradle.kts b/conventions/src/main/kotlin/otel.errorprone-conventions.gradle.kts index d66ec3d6ac84..7fdb82eff87f 100644 --- a/conventions/src/main/kotlin/otel.errorprone-conventions.gradle.kts +++ b/conventions/src/main/kotlin/otel.errorprone-conventions.gradle.kts @@ -112,6 +112,9 @@ tasks { // with older APIs. disable("InconsistentOverloads") + // lots of low level APIs use arrays + disable("AvoidObjectArrays") + if (name.contains("Jmh") || name.contains("Test")) { // Allow underscore in test-type method names disable("MemberName") diff --git a/dependencyManagement/build.gradle.kts b/dependencyManagement/build.gradle.kts index 0746730932b6..221b448bcce1 100644 --- a/dependencyManagement/build.gradle.kts +++ b/dependencyManagement/build.gradle.kts @@ -38,7 +38,7 @@ val DEPENDENCY_BOMS = listOf( val autoServiceVersion = "1.0.1" val autoValueVersion = "1.10.1" -val errorProneVersion = "2.16" +val errorProneVersion = "2.17.0" val byteBuddyVersion = "1.12.20" val asmVersion = "9.4" val jmhVersion = "1.36" diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/SpanLinksBuilder.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/SpanLinksBuilder.java index 328c138c1099..f87ffe4e678c 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/SpanLinksBuilder.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/SpanLinksBuilder.java @@ -5,6 +5,7 @@ package io.opentelemetry.instrumentation.api.instrumenter; +import com.google.errorprone.annotations.CanIgnoreReturnValue; import io.opentelemetry.api.common.Attributes; import io.opentelemetry.api.trace.SpanBuilder; import io.opentelemetry.api.trace.SpanContext; @@ -19,6 +20,7 @@ public interface SpanLinksBuilder { * @return this. * @see SpanBuilder#addLink(SpanContext) */ + @CanIgnoreReturnValue SpanLinksBuilder addLink(SpanContext spanContext); /** @@ -29,5 +31,6 @@ public interface SpanLinksBuilder { * @return this. * @see SpanBuilder#addLink(SpanContext) */ + @CanIgnoreReturnValue SpanLinksBuilder addLink(SpanContext spanContext, Attributes attributes); } diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/SpanStatusBuilder.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/SpanStatusBuilder.java index bc53432b487c..ff59a3c94f1b 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/SpanStatusBuilder.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/SpanStatusBuilder.java @@ -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.StatusCode; @@ -24,6 +25,7 @@ public interface SpanStatusBuilder { * @return this. * @see Span#setStatus(StatusCode) */ + @CanIgnoreReturnValue default SpanStatusBuilder setStatus(StatusCode statusCode) { return setStatus(statusCode, ""); } @@ -42,5 +44,6 @@ default SpanStatusBuilder setStatus(StatusCode statusCode) { * @return this. * @see Span#setStatus(StatusCode, String) */ + @CanIgnoreReturnValue SpanStatusBuilder setStatus(StatusCode statusCode, String description); } diff --git a/instrumentation/log4j/log4j-appender-2.17/library/src/main/java/io/opentelemetry/instrumentation/log4j/appender/v2_17/OpenTelemetryAppender.java b/instrumentation/log4j/log4j-appender-2.17/library/src/main/java/io/opentelemetry/instrumentation/log4j/appender/v2_17/OpenTelemetryAppender.java index 4f0e0d4275f3..a206423e6b67 100644 --- a/instrumentation/log4j/log4j-appender-2.17/library/src/main/java/io/opentelemetry/instrumentation/log4j/appender/v2_17/OpenTelemetryAppender.java +++ b/instrumentation/log4j/log4j-appender-2.17/library/src/main/java/io/opentelemetry/instrumentation/log4j/appender/v2_17/OpenTelemetryAppender.java @@ -7,6 +7,7 @@ import static java.util.Collections.emptyList; +import com.google.errorprone.annotations.CanIgnoreReturnValue; import io.opentelemetry.api.logs.GlobalLoggerProvider; import io.opentelemetry.api.logs.LogRecordBuilder; import io.opentelemetry.instrumentation.log4j.appender.v2_17.internal.ContextDataAccessor; @@ -61,12 +62,14 @@ static class Builder> extends AbstractAppender.Builder * or removed in the future, so only enable this if you know you do not require attributes * filled by this instrumentation to be stable across versions. */ + @CanIgnoreReturnValue public B setCaptureExperimentalAttributes(boolean captureExperimentalAttributes) { this.captureExperimentalAttributes = captureExperimentalAttributes; return asBuilder(); } /** Sets whether log4j {@link MapMessage} attributes should be copied to logs. */ + @CanIgnoreReturnValue public B setCaptureMapMessageAttributes(boolean captureMapMessageAttributes) { this.captureMapMessageAttributes = captureMapMessageAttributes; return asBuilder(); @@ -77,12 +80,14 @@ public B setCaptureMapMessageAttributes(boolean captureMapMessageAttributes) { * * @param captureMarkerAttribute To enable or disable the marker attribute */ + @CanIgnoreReturnValue public B setCaptureMarkerAttribute(boolean captureMarkerAttribute) { this.captureMarkerAttribute = captureMarkerAttribute; return asBuilder(); } /** Configures the {@link ThreadContext} attributes that will be copied to logs. */ + @CanIgnoreReturnValue public B setCaptureContextDataAttributes(String captureContextDataAttributes) { this.captureContextDataAttributes = captureContextDataAttributes; return asBuilder(); diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/bootstrap/BootstrapPackagesBuilder.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/bootstrap/BootstrapPackagesBuilder.java index a34fe8c60a41..604321f5a858 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/bootstrap/BootstrapPackagesBuilder.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/bootstrap/BootstrapPackagesBuilder.java @@ -5,6 +5,7 @@ package io.opentelemetry.javaagent.tooling.bootstrap; +import com.google.errorprone.annotations.CanIgnoreReturnValue; import java.util.Collection; /** @@ -21,6 +22,7 @@ public interface BootstrapPackagesBuilder { * * @return {@code this} */ + @CanIgnoreReturnValue BootstrapPackagesBuilder add(String classNameOrPrefix); /** @@ -29,5 +31,6 @@ public interface BootstrapPackagesBuilder { * * @return {@code this} */ + @CanIgnoreReturnValue BootstrapPackagesBuilder addAll(Collection classNamesOrPrefixes); } diff --git a/muzzle/src/test/java/io/opentelemetry/instrumentation/TestHelperClasses.java b/muzzle/src/test/java/io/opentelemetry/instrumentation/TestHelperClasses.java index b049d125b625..0b3338f802e3 100644 --- a/muzzle/src/test/java/io/opentelemetry/instrumentation/TestHelperClasses.java +++ b/muzzle/src/test/java/io/opentelemetry/instrumentation/TestHelperClasses.java @@ -45,7 +45,7 @@ public interface AnotherHelperInterface extends HelperInterface { Object clone(); - @SuppressWarnings("checkstyle:NoFinalizer") + @SuppressWarnings({"checkstyle:NoFinalizer", "Finalize"}) void finalize(); } diff --git a/muzzle/src/test/java/io/opentelemetry/test/AnotherTestInterface.java b/muzzle/src/test/java/io/opentelemetry/test/AnotherTestInterface.java index c8d7cd2e2019..29811a73a59b 100644 --- a/muzzle/src/test/java/io/opentelemetry/test/AnotherTestInterface.java +++ b/muzzle/src/test/java/io/opentelemetry/test/AnotherTestInterface.java @@ -18,6 +18,6 @@ public interface AnotherTestInterface extends TestInterface { Object clone(); - @SuppressWarnings("checkstyle:NoFinalizer") + @SuppressWarnings({"checkstyle:NoFinalizer", "Finalize"}) void finalize(); }