Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Deprecated API usage in Code

 
Venkat veramasu
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Im migrating my application to java 1.6 from 1.4. there are certain apis already Deprecated in 1.5. So my basic question is what will happen if i continue to use those APIs. Becoz i m seeing the code still in JDK but is marked as @Deprecated.

Thanks in Advance,
Venkataraman
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So far, no deprecated API has ever been removed from JSE, and it's likely to stay that way for the foreseeable future. So you don't need to do anything right now.

As you work with the code, you may want to reduce the use of obsolete APIs in the code sections you're changing anyway, though. Depends a bit on what APIs we're talking about - some of the deprecated ones are actually broken and should be removed ASAP, while others work just as well as their replacement APIs but have less functionality.

It's the same with generics - you may find them useful in new code, or add them existing code you're working with, but it's generally not worthwhile to go through all code and add them wherever possible.
 
Rob Spoor
Sheriff
Posts: 20822
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:As you work with the code, you may want to reduce the use of obsolete APIs in the code sections you're changing anyway, though. Depends a bit on what APIs we're talking about - some of the deprecated ones are actually broken and should be removed ASAP, while others work just as well as their replacement APIs but have less functionality.

And sometimes the deprecated method is simply renamed / implemented slightly differently. java.awt.Component has several of these methods, like enable() / disable() (setEnabled(true) / setEnabled(false)), inside(x, y) (contains(x, y)), location() (getLocation()) etc.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!