Live data from Hacker News

Removal of Unsafe in Java 9 – A disaster in the making

blog.dripstat.com

141–142 of 142 posts

Re: Removal of Unsafe in Java 9 – A disaster in the making

#141

Earlier quoted context omitted.

You quite simply have NO option to do on the JVM most of the things people are using unsafe for in Java 9/10 without a migration plan from Oracle. What Oracle is close to "hey all you performance sensitive folks, we aren't going to support unsafe anymore, can you tell us what you are using it for and how we can migrate to that explicitly?" It just so happens that one of the leading proposals is "leave in java 9 but m…

Whats wrong with: - deprecate in Java 9 - "make it explicit to turn on" in 10, offer alternative official APIs as fallback - remove entirely when most people have switched

Nothing at all. That's what I assume will happen at the end of the day. But people saying that we can just turn it off in 9 because you shouldn't be using internal api's don't seem to get that there is no external solution.

Re: Removal of Unsafe in Java 9 – A disaster in the making

#142
post #38

Earlier quoted context omitted.

Thanks for the thorough explanation - you summarised the issue well, as well as explaining the impact and flow on effects. I have to say, I agree with the engineer.. I'm cringing just knowing this sort of practice is seen as acceptable, and it reinforces my distaste for Java. If you have to resort to insecure practices to achieve performance, there's something wrong with the framework.

Reading this thread as C programmer has me scratching my head. Of course you have to resort to low-level functionality to achieve performance. That's how computers work. We can't all live in fuzzy wuzzy land. Surely Unsafe is safer than writing the whole thing in C and using JNI?

I completely agree - I have no problem with leveraging low-level functionality, but there's usually a safe and and unsafe way to approach it - and from what I've read 'unsafe' doesn't take the secure approach.

(separately: why the downvote? I get downvoted for having the opinion that it's worth a tiny bit of performance for improved security?)

Post reply on HN