[ 
https://issues.apache.org/jira/browse/AVRO-3350?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17485605#comment-17485605
 ] 

ASF subversion and git services commented on AVRO-3350:
-------------------------------------------------------

Commit 8cbbe84bbf5e6fc97eee99131cee2b4df8d705b5 in avro's branch 
refs/heads/master from Kyle Schoonover
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=8cbbe84 ]

AVRO-3350 Validate default enum value exists before returning. (#1500)

Co-authored-by: Kyle T. Schoonover <kyle.t.schoono...@nordstrom.com>

> 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: 10m
>  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)

Reply via email to