A New Model for Java Object Initialization
Java Java
183K subscribers
9,950 views
273

 Published On Sep 1, 2024

Presented by Dan Smith - Senior Developer (Java Platform Group - Oracle) during the JVM Language Summit (August 2024 - Santa Clara, CA).

Improving Field Initialization
This video shows how we can co-evolve the Java language, JVM, and common coding practices to improve how fields are initialized, providing stronger guarantees about their contents.

Goals include
1) eliminating the need for default values;
2) ensuring final fields cannot be observed to mutate; and
3) avoiding early publication of uninitialized objects.

In Amber, Flexible Constructor Bodies allow Java code to initialize fields earlier than it could before, and in Valhalla, value classes have repurposed the ACC_STRICT flag to mark fields that support stronger guarantees.

Make sure to check the    • JVM Language Summit 2024   playlist.

Resources
• JEP Draft - Null-Restricted and Nullable Types (Preview) ➤ https://bugs.openjdk.org/browse/JDK-8...
• JEP Draft - Value Classes and Objects (Preview) ➤ https://openjdk.org/jeps/401
• Valhalla - Where Are We? ➤    • Valhalla - Where Are We? #JVMLS  
• Project Valhalla ➤ https://openjdk.org/projects/valhalla/
• Inside Java ➤ https://inside.java/tag/valhalla
• JVMLS ➤ https://openjdk.org/projects/mlvm/jvm...
• OpenJDK ➤ https://openjdk.org

Tags #Java #OpenJDK #Valhalla

show more

Share/Embed