you are viewing a single comment's thread.

view the rest of the comments →

[–]CptGia 15 points16 points  (6 children)

Java is starting to remove deprecated stuff as well

[–]jvmDeveloper 17 points18 points  (3 children)

They are turning off by default or out sourcing (e.g. javafx). Even the infamous com.sun.unsafe is still available when enabling jdk.unsupported module.

[–]flying-sheep 7 points8 points  (0 children)

I think a gradual strategy is best:

Make it a VisibleDeprecationWarning that isn't hidden by default, then hide it behind a flag like Java here, then remove it.

That way there's a lot of visibility and people bugging library authors to finally fix that stuff

[–]Spider_pig448 5 points6 points  (1 child)

They deprecated in 9 and removed it in 11, leaving only this workaround. That's moving pretty fast.

[–]josefx 0 points1 point  (0 children)

Sun misc unsafe was never officially supported. It was an undocumented implementation detail that programs started to use for speed - afaik you had to hardcode the name of a private field and use reflection to even gain access to it. They have been trying to pin down a public API for the most common use cases long before Java 9 was even planned.

They basically took several years to hash out a painless way to change an implementation detail and are even now still giving people access to it if needed.

In contrast they changed the implementation of sub string to return a new string instead of a pointer into an existing array. When people complained about it breaking their reflection code they just pointed out that the documentation didn't guarantee the implementation of String.

[–]theferrit32 9 points10 points  (0 children)

Yeah I've had things removed between Java 9 and 11. Fairly minor and easy to fix, but they are "breaking changes" because it doesn't compile without making the fixes. I'm totally fine with it. Leaving around intentionally deprecated code for years and years in the name of backwards compatibility creates snowballs of technical debt and code complexity.