• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

Deprecated Methods

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
how to identify deprecated methods at run time for java 1.4.2
[ November 09, 2006: Message edited by: prasad Venkat ]
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello prasad,

Please change your display name first, as Henry asks you for the fourth time already. Click on the "My Profile" link at the top of the page, then click on "View/Update Profile" and change your name in the field "Publicly Displayed Name" to a name that conforms to the policy.

Done?

About your question: If you have deprecated methods that are deprecated using the @Deprecated annotation, then you can identify them at runtime by using reflection. The @Deprecated annotation has runtime retention. Example:

NOTE: Unfortunately this does not work if the method is deprecated by using the old style Javadoc @deprecated tag.
[ November 09, 2006: Message edited by: Jesper Young ]
 
prasad Venkat
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what about previous version of java
 
Jesper de Jong
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's a lot harder for previous versions of Java, in which javadoc @deprecated tags are used. You could write a doclet and run the Javadoc tool on the source code to find the deprecated methods. If you don't have the source code, then I believe it is not possible to detect if a method is deprecated at runtime.
 
Rancher
Posts: 43028
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Libraries like BCEL or ASM can tell you whether a method is deprecated.
 
Onion rings are vegetable donuts. Taste this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic