Commit 8244f8bf by Vimal Sharma Committed by Madhan Neethiraj

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

parent 9e16600c
......@@ -42,18 +42,17 @@ 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());
if (v1Obj instanceof Collection) {
Collection v1List = (Collection) v1Obj;
for (Object v1Elem : v1List) {
......@@ -61,6 +60,11 @@ public class AtlasArrayFormatConverter extends AtlasAbstractFormatConverter {
ret.add(convertedVal);
}
} else {
Object convertedVal = elemConverter.fromV1ToV2(v1Obj, elemType, ctx);
ret.add(convertedVal);
}
}
return ret;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment