commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject [1/2] commons-scxml git commit: SCXML-254 replace deprecated IOUtils.closeQuietly(InputStream) with try-with-resources block
Date Sun, 10 Dec 2017 00:44:57 GMT
Repository: commons-scxml
Updated Branches:
  refs/heads/master 35e75829e -> a61c3c544


SCXML-254 replace deprecated IOUtils.closeQuietly(InputStream) with try-with-resources block


Project: http://git-wip-us.apache.org/repos/asf/commons-scxml/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-scxml/commit/08233bfb
Tree: http://git-wip-us.apache.org/repos/asf/commons-scxml/tree/08233bfb
Diff: http://git-wip-us.apache.org/repos/asf/commons-scxml/diff/08233bfb

Branch: refs/heads/master
Commit: 08233bfb9c8f554fa7b236d3dc7bd622d0ce154e
Parents: 35e7582
Author: Ate Douma <ate@apache.org>
Authored: Sun Dec 10 01:23:36 2017 +0100
Committer: Ate Douma <ate@apache.org>
Committed: Sun Dec 10 01:23:36 2017 +0100

----------------------------------------------------------------------
 src/main/java/org/apache/commons/scxml2/io/ContentParser.java | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-scxml/blob/08233bfb/src/main/java/org/apache/commons/scxml2/io/ContentParser.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/scxml2/io/ContentParser.java b/src/main/java/org/apache/commons/scxml2/io/ContentParser.java
index eb044eb..e3ae09d 100644
--- a/src/main/java/org/apache/commons/scxml2/io/ContentParser.java
+++ b/src/main/java/org/apache/commons/scxml2/io/ContentParser.java
@@ -204,14 +204,9 @@ public class ContentParser {
      * @throws IOException In case of loading or parsing exceptions
      */
     public Object parseResource(final String resourceURL) throws IOException {
-        InputStream in = null;
-        try {
-            in = new URL(resourceURL).openStream();
+        try (InputStream in = new URL(resourceURL).openStream()) {
             String content = IOUtils.toString(in, "UTF-8");
             return parseContent(content);
         }
-        finally {
-            IOUtils.closeQuietly(in);
-        }
     }
 }


Mime
View raw message