kirancodes.me
To Proof Maintenance & Beyond!

JEqualityGen: generating equality and hashing methods

Neville Grech, Julian Rathke, Bernd Fischer

Abstract

Manually implementing equals (for object comparisons) and hashCode (for object hashing) methods in large software projects is tedious and error-prone. This is due to many special cases, such as field shadowing, comparison between different types, or cyclic object graphs. Here, we present JEqualityGen, a source code generator that automatically derives implementations of these methods.

Related papers