Hacking Java
summary
Collection of concrete hacks: Lombok (AST rewrite) alters the compiler internals and reduces boilerplate but breaks debuggers and needs per-compiler fixes; AutoValue (source generation) produces immutable value classes reliably; CGLIB dynamic beans create runtime classes and proxies that work but are slow and hard to maintain; AspectJ bytecode weaving and JavaParser patches enable runtime or source-level fixes — used to patch integer pooling and string-concatenation bugs and to produce a custom Maven build pipeline. Companion examples and tests live at the bitly hackingJava GitHub project.
AI-written summary · about
chapters (16)
- 0:00Introduction
- 1:48Value objects overview
- 9:13Annotation processing basics
- 10:58Lombok deep dive
- 14:55Auto Value alternative
- 17:23Bytecode generation
- 22:22Source code generation
- 30:37Patching third-party libraries
- 35:18AspectJ for patching
- 39:38Source code patching
- 42:54Compile-time defect analysis
- 46:06Google Error Prone
- 46:49Checker Framework
- 49:21AspectJ policy enforcement
- 51:09Production use cases summary
- 52:16Q&A
related talks
43mDon't hack the JVM? ☠️💣💥
54mHot and spicy Java with Lombok. Live!
56mHot and spicy Java with Lombok. Live!
45mMaking Java more dynamic
50mRevealing the magic behind Java annotations
55mMaking Java More Dynamic
54mJava's Hidden Gems
58mModule Adoption? JDK Build Tool? Lombok? Backwards Compatibility? - Ask the Architects
