resolve non-exhaustive switch statements without defaults


bazel 0.4.5 generates a few different errors on the current code [0, 1]:
because there are non-exhaustive switch statements that don't have defaults.

In case [0] this is sort of a non-issue because there is a _different_ switch statement earlier in the code that includes a default (which rejects all other enum values with an exception), but this is fragile.
In cases like these we may want to refactor the code to remove this fragility.

In case [1] there is no previous switch statement that provides a run-time guard (AFAICT).
In cases like these we need to provide a meaningful default behavior (throwing an exception, logging, etc.).

[0] kythe/java/com/google/devtools/kythe/extractors/java/
[1] kythe/kythe/java/com/google/devtools/kythe/analyzers/java/

jrtom created this task.Via WebMar 22 2017, 10:48 AM
jrtom changed the edit policy of this Maniphest Task from "Task Author" to "Core Team (Project)".
jrtom added a subscriber: jrtom.
Herald added a subscriber: Core Team. · View Herald TranscriptVia HeraldMar 22 2017, 10:48 AM
shahms assigned this task to zarko.Via WebWed, Jun 13, 9:33 AM
shahms added a subscriber: shahms.

Bulk reassignment prior to migration, feel free to give to someone else.

shahms placed this task up for grabs.Via WebWed, Jun 13, 12:21 PM
shahms added a subscriber: zarko.

Add Comment