Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-3350

Validate that Default value is found in Enum

    XMLWordPrintableJSON

Details

    Description

      if (null != Default)
      return symbolMap[Default]; 

      Could potentially be returning a KeyNotFoundException. It is recommended we validate there is something before returning it.

      if (Default != null && symbolMap.TryGetValue(Default, out result))
      {
          return result;
      } 

      The issue currently exists in the Ordinal(string symbol) method in EnumSchema

      Attachments

        Issue Links

          Activity

            People

              KSchoonover Kyle Schoonover
              KSchoonover Kyle Schoonover
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h