Code review sweep (run 24966697425)#18323
Merged
Merged
Conversation
Automated code review of instrumentation/internal/internal-eclipse-osgi-3.6/javaagent.
Automated code review of instrumentation/internal/internal-lambda/javaagent.
Automated code review of instrumentation/internal/internal-reflection/javaagent-integration-tests.
Automated code review of instrumentation/internal/internal-url-class-loader/javaagent-integration-tests.
Automated code review of instrumentation/java-http-client/javaagent.
Automated code review of instrumentation/java-http-client/library.
Automated code review of instrumentation/java-http-server/javaagent.
Automated code review of instrumentation/java-http-server/library.
trask
approved these changes
Apr 27, 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:
internal-eclipse-osgi-3.6:javaagentinternal-lambda:javaagentinternal-reflection:javaagentinternal-reflection:javaagent-integration-testsinternal-url-class-loader:javaagentinternal-url-class-loader:javaagent-integration-testsjava-http-client:javaagentjava-http-client:libraryjava-http-client:testingjava-http-server:javaagentjava-http-server:libraryModule:
internal-eclipse-osgi-3.6:javaagentModule path:
instrumentation/internal/internal-eclipse-osgi-3.6/javaagentSummary
Added an explicit
:javaagent-bootstrapdependency injavaagent/build.gradle.kts; no other safe repository-guideline fixes were needed underinstrumentation/internal/internal-eclipse-osgi-3.6/javaagent.Applied Changes
Build
File:
build.gradle.kts:5Change: Added `compileOnly(project(":javaagent-bootstrap"))` to declare the direct compile dependency used by `EclipseOsgiInstrumentation`.
Reason: The module imports `InClassLoaderMatcher` from `:javaagent-bootstrap`, so the dependency should be declared explicitly to keep build wiring correct and consistent with sibling internal javaagent modules.
Module:
internal-lambda:javaagentModule path:
instrumentation/internal/internal-lambda/javaagentSummary
Applied 1 safe style fix in
instrumentation/internal/internal-lambda/javaagent: moved theLambdaTransformerHelperprivate constructor to the end of the static utility class. The requiredmetadata.yamlreview found no configuration issues for this module.Applied Changes
Style
File:
LambdaTransformerHelper.java:42Change: Moved the private `LambdaTransformerHelper()` constructor below the class's static utility method.
Reason: The style guide requires static utility classes to place the private constructor after all methods.
Module:
internal-reflection:javaagentModule path:
instrumentation/internal/internal-reflection/javaagentSummary
No safe repository-guideline fixes were needed in
instrumentation/internal/internal-reflection/javaagent; the module sources andmetadata.yamlalready align with the loaded review rules.Applied Changes
No safe automated changes were applied.
Module:
internal-reflection:javaagent-integration-testsModule path:
instrumentation/internal/internal-reflection/javaagent-integration-testsSummary
Applied one safe review fix in
javaagent-integration-tests:ReflectionTestnow uses more idiomatic AssertJ class assertions and a deterministiccontainsExactly(...)interface-order check; required module validation completed with:check,:check -PtestLatestDeps=true, and finalspotlessApply.Applied Changes
[Testing]
File:
ReflectionTest.java:37Change: Replaced boolean-style `Class.isAssignableFrom(...)` assertions with direct AssertJ class assertions and tightened the interface array assertion from `containsExactlyInAnyOrder(...)` to `containsExactly(...)`.
Reason: Repository test guidance prefers idiomatic AssertJ assertions, and the interface order here is deterministic, so `containsExactly(...)` is the more precise assertion.
Module:
internal-url-class-loader:javaagentModule path:
instrumentation/internal/internal-url-class-loader/javaagentSummary
Reviewed
instrumentation/internal/internal-url-class-loader/javaagentand its modulemetadata.yaml; no safe repository-guideline fixes were needed.Applied Changes
No safe automated changes were applied.
Module:
internal-url-class-loader:javaagent-integration-testsModule path:
instrumentation/internal/internal-url-class-loader/javaagent-integration-testsSummary
Applied 1 safe review fix in
instrumentation/internal/internal-url-class-loader/javaagent-integration-tests:AddUrlTestnow gives the JUnitcleanupextension field minimal visibility, and no other deterministic repository-guideline fixes were needed in the requested scope.Applied Changes
Style
File:
AddUrlTest.java:21Change: Made the `cleanup` `AutoCleanupExtension` field `private static final` and split the annotation onto its own line.
Reason: The style guide requires minimal necessary visibility, and static fields should be `private` unless they are constant-like uppercase fields; `cleanup` is a test helper field, not a public API or constant identifier.
Module:
java-http-client:javaagentModule path:
instrumentation/java-http-client/javaagentSummary
Reviewed
instrumentation/java-http-client/javaagentand applied one safe fix:sendAsync()advice now restoresCallDepthwhen instrumentation declines to start, preventing later async client calls on the same thread from being misclassified as nested.Applied Changes
General
File:
HttpClientInstrumentation.java:146Change: Added `callDepth.decrementAndGet()` before returning from `AsyncAdviceScope.start()` when `instrumenter().shouldStart(...)` is `false`.
Reason: The review checklist’s `[General]` correctness rule requires balanced state management in javaagent advice. Without decrementing `CallDepth` on this early-return path, the thread-local depth leaks and suppresses subsequent top-level `sendAsync()` instrumentation on the same thread.
Module:
java-http-client:libraryModule path:
instrumentation/java-http-client/librarySummary
Applied three safe review fixes in
instrumentation/java-http-client/library: two member-ordering cleanups for style-guide conformance and one small concurrency-safety fix inExperimental.Applied Changes
Style
File:
JavaHttpClientTelemetryBuilder.java:25Change: Moved the static initializer above instance fields so `JavaHttpClientTelemetryBuilder` follows the repository class-organization order.
Reason: The style guide requires static initialization to appear before instance fields in the class layout.
File:
JavaHttpClientInstrumenterBuilderFactory.java:18Change: Moved the private utility constructor below the factory method in `JavaHttpClientInstrumenterBuilderFactory`.
Reason: The style guide says static utility classes should place the private constructor after all methods.
General
File:
Experimental.java:31Change: Read `setEmitExperimentalTelemetry` into a local `setter` variable before the null check and invocation.
Reason: This avoids a racy second read of the volatile field and is a safe reliability fix under the general correctness rule.
Module:
java-http-client:testingModule path:
instrumentation/java-http-client/testingSummary
Reviewed all files under
instrumentation/java-http-client/testingand did not keep any code changes. A candidate assertion-tightening edit inAbstractJavaHttpClientTestwas reverted because it was not safe:cancelRequest()legitimately records the additionalservice.peer.nameattribute, sohasAttributesSatisfyingExactly(...)would overconstrain the test.Applied Changes
No safe automated changes were applied.
Module:
java-http-server:javaagentModule path:
instrumentation/java-http-server/javaagentSummary
Reviewed all files under
instrumentation/java-http-server/javaagentand applied one safe Gradle wiring fix inbuild.gradle.ktsto configurecollectMetadataon everyTesttask using the repository's canonical pattern.Applied Changes
Build
File:
build.gradle.kts:16Change: Replaced `tasks.test { ... }` with `tasks { withType<Test>().configureEach { ... } }` for the `collectMetadata` system property.
Reason: The review checklist allows fixing missing test-task wiring patterns with the clear canonical form; using `withType<Test>().configureEach` ensures `collectMetadata` also applies to non-default test tasks instead of only `test`.
Module:
java-http-server:libraryModule path:
instrumentation/java-http-server/librarySummary
Reviewed
instrumentation/java-http-server/libraryand applied one safe fix inExperimentalto snapshot thevolatilecallback before use.Applied Changes
General
File:
Experimental.java:31Change: Updated `setEmitExperimentalTelemetry(...)` to copy `setEmitExperimentalTelemetry` into a local `setter` variable before the null check and invocation.
Reason: Repository general correctness rules favor reliable concurrency-safe code, and sibling library `Experimental` helpers use this local-copy pattern to avoid a racy double read of a `volatile` callback field.
Download code review diagnostics