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: 22 days 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 (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-06-29T23:52:02.000Z (12 months ago)
- Last Synced: 2026-01-26T16:26:27.277Z (5 months ago)
- Language: Java
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
> [!NOTE]
> Has been reported and fixed here: https://github.com/google/error-prone/issues/4443
### 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.