hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From szets...@apache.org
Subject svn commit: r1096023 - in /hadoop/mapreduce/branches/branch-0.22: CHANGES.txt src/tools/org/apache/hadoop/tools/HadoopArchives.java
Date Fri, 22 Apr 2011 20:31:34 GMT
Author: szetszwo
Date: Fri Apr 22 20:31:34 2011
New Revision: 1096023

URL: http://svn.apache.org/viewvc?rev=1096023&view=rev
Log:
MAPREDUCE-2317. Fix a NPE in HadoopArchives.  Contributed by Devaraj K

Modified:
    hadoop/mapreduce/branches/branch-0.22/CHANGES.txt
    hadoop/mapreduce/branches/branch-0.22/src/tools/org/apache/hadoop/tools/HadoopArchives.java

Modified: hadoop/mapreduce/branches/branch-0.22/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/branch-0.22/CHANGES.txt?rev=1096023&r1=1096022&r2=1096023&view=diff
==============================================================================
--- hadoop/mapreduce/branches/branch-0.22/CHANGES.txt (original)
+++ hadoop/mapreduce/branches/branch-0.22/CHANGES.txt Fri Apr 22 20:31:34 2011
@@ -557,6 +557,8 @@ Release 0.21.1 - Unreleased
     MAPREDUCE-1929. Allow artifacts to be published to the staging Apache Nexus
     Maven Repository. (tomwhite)
 
+    MAPREDUCE-2317. Fix a NPE in HadoopArchives.  (Devaraj K via szetszwo)
+
 Release 0.21.0 - 2010-08-13
 
   INCOMPATIBLE CHANGES

Modified: hadoop/mapreduce/branches/branch-0.22/src/tools/org/apache/hadoop/tools/HadoopArchives.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/branch-0.22/src/tools/org/apache/hadoop/tools/HadoopArchives.java?rev=1096023&r1=1096022&r2=1096023&view=diff
==============================================================================
--- hadoop/mapreduce/branches/branch-0.22/src/tools/org/apache/hadoop/tools/HadoopArchives.java
(original)
+++ hadoop/mapreduce/branches/branch-0.22/src/tools/org/apache/hadoop/tools/HadoopArchives.java
Fri Apr 22 20:31:34 2011
@@ -367,16 +367,18 @@ public class HadoopArchives implements T
         }
         else {
           Path parent = p.getParent();
-          if (allpaths.containsKey(parent.toString())) {
-            HashSet<String> children = allpaths.get(parent.toString());
-            children.add(p.getName());
-          }
-          else {
-            HashSet<String> children = new HashSet<String>();
-            children.add(p.getName());
-            allpaths.put(parent.toString(), children);
+          if (null != parent) {
+            if (allpaths.containsKey(parent.toString())) {
+              HashSet<String> children = allpaths.get(parent.toString());
+              children.add(p.getName());
+            } 
+            else {
+              HashSet<String> children = new HashSet<String>();
+              children.add(p.getName());
+              allpaths.put(parent.toString(), children);
+            }
+            parents.add(parent);
           }
-          parents.add(parent);
         }
       }
       justDirs = parents;



Mime
View raw message