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
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
[ X ] I have performed a self-review of my code
[ X ] My code follows the style guidelines of this project
[ X ] I have commented my code, particularly in hard-to-understand areas
[ X ] I have made corresponding changes to the documentation
[ X ] My changes generate no new warnings
[ X ] I have added tests that prove my fix is effective or that my feature works
[ X ] New and existing unit tests pass locally with my changes
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