how should section exam hashcode-equals contract?


in nutshell, hashcode contract, according java's object.hashcode():




  1. the crush formula shouldn't change unless something inspiring equals() changes

  2. equals() implies crush codes ==



let's assume seductiveness essentially permanent information objects - information never changes after they're constructed, #1 feigned hold. leaves #2: problem simply confirming equals implies crush formula ==.



obviously, can't exam each fathomable information vigilant unless set trivially small. so, best proceed section exam approaching locate common cases?



since instances category immutable, there unparalleled ways make such an object; section exam should cover possible. off tip head, opening points constructors, deserialization, constructors subclasses (which should reducible constructor problem).



[i'm going try answer possess doubt around research. quarrel smoke-stack ers acquire reserve apparatus process.]



[this convenient oo languages, i'm adding tag.]



Comments

Popular posts from this blog

list macos calm editors formula editors

how hibernate @any-related annotations?

why does floated <input> control floated component slip over too distant right ie7, nonetheless firefox?