ERDDAP / erddap

ERDDAP is a scientific data server that gives users a simple, consistent way to download subsets of gridded and tabular scientific datasets in common file formats and make graphs and maps. ERDDAP is a Free and Open Source (Apache and Apache-like) Java Servlet from NOAA NMFS SWFSC Environmental Research Division (ERD).
Creative Commons Zero v1.0 Universal
83 stars 58 forks source link

Ensure proper equals and hashCode implementations and enable some ErrorProne checks #175

Closed ChrisJohnNOAA closed 1 month ago

ChrisJohnNOAA commented 1 month ago

Description

This updates equals and hashCode implementations to have expected java behavior (if they are equals, the hashCodes will match). A mismatch between those could cause leaks in a hashTable (though I didn't find evidence of a leak).

This also enables several ErrorProne checks. The one with the largest impact is enforcing override annotations when a class is overriding a function.

The majority of the code changes are due to the auto formatter being applied since this is the first time many of the classes are getting touched after that was added as a pre-commit check.

Fixes # (issue)

Type of change

Code improvement to reduce error prone code (like equals/hash mismatches).

Checklist before requesting a review