From 8feb26f116b8255853224a74aedb479b9d11b6ae Mon Sep 17 00:00:00 2001 From: Vinod Kumar Vavilapalli Date: Mon, 9 Jan 2012 21:52:53 +0000 Subject: [PATCH] HADOOP-7963. Fix ViewFS to catch a null canonical service-name and pass tests TestViewFileSystem* (Siddharth Seth via vinodkv) git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1229379 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-common-project/hadoop-common/CHANGES.txt | 3 +++ .../main/java/org/apache/hadoop/fs/viewfs/ViewFileSystem.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 3b5e3f1c090..f787e9e48ed 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -263,6 +263,9 @@ Release 0.23.1 - Unreleased HADOOP-7936. There's a Hoop README in the root dir of the tarball. (tucu) + HADOOP-7963. Fix ViewFS to catch a null canonical service-name and pass + tests TestViewFileSystem* (Siddharth Seth via vinodkv) + Release 0.23.0 - 2011-11-01 INCOMPATIBLE CHANGES diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFileSystem.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFileSystem.java index c1e290c012e..0778e7f9eff 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFileSystem.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFileSystem.java @@ -514,7 +514,7 @@ public List> getDelegationTokens(String renewer, for (int i = 0; i < mountPoints.size(); ++i) { String serviceName = mountPoints.get(i).target.targetFileSystem.getCanonicalServiceName(); - if (seenServiceNames.contains(serviceName)) { + if (serviceName == null || seenServiceNames.contains(serviceName)) { continue; } seenServiceNames.add(serviceName);