hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From z..@apache.org
Subject [26/50] [abbrv] hadoop git commit: HADOOP-11500. InputStream is left unclosed in ApplicationClassLoader. Contributed by Ted Yu.
Date Mon, 26 Jan 2015 17:44:41 GMT
HADOOP-11500. InputStream is left unclosed in ApplicationClassLoader. Contributed by Ted Yu.


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

Branch: refs/heads/HDFS-EC
Commit: 3f90fca19117ed9d59391f23a30140bd4ff09f98
Parents: ea85ae4
Author: Tsuyoshi Ozawa <ozawa@apache.org>
Authored: Fri Jan 23 00:50:19 2015 +0900
Committer: Zhe Zhang <zhz@apache.org>
Committed: Mon Jan 26 09:43:28 2015 -0800

----------------------------------------------------------------------
 hadoop-common-project/hadoop-common/CHANGES.txt                | 3 +++
 .../java/org/apache/hadoop/util/ApplicationClassLoader.java    | 6 ++----
 2 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/3f90fca1/hadoop-common-project/hadoop-common/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt
index eb9015c..aaa7041 100644
--- a/hadoop-common-project/hadoop-common/CHANGES.txt
+++ b/hadoop-common-project/hadoop-common/CHANGES.txt
@@ -744,6 +744,9 @@ Release 2.7.0 - UNRELEASED
     HADOOP-11209. Configuration#updatingResource/finalParameters are not
     thread-safe. (Varun Saxena via ozawa)
 
+    HADOOP-11500. InputStream is left unclosed in ApplicationClassLoader.
+    (Ted Yu via ozawa)
+
 Release 2.6.0 - 2014-11-18
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/3f90fca1/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/ApplicationClassLoader.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/ApplicationClassLoader.java
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/ApplicationClassLoader.java
index 9f16b61..6d37c28 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/ApplicationClassLoader.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/ApplicationClassLoader.java
@@ -67,10 +67,8 @@ public class ApplicationClassLoader extends URLClassLoader {
   };
 
   static {
-    InputStream is = null;
-    try {
-      is = ApplicationClassLoader.class.getClassLoader().
-          getResourceAsStream(PROPERTIES_FILE);
+    try (InputStream is = ApplicationClassLoader.class.getClassLoader()
+        .getResourceAsStream(PROPERTIES_FILE);) {
       if (is == null) {
         throw new ExceptionInInitializerError("properties file " +
             PROPERTIES_FILE + " is not found");


Mime
View raw message