Java's Cyclic Object Graphs Challenges

  Рет қаралды 4,249

Java

Java

Күн бұрын

Пікірлер: 11
@claudemartin5907
@claudemartin5907 4 күн бұрын
Those videos are great but what is that background image? It gives me nightmares.
@onebeartoe
@onebeartoe 3 күн бұрын
Thanks, I've only seen this a very few times. But I appreciate the insight into what the heck is going on when it happens.
@BrettKail
@BrettKail 3 күн бұрын
Not that it matters, but should Deser2.testBox be box2.set.contains(box2)?
@SourabhBhat
@SourabhBhat 5 күн бұрын
Very informative talk. Thank you!
@jcsahnwaldt
@jcsahnwaldt 4 күн бұрын
Fun stuff! Regarding toString() 25:20: There are some toString() methods in the JDK that try to handle cyclic object graphs gracefully. For example, AbstractCollection.toString() and AbstractMap.toString() check whether the current collection or map directly contains itself and append "(this Collection)" or "(this Map)" to the string (instead of calling toString() recursively). But this is a "best effort" that only works for cycles of length one. If you have list A that contains list B which in turn contains list A, calling toString() on either of them will crash. 🙂 Arrays.deepToString() goes one step further and actually uses a HashSet to remember the arrays it has seen and appends "[...]" to the string for an array that is contained in itself in a cycle of any length. But of course, these attemts can't really solve the problems Stuart describes. For example, Arrays.deepEquals() and Arrays.deepHashCode() still crash with a StackOverflowError when called with cyclic arrays. (Well, deepEquals() will work for certain cyclic arrays, but in general...)
@PietervandenHombergh
@PietervandenHombergh 5 күн бұрын
I have been telling my students that cycles are to be avoided, as the devil avoids holy water.
@ZeZeBatata69
@ZeZeBatata69 4 күн бұрын
Don't cargo cult on your students too much. The real lessons will happen in their own professional life.
@jimofl
@jimofl 3 күн бұрын
As Java inevitably continues to move towards FP, naturally occurring cyclic graphs will diminish in a strong correlation to an increase in defaulting to immutability.
@delanym
@delanym 5 күн бұрын
I was hoping for discussion of package cycles. It seems modules are now doing what packages should've done initially?
@gsestream
@gsestream 5 күн бұрын
why do things so complex, you actually must know what you are doing, not just random code features
Serialization - A New Hope
50:53
Java
Рет қаралды 9 М.
啊?就这么水灵灵的穿上了?
00:18
一航1
Рет қаралды 67 МЛН
Workshop on AI and API | Hackathon - United Group Presents BUET CSE Fest 2024
2:01:43
Loom - Where Are We? #JVMLS
46:26
Java
Рет қаралды 7 М.
Valhalla - Where Are We? by Brian Goetz
52:07
Devoxx
Рет қаралды 5 М.
Microservices are Technical Debt
31:59
NeetCodeIO
Рет қаралды 541 М.
Java Performance Update 2024 by Per Minborg
52:56
Devoxx
Рет қаралды 713
Intro to Java Programming - Course for Absolute Beginners
3:48:25
freeCodeCamp.org
Рет қаралды 3,4 МЛН
The Tragedy of systemd
47:18
linux.conf.au
Рет қаралды 1,1 МЛН
啊?就这么水灵灵的穿上了?
00:18
一航1
Рет қаралды 67 МЛН