You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "obabichevjb (via GitHub)" <gi...@apache.org> on 2026/08/27 11:06:39 UTC

[I] [Enhancement] Add JSpecify NullMarked annotations to org.apache.rocketmq.client.apis [rocketmq-clients]

obabichevjb opened a new issue, #1350:
URL: https://github.com/apache/rocketmq-clients/issues/1350

   ### Before Creating the Enhancement Request
   
   - [x] I have confirmed that this should be classified as an enhancement rather than a bug/feature.
   
   
   ### Programming Language of the Client
   
   Java
   
   ### Summary
   
   All 32 public types in the `client-apis` module (the gRPC client) lack nullability annotations, causing Kotlin consumers to receive unsafe platform types (`String!`, `Map<String?,?>!`, etc.) with no compile-time nullability guarantees.
   
   ### Motivation
   
   Without nullability metadata, Kotlin code using the client-apis has no compile-time guarantees:
   
   ```kotlin
   // Before: all these are `String!` — Kotlin can't warn you
   val topic: String? = view.topic  // compiles silently
   ```
   
   This applies to all four public API packages:
   
   | Package | Types |
   |---|---|
   | `org.apache.rocketmq.client.apis` | 7 |
   | `…client.apis.consumer` | 14 |
   | `…client.apis.message` | 4 |
   | `…client.apis.producer` | 7 |
   
   Additionally, `SendReceipt.getRecallHandle()` returns a bare `String` while being conditional (upstream's own comment says *"only delay message is supported for now"*). It is the only getter in the gRPC API that breaks the `Optional<T>` convention and lacks documentation of its empty-string sentinel value.
   
   
   
   ### Describe the Solution You'd Like
   
   1. **`@NullMarked` on four packages** — four `package-info.java` files added (JSpecify package scope is not hierarchical). This marks ~99 return values and parameters as non-null by default across all 32 public types.
   
   2. **JSpecify 1.0.0 as a `provided` dependency** — added to the BOM and `client-apis` module. Annotations are `CLASS` retention, so they are encoded in compiled class files and downstream consumers do not need to add any dependency.
   
   3. **Javadoc fix for `SendReceipt.getRecallHandle()`** — replaced an implementation-level line comment with proper Javadoc documenting that this method returns an empty string (not null) when recall is unsupported. Callers should test with `String.isEmpty()` rather than for nullness.
   
   
   ### Describe Alternatives You've Considered
   
   -
   
   ### Additional Context
   
   -


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Enhancement] Add JSpecify NullMarked annotations to org.apache.rocketmq.client.apis [rocketmq-clients]

Posted by "RockteMQ-AI (via GitHub)" <gi...@apache.org>.
RockteMQ-AI commented on issue #1350:
URL: https://github.com/apache/rocketmq-clients/issues/1350#issuecomment-5655083084

   **Issue Evaluation**
   
   Category: `type/enhancement` | Status: **Evaluated**
   
   **Feasibility:** Feasible
   **Scope:** Java client API — `org.apache.rocketmq.client.apis` package
   **Compatibility:** Additive; no breaking changes
   
   Adding JSpecify `@NullMarked` annotations improves null-safety for Java consumers of the client API. This is a low-risk, high-value improvement that helps IDE and static analysis tools catch null-related issues at compile time.
   
   ---
   *Automated evaluation by github-manager*
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Enhancement] Add JSpecify NullMarked annotations to org.apache.rocketmq.client.apis [rocketmq-clients]

Posted by "RockteMQ-AI (via GitHub)" <gi...@apache.org>.
RockteMQ-AI commented on issue #1350:
URL: https://github.com/apache/rocketmq-clients/issues/1350#issuecomment-5438792120

   **Issue Evaluation**
   
   Category: `type/enhancement` | Status: **Evaluated**
   
   **Feasibility:** Feasible — JSpecify `@NullMarked` annotations are `CLASS` retention, zero runtime cost, and the scope is well-defined (32 public types across 4 packages).
   
   **Scope:** `client-apis/java` — four `package-info.java` files covering `apis`, `apis.consumer`, `apis.message`, `apis.producer`.
   
   **Compatibility:** No breaking changes for Java consumers. Kotlin consumers gain compile-time nullability safety (platform types become non-null by default). JSpecify 1.0.0 as `provided` scope means no transitive dependency impact.
   
   **Assessment:**
   
   This is a valuable improvement for Kotlin interoperability, which is increasingly important as the Kotlin ecosystem grows in the JVM space.
   
   1. **`@NullMarked` on four packages** — Correct approach. JSpecify package scope is not hierarchical, so four `package-info.java` files are needed. Marking ~99 return values and parameters as non-null by default matches the actual API contract (these methods do not return null).
   
   2. **`SendReceipt.getRecallHandle()` exception** — Good catch. This is the only getter that breaks the `Optional<T>` convention. Documenting the empty-string sentinel with proper Javadoc (rather than an implementation-level comment) is the right fix. The suggestion to use `String.isEmpty()` rather than nullness checks is correct.
   
   3. **JSpecify 1.0.0 as `provided`** — Correct dependency scope. `CLASS` retention means annotations are in compiled class files for downstream consumers without requiring them to add any dependency.
   
   4. **Cross-language consideration** — This only affects the Java client-apis module. The Go/C++/C#/Rust clients have their own nullability mechanisms and are unaffected.
   
   The implementation is straightforward and low-risk. Looking forward to the PR.
   
   ---
   *Automated evaluation by github-manager*
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Enhancement] Add JSpecify NullMarked annotations to org.apache.rocketmq.client.apis [rocketmq-clients]

Posted by "RockteMQ-AI (via GitHub)" <gi...@apache.org>.
RockteMQ-AI commented on issue #1350:
URL: https://github.com/apache/rocketmq-clients/issues/1350#issuecomment-5440358038

   **Issue Evaluation**
   
   Category: enhancement | Status: **Evaluated**
   
   **Feasibility:** Feasible
   **Scope:** Java client API annotations
   **Compatibility:** Backward compatible
   
   Adding JSpecify NullMarked annotations improves null-safety for Java clients and Kotlin interop. Low-risk improvement.
   
   ---
   *Automated evaluation by github-manager*


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Enhancement] Add JSpecify NullMarked annotations to org.apache.rocketmq.client.apis [rocketmq-clients]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #1350:
URL: https://github.com/apache/rocketmq-clients/issues/1350#issuecomment-6243847603

   This issue was closed because it has been inactive for 3 days since being marked as stale.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Enhancement] Add JSpecify NullMarked annotations to org.apache.rocketmq.client.apis [rocketmq-clients]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #1350: [Enhancement] Add JSpecify NullMarked annotations to org.apache.rocketmq.client.apis
URL: https://github.com/apache/rocketmq-clients/issues/1350


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Enhancement] Add JSpecify NullMarked annotations to org.apache.rocketmq.client.apis [rocketmq-clients]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #1350:
URL: https://github.com/apache/rocketmq-clients/issues/1350#issuecomment-6159594140

   This issue is stale because it has been open for 30 days with no activity. It will be closed in 3 days if no further activity occurs.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org