You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sentry.apache.org by sd...@apache.org on 2015/11/05 02:44:40 UTC

[12/25] incubator-sentry git commit: SENTRY-892: parsePath should handle empty paths well ( Sravya Tirukkovalur, Reviewed by: Lenni Kuff and Colin Ma)

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/45b28a77
Tree: http://git-wip-us.apache.org/repos/asf/incubator-sentry/tree/45b28a77
Diff: http://git-wip-us.apache.org/repos/asf/incubator-sentry/diff/45b28a77

Branch: refs/heads/hive_plugin_v2
Commit: 45b28a775b646f58e357c7fcdfa248fd33967406
Parents: e8723d0
Author: Sravya Tirukkovalur <sr...@cloudera.com>
Authored: Tue Sep 22 09:31:25 2015 -0500
Committer: Sun Dapeng <sd...@apache.org>
Committed: Mon Nov 2 16:36:30 2015 +0800

----------------------------------------------------------------------
 .../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/45b28a77/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());