Beyond lambdas, the aftermath
summary
Shows concrete pitfalls and fixes when adopting Java 8: orElse vs orElseGet causes eagerly-evaluated side effects so swap to Supplier-based orElseGet; never expose Optional as a public input parameter because it hides invariants; a flat stream can hide a nullpointer in intermediate ops so inspect the intermediate stack frames; use reduce to assert a single result instead of findFirst when duplicates break assumptions; parallelStream+ThreadLocal fails (use explicit parameters); prefer stateless lambdas for huge performance gains; streams are late-binding — copy mutable sources.
AI-written summary · about
chapters (5)
- 0:00Start
- 6:42Avoid a Nullpointerexception
- 9:53Stack Traces
- 23:50Functional Interface
- 31:57How Would You Simulate Normal Ordering
related talks
49mJava 8: the good, the bad and the ugly
47mThe Dark Side of Java 8 - Lessons Learned
01h 05mJava 8: The Good, the Bad and the Ugly
57mTen Common mistakes made in Functional Java
49mTen Common Mistakes Made in Functional Java 1
32mThe Dark Side of Java 8
01h 50mFree Your Lambdas
01h 07mJava SE: Lambdas, Streams & Future Directions
