You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by ni...@apache.org on 2019/05/24 12:32:14 UTC
[atlas] branch branch-1.0 updated: ATLAS-3201:- Fix getByGuid in
AtlasTypeRegistry, doesn't raise exception if guid invalid
This is an automated email from the ASF dual-hosted git repository.
nixon pushed a commit to branch branch-1.0
in repository https://gitbox.apache.org/repos/asf/atlas.git
The following commit(s) were added to refs/heads/branch-1.0 by this push:
new 794697f ATLAS-3201:- Fix getByGuid in AtlasTypeRegistry, doesn't raise exception if guid invalid
794697f is described below
commit 794697f7a598826fa2a4231a7a3a6cd07086ac44
Author: Diego Marino Monetti <dm...@gmail.com>
AuthorDate: Wed May 8 18:30:34 2019 +0200
ATLAS-3201:- Fix getByGuid in AtlasTypeRegistry, doesn't raise exception if guid invalid
Signed-off-by: nixonrodrigues <ni...@apache.org>
---
intg/src/main/java/org/apache/atlas/type/AtlasTypeRegistry.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/intg/src/main/java/org/apache/atlas/type/AtlasTypeRegistry.java b/intg/src/main/java/org/apache/atlas/type/AtlasTypeRegistry.java
index f9aa4a9..c0ac7ad 100644
--- a/intg/src/main/java/org/apache/atlas/type/AtlasTypeRegistry.java
+++ b/intg/src/main/java/org/apache/atlas/type/AtlasTypeRegistry.java
@@ -116,12 +116,14 @@ public class AtlasTypeRegistry {
return ret;
}
- public AtlasType getTypeByGuid(String guid) {
+ public AtlasType getTypeByGuid(String guid) throws AtlasBaseException {
if (LOG.isDebugEnabled()) {
LOG.debug("==> AtlasTypeRegistry.getTypeByGuid({})", guid);
}
AtlasType ret = registryData.allTypes.getTypeByGuid(guid);
+ if(ret == null)
+ throw new AtlasBaseException(AtlasErrorCode.TYPE_GUID_NOT_FOUND, guid);
if (LOG.isDebugEnabled()) {
LOG.debug("<== AtlasTypeRegistry.getTypeByGuid({}): {}", guid, ret);