Enable UnnecessarilyFullyQualified errorprone check#2628
Merged
trask merged 1 commit intoopen-telemetry:mainfrom Feb 14, 2026
Merged
Enable UnnecessarilyFullyQualified errorprone check#2628trask merged 1 commit intoopen-telemetry:mainfrom
trask merged 1 commit intoopen-telemetry:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enables the UnnecessarilyFullyQualified ErrorProne check and introduces a custom ErrorProne check for deprecated API usage. The changes are ported from opentelemetry-java PRs #8061 and #8078, adapted for the contrib repository. The PR replaces javac's -Xlint:deprecation warning (which has issues with --release 8 due to JDK-8032211) with a custom ErrorProne check that properly honors @SuppressWarnings annotations.
Changes:
- Adds a new
custom-checksmodule with theOtelDeprecatedApiUsageErrorProne check - Enables the
UnnecessarilyFullyQualifiedErrorProne check by removing its disable statement - Removes unnecessary fully qualified type names across the codebase and adds proper imports
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 27 comments.
Show a summary per file
| File | Description |
|---|---|
| settings.gradle.kts | Includes the new custom-checks module in the build |
| custom-checks/build.gradle.kts | Configures the custom-checks module with Java 21 source/target, compiler exports for javac internals, and circular dependency prevention |
| custom-checks/src/main/java/.../OtelDeprecatedApiUsage.java | Implements custom ErrorProne check for deprecated API usage with proper handling of same-class usage, import statements, and deprecated contexts |
| custom-checks/src/test/java/.../OtelDeprecatedApiUsageTest.java | Comprehensive test suite covering positive and negative cases for the custom check |
| custom-checks/src/main/resources/META-INF/services/.../BugChecker | Service loader registration for the custom check |
| buildSrc/.../otel.java-conventions.gradle.kts | Suppresses -Xlint:deprecation in favor of the custom ErrorProne check |
| buildSrc/.../otel.errorprone-conventions.gradle.kts | Removes disable statement for UnnecessarilyFullyQualified check, adds custom-checks dependency, and includes circular dependency prevention |
| dependencyManagement/build.gradle.kts | Adds error_prone_test_helpers dependency for testing |
| prometheus-client-bridge/.../MetricAdapter.java | Removes fully qualified Exemplar type and adds import |
| prometheus-client-bridge/.../MetricAdapterTest.java | Removes fully qualified List type and adds import |
| processors/.../InterceptableLogRecordExporterTest.java | Removes fully qualified Body type and adds import |
| opamp-client/.../OkHttpWebSocket.java | Removes fully qualified Request type and adds import |
| opamp-client/.../OkHttpSender.java | Removes fully qualified Request type and adds import |
| maven-extension/.../MavenDeployHandler.java | Removes fully qualified ArtifactRepository type and adds import |
| maven-extension/.../OtelExecutionListener.java | Removes fully qualified Context type and adds import |
| ibm-mq-metrics/.../JakartaPutGet.java | Removes fully qualified CMQC constant reference and uses import |
| gcp-auth-extension/.../GcpAuthExtensionEndToEndTest.java | Removes fully qualified SecureRandom type and adds import |
| disk-buffering/.../SpanDataImpl.java | Removes fully qualified InstrumentationLibraryInfo type and adds import |
| disk-buffering/.../LogRecordDataImpl.java | Removes fully qualified Body type and adds import |
| aws-resources/.../EcsResource.java | Removes fully qualified IncubatingAttributes constant reference and uses static import |
custom-checks/src/main/java/io/opentelemetry/gradle/customchecks/OtelDeprecatedApiUsage.java
Show resolved
Hide resolved
custom-checks/src/main/java/io/opentelemetry/gradle/customchecks/OtelDeprecatedApiUsage.java
Show resolved
Hide resolved
custom-checks/src/main/java/io/opentelemetry/gradle/customchecks/OtelDeprecatedApiUsage.java
Show resolved
Hide resolved
custom-checks/src/main/java/io/opentelemetry/gradle/customchecks/OtelDeprecatedApiUsage.java
Show resolved
Hide resolved
custom-checks/src/main/java/io/opentelemetry/gradle/customchecks/OtelDeprecatedApiUsage.java
Show resolved
Hide resolved
custom-checks/src/main/java/io/opentelemetry/gradle/customchecks/OtelDeprecatedApiUsage.java
Show resolved
Hide resolved
custom-checks/src/main/java/io/opentelemetry/gradle/customchecks/OtelDeprecatedApiUsage.java
Show resolved
Hide resolved
custom-checks/src/main/java/io/opentelemetry/gradle/customchecks/OtelDeprecatedApiUsage.java
Show resolved
Hide resolved
custom-checks/src/main/java/io/opentelemetry/gradle/customchecks/OtelDeprecatedApiUsage.java
Show resolved
Hide resolved
...try/contrib/disk/buffering/internal/serialization/mapping/logs/models/LogRecordDataImpl.java
Show resolved
Hide resolved
laurit
approved these changes
Feb 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ported from opentelemetry-java. Combined both of these steps into this 1 PR