473,386 Members | 1,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 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 10410
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 the inner class need access to the enclosing...
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 able to check all the methods defined in B #and A,...
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' attribute. This class can be modified as needed. - a...
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 that deal with templates. Exercise 13.9 asks for me...
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 instance of a derived object. I can create a base class...
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 myadd.dll - Contains PageBase which inherits...
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 days ago. I pulled it from the freezer and...
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 base class in python. After reading up on metaclass...
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 open for comments about it. Have I missed the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.