This week I am giving you three tips in just a few quick words! This time it’s about what not to do.
The term deprecated in programming means that some functionality or a piece of code has been flagged as no longer useful. This is usually because there is newer, better functionality available. Deprecated code is left in the codebase for a period after deprecation to prevent regression errors. But often it will be removed in some future version.
Java has been around for a long time, so it is to be expected that some of the functionality has been improved over time. That means that some other functionality has been deprecated. You should avoid using deprecated Java functionality. And if you still have some of it, plan to remove it as part of your (hopefully) regular code refactoring.
Applets
You’ve heard of applets? Those graphical programs the older Java programmers in the office used to develop Java applications that ran in browser pages?
Don’t use them!! They’re gone!
For more information, see JEP 398: Deprecate the Applet API for Removal.
Security Manager
You’ve heard of the SecurityManager
class? The class that protected the integrity of users’ machines and the confidentiality of their data by running applets in a sandbox?
Don’t use it!! It’s gone too!
For more information, see JEP 411: Deprecate the Security Manager for Removal.
Finalizers
You’ve heard of finalizers? Those magical methods that are supposed to free resources after objects have been marked as unreachable?
Don’t use them!! They’re also being deprecated and flagged for removal.
For way more information on this topic than you’ll probably ever need, see JEP 421: Deprecate Finalization for Removal.
Stay safe, and see you next week with more details on these tips. (Or maybe not, because you would have had time to read and digest these links…)
1 thought on “Avoid These! Deprecated Java Functionality”
Pingback: About Finalizers • 2022 • Incus Data Programming Courses