You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by sz...@apache.org on 2014/02/26 23:14:22 UTC

svn commit: r1572297 - in /hadoop/common/branches/branch-2.4/hadoop-common-project/hadoop-common: ./ CHANGES.txt src/ src/main/java/ src/main/java/org/apache/hadoop/util/VersionInfo.java

Author: szetszwo
Date: Wed Feb 26 22:14:22 2014
New Revision: 1572297

URL: http://svn.apache.org/r1572297
Log:
svn merge -c 1572221 from branch-2 for HADOOP-10368. InputStream is not closed in VersionInfo ctor.

Modified:
    hadoop/common/branches/branch-2.4/hadoop-common-project/hadoop-common/   (props changed)
    hadoop/common/branches/branch-2.4/hadoop-common-project/hadoop-common/CHANGES.txt   (contents, props changed)
    hadoop/common/branches/branch-2.4/hadoop-common-project/hadoop-common/src/   (props changed)
    hadoop/common/branches/branch-2.4/hadoop-common-project/hadoop-common/src/main/java/   (props changed)
    hadoop/common/branches/branch-2.4/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/VersionInfo.java

Propchange: hadoop/common/branches/branch-2.4/hadoop-common-project/hadoop-common/
------------------------------------------------------------------------------
  Merged /hadoop/common/trunk/hadoop-common-project/hadoop-common:r1572220
  Merged /hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common:r1572221

Modified: hadoop/common/branches/branch-2.4/hadoop-common-project/hadoop-common/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2.4/hadoop-common-project/hadoop-common/CHANGES.txt?rev=1572297&r1=1572296&r2=1572297&view=diff
==============================================================================
--- hadoop/common/branches/branch-2.4/hadoop-common-project/hadoop-common/CHANGES.txt (original)
+++ hadoop/common/branches/branch-2.4/hadoop-common-project/hadoop-common/CHANGES.txt Wed Feb 26 22:14:22 2014
@@ -57,6 +57,9 @@ Release 2.4.0 - UNRELEASED
 
     HADOOP-10355. Fix TestLoadGenerator#testLoadGenerator. (Haohui Mai via jing9)
 
+    HADOOP-10368. InputStream is not closed in VersionInfo ctor.
+    (Tsuyoshi OZAWA via szetszwo)
+
 Release 2.3.1 - UNRELEASED
 
   INCOMPATIBLE CHANGES

Propchange: hadoop/common/branches/branch-2.4/hadoop-common-project/hadoop-common/CHANGES.txt
------------------------------------------------------------------------------
  Merged /hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt:r1572221
  Merged /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt:r1572220

Propchange: hadoop/common/branches/branch-2.4/hadoop-common-project/hadoop-common/src/
------------------------------------------------------------------------------
  Merged /hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src:r1572221
  Merged /hadoop/common/trunk/hadoop-common-project/hadoop-common/src:r1572220

Propchange: hadoop/common/branches/branch-2.4/hadoop-common-project/hadoop-common/src/main/java/
------------------------------------------------------------------------------
  Merged /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java:r1572220
  Merged /hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java:r1572221

Modified: hadoop/common/branches/branch-2.4/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/VersionInfo.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2.4/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/VersionInfo.java?rev=1572297&r1=1572296&r2=1572297&view=diff
==============================================================================
--- hadoop/common/branches/branch-2.4/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/VersionInfo.java (original)
+++ hadoop/common/branches/branch-2.4/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/VersionInfo.java Wed Feb 26 22:14:22 2014
@@ -31,6 +31,7 @@ import org.apache.hadoop.classification.
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.Properties;
+import org.apache.hadoop.io.IOUtils;
 
 /**
  * This class returns build information about Hadoop components.
@@ -45,16 +46,19 @@ public class VersionInfo {
   protected VersionInfo(String component) {
     info = new Properties();
     String versionInfoFile = component + "-version-info.properties";
+    InputStream is = null;
     try {
-      InputStream is = Thread.currentThread().getContextClassLoader()
+      is = Thread.currentThread().getContextClassLoader()
         .getResourceAsStream(versionInfoFile);
       if (is == null) {
         throw new IOException("Resource not found");
       }
       info.load(is);
     } catch (IOException ex) {
-      LogFactory.getLog(getClass()).warn("Could not read '" + 
-        versionInfoFile + "', " + ex.toString(), ex);
+      LogFactory.getLog(getClass()).warn("Could not read '" +
+          versionInfoFile + "', " + ex.toString(), ex);
+    } finally {
+      IOUtils.closeStream(is);
     }
   }