Skip to content

Review fixes for rabbitmq-2.7:javaagent#17615

Merged
trask merged 1 commit intomainfrom
otelbot/code-review-rabbitmq-2.7-javaagent
Apr 6, 2026
Merged

Review fixes for rabbitmq-2.7:javaagent#17615
trask merged 1 commit intomainfrom
otelbot/code-review-rabbitmq-2.7-javaagent

Conversation

@otelbot
Copy link
Copy Markdown
Contributor

@otelbot otelbot bot commented Apr 6, 2026

Summary

Applied 4 safe review fixes under instrumentation/rabbitmq-2.7/javaagent: aligned concrete nullable parameters with actual null flows and added missing suppress = Throwable.class on non-trivial ByteBuddy advice.

Applied Changes

Javaagent

File: RabbitChannelInstrumentation.java:132
Change: Added suppress = Throwable.class to ChannelMethodAdvice.onEnter() and ChannelGetAdvice.takeTimestamp(), and marked ChannelGetAdvice/ChannelMethodAdviceScope throwable and response inputs @Nullable where the advice path can supply null.
Reason: javaagent-advice-patterns.md requires suppress = Throwable.class on non-trivial advice, and general-rules.md requires @Nullable when concrete callers such as @Advice.Return/@Advice.Thrown can pass null.

File: RabbitCommandInstrumentation.java:52
Change: Added suppress = Throwable.class to CommandConstructorAdvice.setSpanNameAddHeaders().
Reason: javaagent-advice-patterns.md says non-trivial @Advice.OnMethodExit bodies should use suppress = Throwable.class so instrumentation failures do not escape into application code.

Nullability

File: RabbitSingletons.java:112
Change: Annotated buildMessagingAttributesExtractor(..., operation) with @Nullable for MessageOperation operation.
Reason: general-rules.md says parameters must be marked @Nullable when real callers pass null; createChannelInstrumenter(false) passes null for the non-publish case.

File: ReceiveRequest.java:16
Change: Annotated ReceiveRequest.create(..., response, ...) so response is @Nullable.
Reason: general-rules.md requires @Nullable on parameters that are actually passed null; the basicGet receive path can construct ReceiveRequest with a null GetResponse when no message is returned.


Download code review diagnostics

Automated code review of instrumentation/rabbitmq-2.7/javaagent.
@otelbot otelbot bot requested a review from a team as a code owner April 6, 2026 17:27
@trask trask merged commit c1ea8b0 into main Apr 6, 2026
96 checks passed
@trask trask deleted the otelbot/code-review-rabbitmq-2.7-javaagent branch April 6, 2026 18:30
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.

1 participant