Code review sweep (run 25235735340)#18503
Merged
Merged
Conversation
Automated code review of instrumentation/servlet/servlet-3.0/testing.
Automated code review of instrumentation/servlet/servlet-5.0/javaagent.
Automated code review of instrumentation/servlet/servlet-5.0/jetty11-testing.
Automated code review of instrumentation/servlet/servlet-5.0/library.
Automated code review of instrumentation/servlet/servlet-5.0/testing.
Automated code review of instrumentation/servlet/servlet-5.0/tomcat-testing.
trask
approved these changes
May 2, 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:
servlet-3.0:javaagent-unit-testsservlet-3.0:libraryservlet-3.0:testingservlet-5.0:javaagentservlet-5.0:javaagent-unit-testsservlet-5.0:jetty11-testingservlet-5.0:jetty12-testingservlet-5.0:libraryservlet-5.0:testingservlet-5.0:tomcat-testingModule:
servlet-3.0:javaagent-unit-testsModule path:
instrumentation/servlet/servlet-3.0/javaagent-unit-testsSummary
No safe repository-guideline fixes were applied after reviewing all files under
instrumentation/servlet/servlet-3.0/javaagent-unit-testsand validating the relatedmetadata.yamlentries by inspection.Applied Changes
No safe automated changes were applied.
Module:
servlet-3.0:libraryModule path:
instrumentation/servlet/servlet-3.0/librarySummary
No safe repository-guideline fixes were found in
instrumentation/servlet/servlet-3.0/library; no files were changed.Applied Changes
No safe automated changes were applied.
Module:
servlet-3.0:testingModule path:
instrumentation/servlet/servlet-3.0/testingSummary
Applied safe repository-guideline fixes in
instrumentation/servlet/servlet-3.0/testingand committed them as337802da.Applied Changes
Testing
File:
AbstractServlet3Test.java:38Change: Registered `AutoCleanupExtension` and replaced manual `ExperimentalSnippetHolder.setSnippet("")` cleanup with `cleanup.deferCleanup(...)` immediately after setting the snippet.
Reason: The testing cleanup guideline prefers `AutoCleanupExtension.deferCleanup(...)` so cleanup runs after the test even when assertions fail; this also matches the existing servlet 5 testing pattern.
Correctness
File:
AbstractTomcatServlet3Test.java:100Change: Changed the Tomcat webapp child path from `"/webapps/ROOT"` to `"webapps/ROOT"`.
Reason: General correctness: an absolute child path passed to `new File(baseDir, ...)` ignores the JUnit `@TempDir`; using a relative path keeps the test webapp directory isolated under the per-test temp directory.
Module:
servlet-5.0:javaagentModule path:
instrumentation/servlet/servlet-5.0/javaagentSummary
Applied and committed safe review fixes for
servlet-5.0javaagent: replaced the statelessHttpServerResponseMutatorenum singleton with directnew Servlet5HttpServerResponseMutator()usage.Applied Changes
Style
File:
Servlet5HttpServerResponseMutator.java:11Change: Converted `Servlet5HttpServerResponseMutator` from an `enum` singleton to a regular `class` and removed `INSTANCE`.
Reason: Repository review guidance prefers direct instance creation over enum/static singletons for stateless telemetry interface implementations such as `HttpServerResponseMutator`, outside hot paths.
File:
JakartaServletServiceAdvice.java:87Change: Replaced `Servlet5HttpServerResponseMutator.INSTANCE` with `new Servlet5HttpServerResponseMutator()`.
Reason: Repository review guidance says stateless telemetry interface implementations should be instantiated directly at registration/initialization call sites instead of using singleton access.
Module:
servlet-5.0:javaagent-unit-testsModule path:
instrumentation/servlet/servlet-5.0/javaagent-unit-testsSummary
No safe repository-guideline fixes were needed under
instrumentation/servlet/servlet-5.0/javaagent-unit-tests; scoped tests andbuild.gradle.ktsalready align with the loaded style, testing, Gradle, and mandatorymetadata.yamlguidance.Applied Changes
No safe automated changes were applied.
Module:
servlet-5.0:jetty11-testingModule path:
instrumentation/servlet/servlet-5.0/jetty11-testingSummary
Applied safe visibility fixes in
jetty11-testingand committed them inc8a56cb5.Applied Changes
Style
File:
JettyServlet5Test.java:26Change: Changed the `@RegisterExtension` `testing` field from `protected` to `private`.
Reason: Repository style guide requires static fields to use the most restrictive visibility; the field is not accessed by subclasses or other classes.
File:
JettyServletHandlerTest.java:30Change: Changed the `@RegisterExtension` `testing` field from `protected` to `private`.
Reason: Repository style guide requires static fields to use the most restrictive visibility; the field is only used by JUnit extension registration in the declaring class.
Module:
servlet-5.0:jetty12-testingModule path:
instrumentation/servlet/servlet-5.0/jetty12-testingSummary
No safe fixes were applied. One issue remains because the review workflow says not to auto-fix missing
testExperimentaltask wiring when experimental flags are set unconditionally.Applied Changes
No safe automated changes were applied.
Unresolved Items
File:
build.gradle.ktsReason: `tasks.test` unconditionally enables `-Dotel.instrumentation.servlet.experimental.capture-request-parameters=test-parameter` without a dedicated `testExperimental` task; `testing-experimental-flags.md` says experimental flags should be isolated in `testExperimental`, but the review guidelines classify this as a non-auto-fix requiring manual follow-up.
Module:
servlet-5.0:libraryModule path:
instrumentation/servlet/servlet-5.0/librarySummary
Applied and committed one safe repository-guideline fix for
servlet-5.0library nullability accuracy.Applied Changes
Nullability
File:
Servlet5Accessor.java:52Change: Added `@Nullable` to `Servlet5Accessor` methods and the `setRequestAttribute` value parameter where Jakarta Servlet API calls can produce or accept `null`.
Reason: Repository nullability guidance requires `@Nullable` annotations where a concrete runtime source can pass or return `null`; methods such as `getQueryString()`, `getAttribute()`, `getHeader()`, `getPathInfo()`, and `getUserPrincipal()` may return `null`, and `setAttribute(..., null)` is allowed by the servlet API.
Module:
servlet-5.0:testingModule path:
instrumentation/servlet/servlet-5.0/testingSummary
Applied safe repository-guideline fixes in
servlet-5.0:testingand committed them asef3dcd1f.Applied Changes
General
File:
AbstractTomcatServlet5Test.java:100Change: Changed Tomcat webapp setup to create `webapps/ROOT` under the JUnit `@TempDir`, and switched per-test cleanup to `TestAccessLogValve.clearLoggedIds()`.
Reason: Repository general correctness guidance requires fixing deterministic reliability issues; `new File(baseDir, "/webapps/ROOT")` ignores `baseDir`, and cleanup should use the synchronized accessor added for the shared access-log state.
File:
TestAccessLogValve.java:29Change: Made `getLoggedIds()` return a synchronized snapshot, added synchronized `clearLoggedIds()`, and made the wait timeout check depend on whether the expected IDs were observed.
Reason: Repository general correctness guidance calls for fixing concurrency hazards and reliability issues; `loggedIds` is written under synchronization, so reads and clears must use the same lock, and timeout handling should fail only when the expected entries are still absent.
Module:
servlet-5.0:tomcat-testingModule path:
instrumentation/servlet/servlet-5.0/tomcat-testingSummary
Applied one safe repository-guideline fix in
tomcat-testing; the working tree is clean after committing the change.Applied Changes
General
File:
TomcatServlet5MappingTest.java:31Change: Changed `new File(baseDir, "/webapps/ROOT")` to `new File(baseDir, "webapps/ROOT")` so the Tomcat webapp directory is created under the JUnit `@TempDir`.
Reason: Repository review guidelines require fixing correctness issues; an absolute child path makes `File` ignore `baseDir`, defeating temporary-directory isolation.
Download code review diagnostics