dcsimg
How can I deprecate a method of my own package?
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Riken_Shah
Posted On:   Friday, June 15, 2001 04:33 PM

I want to deprecate some methods of an older version of my package. The javadoc suggest for having a java comment such as @deprecate , but this doesnt give a compilation warning !! what should i do?

Re: How can I deprecate a method of my own package?

Posted By:   Luigi_Viggiano  
Posted On:   Sunday, June 17, 2001 07:16 AM

The tag is @deprecated, not @deprecate!

If you are a "born bad" programmer like me ;-) you can also remove deprecated method implementation (commenting it) and throw java.lang.UnsupportedOperationException("Method xxxx() is deprecated! use yyyy() instead!");. But this approach is not correct: it should be used only if you want to be sure that people won't longer use the method. This breaks backward compatibility.

Re: How can I deprecate a method of my own package?

Posted By:   AlessandroA_Garbagnati  
Posted On:   Friday, June 15, 2001 05:22 PM

Hi,

Yes that's the right way as even mentioned in this FAQ.


When you compile, try using the:

  -deprecation

option. Or just do

  javac

with no parameters to see a list of options.

About | Sitemap | Contact