-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Replace unambiguous of throw Throwables.propagate with definition
#70
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
Conversation
|
R: @lukecwik It also looks like there might be some poor handling of an |
In the SDK the path taken by Throwables.propagate is always statically known, and the inlined logic is more explicit and readable: - If an exception e is already a checked exception, Throwables.propagate(e) is the same as `throw new RuntimeException(e)`. - If an exception e is already a RuntimeException or Error, Throwables.propagate(e) is the same as `throw e`.
5c13f33 to
8a8a3d4
Compare
| if (currentLatch > 0) { | ||
| countDownLatches[currentLatch - 1].countDown(); | ||
| } | ||
| } catch (InterruptedException e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add Thread.currentThread().interrupt() before the throws
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. (just below the diff)
|
@kennknowles @lukecwik ping? |
|
pong |
|
LGTM |
In the SDK the path taken by
Throwables.propagateis always statically known, and the inlined logic is more explicit and readable:Throwables.propagate(e)is the same as
throw new RuntimeException(e).RuntimeExceptionorError,Throwables.propagate(e)is the same asthrow e.