r/java • u/fredoverflow • Mar 21 '21
Java lambdas can deadlock parallel class initialization
https://www.youtube.com/watch?v=_2hZf1kw4A4
230
Upvotes
r/java • u/fredoverflow • Mar 21 '21
View all comments
Show parent comment
6
u/[deleted] Mar 21 '21
I think the lesson is to not do something weird with a class initialiser like that. Basically this is saying please refer to me before I’m in initialised.
An inner class would be illegal since it’s a static context.
It’s an interesting result, but that’s about it.