Skip to content

fix: Add nullability annotations and fix kotlin-stdlib transitive leak - #10979

Open
obabichevjb wants to merge 1 commit into
apache:developfrom
obabichevjb:obabichev/kotlin-nullability
Open

fix: Add nullability annotations and fix kotlin-stdlib transitive leak#10979
obabichevjb wants to merge 1 commit into
apache:developfrom
obabichevjb:obabichev/kotlin-nullability

Conversation

@obabichevjb

@obabichevjb obabichevjb commented Aug 27, 2026

Copy link
Copy Markdown

Which Issue(s) This PR Fixes

Brief Description

This PR contains two independent fixes:

  1. @Nullable annotations on 7 getters in Message.java that can return null at runtime. The methods are declared as returning plain String/Map with no nullability metadata, which produces silent NPEs in Kotlin consumers and gives no warning in Java IDEs.

  2. Exclude leaked kotlin-stdlib from the opentelemetry-exporter-otlp dependency chain. A pure-Java project depending on rocketmq-client transitively resolves kotlin-stdlib via: opentelemetry-exporter-otlpopentelemetry-exporter-sender-okhttpokhttpkotlin-stdlib-*. Upstream already wrote kotlin-stdlib exclusions for the okio-jvm edge; this extends them to cover the okhttp path, enforcing a constraint upstream already intended.

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Summary

This PR adds @Nullable annotations to getter methods in Message.java that can legitimately return null, and excludes transitive kotlin-stdlib dependencies from opentelemetry-exporter-otlp to reduce dependency bloat.

Both changes look correct and well-scoped:

  • The @Nullable annotations accurately reflect the nullability contract of these getters (e.g., getTags(), getKeys(), getTransactionId() can all return null)
  • The kotlin-stdlib exclusions prevent unnecessary transitive dependencies from leaking into the classpath

LGTM.


Automated review by github-manager-bot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants