Code review sweep (run 24964322798)#18319
Merged
Merged
Conversation
Automated code review of instrumentation/gwt-2.0/javaagent.
Automated code review of instrumentation/helidon-4.3/javaagent.
Automated code review of instrumentation/helidon-4.3/testing.
Automated code review of instrumentation/hibernate/hibernate-3.3/javaagent.
Automated code review of instrumentation/hibernate/hibernate-4.0/javaagent.
Automated code review of instrumentation/hibernate/hibernate-6.0/javaagent.
ByteBuddy advice with inline=false in GwtRpcInstrumentation references GwtSingletons from instrumented class com.google.gwt.user.server.rpc.RPC, which is in a different package. Making the class and its members package-private caused IllegalAccessError at runtime, breaking GwtTest.
… set
The testapp source set's resources block was never consumed: the webapp files are copied directly via the copyTestWebapp task using from(file("src/testapp/webapp")), independent of the source set. compileGwt only uses java.srcDirs/compileClasspath, and the test classpath only adds build/testapp/classes. Dropping the dead block.
Matches the dominant convention for non-enum HttpServerResponseMutator implementations in this repo (Akka, Pekko, Grizzly, Jetty 8/11/12, Servlet 3/5, Liberty all use 'new XyzResponseMutator()' at the call site) and the default rule in general-rules.md ('Prefer Instance Creation Over Singletons'). Header customization is not a hot path that warrants the singleton exception.
trask
approved these changes
Apr 26, 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:
guava-10.0:javaagentguava-10.0:librarygwt-2.0:javaagenthelidon-4.3:javaagenthelidon-4.3:libraryhelidon-4.3:testinghibernate-3.3:javaagenthibernate-4.0:javaagenthibernate-6.0:javaagentModule:
guava-10.0:javaagentModule path:
instrumentation/guava-10.0/javaagentSummary
Reviewed
instrumentation/guava-10.0/javaagentand the mandatoryinstrumentation/guava-10.0/metadata.yamlvalidation surface; no safe repository-guideline fixes were needed.Applied Changes
No safe automated changes were applied.
Module:
guava-10.0:libraryModule path:
instrumentation/guava-10.0/librarySummary
Reviewed
instrumentation/guava-10.0/libraryand validatedinstrumentation/guava-10.0/metadata.yaml; no safe repository-guideline fixes were needed.Applied Changes
No safe automated changes were applied.
Module:
gwt-2.0:javaagentModule path:
instrumentation/gwt-2.0/javaagentSummary
Applied 2 safe fixes under
instrumentation/gwt-2.0/javaagent: corrected thetestappresource directory and reducedGwtSingletonsvisibility for internal-only javaagent use.metadata.yamlneeded no changes because this module does not define instrumentation config, and both required:checkruns still hit the same pre-existingGwtTestfailure.Applied Changes
Build
File:
build.gradle.kts:27Change: Changed the `testapp` source set resources path from `src/webapp` to the existing `src/testapp/webapp` directory.
Reason: Repository review rules prioritize deterministic correctness fixes; the previous path did not exist in this module, so the source set was misconfigured.
Style
File:
GwtSingletons.java:16Change: Made `GwtSingletons`, `RPC_CONTEXT_KEY`, and `instrumenter()` package-private.
Reason: The style guide requires minimal necessary visibility, and this helper is only used from the same package inside `javaagent/src/main`.
Unresolved Items
File:
GwtTest.javaReason: Both `./gradlew :instrumentation:gwt-2.0:javaagent:check` and `./gradlew :instrumentation:gwt-2.0:javaagent:check -PtestLatestDeps=true` fail before and after these review fixes because `testGwt()` expects an exception event on `test.gwt.shared.MessageService/sendMessage`, but the exported span has no events; the same runs also end with `1 Advice failures during test`.
Module:
helidon-4.3:javaagentModule path:
instrumentation/helidon-4.3/javaagentSummary
Reviewed
instrumentation/helidon-4.3/javaagent, validated the siblingmetadata.yamlusage against the module’s standard HTTP-server config wiring, and applied a safe hot-path fix so Helidon response customization now reuses a singleHelidonServerResponseMutatorinstead of allocating one per request.Applied Changes
[Style]
File:
HelidonServerResponseMutator.java:13Change: Added a shared `INSTANCE` field and a private constructor to make `HelidonServerResponseMutator` reusable.
Reason: The repository singleton guideline for stateless telemetry interfaces keeps a singleton on hot paths; this `HttpServerResponseMutator` is used during per-request response customization, so reusing one instance avoids unnecessary allocations.
File:
ResponseCustomizingFilter.java:24Change: Replaced `new HelidonServerResponseMutator()` with `HelidonServerResponseMutator.INSTANCE` in the filter path.
Reason: The same hot-path exception in the stateless telemetry interface guideline says not to allocate a new mutator on each request when a reusable singleton is sufficient.
Module:
helidon-4.3:libraryModule path:
instrumentation/helidon-4.3/librarySummary
Reviewed
instrumentation/helidon-4.3/libraryand performed the requiredmetadata.yamlvalidation checks for the Helidon instrumentation module; no safe repository-guideline fixes were needed.Applied Changes
No safe automated changes were applied.
Module:
helidon-4.3:testingModule path:
instrumentation/helidon-4.3/testingSummary
Applied one safe review fix in
instrumentation/helidon-4.3/testing: narrowed unused package-visible helper methods inAbstractHelidonTesttoprivate staticto match the repository's minimal-visibility rule.Applied Changes
Style
File:
AbstractHelidonTest.java:33Change: Changed the three `sendResponse(...)` helper overloads from package-visible to `private static`.
Reason: The style guide requires the most restrictive visibility that still allows the code to function, and these helpers are only called within `AbstractHelidonTest`.
Module:
hibernate-3.3:javaagentModule path:
instrumentation/hibernate/hibernate-3.3/javaagentSummary
Reviewed
instrumentation/hibernate/hibernate-3.3/javaagentand applied one safe repository-guideline cleanup: tightened a test-only helper inSessionTestto minimum required visibility. Module validation completed with:instrumentation:hibernate:hibernate-3.3:javaagent:check,:instrumentation:hibernate:hibernate-3.3:javaagent:check -PtestLatestDeps=true, andspotlessApply.Applied Changes
style
File:
SessionTest.java:578Change: Changed `sessionAssertion(...)` from package-private to `private static`.
Reason: Follows the repository style rule to prefer the narrowest visibility for members that are only used within the declaring class, with no behavior change.
Module:
hibernate-4.0:javaagentModule path:
instrumentation/hibernate/hibernate-4.0/javaagentSummary
Applied 3 safe review fixes in
instrumentation/hibernate/hibernate-4.0/javaagent: reordered theEntityNameUtilutility class to match the style guide’s member-ordering rules, and tightened test fixture field visibility/immutability per the minimal-visibility andfinal-where-possible guidelines.Applied Changes
Style
File:
EntityNameUtil.java:15Change: Reordered `EntityNameUtil` so the public factory method appears above the private helper, and moved the private utility constructor to the end of the class.
Reason: The style guide says calling methods should appear above the methods they call, and static utility classes should keep the private constructor after all methods.
File:
EntityManagerTest.java:53Change: Changed `entityManagerFactory` from package-private to `private static final`.
Reason: Repository style requires the most restrictive visibility that still works; this test fixture is only used inside `EntityManagerTest`.
File:
SpringJpaTest.java:42Change: Changed `context` and `repo` to `private final` fields.
Reason: The style guide prefers minimal necessary visibility and `final` fields where possible; these per-test fixtures are initialized once and never reassigned.
Module:
hibernate-6.0:javaagentModule path:
instrumentation/hibernate/hibernate-6.0/javaagentSummary
Applied 3 safe review fixes in
hibernate-6.0: added the missingmetadata.yamldeclarative config mapping, removed a dead query matcher branch inSessionInstrumentation, and normalized the single-landmarkclassLoaderMatcher()comment layout.Applied Changes
[Config]
File:
metadata.yaml:6Change: Added the missing `declarative_name: java.hibernate.experimental_span_attributes/development` entry for `otel.instrumentation.hibernate.experimental-span-attributes`.
Reason: `knowledge/metadata-yaml-format.md` requires every instrumentation config entry to declare `declarative_name`, and experimental flat properties must map to a declarative key with `/development`.
[Javaagent]
File:
SessionInstrumentation.java:85Change: Removed the extra `.or(named("org.hibernate.query.spi.QueryImplementor"))` branch from the query-return matcher.
Reason: Under the general correctness rules, ineffective matcher logic should be fixed: `named(...)` here matches method names, not return types, so that branch was dead and never widened the advice target set.
File:
HibernateInstrumentationModule.java:27Change: Rewrote the single-class `classLoaderMatcher()` to the compact one-line `hasClassesNamed(...)` form with the version comment above it.
Reason: `knowledge/javaagent-module-patterns.md` prefers the compact comment layout for a single-landmark `classLoaderMatcher()` so the version boundary is documented in the repository’s standard form.
Download code review diagnostics