Bug - equals() methods overload instead of override Object.equals()
Java library to remove Object/Relation Impedance
Brought to you by:
gregorydgraham
Some implementation of equals() methods are implemented as equals(SomeObjectType) instead of equals(Object). Thus they overload Object.equals(Object) instead of overriding it, and consequently strange behaviour is occurring.
Known cases:
QueryableDatatype.equals(QueryableDatatype)
DBOperator.equals(DBOperator)
I've committed nz.co.gregs.dbvolution.datatypes.DBIntegerTest showing a bug whereby DBInteger.equals() doesn't work correctly. The failing test case is @Ignore'd at the moment.
"@Override" annotation should be added to all equals() methods throughout DBv codebase to avoid this.
Anonymous
Well spotted and excellent write-up.
This is obviously not something I have done before but it's definitely a valid operation.
I've changed all the equals(*) methods to equals(Object)