HDFS-9257. improve error message for "Absolute path required" in INode.java to contain the rejected path. Contributed by Marcell Szabo

(cherry picked from commit 52ac73f344)
This commit is contained in:
Harsh J 2015-10-16 17:12:35 +02:00
parent 2862057f11
commit 76cfd833f3
2 changed files with 5 additions and 1 deletions

View File

@ -16,6 +16,9 @@ Release 2.8.0 - UNRELEASED
IMPROVEMENTS IMPROVEMENTS
HDFS-9257. improve error message for "Absolute path required" in INode.java
to contain the rejected path (Marcell Szabo via harsh)
HDFS-2390. dfsadmin -setBalancerBandwidth does not validate -ve value HDFS-2390. dfsadmin -setBalancerBandwidth does not validate -ve value
(Gautam Gopalakrishnan via harsh) (Gautam Gopalakrishnan via harsh)

View File

@ -748,7 +748,8 @@ public abstract class INode implements INodeAttributes, Diff.Element<byte[]> {
*/ */
public static String[] getPathNames(String path) { public static String[] getPathNames(String path) {
if (path == null || !path.startsWith(Path.SEPARATOR)) { if (path == null || !path.startsWith(Path.SEPARATOR)) {
throw new AssertionError("Absolute path required"); throw new AssertionError("Absolute path required, but got '"
+ path + "'");
} }
return StringUtils.split(path, Path.SEPARATOR_CHAR); return StringUtils.split(path, Path.SEPARATOR_CHAR);
} }