trinodb / trino

Official repository of Trino, the distributed SQL query engine for big data, formerly known as PrestoSQL (https://trino.io)
https://trino.io
Apache License 2.0
10.15k stars 2.93k forks source link

Enable more errorprone checks #4188

Open findepi opened 4 years ago

findepi commented 4 years ago

The checks are defined here: https://github.com/prestosql/presto/blob/fcb91631a655f8af7c6aeb803861d1c738f67281/pom.xml#L1424

Here's how to run the checks: https://github.com/prestosql/presto/blob/fcb91631a655f8af7c6aeb803861d1c738f67281/.github/workflows/ci.yml#L72-L73

chhsiao90 commented 4 years ago

BadInstanceof, CompareToZero, InconsistentHashCode, ObjectToString are enabled in #4289

chhsiao90 commented 4 years ago

ImmutableEnumChecker, ImmutableAnnotationChecker, Immutable, ImmutableModification were enabled in #4470

findepi commented 3 years ago

I added OptionalEquality to the list. It's apparently possible to make a mistake when refactoring the code, like here https://github.com/prestosql/presto/blob/ece62ab29bc96a723669687e17bc2eef183a2d4d/presto-base-jdbc/src/main/java/io/prestosql/plugin/jdbc/JdbcTypeHandle.java#L130