void main Rodrigo Graciano
summary
A Java 8 conference app (50 sessions, 50 speakers, ~1,000 attendees) gets ported to Java 22 using Maven and IntelliJ, with Faker seeding data and ThreadLocalRandom for raffles; the build flips to --enable-preview to try string templates (Java 22 only) and other previews. Concrete changes: replace verbose DTOs with records, use sealed classes and pattern‑matching switch, apply var and text blocks, simplify switch yields and formatting. The demo runs and prints improved NPE diagnostics and cleaner outputs; code and examples live on GitHub.
AI-written summary · about
chapters (35)
- 0:00Introduction to refactoring
- 1:04Simplifying Hello World in Java 21
- 4:46Java 21 features overview
- 5:09Conference app project overview
- 6:53Java 8 and Java 22 modules
- 8:57Faker library for random data
- 9:39Application output demonstration
- 10:00Updating Maven compiler settings
- 11:02Fix Me Zero in Maven POM
- 12:48Preview features in Java
- 14:13IDE and Maven project sync
- 15:58Removing Autoboxing in Java
- 17:01Null pointer exceptions in Java 14+
- 18:24Introduction to VAR keyword
- 20:57VAR caveats and best practices
- 22:41Switch expressions for payment types
- 24:49Handling complex switch expressions
- 26:33Text blocks for readable strings
- 29:44Text block formatting rules
- 31:50Refactoring raffle method with pattern matching
- 34:18Pattern matching with instanceof
- 36:05Introduction to Java Records
- 38:12Records for immutable data
- 39:58Records with collections and streams
- 41:24Null pointer fixes with Records
- 42:28Sealed classes for controlled inheritance
- 46:41Sealed class hierarchy rules
- 48:51Sealed interfaces and records
- 49:31Pattern matching for deconstruction
- 51:18Underscore for unused variables
- 52:03String templates introduction
- 53:52String template interpolation
- 54:39Raw string templates with method calls
- 55:42String formatting with templates
- 57:13Simplified main method in Java
