HADOOP-11878. FileContext#fixRelativePart should check for not null for a more informative exception. (Brahma Reddy Battula via kasha)

(cherry picked from commit 2e3d83f97b)
This commit is contained in:
Karthik Kambatla 2015-07-08 11:34:34 -07:00
parent cc73f23713
commit 4227fff3c6
2 changed files with 6 additions and 0 deletions

View File

@ -221,6 +221,9 @@ Release 2.8.0 - UNRELEASED
HADOOP-12194. Support for incremental generation in the protoc plugin. HADOOP-12194. Support for incremental generation in the protoc plugin.
(wang) (wang)
HADOOP-11878. FileContext#fixRelativePart should check for not null for a
more informative exception. (Brahma Reddy Battula via kasha)
BUG FIXES BUG FIXES
HADOOP-11802: DomainSocketWatcher thread terminates sometimes after there HADOOP-11802: DomainSocketWatcher thread terminates sometimes after there

View File

@ -59,6 +59,8 @@ import org.apache.hadoop.security.UserGroupInformation;
import org.apache.hadoop.security.token.Token; import org.apache.hadoop.security.token.Token;
import org.apache.hadoop.util.ShutdownHookManager; import org.apache.hadoop.util.ShutdownHookManager;
import com.google.common.base.Preconditions;
/** /**
* The FileContext class provides an interface to the application writer for * The FileContext class provides an interface to the application writer for
* using the Hadoop file system. * using the Hadoop file system.
@ -272,6 +274,7 @@ public class FileContext {
* has been deliberately declared private. * has been deliberately declared private.
*/ */
Path fixRelativePart(Path p) { Path fixRelativePart(Path p) {
Preconditions.checkNotNull(p, "path cannot be null");
if (p.isUriPathAbsolute()) { if (p.isUriPathAbsolute()) {
return p; return p;
} else { } else {