Program: 958
Project: 958
Buggy source:
@Override public UIWidget deserialize(JsonElement json,Type typeOfT,JsonDeserializationContext context) throws JsonParseException {
  JsonObject jsonObject=json.getAsJsonObject();
  String type=jsonObject.get("String_Node_Str").getAsString();
  ClassMetadata<? extends UIWidget,?> elementMetadata=nuiManager.getWidgetMetadataLibrary().resolve(type,ModuleContext.getContext());
  if (elementMetadata == null) {
    logger.error("String_Node_Str",type);
    return null;
  }
  String id=null;
  if (jsonObject.has("String_Node_Str")) {
    id=jsonObject.get("String_Node_Str").getAsString();
  }
  UIWidget element=elementMetadata.newInstance();
  if (id != null) {
    FieldMetadata fieldMetadata=elementMetadata.getField("String_Node_Str");
    if (fieldMetadata == null) {
      logger.warn("String_Node_Str",elementMetadata.getUri());
    }
 else {
      fieldMetadata.setValue(element,id);
    }
  }
  for (  FieldMetadata<? extends UIWidget,?> field : elementMetadata.getFields()) {
    if (jsonObject.has(field.getSerializationName())) {
      if (field.getName().equals(CONTENTS_FIELD) && UILayout.class.isAssignableFrom(elementMetadata.getType())) {
        continue;
      }
      try {
        if (List.class.isAssignableFrom(field.getType())) {
          Type contentType=ReflectionUtil.getTypeParameter(field.getField().getGenericType(),0);
          if (contentType != null) {
            List result=Lists.newArrayList();
            JsonArray list=jsonObject.getAsJsonArray(field.getSerializationName());
            for (            JsonElement item : list) {
              result.add(context.deserialize(item,contentType));
            }
            field.setValue(element,result);
          }
        }
 else {
          field.setValue(element,context.deserialize(jsonObject.get(field.getSerializationName()),field.getType()));
        }
      }
 catch (      Throwable e) {
        logger.error("String_Node_Str",field.getName(),type,e);
      }
    }
  }
  if (UILayout.class.isAssignableFrom(elementMetadata.getType())) {
    UILayout layout=(UILayout)element;
    Class<? extends LayoutHint> layoutHintType=(Class<? extends LayoutHint>)ReflectionUtil.getTypeParameter(elementMetadata.getType().getGenericSuperclass(),0);
    if (jsonObject.has(CONTENTS_FIELD)) {
      for (      JsonElement child : jsonObject.getAsJsonArray(CONTENTS_FIELD)) {
        UIWidget childElement=context.deserialize(child,UIWidget.class);
        if (childElement != null) {
          LayoutHint hint=null;
          if (child.isJsonObject()) {
            JsonObject childObject=child.getAsJsonObject();
            if (layoutHintType != null && childObject.has(LAYOUT_INFO_FIELD)) {
              hint=context.deserialize(childObject.get(LAYOUT_INFO_FIELD),layoutHintType);
            }
          }
          layout.addWidget(childElement,hint);
        }
      }
    }
  }
  return element;
}

Fixed version (ground truth):
@Override public UIWidget deserialize(JsonElement json,Type typeOfT,JsonDeserializationContext context) throws JsonParseException {
  JsonObject jsonObject=json.getAsJsonObject();
  String type=jsonObject.get("String_Node_Str").getAsString();
  ClassMetadata<? extends UIWidget,?> elementMetadata=nuiManager.getWidgetMetadataLibrary().resolve(type,ModuleContext.getContext());
  if (elementMetadata == null) {
    logger.error("String_Node_Str",type);
    return null;
  }
  String id=null;
  if (jsonObject.has("String_Node_Str")) {
    id=jsonObject.get("String_Node_Str").getAsString();
  }
  UIWidget element=elementMetadata.newInstance();
  if (id != null) {
    FieldMetadata fieldMetadata=elementMetadata.getField("String_Node_Str");
    if (fieldMetadata == null) {
      logger.warn("String_Node_Str",elementMetadata.getUri());
    }
 else {
      fieldMetadata.setValue(element,id);
    }
  }
  for (  FieldMetadata<? extends UIWidget,?> field : elementMetadata.getFields()) {
    if (jsonObject.has(field.getSerializationName())) {
      if (field.getName().equals(CONTENTS_FIELD) && UILayout.class.isAssignableFrom(elementMetadata.getType())) {
        continue;
      }
      try {
        if (List.class.isAssignableFrom(field.getType())) {
          Type contentType=ReflectionUtil.getTypeParameter(field.getField().getGenericType(),0);
          if (contentType != null) {
            List result=Lists.newArrayList();
            JsonArray list=jsonObject.getAsJsonArray(field.getSerializationName());
            for (            JsonElement item : list) {
              result.add(context.deserialize(item,contentType));
            }
            field.setValue(element,result);
          }
        }
 else {
          field.setValue(element,context.deserialize(jsonObject.get(field.getSerializationName()),field.getType()));
        }
      }
 catch (      Throwable e) {
        logger.error("String_Node_Str",field.getName(),type,e);
      }
    }
  }
  if (UILayout.class.isAssignableFrom(elementMetadata.getType())) {
    UILayout layout=(UILayout)element;
    Class<? extends LayoutHint> layoutHintType=(Class<? extends LayoutHint>)ReflectionUtil.getTypeParameter(elementMetadata.getType().getGenericSuperclass(),0);
    if (jsonObject.has(CONTENTS_FIELD)) {
      for (      JsonElement child : jsonObject.getAsJsonArray(CONTENTS_FIELD)) {
        UIWidget childElement=context.deserialize(child,UIWidget.class);
        if (childElement != null) {
          LayoutHint hint=null;
          if (child.isJsonObject()) {
            JsonObject childObject=child.getAsJsonObject();
            if (layoutHintType != null && !layoutHintType.isInterface() && !Modifier.isAbstract(layoutHintType.getModifiers()) && childObject.has(LAYOUT_INFO_FIELD)) {
              hint=context.deserialize(childObject.get(LAYOUT_INFO_FIELD),layoutHintType);
            }
          }
          layout.addWidget(childElement,hint);
        }
      }
    }
  }
  return element;
}