error-prone
error-prone copied to clipboard
Open source GoodTime checks
Context
Google projects like Guava have @SuppressWarnings("GoodTime") in various places (github search, sourcegraph search).
As I understand it from my time at Google, the GoodTime checks make working with time better in Java, and help devs avoid footguns. Things like:
- prefer using
java.timeover older libraries like Joda - prefer using strongly typed
InstantandDurationover weakly typedint millisorint epochSeconds - use TimeSource instead of
Instant.now()to allow testing with an externally-supplied fake clock/source - many others I'm sure
Issue
Are these GoodTime checks something that might be open sourced? I remember them fondly and wish they were running on my current codebases!