~/talk

The Cycling Tour – Java's Fraught Relationship with Cyclic Object Graphs

Talkat Devoxx Belgium 2024 · 2024-10-07..10-11· [java]
slides:none on file

Shows five concrete failure modes: modules and class inheritance cycles are rejected at load time, but static class initialization cycles produce partially initialized fields, surprising values and NPEs; equals/hashCode/toString on cyclic object graphs cause StackOverflow or OOM; Java serialization uses an identity object table and back‑refs so direct references survive, but deserialization breaks when code relies on object state (hashCode used by collections) leading to corruption or NPE. Recommends remove heavy work from static initializers, use post‑init/DI, mark transient or use custom readObject/writeObject with validation; diagnostic flag: -Xlog:class+resolve=trace.

AI-written summary · about

  1. 0:00Introduction
  2. 1:04Graph theory basics
  3. 5:44Module cycles
  4. 6:25Class hierarchy cycles
  5. 7:49Class initialization cycles
  6. 10:40Static initialization demo
  7. 14:33Static initialization pitfalls
  8. 17:45Diagnosing initialization issues
  9. 21:13Equals and hashCode cycles
  10. 23:19Collections and cycles
  11. 26:33Serialization overview
  12. 27:16Serialization cycle problems
  13. 31:58Serialization demo
  14. 36:12Deserialization pitfalls
  15. 41:15Fixing serialization issues
  16. 44:08Summary and advice
  17. 49:27Future of serialization
~/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.