Bug 204081 - [compiler] Make deprecation warning message richer
Summary: [compiler] Make deprecation warning message richer
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows 2000
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-20 04:11 EDT by Mauro Molinari CLA
Modified: 2013-09-10 01:12 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mauro Molinari CLA 2007-09-20 04:11:56 EDT
Build ID: I20070625-1500

Steps To Reproduce:
1. Suppose you have:

public class A
{
  /**
   * @deprecated use {@link #b()} instead
   */
  public void a(){}

  public void b(){}

  public void c()
  {
    a();  // (*)
  }
}

2. as of now, the warning given on line marked as (*) is:

The method a() from the type A is deprecated

It would be VERY useful if the warning could include at least the contents of the @deprecation JavaDOC tag, so that the warning would become something like:

The method a() from the type A is deprecated

@deprecated use b() instead

This would inform the developer on what is the reason of the deprecation or the way to avoid using that code.

As of now, if you want to know how to fix the deprecation warning, pressing F2 is not enough: you must go to the declaration of the deprecated method, have a look to its JavaDOC, go back to your client code and fix it.
Comment 1 Dani Megert CLA 2007-09-20 05:04:51 EDT
The warning is coming from JDT Core.

Workaround: assign your custom modifier to the Javadoc hover on the Java > Editor > Hovers preference page (e.g. Ctrl). This allows to look at the hover.
Comment 2 Adtc Rulez CLA 2013-09-09 01:10:52 EDT
It would still be very useful if the deprecated warning can pull the @deprecated note from the corresponding Javadoc and display it. Holding Ctrl-Shift to see the full javadoc doesn't always help, as the @deprecated note may be located in the class javadoc, but I may be looking at the method javadoc.
Comment 3 Jay Arthanareeswaran CLA 2013-09-10 01:12:42 EDT
The JDT core team is currently busy with the Java 8 effort and unlikely to take this up any time soon. However, should there be a patch, we could look at it.