bitcoinj/bitcoinj — pull request #65 by qertoip (2014-05-24 20:32:39+00:00)
Title: Improved consistency and formal correctness of existing equals methods

In most cases these changes probably won't have any observable effect. However, the patch aims to establish a better practice and consistency in the tricky subject of objects equality.

Improved consistency and formal correctness of all existing .equals methods to meet IntelliJ's convention.

* added null handling so equals methods return false for null argument
* replaced instanceof with getClass to force strict type equality
* added @Override for equals and hashCode where missing
* minor refactorings in equals methods to simplify and improve consistency
* added missing hashCode for ListMessage based on equals definition

Things that HAVE NOT changed:

* set of attributes used for equality checking
* hashCode calculation (except for added hashCode in ListMessage)
* correlation between equals and hashCode
* no new equals methods added