469,360 Members | 1,774 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,360 developers. It's quick & easy.

How to depreciate a class?


I have a class in a library I've developed that I would like to
depreciate. What is the keyword/method of doing this? The Java
language specification doesn't seem to mention depreciation at all.

Mark McKay
--
http://www.kitfox.com

Jul 17 '05 #1
4 10029
While it was 19/9/03 6:27 pm throughout the UK, Brad BARCLAY sprinkled
little black dots on a white screen, and they fell thus:
Mark McKay wrote:

I have a class in a library I've developed that I would like to
depreciate. What is the keyword/method of doing this? The Java
language specification doesn't seem to mention depreciation at all.

Use "@deprecate" in the class JavaDoc header.


I think you're thinking of @deprecated.

But this doesn't actually deprecate the method - it merely tells JavaDoc
that the method is deprecated. Real deprecated methods issue a compiler
warning when you try to use them. Does anyone have any idea how to do this?

And @deprecate doesn't do either.

Stewart.

--
My e-mail is valid but not my primary mailbox. Please keep replies on
on the 'group where everyone may benefit.

Jul 17 '05 #2
Stewart Gordon wrote:
I think you're thinking of @deprecated.
Oops -- I missed the 'd'. Thanks.
But this doesn't actually deprecate the method - it merely tells JavaDoc
that the method is deprecated. Real deprecated methods issue a compiler
warning when you try to use them. Does anyone have any idea how to do
this?

And @deprecate doesn't do either.


In fact, it does. I use it in a variety of places in my code, and the
compiler will indeed pick it up. For example, here's a section from the
latest Ant build log for my Open Source project, the jSyncManager
(http://www.jsyncmanager.org):

[javac]
/home/jsm-nightly/work_dir/20030918/jsyncmanager/source/org/jSyncManager/Client/LegacyMain.java:28:
warning: org.jSyncManager.Client.LegacyClient.JSyncManagerF rame in
org.jSyncManager.Client.LegacyClient has been deprecated
[javac] import org.jSyncManager.Client.LegacyClient.JSyncManagerF rame;
[javac] ^

The code in question simply has the following statement:

/** The JSyncManager class.
* This class provides a GUI for end-user synchronization, and for
* managing jConduits.
* @author Brad BARCLAY <bb******@jsyncmanager.org>
* <br>Last modified by: $Author: yaztromo $ on
* $Date: 2003/06/26 02:28:43 $.
* @version $Revision: 1.11 $
* @deprecated This class has been completely deprecated by the new
* Swing GUI client classes. It is provided here as completely
* unsupported code, so please use at your own risk!
*/

As you can see from the above, it does indeed generate a compiler
warning. HTH!

Brad BARCLAY

--
=-=-=-=-=-=-=-=-=
From the OS/2 WARP v4.5 Desktop of Brad BARCLAY.
The jSyncManager Project: http://www.jsyncmanager.org

Jul 17 '05 #3
I was under the impression that comments were removed
by the compiler, no?
"Brad BARCLAY" <bb******@jsyncmanager.org> wrote in message
news:wC******************@news02.bloor.is.net.cabl e.rogers.com...
Stewart Gordon wrote:
I think you're thinking of @deprecated.
Oops -- I missed the 'd'. Thanks.
But this doesn't actually deprecate the method - it merely tells JavaDoc
that the method is deprecated. Real deprecated methods issue a compiler
warning when you try to use them. Does anyone have any idea how to do
this?

And @deprecate doesn't do either.


In fact, it does. I use it in a variety of places in my code, and the
compiler will indeed pick it up. For example, here's a section from the
latest Ant build log for my Open Source project, the jSyncManager
(http://www.jsyncmanager.org):

[javac]

/home/jsm-nightly/work_dir/20030918/jsyncmanager/source/org/jSyncManager/Cli
ent/LegacyMain.java:28: warning: org.jSyncManager.Client.LegacyClient.JSyncManagerF rame in
org.jSyncManager.Client.LegacyClient has been deprecated
[javac] import org.jSyncManager.Client.LegacyClient.JSyncManagerF rame; [javac] ^

The code in question simply has the following statement:

/** The JSyncManager class.
* This class provides a GUI for end-user synchronization, and for
* managing jConduits.
* @author Brad BARCLAY &lt;bb******@jsyncmanager.org&gt;
* <br>Last modified by: $Author: yaztromo $ on
* $Date: 2003/06/26 02:28:43 $.
* @version $Revision: 1.11 $
* @deprecated This class has been completely deprecated by the new
* Swing GUI client classes. It is provided here as completely
* unsupported code, so please use at your own risk!
*/

As you can see from the above, it does indeed generate a compiler
warning. HTH!

Brad BARCLAY

--
=-=-=-=-=-=-=-=-=
From the OS/2 WARP v4.5 Desktop of Brad BARCLAY.
The jSyncManager Project: http://www.jsyncmanager.org

Jul 17 '05 #4
Phil... wrote:
I was under the impression that comments were removed
by the compiler, no?


Only from the output. The input will still contain the comments, and
can thus be processed.

I can only assume that there is a bytecode "flag" of somesort for
deprecated items, which gets added by the compiler when it encounters a
deprecated element.

Brad BARCLAY

--
=-=-=-=-=-=-=-=-=
From the OS/2 WARP v4.5 Desktop of Brad BARCLAY.
The jSyncManager Project: http://www.jsyncmanager.org


Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Murat Tasan | last post: by
2 posts views Thread by Fernando Rodriguez | last post: by
2 posts views Thread by Gabriel Genellina | last post: by
5 posts views Thread by Andy | last post: by
3 posts views Thread by Hamilton Woods | last post: by
reply views Thread by emin.shopper | last post: by
78 posts views Thread by Jeremy J Starcher | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.