An open API service indexing awesome lists of open source software.

https://github.com/robinst/error-prone-unnecessary-default

Example for reproducing a problem with error-prone's UnnecessaryDefaultInEnumSwitch
https://github.com/robinst/error-prone-unnecessary-default

Last synced: 10 months ago
JSON representation

Example for reproducing a problem with error-prone's UnnecessaryDefaultInEnumSwitch

Awesome Lists containing this project

README

          

# error-prone minimal example for UnnecessaryDefaultInEnumSwitch

Example to reproduce a problem with the
[UnnecessaryDefaultInEnumSwitch](https://errorprone.info/bugpattern/UnnecessaryDefaultInEnumSwitch)
bug pattern.

Steps to reproduce:

1. Clone this repo
2. Run `bazel build :hello`

Expected: The build should error with "Switch handles all enum values"
Actual: The build succeeds

See [Hello.java](src/main/java/example/Hello.java) for the source code.
What's interesting is that if you change it to this:

```java
case BAR -> {
}
case BAZ -> {
}
```

It does error as expected.