[
https://issues.apache.org/jira/browse/AVRO-3350?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17485606#comment-17485606
]
ASF subversion and git services commented on AVRO-3350:
-------------------------------------------------------
Commit 064a1ab945963baff282912a8f5b7e0691683d40 in avro's branch
refs/heads/branch-1.11 from Kyle Schoonover
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=064a1ab ]
AVRO-3350 Validate default enum value exists before returning. (#1500)
Co-authored-by: Kyle T. Schoonover <[email protected]>
(cherry picked from commit 8cbbe84bbf5e6fc97eee99131cee2b4df8d705b5)
> Validate that Default value is found in Enum
> --------------------------------------------
>
> Key: AVRO-3350
> URL: https://issues.apache.org/jira/browse/AVRO-3350
> Project: Apache Avro
> Issue Type: Bug
> Components: csharp
> Affects Versions: 1.11.1
> Reporter: Kyle Schoonover
> Priority: Minor
> Labels: pull-request-available
> Time Spent: 20m
> Remaining Estimate: 0h
>
> {code:java}
> if (null != Default)
> return symbolMap[Default]; {code}
> Could potentially be returning a KeyNotFoundException. It is recommended we
> validate there is something before returning it.
> {code:java}
> if (Default != null && symbolMap.TryGetValue(Default, out result))
> {
> return result;
> } {code}
> The issue currently exists in the Ordinal(string symbol) method in EnumSchema
--
This message was sent by Atlassian Jira
(v8.20.1#820001)