sulky icon indicating copy to clipboard operation
sulky copied to clipboard

fix equals using getClass() instead of instanceof.

Open bmarwell opened this issue 5 years ago • 0 comments

Probably unwanted getClass() in the equals method. getClass() should only be used for proxiable objects, like JPA’s entity classes (e.g. implemented by hibernate, eclipselink, etc). Every other class should not add fields and thus must comply to the java spec which forbids mutation by adding fields. Thus, the subclass must comply to using equals with the instanceof keyword.

bmarwell avatar Aug 31 '20 07:08 bmarwell