You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Jason Altekruse (JIRA)" <ji...@apache.org> on 2015/07/20 19:56:04 UTC

[jira] [Commented] (DRILL-3521) [umbrella] Review switch statements throughout codebase to add default cases where there are none

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

Jason Altekruse commented on DRILL-3521:
----------------------------------------

Taking a closer look at my example, this switch is evaluated on an Enum, so this might be the correct behavior. I will keep the bug open as I know there are other such issues elsewhere. I will hopefully be updating this issue with some examples soon.

> [umbrella] Review switch statements throughout codebase to add default cases where there are none
> -------------------------------------------------------------------------------------------------
>
>                 Key: DRILL-3521
>                 URL: https://issues.apache.org/jira/browse/DRILL-3521
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Execution - Flow
>            Reporter: Jason Altekruse
>            Assignee: Jason Altekruse
>             Fix For: 1.3.0
>
>
> There are a number of places in the code that are missing default branches on case statements. One particular instance I noticed is in OptionValue.createOption, which returns null if passed an unexpected type. This and a few other places in the code could be made a little nicer to work with if we just provided the standard behavior of throwing an exception (or a documented default value that will make sense in a few contexts).
> One additional note, in a number of places where we do have defaults, but the exception thrown is an UnsupportedOperationException with no message. DRILL-2680 discusses this problem, so this might be handled over there, but as we fill in the switch defaults we should try to avoid introducing the new problem of exceptions lacking descriptions.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)