Bug 40485 - Use of deprecated methods is not shown
Summary: Use of deprecated methods is not shown
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 M3   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords: readme
Depends on:
Blocks:
 
Reported: 2003-07-18 13:11 EDT by Roman Seibold CLA
Modified: 2004-07-19 15:59 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Seibold CLA 2003-07-18 13:11:38 EDT
When I make use of a deprecated method it used to be shown
in task-view. Since 2.1, 2.1.1, 3.0 it isn't any more.

E.g.

    Component c = new JFrame();
    c.show();

should (according to javac) print out:

warning: show() in java.awt.Component has been deprecated

and

    JFrame c = new JFrame();
    c.show();

not.

In my environment (Usage of deprecated API: warning or error)
this is not the case.
Comment 1 Martin Aeschlimann CLA 2003-07-22 05:09:32 EDT
Seems to work for me: Do you get the warning marker in the editor's (left)
marker bar?
Did you enable project specific compiler settings? Maybe deprecation is disabled
there.
Is this is only the case for
    Component c = new JFrame();
    c.show();
or do you also get no warning for
public class B {
	/**
	 * @deprecated
	 */
	public static void foo1() {
	}
}
public class a {
	public void foo2() {
            B.foo1();
	}
}
Comment 2 Roman Seibold CLA 2003-07-22 05:53:23 EDT
public class A
{
  /**
   * @deprecated
   */
  public static void foo1()
  {
  }
}

public class B
{

  public static void main(String[] args)
  {
    A.foo1();

    Component c = new JFrame();
    c.show();
  }
}


---

In my configuration

A.foo1(); is signaled as deprecated, indicating by
a yellow warning symbol in the left column of the editor
and in the task view.

c.show() is NOT marked as usage of deprecated methods.

Occurs to me Compiler 1.3/1.4,
"Usage of deprecated API" - Warning
Comment 3 Roman Seibold CLA 2003-07-22 05:55:50 EDT
By the way:

this concerns Eclipse 2.1, 2.1.1 and 3.0M1.

A test in recent 3.0M2 shows the usage of deprecated API
left to c.show()!

So there must've been some changes since, then.
Comment 4 Martin Aeschlimann CLA 2003-07-22 09:26:39 EDT
moving to jdt.core
Comment 5 Philipe Mulet CLA 2003-07-22 11:05:09 EDT
Oliver - pls investigate what has changed on this front.
Comment 6 Roman Seibold CLA 2003-07-23 11:59:54 EDT
Ok.

Here some more infos:

Using JRE 1.3 as underlying Runtime, the deprecation warnings
are displayed. That's true for 1.4.0.

1.4.1 - untested -

1.4.2 shows the described behaviour, only self-made deprecations
are shown, platform deprecations are suppressed

OS: Windows XP, SP 1
Comment 7 Roman Seibold CLA 2003-07-24 07:50:58 EDT
Ok, this should explain the problem, but not solve it...

When I first ran my Eclipse it catched 1.4.2 JRE (not J2SDK!)
as underlying runtime. There must've been several changes to
rt.jar, especially debug and deprecation information, cause
the rt.jar of JRE and SDK have according to my collegue different 
sizes. When I use the SDK as runtime I see all deprecation warnings.

It worked in my eclipse 3.0M2 'cause I used the J2SDK there.

So I suggest to close this bug and instead make I installation
remark to use SDK.
Comment 8 Olivier Thomann CLA 2003-08-22 10:18:08 EDT
Closed as INVALID.
Jim, please add note in readme.
Comment 9 sef CLA 2004-07-16 09:56:19 EDT
and only show unused metods (16.07.2004)
Comment 10 Jim des Rivieres CLA 2004-07-19 11:50:36 EDT
Olivier, I'm not sure what the release note should cover. Please draft an item 
and I will add to release notes.
Comment 11 Olivier Thomann CLA 2004-07-19 12:05:53 EDT
The release notes should cover the fact that the compilation should be made
against the libraries of a SDK not the libraries of a JRE. The JRE libraries
don't contain deprecated information since they are not packaged to be used for
compilation, only for runtime.
So the compiler cannot issue deprecated warnings when the code is compiled
against  JRE libraries.
Comment 12 Jim des Rivieres CLA 2004-07-19 15:59:42 EDT
Included JDT release note for 3.0.1.