Can Eclipse Be Used To Find All Deprecated Method Calls?

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


Asked by: Aida272 | Posted: 23-01-2022






Answer 1

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.

Answered by: Dainton587 | Posted: 24-02-2022



Answer 2

[Updating eight years later, for current versions of Eclipse, with screenshots.]

First, build your projects. Once you've built your projects, the Problems view includes deprecations by default. You can group all the deprecations together.

To show the Problems view, use Window>Show View>Problems.

If deprecations don't appear after the next step, you can configure them in Preferences under Java>Compiler>Errors/Warnings.

Group deprecations together using the Problem view menu. Start by clicking the control circled below.

Menu to gruop by Java problem type

Once you've done that, open the "Deprecation" subtree. For example:

enter image description here

Answered by: Patrick239 | Posted: 24-02-2022



Answer 3

You can always use the grep facilities under 'Search -> File'. Eclipse can do a recursive search for @deprecated after you check on the 'consider derived resources' option box.

Answered by: Owen961 | Posted: 24-02-2022



Similar questions

java - F2 focus in Eclipse for deprecated members

In Eclipse, the F2/focus or a hover on a member gives you a popup with the javadocs. However, if the member is deprecated, you only get a message like 'The field blahblah is deprecated'. Does anyone know if this is a known bug/feature? If yes, is there a handy shortcut to get a javadoc popup for deprecated members? Typically the alternate use of the a deprecated member is in the @deprecated javadoc tag. H...


java - Eclipse doesn't strike out deprecated classes?

Here is a sample code public class DeprecatedTest { private final List<Object> instances; public DeprecatedTest(){ instances = new ArrayList<Object>(); instances.add(new Depr()); instances.add(new Depr1()); instances.add(new Depr2()); instances.add(new Depr3()); Depr depr = new Depr(); Depr2 depr2 = new Depr2(); } ...


vector - Java - make eclipse show deprecated code as errors

I am trying to update some code from jre 1.4 to 1.7. basically I am trying to swap out vectors and hashtables for arraylists and hashmaps. I am using the jre 1.7, however, when I try to change the compiler error settings to error for deprecated code, it doesnt error on vector's or hash tables despite them being deprecated. I am sure I have configured it to error on these before and was wondering if anyone had any idea what...


java - Eclipse not showing deprecated warning?

As per Javadocs: public Date (int year, int month, int day) This constructor was deprecated in API level 1. Date date = new Date(year,month,date); This constructor was deprecated in API Level 1 but my Eclipse isn't giving me deprecation warning in the Android project I'm creating. What can be the issue? Is there a silly mistake that I'm making? I've compiled the project at ...


java - Eclipse Outline View- how to hide deprecated methods

How to hide the @Deprecated annotated methods from the Eclipse Outline view for Java or JavaEE?


eclipse - How to find java deprecated apis for third party tools?

Closed. This question needs details or clarity. It ...


java - When are API methods marked "deprecated" actually going to go away?

I'm code reviewing a change one of my co-workers just did, and he added a bunch of calls to Date.toMonth(), Date.toYear() and other deprecated Date methods. All these methods were deprecated in JDK 1.1, but he insists that it's ok to use them because they haven't gone away yet (we're using JDK 1.5) and I'm saying they might go away any day now and he should use Calendar ...


java - Why was "new Date(int year, int month, int day)" deprecated?

My application I've recently inherited is FULL of deprecation warnings about the constructor: Date d = new Date(int year, int month, int day) Does anyone know or can point to a reason why something as simple as this was "replaced" with something like this: Date d = null; Calendar cal = GregorianCalendar.getInstance(); cal.set(1900 + year, month, day); d = cal.getTime();


java - How to retrieve a list of deprecated methods from a class

How do I retrieve a list of deprecated methods from a class. I need to list the methods that have been marked as deprecated for a class to pass on to documentation. I don't really want to copy and paste each method and its javadoc into a seperate file, is it possible to do this through the javadoc tool or through eclipse?


java - F2 focus in Eclipse for deprecated members

In Eclipse, the F2/focus or a hover on a member gives you a popup with the javadocs. However, if the member is deprecated, you only get a message like 'The field blahblah is deprecated'. Does anyone know if this is a known bug/feature? If yes, is there a handy shortcut to get a javadoc popup for deprecated members? Typically the alternate use of the a deprecated member is in the @deprecated javadoc tag. H...


JDBC Dates Deprecated in Java (java.sql package)

I am working with JDBC and MySQL. I have a date column that I need included in my result set. Unfortunately, I cannot find a class in Java to retrieve the date. The SQL Date class is deprecated. How do you get Date objects from a result set?


Java: How to avoid deprecated warning in derived interfaces which override deprecated members?

Consider the following simplified interface inheritence hierarchy: // Starting point: public interface Base { void Foo(); } public interface Derived extends Base { } It is intended to move the Foo method from the Base interface to the Derived interface: // Desired end-point: public interface Base { } public interface Derived exte...


Java date function which is not deprecated

I simply need to print the date of the day on the console in this format: Day.Month.Year. Example: 03.10.09 Code: GregorianCalendar c = new GregorianCalendar(); Date s = c.getTime(); System.out.println(s); The console prints: Sat Oct 03 13:33:36 CEST 2009 I could do it with a case statement, but I am sure there is someth...


java - How can I suppress javac warnings about deprecated api?

When I compile, javac outputs: Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details.` I wish to suppress this warning. Trying -Xlint:none does not seem to help.


How can I tell at runtime that a Java 1.4 type or member is deprecated?

In Java 6 I can use a technique like this: @Deprecated public final class Test { public static void main(String[] args) { System.out.println(Test.class.isAnnotationPresent(Deprecated.class)); } } to decide if a type is deprecated. Is there any way at all to do this in 1.4 with the old style (Javadoc-based) deprecation?


java - How to exclude deprecated public methods from Javadoc?

I would like to generate javadoc for my classes. The 'generate Javadoc' command gives me an option to create Javadoc for members with visibility Private/Package/Protected/Public. But there are some public methods I don't want to be included in the Javadoc. How can I specify for this Javadoc generator exactly which members/methods to include and which ones to not include? (I use eclipse 3.4.2) Edit: Some of ...






Still can't find your answer? Check out these amazing Java communities for help...



Java Reddit Community | Java Help Reddit Community | Dev.to Java Community | Java Discord | Java Programmers (Facebook) | Java developers (Facebook)



top