-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
reuse Configuration.defaultApiClient
in no-arg Api ctors and make ref volatile (fixes issue #20633)
#20635
Conversation
…the new value is immediately visible to all other threads
…of creating new ApiClient every time
…code cleanup; no functional changes
…ls, possibly due to timezone (Locale.ROOT) of local system
…-enabled unit-test
Hi @ronreynolds, thanks for the PR! The changes look good to me. |
@martin-mfg done. sync'ed with master, generated new samples (a little shocked there were so many but i guess that's what happens when you mess with anyof, oneof, and pojo mustache files). |
thanks for the PR. can you please review the test failure when you've time? |
@wing328 it failed due to
bandwidth issue? (since it appears the download started but didn't finish). 🤔 EDIT: EDIT: |
pushed fix for missing import of ApiClient in 2 other model mustache files; verified build of petstore/native and petstore/native-async locally; this should address all the issues of which i am aware with this PR. 🤞 |
thanks for the PR, which has been merged |
fixes issue #20633
this PR changes the following (all within java:native):
Configuration.defaultApiClient
volatile
so that changes will be synced across threadsConfiguration.defaultApiClient
in no-arg ctors of*Api
classes to avoid needless creation of newApiClient
sURLEncoder.encode(..., StandardCharsets.UTF_8).replaceAll("\\+", "%20")
with calls toApiClient.urlEncode(...)
PR checklist
Commit all changed files.
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*
.IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
master
(upcoming7.x.0
minor release - breaking changes with fallbacks),8.0.x
(breaking changes without fallbacks)(is it not possible to create an alias for the java technical committee?)
@bbdouglas (2017/07) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01) @karismann (2019/03) @Zomzog (2019/04) @lwlee2608 (2019/10) @martin-mfg (2023/08)