cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wid...@apache.org
Subject [38/50] git commit: updated refs/heads/CLOUDSTACK-8581 to 1a2e80b
Date Fri, 10 Jul 2015 10:08:33 GMT
coverity 1308118: more resources being opened only one closed on exception nothing was closed

Signed-off-by: Daan Hoogland <daan@onecht.net>


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

Branch: refs/heads/CLOUDSTACK-8581
Commit: 6376503fe338496f3936fb10c2d6d30598e07023
Parents: bcc8182
Author: Daan Hoogland <daan@onecht.net>
Authored: Tue Jul 7 12:34:10 2015 +0200
Committer: Daan Hoogland <daan@onecht.net>
Committed: Thu Jul 9 21:30:23 2015 +0200

----------------------------------------------------------------------
 .../hypervisor/xenserver/resource/CitrixResourceBase.java   | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6376503f/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
index 48e721f..71cc114 100644
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
+++ b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
@@ -5052,12 +5052,11 @@ public abstract class CitrixResourceBase implements ServerResource,
HypervisorRe
                         }
 
                         if (result && content != null && !content.isEmpty())
{
-                            try {
-                                final File file = new File(folder+"/"+fileName+".txt");
-                                final OutputStreamWriter fw = new OutputStreamWriter(new
FileOutputStream(file.getAbsoluteFile()),"UTF-8");
-                                final BufferedWriter bw = new BufferedWriter(fw);
+                            File file = new File(folder+"/"+fileName+".txt");
+                            try (OutputStreamWriter fw = new OutputStreamWriter(new FileOutputStream(file.getAbsoluteFile()),"UTF-8");
+                                 BufferedWriter bw = new BufferedWriter(fw);
+                                ) {
                                 bw.write(content);
-                                bw.close();
                                 s_logger.debug("created file: "+ file + " in folder:"+folder);
                             } catch (final IOException ex) {
                                 s_logger.debug("Failed to create file "+ ex.getMessage());


Mime
View raw message