Menu

Java and Kotlin news: value classes arrive in JDK 28 and Kotlin 2.5
📰

Java and Kotlin news: value classes arrive in JDK 28 and Kotlin 2.5

DEV Community: kotlin·Dmitry Protsenko·6 days ago
#gxUrxBl6
#devtokotlin#devto#dev#java#spring
Long article (2443 words) — no AI summary yet.
Reading 0:00
15s threshold

Java’s Integer and LocalDate lose their identity in JDK 28 previews, and patched Java runtimes may still trust compromised eMudhra certificates.

This digest covers 20 to 28 October 2026.

Java

1. Integer and LocalDate lose their identity in JDK 28 previews (JEP 401)

Every Java object has an identity: two objects with the same fields are still two objects, and == tells them apart. Value classes give that up so the JVM can store them flat, like primitives. JEP 401 brings them to JDK 28 as a preview, and OpenJDK’s Quality Outreach asked library maintainers to test now.

With preview features on, 30 JDK classes become value classes. Integer and LocalDate are among them, even in code compiled on older JDKs:

var x = LocalDate . of ( 2026 , 7 , 31 ); var y = LocalDate . of ( 2026 , 7 , 31 );

var identical = x == y ; // without value classes: false // with value classes: true

Enter fullscreen mode

Exit fullscreen mode

Synchronizing on these objects or using them as WeakHashMap keys throws IdentityException.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.