Skip to content

Review fixes for r2dbc-1.0:javaagent#17611

Merged
laurit merged 2 commits intomainfrom
otelbot/code-review-r2dbc-1.0-javaagent
Apr 7, 2026
Merged

Review fixes for r2dbc-1.0:javaagent#17611
laurit merged 2 commits intomainfrom
otelbot/code-review-r2dbc-1.0-javaagent

Conversation

@otelbot
Copy link
Copy Markdown
Contributor

@otelbot otelbot bot commented Apr 6, 2026

Summary

Applied safe review fixes in instrumentation/r2dbc-1.0/javaagent: corrected the bounded muzzle declaration to match actual r2dbc-spi coverage and aligned singleton-holder naming/access with javaagent conventions.

Applied Changes

Build

File: build.gradle.kts:10
Change: Expanded the muzzle range to versions.set("[0.9.0.RELEASE,)") and added assertInverse.set(true).
Reason: gradle-conventions.md requires assertInverse.set(true) for bounded muzzle ranges, and the module's :muzzle results showed this instrumentation already matches r2dbc-spi 0.9.x, so the declared lower bound needed to reflect the real supported range.

Javaagent

File: R2dbcInstrumentation.java:8
Change: Static-imported R2dbcSingletons.telemetry() and used the accessor unqualified inside FactoryAdvice.
Reason: javaagent-singletons-patterns.md says callers should static import exported singleton accessors and use them unqualified instead of qualifying them with the holder class.

Style

File: R2dbcSingletons.java:19
Change: Renamed the shared R2dbcTelemetry field from TELEMETRY to telemetry so the field and accessor names match.
Reason: The singleton-holder and style rules require runtime collaborator fields to use lower camel case, with the accessor using the same name; uppercase is reserved for constant-like identifiers, not service objects such as R2dbcTelemetry.


Download code review diagnostics

Automated code review of instrumentation/r2dbc-1.0/javaagent.
@otelbot otelbot bot requested a review from a team as a code owner April 6, 2026 16:56
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀

Comment on lines 10 to +27
@@ -23,7 +24,7 @@ sourceSets {
}

dependencies {
library("io.r2dbc:r2dbc-spi:1.0.0.RELEASE")
library("io.r2dbc:r2dbc-spi:0.9.0.RELEASE")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@laurit I'm thinking to just leave the module name as 1.0, since it's a nice round number 😄

@laurit laurit merged commit c81d668 into main Apr 7, 2026
94 checks passed
@laurit laurit deleted the otelbot/code-review-r2dbc-1.0-javaagent branch April 7, 2026 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants