~/talk

Not all equals methods are created equal

Talkat Devoxx Belgium 2017 · 2017-11-06..11-10· [testing, java]
slides:none on file

Shows concrete bugs: an IDE can generate an equals with the wrong signature (equals(Object) signature), mutable fields that change hashCode break HashSet lookups, and using getClass vs instanceof causes Liskov and mocking tools to fail. Adding state in a subclass creates symmetry/transitivity failures unless the canEqual pattern is used. Demonstrates EqualsVerifier as a one-line test that flags each specific failure (and sometimes needs manual helpers for recursive types like java.sql.Date).

AI-written summary · about

  1. 0:00Start
  2. 2:08Transitivity
  3. 3:13Three Kinds of Equals Tests in Projects
  4. 6:52Consistency
  5. 8:41Liskov Substitution Principle
  6. 13:49Transitivity Issue
  7. 18:19Make Your Equals and Hashcode Method Final
  8. 18:47Concluding
  9. 26:23How Does ecos Verifier Work with Objects That Have Custom Objects inside of Them
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.