Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Eclipse Be Used To Find All Deprecated Method Calls?

Tags:

java

eclipse

ide

Does Eclipse have a feature that lets you search a project to find all calls to deprecated methods?

like image 312
John Topley Avatar asked Oct 24 '08 13:10

John Topley


People also ask

How do you check where a method is called in eclipse?

Select mymethod() and press ctrl + alt + h . To see some detailed Information about any method you can use this by selecting that particular Object or method and right click. you can see the "OpenCallHierarchy" ( Ctrl + Alt + H ).

What is deprecated in eclipse?

API deprecation is used to inform API clients that a particular API element is no longer recommended for use. The deprecation comment should describe the reason for the deprecation, and directions for how to replace their usage with the new recommended way of doing things.

What happens to deprecated methods in Java?

Similarly, when a class or method is deprecated, it means that the class or method is no longer considered important. It is so unimportant, in fact, that it should no longer be used at all, as it might well cease to exist in the future. The need for deprecation comes about because as a class evolves, its API changes.

What happens if we use deprecated methods?

A deprecated class or method is like that. It is no longer important. It is so unimportant, in fact, that you should no longer use it, since it has been superseded and may cease to exist in the future.


1 Answers

You can set the compiler to generate errors or warnings (your choice) for any usage of deprecated API.

Preferences -> Java -> Compiler -> Errors/Warnings -> Deprecated and restricted API section.

Then, each use of a deprecated method or API will show up as an error/warning in the Problems view.

like image 62
matt b Avatar answered Sep 23 '22 01:09

matt b