Skip to content

Comments

Enable UnnecessarilyFullyQualified errorprone check#2628

Merged
trask merged 1 commit intoopen-telemetry:mainfrom
trask:unnecessarily-fully-qualified
Feb 14, 2026
Merged

Enable UnnecessarilyFullyQualified errorprone check#2628
trask merged 1 commit intoopen-telemetry:mainfrom
trask:unnecessarily-fully-qualified

Conversation

@trask
Copy link
Member

@trask trask commented Feb 13, 2026

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-checks module with the OtelDeprecatedApiUsage ErrorProne check
  • Enables the UnnecessarilyFullyQualified ErrorProne 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

@trask trask added this pull request to the merge queue Feb 14, 2026
Merged via the queue into open-telemetry:main with commit b81c641 Feb 14, 2026
27 checks passed
@trask trask deleted the unnecessarily-fully-qualified branch February 14, 2026 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants