File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Deprecated methods - doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Deprecated methods - doubt" Watch "Deprecated methods - doubt" New topic

Deprecated methods - doubt

Janhavi Namshikar
Ranch Hand

Joined: Sep 29, 2005
Posts: 85


I have got a question about deprecated methods.
Do they cause any performance issue when used in your application? What are the drawback of using a deprecated method.
Does it affect the functioning and performance in any way?

Thank you.


"Weekends don't count unless you spend them doing something completely pointless."
u johansson
Ranch Hand

Joined: Dec 27, 2005
Posts: 47
The main issue is that deprecated methods may, in principle, disappear in future Java versions and thus break your program.
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
There are a number of reasons why a method or class may become deprecated. An API may not be easily extensible without breaking backwards compatibility, and thus be superseded by a more powerful API (e.g., java.util.Date has been deprecated in favor of Calendar, or the Java 1.0 event model). It may also simply not work or produce incorrect results under certain circumstances (e.g., some of the stream classes do not work properly with some encodings). Sometimes an API is just ill-conceived (SingleThreadModel in the servlet API), and gets replaced by nothing. And some of the early calls have been replaced by "Java Bean"-compatible methods (size by getSize, bounds by getBounds etc.)

So there are a number of reasons why an API can be deprecated. Study the javadocs for the classes and methods you use to see whether it is advisable to avoid them in your case. I don't generally advise to remove deprecated methods just for its own sake, but to consider the circumstances.
Jaime M. Tovar
Ranch Hand

Joined: Mar 28, 2005
Posts: 133
It is a matter of decision and risk, deprecated means that you should not be using those methods as part of a new development. Basically because they are known to have undesirable behavior (lets say lack of precision, lack of portability, problems with performance). They are kept because some times it is mandatory to have backward compatibility in software maintenance. Normally when something is deprecated it is replaced by a better option, so if you can choose go for the non deprecated functionality. Just for your own security and good practices.

She will remember your heart when men are fairy tales in books written by rabbits.<br /> As long as there is duct tape... there is also hope.
Adam Richards
Ranch Hand

Joined: Nov 03, 2005
Posts: 135
What do you "doubt"?
I agree. Here's the link:
subject: Deprecated methods - doubt
jQuery in Action, 3rd edition