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
- Host: GitHub
- URL: https://github.com/robinst/error-prone-unnecessary-default
- Owner: robinst
- License: mit
- Created: 2024-06-20T06:50:38.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-06-20T06:56:42.000Z (over 1 year ago)
- Last Synced: 2025-02-25T06:45:06.519Z (11 months ago)
- Language: Java
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.