You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sentry.apache.org by sr...@apache.org on 2015/09/22 16:32:29 UTC
incubator-sentry git commit: SENTRY-892: parsePath should handle
empty paths well ( Sravya Tirukkovalur, Reviewed by: Lenni Kuff and Colin Ma)
Repository: incubator-sentry
Updated Branches:
refs/heads/master 5f19d33e2 -> dd074b9fa
SENTRY-892: parsePath should handle empty paths well ( Sravya Tirukkovalur, Reviewed by: Lenni Kuff and Colin Ma)
Project: http://git-wip-us.apache.org/repos/asf/incubator-sentry/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-sentry/commit/dd074b9f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-sentry/tree/dd074b9f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-sentry/diff/dd074b9f
Branch: refs/heads/master
Commit: dd074b9fa1fc173733913ccb955c78927657595c
Parents: 5f19d33
Author: Sravya Tirukkovalur <sr...@cloudera.com>
Authored: Tue Sep 22 09:31:25 2015 -0500
Committer: Sravya Tirukkovalur <sr...@cloudera.com>
Committed: Tue Sep 22 09:31:25 2015 -0500
----------------------------------------------------------------------
.../src/main/java/org/apache/sentry/hdfs/PathsUpdate.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/dd074b9f/sentry-hdfs/sentry-hdfs-common/src/main/java/org/apache/sentry/hdfs/PathsUpdate.java
----------------------------------------------------------------------
diff --git a/sentry-hdfs/sentry-hdfs-common/src/main/java/org/apache/sentry/hdfs/PathsUpdate.java b/sentry-hdfs/sentry-hdfs-common/src/main/java/org/apache/sentry/hdfs/PathsUpdate.java
index 79019f4..8c5edd7 100644
--- a/sentry-hdfs/sentry-hdfs-common/src/main/java/org/apache/sentry/hdfs/PathsUpdate.java
+++ b/sentry-hdfs/sentry-hdfs-common/src/main/java/org/apache/sentry/hdfs/PathsUpdate.java
@@ -91,7 +91,7 @@ public class PathsUpdate implements Updateable.Update {
*
* @param path : Needs to be a HDFS location with scheme
* @return Path in the form a list containing the path tree with scheme/ authority stripped off.
- * Returns null if a non HDFS path
+ * Returns null if a non HDFS path or if path is null/empty
*/
public static List<String> parsePath(String path) {
try {
@@ -99,6 +99,8 @@ public class PathsUpdate implements Updateable.Update {
URI uri = null;
if (StringUtils.isNotEmpty(path)) {
uri = new URI(URIUtil.encodePath(path));
+ } else {
+ return null;
}
Preconditions.checkNotNull(uri.getScheme());