Get the latest tech news

JEP draft: Prepare to make final mean final


draft: Prepare to Make Final Mean Final Summary Issue warnings about uses of deep reflection to mutate final fields. The warnings aim to prepare developers for a future release that ensures integrity by default by restricting final field mutation; this makes Java programs safer and potentially faster.

The warnings aim to prepare developers for a future release that ensures integrity by default by restricting final field mutation; this makes Java programs safer and potentially faster. The Java Platform provides a number of APIs that allow final fields to be reassigned at any time by any code in the program, undermining all reasoning about correctness and invalidating important optimizations. Rather than issue warnings, a future JDK release will throw exceptions by default when Java code uses deep reflection to mutate final fields.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of JEP draft

JEP draft

Related news:

News photo

JEP Draft: Adapt Object Monitors for Virtual Threads

News photo

JEP Draft: Support HTTP/3 in the HttpClient

News photo

JEP draft: Exception handling in switch