Those videos are great but what is that background image? It gives me nightmares.
@onebeartoe3 күн бұрын
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.
@BrettKail3 күн бұрын
Not that it matters, but should Deser2.testBox be box2.set.contains(box2)?
@SourabhBhat5 күн бұрын
Very informative talk. Thank you!
@jcsahnwaldt4 күн бұрын
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...)
@PietervandenHombergh5 күн бұрын
I have been telling my students that cycles are to be avoided, as the devil avoids holy water.
@ZeZeBatata694 күн бұрын
Don't cargo cult on your students too much. The real lessons will happen in their own professional life.
@jimofl3 күн бұрын
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.
@delanym5 күн бұрын
I was hoping for discussion of package cycles. It seems modules are now doing what packages should've done initially?
@gsestream5 күн бұрын
why do things so complex, you actually must know what you are doing, not just random code features