This is an automated email from the ASF dual-hosted git repository.
nixon pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git
The following commit(s) were added to refs/heads/master by this push:
new 5129069 ATLAS-3201:- Fix getByGuid in AtlasTypeRegistry, doesn't
raise exception if guid invalid
5129069 is described below
commit 512906934b1907441e1648f36d18d87f91d6db82
Author: Diego Marino Monetti <[email protected]>
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 <[email protected]>
---
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);