IDL-generated parse method uses string literals for field names instead of the generated constants

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Internal Code
    • None
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      The IDL-generated parser code already has StringData constants for the field names, but the parse method uses string literals directly. Seems like it should be using these constants instead.

      For example:

      constexpr StringData WriteOpTxnInfo::kStmtIdsFieldName;
      constexpr StringData WriteOpTxnInfo::kTxnNumFieldName;
      ...
              if (fieldName == "txnNum") {
                  if (ctxt.checkAndAssertType(element, NumberLong)) {
                      _txnNum = element._numberLong();
                  }
              }
              else if (fieldName == "stmtIds") {
                  std::uint32_t expectedFieldNumber{0};
      ...
      

            Assignee:
            Spencer Jackson
            Reporter:
            Kaloian Manassiev
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: