atlas-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mad...@apache.org
Subject incubator-atlas git commit: ATLAS-1572: updated notification processing to handle messages from v1 hooks
Date Mon, 27 Feb 2017 18:39:50 GMT
Repository: incubator-atlas
Updated Branches:
  refs/heads/master 9e16600c4 -> 8244f8bf9


ATLAS-1572: updated notification processing to handle messages from v1 hooks


Project: http://git-wip-us.apache.org/repos/asf/incubator-atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-atlas/commit/8244f8bf
Tree: http://git-wip-us.apache.org/repos/asf/incubator-atlas/tree/8244f8bf
Diff: http://git-wip-us.apache.org/repos/asf/incubator-atlas/diff/8244f8bf

Branch: refs/heads/master
Commit: 8244f8bf9a3a9e2bd51889cac708ef57c3188e53
Parents: 9e16600
Author: Vimal Sharma <svimal2106@apache.org>
Authored: Mon Feb 27 10:39:19 2017 -0800
Committer: Madhan Neethiraj <madhan@apache.org>
Committed: Mon Feb 27 10:39:33 2017 -0800

----------------------------------------------------------------------
 .../converters/AtlasArrayFormatConverter.java   | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/8244f8bf/repository/src/main/java/org/apache/atlas/repository/converters/AtlasArrayFormatConverter.java
----------------------------------------------------------------------
diff --git a/repository/src/main/java/org/apache/atlas/repository/converters/AtlasArrayFormatConverter.java
b/repository/src/main/java/org/apache/atlas/repository/converters/AtlasArrayFormatConverter.java
index 9e8f523..882cd1b 100644
--- a/repository/src/main/java/org/apache/atlas/repository/converters/AtlasArrayFormatConverter.java
+++ b/repository/src/main/java/org/apache/atlas/repository/converters/AtlasArrayFormatConverter.java
@@ -42,22 +42,26 @@ public class AtlasArrayFormatConverter extends AtlasAbstractFormatConverter
{
         Collection ret = null;
 
         if (v1Obj != null) {
-            if (v1Obj instanceof List) {
-                ret = new ArrayList();
-            } else if (v1Obj instanceof Set) {
+            if (v1Obj instanceof Set) {
                 ret = new LinkedHashSet();
             } else {
-                throw new AtlasBaseException(AtlasErrorCode.UNEXPECTED_TYPE, "List or Set",
-                                             v1Obj.getClass().getCanonicalName());
+                ret = new ArrayList();
             }
 
             AtlasArrayType       arrType       = (AtlasArrayType) type;
             AtlasType            elemType      = arrType.getElementType();
             AtlasFormatConverter elemConverter = converterRegistry.getConverter(elemType.getTypeCategory());
-            Collection           v1List        = (Collection) v1Obj;
 
-            for (Object v1Elem : v1List) {
-                Object convertedVal = elemConverter.fromV1ToV2(v1Elem, elemType, ctx);
+            if (v1Obj instanceof Collection) {
+                Collection v1List = (Collection) v1Obj;
+
+                for (Object v1Elem : v1List) {
+                    Object convertedVal = elemConverter.fromV1ToV2(v1Elem, elemType, ctx);
+
+                    ret.add(convertedVal);
+                }
+            } else {
+                Object convertedVal = elemConverter.fromV1ToV2(v1Obj, elemType, ctx);
 
                 ret.add(convertedVal);
             }


Mime
View raw message