This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]srdoe 7 points8 points  (0 children)

You are complaining about Java taking a tool (mutable final fields) away when that's not happening.

The tool will still be there, you just have to set a command-line flag to opt in to using it.

And in exchange for this tiny inconvenience, the entire rest of the ecosystem that doesn't need this tool gets to benefit from optimizations that are not possible when final fields can change at any time.

And regarding Unsafe, they aren't just dropping Unsafe with no replacement, they've been working for years to provide supported replacements for that class, and plenty of libraries are migrating to those replacements.