[ https://issues.apache.org/jira/browse/DRILL-3521?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jason Altekruse updated DRILL-3521: ----------------------------------- Description: 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. was: 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. 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. > [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)