Code review sweep (run 24980313637)#18335
Merged
Merged
Conversation
Automated code review of instrumentation/jetty-httpclient/jetty-httpclient-12.0/library.
Automated code review of instrumentation/jetty-httpclient/jetty-httpclient-12.0/testing.
Automated code review of instrumentation/jetty-httpclient/jetty-httpclient-9.2/javaagent.
Automated code review of instrumentation/jetty-httpclient/jetty-httpclient-9.2/library.
Automated code review of instrumentation/jetty-httpclient/jetty-httpclient-9.2/testing.
Automated code review of instrumentation/jetty/jetty-11.0/javaagent.
Automated code review of instrumentation/jetty/jetty-12.0/javaagent.
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:
jetty-httpclient-12.0:libraryjetty-httpclient-12.0:testingjetty-httpclient-9.2:javaagentjetty-httpclient-9.2:libraryjetty-httpclient-9.2:testingjetty-11.0:javaagentjetty-12.0:javaagentModule:
jetty-httpclient-12.0:libraryModule path:
instrumentation/jetty-httpclient/jetty-httpclient-12.0/librarySummary
Applied one safe fix in
TracingHttpRequest: added accurate@Nullableannotations for the lazily initialized parent-context path and reduced the constructor to package-private to match the non-public class.Applied Changes
[Style]
File:
TracingHttpRequest.java:24Change: Annotated `parentContext` and `openScope()` with `@Nullable`, and removed the redundant `public` modifier from the `TracingHttpRequest` constructor.
Reason: The review checklist requires accurate nullability for fields and return values that can actually be `null`, and the style guide requires minimal necessary visibility; `parentContext` is unset until `send()` runs, `openScope()` can return `null`, and a constructor on a package-private class should not be wider than package-private.
Module:
jetty-httpclient-12.0:testingModule path:
instrumentation/jetty-httpclient/jetty-httpclient-12.0/testingSummary
Updated
AbstractJettyClient12Testto use an accurate comment for the disabled reused-request scenario; no other safe in-scope review fixes were needed.Applied Changes
General
File:
AbstractJettyClient12Test.java:62Change: Reworded the reused-request comment to state that Jetty 12 does not support reusing requests and that calling `request.send()` twice blocks indefinitely.
Reason: `knowledge/general-rules.md` says to fix incorrect comments; this keeps the test helper's explanation precise and aligned with the behavior behind `disableTestReusedRequest()`.
Module:
jetty-httpclient-9.2:javaagentModule path:
instrumentation/jetty-httpclient/jetty-httpclient-9.2/javaagentSummary
Applied three safe review fixes for
jetty-httpclient-9.2: completed missing supporteddeclarative_namemetadata mappings, normalized a non-constant Gradle variable name to lower camel case, and simplified the single-landmarkclassLoaderMatcher()to the repository-preferred compact form.Applied Changes
Config
File:
metadata.yaml:8Change: Added missing `declarative_name` entries for the supported flat properties `otel.instrumentation.http.known-methods`, `otel.instrumentation.http.client.capture-request-headers`, `otel.instrumentation.http.client.capture-response-headers`, `otel.instrumentation.http.client.emit-experimental-telemetry`, and `otel.instrumentation.sanitization.url.experimental.sensitive-query-parameters`.
Reason: `metadata-yaml-format.md` requires valid declarative config mappings for supported instrumentation properties; these entries were missing and now match the repository's validated bridge mappings.
Style
File:
build.gradle.kts:15Change: Renamed `jettyVers_base9` to `jettyVersBase9` and updated its only usage.
Reason: The style guide requires lower camel case for non-constant variables; this Gradle version holder was not a constant-style field and should follow repository naming conventions.
Javaagent
File:
JettyHttpClient9InstrumentationModule.java:30Change: Rewrote the single-class `classLoaderMatcher()` to use the compact one-line `hasClassesNamed(...)` form under the version comment.
Reason: `javaagent-module-patterns.md` prefers the compact form for a single landmark class in `classLoaderMatcher()` to keep version-boundary comments concise and consistent.
Module:
jetty-httpclient-9.2:libraryModule path:
instrumentation/jetty-httpclient/jetty-httpclient-9.2/librarySummary
Applied two safe hot-path cleanup fixes in
jetty-httpclient-9.2library;metadata.yamlreview found no changes needed, and the required Gradle validation completed cleanly.Applied Changes
Style
File:
JettyClientWrapUtil.java:60Change: Replaced the `wrapResponseListeners()` stream pipeline with a pre-sized loop and pre-sized the listener-interface list used during proxy wrapping.
Reason: The style guide's performance rule says to avoid unnecessary allocations on the instrumentation hot path; this removes stream-pipeline overhead and avoids repeated `ArrayList` resizing while preserving behavior.
File:
JettyClientTracingListener.java:87Change: Pre-sized the request-listener interface list in `wrapRequestListeners()` to the known maximum interface count.
Reason: The repository performance guidance prefers avoiding avoidable allocations on hot paths; using the known listener-interface count prevents unnecessary `ArrayList` growth during request-time listener wrapping.
Module:
jetty-httpclient-9.2:testingModule path:
instrumentation/jetty-httpclient/jetty-httpclient-9.2/testingSummary
Applied one safe reliability fix in
AbstractJettyClient9Test;metadata.yamlreview forjetty-httpclient-9.2did not require any deterministic changes.Applied Changes
General
File:
AbstractJettyClient9Test.java:45Change: Hardened `@AfterEach` cleanup to handle partial `@BeforeEach` failures and preserve both `HttpClient.stop()` exceptions, and changed HTTPS client selection to use `"https".equalsIgnoreCase(uri.getScheme())`.
Reason: The review checklist requires fixing deterministic correctness issues. This shared test base could throw `NullPointerException` during cleanup after partial setup failure and could skip the second `stop()` call if the first one failed. The style guide also prefers null-safe comparisons, so comparing the constant to `uri.getScheme()` avoids dereferencing a nullable scheme.
Module:
jetty-11.0:javaagentModule path:
instrumentation/jetty/jetty-11.0/javaagentSummary
Applied a safe metadata fix in
instrumentation/jetty/jetty-11.0/metadata.yamlby adding the missingdeclarative_namemappings for all declared config keys and declaringCONTEXT_PROPAGATIONto match the Jetty 11 module behavior.Applied Changes
Config
File:
metadata.yaml:6Change: Added `declarative_name` for each `configurations` entry and added the `CONTEXT_PROPAGATION` feature.
Reason: `metadata-yaml-format.md` requires each metadata config entry to include the correct declarative mapping, and module metadata should accurately declare supported features exposed by the existing instrumentation behavior.
Module:
jetty-12.0:javaagentModule path:
instrumentation/jetty/jetty-12.0/javaagentSummary
Applied safe internal visibility reductions in the
jetty-12.0javaagent; the requiredmetadata.yamlreview found no deterministic fixes.Applied Changes
Style
File:
Jetty12Helper.java:17Change: Reduced `Jetty12Helper` and its helper methods to package-private visibility because they are only used inside the local `v12_0` package.
Reason: The style guide and review checklist require the most restrictive visibility that still works; these javaagent internals are not directly referenced from `@Advice` methods or outside the package.
File:
Jetty12ResponseMutator.java:11Change: Reduced `Jetty12ResponseMutator` to package-private visibility.
Reason: The repository style rule prefers minimal necessary visibility, and this mutator is only instantiated from package-local Jetty 12 instrumentation code.
File:
Jetty12Singletons.java:14Change: Reduced `Jetty12Singletons` and its `helper()` accessor to package-private visibility.
Reason: The style guide requires internal javaagent helpers to avoid broader visibility than needed; both the class and accessor are only used within the same package.
Download code review diagnostics