Code review sweep (run 25192686470)#18463
Merged
Merged
Conversation
Automated code review of instrumentation/jaxws/jaxws-2.0-metro-2.2/javaagent.
Automated code review of instrumentation/kafka/kafka-clients/kafka-clients-0.11/javaagent.
Automated code review of instrumentation/kafka/kafka-clients/kafka-clients-0.11/testing.
Automated code review of instrumentation/kafka/kafka-clients/kafka-clients-common-0.11/library.
Automated code review of instrumentation/kafka/kafka-connect-2.6/testing.
Automated code review of instrumentation/kafka/kafka-streams-0.11/javaagent.
trask
approved these changes
May 1, 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.
Automated code review sweep walked the following modules in order
and stopped after accumulating at least 10 modified files:
jaxws-2.0-cxf-3.0:javaagentjaxws-2.0-cxf-3.0:javaagent-unit-testsjaxws-2.0-metro-2.2:javaagentkafka-clients-0.11:javaagentkafka-clients-0.11:testingkafka-clients-2.6:librarykafka-clients-common-0.11:librarykafka-connect-2.6:javaagentkafka-connect-2.6:testingkafka-streams-0.11:javaagentModule:
jaxws-2.0-cxf-3.0:javaagentModule path:
instrumentation/jaxws/jaxws-2.0-cxf-3.0/javaagentSummary
No safe deterministic fixes were applied.
metadata.yamlconfiguration coverage was reviewed and no metadata change was needed; onebuild.gradle.ktsmuzzle item needs manual resolution because addingassertInverse.set(true)is not safe when the file documents that older versions also pass muzzle.Applied Changes
No safe automated changes were applied.
Unresolved Items
File:
build.gradle.ktsReason: The `muzzle` `pass` range `versions.set("[3.0.0,)")` omits `assertInverse.set(true)`, which `gradle-conventions.md` expects unless the range covers all versions. The existing comment says earlier CXF versions also pass muzzle, so auto-adding `assertInverse.set(true)` would likely fail; choose a validated version-boundary landmark or broaden/document the range before enabling inverse muzzle validation.
Module:
jaxws-2.0-cxf-3.0:javaagent-unit-testsModule path:
instrumentation/jaxws/jaxws-2.0-cxf-3.0/javaagent-unit-testsSummary
No safe repository-guideline fixes were needed in
instrumentation/jaxws/jaxws-2.0-cxf-3.0/javaagent-unit-tests; the scoped files already conform to the loaded style, testing, andmetadata.yamlreview guidance.Applied Changes
No safe automated changes were applied.
Module:
jaxws-2.0-metro-2.2:javaagentModule path:
instrumentation/jaxws/jaxws-2.0-metro-2.2/javaagentSummary
Applied one safe repository-guideline fix and committed it in
0464b9ef. Validation completed with./gradlew :instrumentation:jaxws:jaxws-2.0-metro-2.2:javaagent:check,./gradlew :instrumentation:jaxws:jaxws-2.0-metro-2.2:javaagent:check -PtestLatestDeps=true, and./gradlew spotlessApply.Applied Changes
Javaagent
File:
MetroServerSpanNameUpdater.java:163Change: Changed reflective servlet path extraction in `invokeSafely()` to log failures at `FINE` and return `null` instead of rethrowing `RuntimeException`, `Error`, or `AssertionError`.
Reason: Repository javaagent guidance says instrumentation helper code must not throw into the application; suppressed or best-effort failures should be logged instead of silently swallowed or propagated.
Unresolved Items
File:
build.gradle.ktsReason: `tasks.test` enables experimental `otel.instrumentation.common.experimental.controller-telemetry.enabled` unconditionally without a dedicated `testExperimental` task; review instructions classify missing `testExperimental` task wiring as not auto-fixable, so the next action is to decide whether to split the experimental run into a dedicated task.
Module:
kafka-clients-0.11:javaagentModule path:
instrumentation/kafka/kafka-clients/kafka-clients-0.11/javaagentSummary
Applied one safe repository-guideline fix under
instrumentation/kafka/kafka-clients/kafka-clients-0.11/javaagentand committed it as7accf62c.Applied Changes
Nullability
File:
KafkaConsumerInstrumentation.java:60Change: Added `@Nullable` to the `@Advice.Return ConsumerRecords<?, ?> records` and `@Advice.Thrown Throwable error` parameters in `PollAdvice.onExit`.
Reason: Repository nullability guidance requires annotating parameters that can be `null`; ByteBuddy exit advice can receive a `null` return value on exceptional exit and `@Advice.Thrown` is `null` on successful calls.
Module:
kafka-clients-0.11:testingModule path:
instrumentation/kafka/kafka-clients/kafka-clients-0.11/testingSummary
Applied one safe repository-guideline fix under
instrumentation/kafka/kafka-clients/kafka-clients-0.11/testingand committed it.Applied Changes
Style
File:
KafkaTestUtil.java:19Change: Renamed unused `NoSuchMethodException` catch parameter from `e` to `ignored`.
Reason: `knowledge/general-rules.md` requires intentionally unused catch parameters to use `ignored`.
Module:
kafka-clients-2.6:libraryModule path:
instrumentation/kafka/kafka-clients/kafka-clients-2.6/librarySummary
No safe repository-guideline fixes were applied under
instrumentation/kafka/kafka-clients/kafka-clients-2.6/library; reviewed source/test files andmetadata.yamlcoverage, and found no deterministic in-scope changes.Applied Changes
No safe automated changes were applied.
Module:
kafka-clients-common-0.11:libraryModule path:
instrumentation/kafka/kafka-clients/kafka-clients-common-0.11/librarySummary
Applied and committed safe review fixes for
kafka-clients-common-0.11library; converted registration-timeKafkaConsumerRecordGettersingleton usage to direct instance creation.Applied Changes
Style
File:
KafkaConsumerRecordGetter.java:18Change: Converted `KafkaConsumerRecordGetter` from an enum singleton to a plain package-private `class`.
Reason: Repository review guideline prefers direct instance creation over enum/static singleton patterns for stateless telemetry interface implementations such as `TextMapGetter` when used at registration time.
File:
KafkaBatchProcessSpanLinksExtractor.java:21Change: Replaced `KafkaConsumerRecordGetter.INSTANCE` with `new KafkaConsumerRecordGetter()` in `PropagatorBasedSpanLinksExtractor` setup.
Reason: Repository review guideline says stateless telemetry interface implementations should be instantiated directly at registration/setup call sites instead of using singleton access.
File:
KafkaInstrumenterFactory.java:146Change: Replaced `KafkaConsumerRecordGetter.INSTANCE` with `new KafkaConsumerRecordGetter()` in consumer instrumenter builder paths.
Reason: Repository review guideline says stateless telemetry interface implementations should be instantiated directly in `Instrumenter` builder chains instead of using singleton access.
Module:
kafka-connect-2.6:javaagentModule path:
instrumentation/kafka/kafka-connect-2.6/javaagentSummary
No safe repository-guideline fixes were needed under
instrumentation/kafka/kafka-connect-2.6/javaagent. The modulemetadata.yamlhas no config entries to validate against source usage, and the reviewed javaagent files already match the applicable guidance.Applied Changes
No safe automated changes were applied.
Module:
kafka-connect-2.6:testingModule path:
instrumentation/kafka/kafka-connect-2.6/testingSummary
Applied safe naming fixes in
kafka-connect-2.6testing and committed them in73e8afe1.Applied Changes
Naming
File:
KafkaConnectSinkTaskBaseTest.java:125Change: Renamed `getInternalKafkaBoostrapServers()` and `getKafkaBoostrapServers()` to `getInternalKafkaBootstrapServers()` and `getKafkaBootstrapServers()`, and updated internal call sites.
Reason: Repository review guidance enforces clear, correct API/getter naming; `Bootstrap` matches Kafka `BOOTSTRAP_SERVERS_CONFIG` terminology and fixes the misspelled helper names.
File:
MongoKafkaConnectSinkTaskTest.java:109Change: Updated Kafka producer setup to call `getKafkaBootstrapServers()`.
Reason: Call sites must stay aligned with the corrected helper name from the shared test base; this preserves compile-ready repository naming conformance.
File:
PostgresKafkaConnectSinkTaskTest.java:124Change: Updated Kafka producer setup to call `getKafkaBootstrapServers()`.
Reason: Call sites must stay aligned with the corrected helper name from the shared test base; this preserves compile-ready repository naming conformance.
Module:
kafka-streams-0.11:javaagentModule path:
instrumentation/kafka/kafka-streams-0.11/javaagentSummary
Applied and committed safe repository-guideline fixes for
kafka-streams-0.11javaagent in commit5c212404.Applied Changes
Style
File:
StateHolder.java:14Change: Changed public static `HOLDER` to private lower-camel `holder` with a public `holder()` accessor.
Reason: Repository style requires static fields to be private unless they are constant-like, and javaagent singleton accessors should expose lower-camel collaborators through same-named accessors.
Nullability
File:
PartitionGroupInstrumentation.java:48Change: Annotated nullable `@Advice.Return` `StampedRecord` and switched call sites to the `StateHolder.holder()` accessor.
Reason: Nullability correctness requires annotations when a value can be `null`; the existing null guard shows `@Advice.Return` can be absent, and singleton access should use the accessor pattern.
File:
RecordDeserializerInstrumentation.java:50Change: Annotated the `@AssignReturned.ToReturned` advice method and `@Advice.Return` `ConsumerRecord` as `@Nullable`.
Reason: Nullability correctness requires return annotations when a method can return `null`; this advice returns `null` when the instrumented method result is `null`.
File:
SourceNodeRecordDeserializerInstrumentation.java:47Change: Annotated the `@AssignReturned.ToReturned` advice method and `@Advice.Return` `ConsumerRecord` as `@Nullable`.
Reason: Nullability correctness requires return annotations when a method can return `null`; this advice returns `null` when the instrumented method result is `null`.
Javaagent
File:
StreamTaskInstrumentation.java:48Change: Used `StateHolder.holder()` and guarded nullable `@Advice.Enter` while annotating nullable `@Advice.Thrown`.
Reason: Advice patterns require cleanup advice to tolerate suppressed enter advice state, and nullability correctness requires `@Nullable` for `@Advice.Thrown` because it is `null` on successful exits.
File:
StreamThreadInstrumentation.java:37Change: Added `onThrowable = Throwable.class` to the run-loop exit advice that restores Kafka consumer wrapping state.
Reason: Javaagent advice cleanup that restores state must run on both normal and exceptional exits, per the advice cleanup guideline.
Testing
File:
KafkaStreamsBaseTest.java:52Change: Replaced separate `@AfterAll` cleanup with `AutoCleanupExtension.deferAfterAll(...)` registrations next to Kafka resource creation.
Reason: Testing guidelines prefer `AutoCleanupExtension` with `deferAfterAll(...)` for class-scoped resources so creation and cleanup stay together.
Download code review diagnostics