cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ko...@apache.org
Subject [01/11] git commit: updated refs/heads/master to 31db58f
Date Sun, 23 Nov 2014 19:49:09 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 71bb436c8 -> 31db58f72


Stream handling simplification in PropertiesUtil

- use resource block instead of finally block

Signed-off-by: Laszlo Hornyak <laszlo.hornyak@gmail.com>


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

Branch: refs/heads/master
Commit: ca9dd457f974e10ee1e92e0363425b57a3a8513f
Parents: 71bb436
Author: Laszlo Hornyak <laszlo.hornyak@gmail.com>
Authored: Wed Feb 26 21:40:11 2014 +0100
Committer: Laszlo Hornyak <laszlo.hornyak@gmail.com>
Committed: Sun Nov 23 19:48:55 2014 +0100

----------------------------------------------------------------------
 utils/src/com/cloud/utils/PropertiesUtil.java | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ca9dd457/utils/src/com/cloud/utils/PropertiesUtil.java
----------------------------------------------------------------------
diff --git a/utils/src/com/cloud/utils/PropertiesUtil.java b/utils/src/com/cloud/utils/PropertiesUtil.java
index 3b1070c..608ef09 100755
--- a/utils/src/com/cloud/utils/PropertiesUtil.java
+++ b/utils/src/com/cloud/utils/PropertiesUtil.java
@@ -168,12 +168,11 @@ public class PropertiesUtil {
      * @param file  the file to load from
      * @throws IOException
      */
-    public static void loadFromFile(Properties properties, File file) throws IOException
{
-        InputStream stream = new FileInputStream(file);
-        try {
+    public static void loadFromFile(final Properties properties, final File file)
+            throws IOException {
+        try (final InputStream stream = new FileInputStream(file)) {
             properties.load(stream);
-        } finally {
-            IOUtils.closeQuietly(stream);
         }
     }
+
 }


Mime
View raw message