You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by da...@apache.org on 2015/06/17 12:41:09 UTC

git commit: updated refs/heads/master to 0952580

Repository: cloudstack
Updated Branches:
  refs/heads/master 6da6c5f76 -> 095258009


findbugs: try-with-resource to circumvent not handling an exception on
close

Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/09525800
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/09525800
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/09525800

Branch: refs/heads/master
Commit: 095258009685442cfe096a7c029259b0b9ee822c
Parents: 6da6c5f
Author: Daan Hoogland <da...@gmail.com>
Authored: Wed Jun 17 12:41:04 2015 +0200
Committer: Daan Hoogland <da...@gmail.com>
Committed: Wed Jun 17 12:41:04 2015 +0200

----------------------------------------------------------------------
 .../vmware/manager/VmwareStorageManagerImpl.java         | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/09525800/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java
index 0bf8d99..84f7fc0 100644
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java
@@ -1040,11 +1040,9 @@ public class VmwareStorageManagerImpl implements VmwareStorageManager {
     private String createOVAFromMetafile(String metafileName) throws Exception {
         File ova_metafile = new File(metafileName);
         Properties props = null;
-        FileInputStream strm = null;
         String ovaFileName = "";
         s_logger.info("Creating OVA using MetaFile: " + metafileName);
-        try {
-            strm = new FileInputStream(ova_metafile);
+        try (FileInputStream strm = new FileInputStream(ova_metafile);) {
 
             s_logger.info("loading properties from ova meta file: " + metafileName);
             props = new Properties();
@@ -1094,13 +1092,6 @@ public class VmwareStorageManagerImpl implements VmwareStorageManager {
         } catch (Exception e) {
             s_logger.error("Exception while creating OVA using Metafile", e);
             throw e;
-        } finally {
-            if (strm != null) {
-                try {
-                    strm.close();
-                } catch (Exception e) {
-                }
-            }
         }
 
     }