Github user rsafonseca commented on a diff in the pull request:
https://github.com/apache/cloudstack/pull/467#discussion_r32618952
--- Diff:
plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java
---
@@ -1094,13 +1092,6 @@ private String createOVAFromMetafile(String
metafileName) throws Exception {
} catch (Exception e) {
s_logger.error("Exception while creating OVA using Metafile",
e);
throw e;
- } finally {
- if (strm != null) {
- try {
- strm.close();
--- End diff --
Nice, i was unaware of that. Thx for the link Rajani, I'll start using
try-with-resources as well :D
On Jun 17, 2015 1:51 PM, "Rajani Karuturi" <[email protected]> wrote:
> In
>
plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java
> <https://github.com/apache/cloudstack/pull/467#discussion_r32618313>:
>
> > @@ -1094,13 +1092,6 @@ private String createOVAFromMetafile(String
metafileName) throws Exception {
> > } catch (Exception e) {
> > s_logger.error("Exception while creating OVA using
Metafile", e);
> > throw e;
> > - } finally {
> > - if (strm != null) {
> > - try {
> > - strm.close();
>
> @rsafonseca <https://github.com/rsafonseca> since its a try-with-resources
> Statement
>
<http://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html>,
> it will get closed
>
> â
> Reply to this email directly or view it on GitHub
> <https://github.com/apache/cloudstack/pull/467/files#r32618313>.
>
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---