fix(java-sdk): Add Java timeout overload#927
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bd3a4b47dc
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| /** | ||
| * Java-friendly timeout overload using java.time.Duration. | ||
| */ | ||
| fun timeout(timeout: java.time.Duration?): Builder { |
There was a problem hiding this comment.
Make java Duration overload non-nullable
Declaring the new overload as timeout(timeout: java.time.Duration?) introduces an overload-resolution regression for Kotlin callers that previously used builder.timeout(null) to explicitly clear timeout: null now matches both Duration? and java.time.Duration?, so the call becomes ambiguous at compile time. This is a source-compatibility break introduced by this change; making the Java overload non-nullable (or giving it a distinct JVM/Kotlin name) preserves Java ergonomics without breaking existing Kotlin call sites.
Useful? React with 👍 / 👎.
|
Changed directories: sdks. 📋 Recommended labels (based on changed files):
Other available labels:
💡 Tip: Use cc @Gujiassh |
|
Thanks for the contribution and for clearly identifying the Java interop issue caused by Kotlin value-class name mangling. Considering the same problem also affects So #928 should cover this PR's intent plus the related API surfaces from #849. Appreciate the patch and the regression-test direction here. |
Summary
java.time.Durationoverload forRunCommandRequest.Builder.timeout(...)Fixes #849.
Verification
./gradlew :sandbox:test --tests com.alibaba.opensandbox.sandbox.domain.models.execd.executions.RunCommandRequestTestgit diff --check