Skip to content
This repository has been archived by the owner on Aug 13, 2020. It is now read-only.

Remove SonarQube warnings #15

Merged
merged 1 commit into from
Mar 4, 2016
Merged

Remove SonarQube warnings #15

merged 1 commit into from
Mar 4, 2016

Conversation

ZeeshanGhalib
Copy link
Contributor

No description provided.


try (QueueSession session = queueConnection.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE)) {
sender.send(envelopeConverter.toMessage(envelope, session));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you only have one try with resource will the other resources be automatically closed on exceptions? - just realised this is fine after speaking with Zeeshan.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, all the resources will be closed in reverse order of the order in which they are created / listed inside the parentheses. http://tutorials.jenkov.com/java-exception-handling/try-with-resources.html#using-multiple-resources

matt-rich pushed a commit that referenced this pull request Mar 4, 2016
@matt-rich matt-rich merged commit 4817078 into master Mar 4, 2016
@matt-rich matt-rich deleted the remove-sonarqube-warnings branch March 4, 2016 15:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants