javac doesn't show decprecated API calls to me

R

Richard Ivarson

Hi,

how do I make javac to show deprecated API calls in my Java sourcecode
files? Reading javac's documentation tells me this feature is on per
default.
http://java.sun.com/j2se/1.4.2/docs/tooldocs/solaris/javac.htmljavac -deprecation
Show a description of each use or override of a deprecated member or
class. Without -deprecation, javac shows the names of source files
that use or override deprecated members or classes.
<<<

However when for example I use a JPanel and call its "show()" method,
I don't get any decprecation warning from javac.
The JPanel documentation
http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/JPanel.html
says, that the show() method is inherited from class
java.awt.Container and there you can read:
http://java.sun.com/j2se/1.4.2/docs/api/java/awt/Component.html#show()show()
Deprecated. As of JDK version 1.1, replaced by setVisible(boolean).
<<<

What am I getting wrong? Thanks.

-ric
 
D

Dario

Richard said:
However when for example I use a JPanel and call its "show()" method,
I don't get any decprecation warning from javac.

When I compile the following source:

import javax.swing.JPanel;
class A42 extends JPanel{void test(){show();}}

I obtain the following warning:

Note: A42.java uses or overrides a deprecated API.
Note: Recompile with -deprecation for details.

So, what is your point?

- Dario
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top