You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by ma...@apache.org on 2015/11/13 17:46:26 UTC

[2/3] incubator-ranger git commit: RANGER-726: Fixed a potential NPE

RANGER-726: Fixed a potential NPE

Signed-off-by: Madhan Neethiraj <ma...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/incubator-ranger/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ranger/commit/427ed4a2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ranger/tree/427ed4a2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ranger/diff/427ed4a2

Branch: refs/heads/tag-policy
Commit: 427ed4a2b84139c8137becb4d06cdacbf890740d
Parents: 4db2356
Author: Abhay Kulkarni <ak...@hortonworks.com>
Authored: Thu Nov 12 13:36:58 2015 -0800
Committer: Madhan Neethiraj <ma...@apache.org>
Committed: Fri Nov 13 08:30:08 2015 -0800

----------------------------------------------------------------------
 .../ranger/tagsync/source/atlas/AtlasNotificationMapper.java   | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/427ed4a2/tagsync/src/main/java/org/apache/ranger/tagsync/source/atlas/AtlasNotificationMapper.java
----------------------------------------------------------------------
diff --git a/tagsync/src/main/java/org/apache/ranger/tagsync/source/atlas/AtlasNotificationMapper.java b/tagsync/src/main/java/org/apache/ranger/tagsync/source/atlas/AtlasNotificationMapper.java
index 15a511d..7a2422b 100644
--- a/tagsync/src/main/java/org/apache/ranger/tagsync/source/atlas/AtlasNotificationMapper.java
+++ b/tagsync/src/main/java/org/apache/ranger/tagsync/source/atlas/AtlasNotificationMapper.java
@@ -298,7 +298,7 @@ class AtlasNotificationMapper {
 		return ret;
 	}
 
-	static private String[] getQualifiedNameComponents(IReferenceableInstance entity) {
+	static private String[] getQualifiedNameComponents(IReferenceableInstance entity) throws Exception {
 		String ret[] = new String[MAX_HIERARCHY_LEVELS];
 
 		String qualifiedNameAttributeName = StringUtils.equals(entity.getTypeName(), ENTITY_TYPE_HIVE_TABLE) ?
@@ -306,6 +306,10 @@ class AtlasNotificationMapper {
 
 		String qualifiedName = getEntityAttribute(entity, qualifiedNameAttributeName, String.class);
 
+		if (StringUtils.isBlank(qualifiedName)) {
+			throw new Exception("Could not get a valid value for " + qualifiedNameAttributeName + " attribute from entity notification.");
+		}
+
 		String nameHierarchy[] = qualifiedName.split(QUALIFIED_NAME_FORMAT_DELIMITER_STRING);
 
 		int hierarchyLevels = nameHierarchy.length;