Java 9 Unsafe issue - The parts you never read

On Monday, we published an article showing the dangers of removing Unsafe from Java, which is scheduled to happen in Java 9. The article got extremely popular on social media.

While most people fully read our post and agreed with it, a lot of people took issues with our article without even fully reading it! Here is a look at what those people said vs what was actually written in our article.

1. The Google Doc

- What people thought

A lot of people linked to a google doc as proof that issue is being taken care of:


- What was actually written

That document was linked on the very first line of our article. In fact, the entire article was about that document!




2. The Quote

- What people thought

Many people thought the quote in the article was misquoted or was taken out of context. They provided the full link to the quote to show that we were misguiding people:


- What was actually written

The full quote was already linked to, right above the quote itself.




3. Its your fault for using it

- What people thought

A lot of people thought that since Oracle had warned users to not use the class in the first place, it is Ok for them to remove it now.


- What was actually written

This is what the article is discussing! While Oracle is well within its rights to remove the class, the ramifications of that will be terrible since too much software uses it at this point.



4. Put it behind a flag

- What people thought

Most people thought that enabling Unsafe by putting it behind a flag is completely fine.



Even InfoQ jumped in, without even reading our post:



Their article just reiterates all our fears:

- What was actually written

These people never bothered to actually read the entire article since the entire point of the article is to show that putting things behind a flag does not solve the issue.

Imagine if the DateTime API was enabled only by a special flag in Java 8, and all code was forced to switch to java.time package. That would break almost all existing Java code and no one would use Java 8.


Most people agreed

The reason why the post was so popular was because most people understood the dangers of removing Unsafe.



Conclusion

Removal of Unsafe in Java 9 is a real issue. The code to remove it and put it behind a flag has already been checked in!

The issues outlined in the article are real. Raise awareness of this to prevent the above code from being finalized in Java 9.

Show Comments