Repository: atlas Updated Branches: refs/heads/master a7f3e1ad3 -> c746a0505
ATLAS-2330: Updated to address unit test failure. Root cause: Change in behavior in AtlasJson. Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/c746a050 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/c746a050 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/c746a050 Branch: refs/heads/master Commit: c746a0505722adc46c19def24f2fb9c6b76fb367 Parents: a7f3e1a Author: Ashutosh Mestry <ames...@hortonworks.com> Authored: Thu Jan 11 09:39:29 2018 -0800 Committer: Ashutosh Mestry <ames...@hortonworks.com> Committed: Thu Jan 11 09:39:29 2018 -0800 ---------------------------------------------------------------------- .../java/org/apache/atlas/repository/impexp/ZipSource.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/atlas/blob/c746a050/repository/src/main/java/org/apache/atlas/repository/impexp/ZipSource.java ---------------------------------------------------------------------- diff --git a/repository/src/main/java/org/apache/atlas/repository/impexp/ZipSource.java b/repository/src/main/java/org/apache/atlas/repository/impexp/ZipSource.java index bd51d3b..ecfbd24 100644 --- a/repository/src/main/java/org/apache/atlas/repository/impexp/ZipSource.java +++ b/repository/src/main/java/org/apache/atlas/repository/impexp/ZipSource.java @@ -135,12 +135,18 @@ public class ZipSource implements EntityImportStream { } private <T> T convertFromJson(Class<T> clazz, String jsonData) throws AtlasBaseException { + T t; try { - return AtlasType.fromJson(jsonData, clazz); + t = AtlasType.fromJson(jsonData, clazz); + if(t == null) { + throw new AtlasBaseException("Error converting file to JSON."); + } } catch (Exception e) { throw new AtlasBaseException("Error converting file to JSON.", e); } + + return t; } private String getFromCache(String entryName) {