feat(generator): emit ResumableUploadCallSettings on stub and service settings - #14318
feat(generator): emit ResumableUploadCallSettings on stub and service settings#14318whowes wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds support for generating ResumableUploadCallSettings in the Java GAPIC generator. It updates the settings and stub settings composers to detect resumable upload methods, generate corresponding call settings, and apply global timeout configurations from the service config. The review feedback suggests replacing !Objects.isNull with a standard null check and guarding against a potential NullPointerException when fetching retry settings.
| } | ||
|
|
||
| if (method.isResumableUpload()) { | ||
| if (!Objects.isNull(serviceConfig)) { |
There was a problem hiding this comment.
| GapicRetrySettings retrySettings = | ||
| serviceConfig | ||
| .getAllGapicRetrySettings(service) | ||
| .get(serviceConfig.getRetryParamsName(service, method)); |
There was a problem hiding this comment.
If serviceConfig.getRetryParamsName(service, method) returns null (e.g., when the method is not configured in the service config), calling .get(null) on the map returned by getAllGapicRetrySettings can throw a NullPointerException (especially if the map is a Guava ImmutableMap). Guard against this by checking if the retry params name is null first.
| GapicRetrySettings retrySettings = | |
| serviceConfig | |
| .getAllGapicRetrySettings(service) | |
| .get(serviceConfig.getRetryParamsName(service, method)); | |
| String retryParamsName = serviceConfig.getRetryParamsName(service, method); | |
| GapicRetrySettings retrySettings = retryParamsName != null | |
| ? serviceConfig.getAllGapicRetrySettings(service).get(retryParamsName) | |
| : null; |
|
|



Work in progress, not ready for review