472,353 Members | 1,093 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

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 10348
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Murat Tasan | last post by:
hi, i am having a small problem with constructing an inner class. i am using an inner class (and not a static nested class) because the methods of...
2
by: Fernando Rodriguez | last post by:
Hi, I need to traverse the methods defined in a class and its superclasses. This is the code I'm using: # An instance of class B should be...
2
by: Gabriel Genellina | last post by:
Hi In the following code sample, I have: - a Worker class, which could have a lot of methods and attributes. In particular, it has a 'bar'...
1
by: Oplec | last post by:
Hi, I'm learning C++ as a hobby using The C++ Programming Language : Special Edition by Bjarne Stroustrup. I'm working on chpater 13 exercises...
9
by: Banaticus Bart | last post by:
I wrote an abstract base class from which I've derived a few other classes. I'd like to create a base class array where each element is an...
5
by: Andy | last post by:
Hi all, I have a site with the following architecture: Common.Web.dll - Contains a CommonPageBase class which inherits System.Web.UI.Page...
3
by: Hamilton Woods | last post by:
Diehards, I developed a template matrix class back around 1992 using Borland C++ 4.5 (ancestor of C++ Builder) and haven't touched it until a few...
0
by: emin.shopper | last post by:
I had a need recently to check if my subclasses properly implemented the desired interface and wished that I could use something like an abstract...
78
by: Jeremy J Starcher | last post by:
(Request for Discussion) I've put together a guide that I hope will help novice coders avoid the same hair pulling that I went through. I'm...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.