Program: 28647
Project: 28647
Buggy source:
/** 
 * Starts recursively parsing the given jsonObject.
 * @param context               Represents the context of the parsing.
 * @param parent                The parent view group under which the view being created has to beadded as a child.
 * @param currentViewJsonObject The jsonObject which represents the current node which is getting parsed.
 * @param existingView          A view which needs to be used instead of creating a new one. Pass nullfor first pass.
 * @param childIndex            index of child inside its parent view
 * @return The {@link com.flipkart.layoutengine.view.ProteusView} that was built.
 */
protected ProteusView buildImpl(final ParserContext context,final ViewGroup parent,final JsonObject currentViewJsonObject,View existingView,final int childIndex){
  JsonElement viewTypeElement=currentViewJsonObject.get(TYPE);
  String viewType;
  if (viewTypeElement != null) {
    viewType=viewTypeElement.getAsString();
  }
 else {
    Log.e(TAG,"String_Node_Str");
    return null;
  }
  LayoutHandler<View> handler=layoutHandlers.get(viewType);
  if (handler == null) {
    return onUnknownViewEncountered(context,viewType,parent,currentViewJsonObject,childIndex);
  }
  final View createdView;
  if (existingView == null) {
    createdView=createView(context,parent,handler,currentViewJsonObject);
    handler.setupView(parent,createdView);
  }
 else {
    createdView=existingView;
  }
  ProteusView proteusViewToReturn=createProteusViewToReturn(createdView);
  prepareView(proteusViewToReturn,context.getDataProvider());
  for (  Map.Entry<String,JsonElement> entry : currentViewJsonObject.entrySet()) {
    if (TYPE.equals(entry.getKey()) || CHILDREN.equals(entry.getKey()) || CHILD_TYPE.equals(entry.getKey())) {
      continue;
    }
    JsonElement jsonDataValue=entry.getValue();
    String attributeName=entry.getKey();
    boolean handled=handleAttribute(handler,context,attributeName,currentViewJsonObject,jsonDataValue,proteusViewToReturn,parent,childIndex);
    if (!handled) {
      onUnknownAttributeEncountered(context,attributeName,jsonDataValue,currentViewJsonObject,createdView,childIndex);
    }
  }
  JsonElement childViewElement=currentViewJsonObject.get(CHILD_TYPE);
  JsonElement childrenElement=currentViewJsonObject.get(CHILDREN);
  JsonArray children=null;
  if (childrenElement != null) {
    children=parseChildren(handler,context,childrenElement,childIndex);
  }
  if (children != null && children.size() > 0) {
    ViewGroup selfViewGroup=(ViewGroup)createdView;
    List<ProteusView> childrenToAdd=new ArrayList<>();
    for (int i=0; i < children.size(); i++) {
      JsonObject childObject=children.get(i).getAsJsonObject();
      if (childViewElement != null) {
        childObject.add(TYPE,childViewElement);
      }
      ProteusView childView=buildImpl(context,selfViewGroup,childObject,null,i);
      childrenToAdd.add(childView);
    }
    if (childrenToAdd.size() > 0) {
      handler.addChildren(context,proteusViewToReturn,childrenToAdd,currentViewJsonObject);
    }
  }
  return proteusViewToReturn;
}

Fixed version (ground truth):
/** 
 * Starts recursively parsing the given jsonObject.
 * @param context               Represents the context of the parsing.
 * @param parent                The parent view group under which the view being created has to beadded as a child.
 * @param currentViewJsonObject The jsonObject which represents the current node which is getting parsed.
 * @param existingView          A view which needs to be used instead of creating a new one. Pass nullfor first pass.
 * @param childIndex            index of child inside its parent view
 * @return The {@link com.flipkart.layoutengine.view.ProteusView} that was built.
 */
protected ProteusView buildImpl(final ParserContext context,final ViewGroup parent,final JsonObject currentViewJsonObject,View existingView,final int childIndex){
  JsonElement viewTypeElement=currentViewJsonObject.get(TYPE);
  String viewType;
  if (viewTypeElement != null) {
    viewType=viewTypeElement.getAsString();
  }
 else {
    Log.e(TAG,"String_Node_Str");
    return null;
  }
  LayoutHandler<View> handler=layoutHandlers.get(viewType);
  if (handler == null) {
    return onUnknownViewEncountered(context,viewType,parent,currentViewJsonObject,childIndex);
  }
  final View createdView;
  if (existingView == null) {
    createdView=createView(context,parent,handler,currentViewJsonObject);
    handler.setupView(parent,createdView);
  }
 else {
    createdView=existingView;
  }
  ProteusView proteusViewToReturn=createProteusViewToReturn(createdView);
  prepareView(proteusViewToReturn,context);
  for (  Map.Entry<String,JsonElement> entry : currentViewJsonObject.entrySet()) {
    if (TYPE.equals(entry.getKey()) || CHILDREN.equals(entry.getKey()) || CHILD_TYPE.equals(entry.getKey())) {
      continue;
    }
    JsonElement jsonDataValue=entry.getValue();
    String attributeName=entry.getKey();
    boolean handled=handleAttribute(handler,context,attributeName,currentViewJsonObject,jsonDataValue,proteusViewToReturn,parent,childIndex);
    if (!handled) {
      onUnknownAttributeEncountered(context,attributeName,jsonDataValue,currentViewJsonObject,createdView,childIndex);
    }
  }
  JsonElement childViewElement=currentViewJsonObject.get(CHILD_TYPE);
  JsonElement childrenElement=currentViewJsonObject.get(CHILDREN);
  JsonArray children=null;
  if (childrenElement != null) {
    children=parseChildren(handler,context,childrenElement,childIndex);
  }
  if (children != null && children.size() > 0) {
    ViewGroup selfViewGroup=(ViewGroup)createdView;
    List<ProteusView> childrenToAdd=new ArrayList<>();
    for (int i=0; i < children.size(); i++) {
      JsonObject childObject=children.get(i).getAsJsonObject();
      if (childViewElement != null) {
        childObject.add(TYPE,childViewElement);
      }
      ProteusView childView=buildImpl(context,selfViewGroup,childObject,null,i);
      childrenToAdd.add(childView);
    }
    if (childrenToAdd.size() > 0) {
      handler.addChildren(context,proteusViewToReturn,childrenToAdd,currentViewJsonObject);
    }
  }
  return proteusViewToReturn;
}