Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Re-interrupt the thread in the generated code #4382

Merged
merged 2 commits into from
Nov 13, 2019

Conversation

feliksik
Copy link
Contributor

@feliksik feliksik commented Nov 5, 2019

Otherwise the client has to check for the type (InterruptedException) of the cause of the thrown exception.

Fixes #4380

  • Read the contribution guidelines.
  • If contributing template-only or documentation-only changes which will change sample output, build the project before.
  • Run the shell script(s) under ./bin/ (or Windows batch scripts under.\bin\windows) to update Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit, and these must match the expectations made by your contribution. You only need to run ./bin/{LANG}-petstore.sh, ./bin/openapi3/{LANG}-petstore.sh if updating the code or mustache templates for a language ({LANG}) (e.g. php, ruby, python, etc).
  • File the PR against the correct branch: master, 4.3.x, 5.0.x. Default: master.
  • Copy the technical committee to review the pull request if your PR is targeting a particular programming language.

Note that I didn't commit the output of running the ./bin/ scripts... it seemed to create a much larger diff than I expected, that I'm not sure it's doing the right thing.

Tech-committee for java: @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)

…as to check for

the type of the cause of the thrown exception.
@wing328
Copy link
Member

wing328 commented Nov 7, 2019

Thanks for the PR but your commit (as shown in the Commits tab) is not linked to your Github account, which means this PR won't count as your contribution in https://github.com/OpenAPITools/openapi-generator/graphs/contributors.

Let me know if you need help fixing it.

Ref: https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-can-i-update-commits-that-are-not-linked-to-my-github-account

@wing328
Copy link
Member

wing328 commented Nov 12, 2019

Please instead run ./bin/java-petstore-all.sh to update the Java samples.

@wing328 wing328 added this to the 4.2.1 milestone Nov 12, 2019
@bbdouglas
Copy link
Contributor

Looks good.

I'll admit I had not known about the need to re-interrupt the thread when catching an InterruptedException, but reading about Java Thread Primitives makes it seem like this is exactly what we need to do.

Thanks for putting this together!

@wing328
Copy link
Member

wing328 commented Nov 13, 2019

Updated samples via bb86345. All tests passed.

@wing328 wing328 merged commit 440e3f3 into OpenAPITools:master Nov 13, 2019
@wing328
Copy link
Member

wing328 commented Nov 13, 2019

@feliksik please add your company email address as a secondary email address to your Github account so that your commit will be linked correctly to your Github account.

@feliksik
Copy link
Contributor Author

@wing328 ah thanks for pointing this out; I should have used my private email address, but that's ok.

@wing328
Copy link
Member

wing328 commented Nov 15, 2019

@feliksik thanks for the PR, which has been included in the v4.2.1 release: https://twitter.com/oas_generator/status/1195339336922759168

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] The interrupt() flag is not restored for the caught RuntimeException.
3 participants