Using old classes with new helper JAR

G

Guest

Hi..All,

In one of our application, we developed/complied a java code which
uses couple of 3rd party JAR files. Since last couple of years we have
been getting the new/updated JAR files from the 3rd party, but we never
complied our code with the new JAR files till now.
Recently we made some small enhancement to the JAVA code & are trying to
compile it with the latest JAR files. The compilation is throwing lot of
errors due to the deprecated methods we are calling.

I am wondering how did it work earlier i.e the same class file with new
3rd PARTY JAR files.

Regards,

P
 
A

Andrew Thompson

In one of our application, we developed/complied a java code which
uses couple of 3rd party JAR files. Since last couple of years we have
been getting the new/updated JAR files from the 3rd party, but we never
complied our code with the new JAR files till now.
Recently we made some small enhancement to the JAVA code & are trying to
compile it with the latest JAR files. The compilation is throwing lot of
errors due to the deprecated methods we are calling.

Deprecatad methods of what? The core API, or the
3rd party Jars?
I am wondering how did it work earlier i.e the same class file with new
3rd PARTY JAR files.

I do not understand your question. Do you know
what 'deprecated' means (in this context)?

Basically it means 'we will remove these classes
someday, stop using them'. Note that 'someday'
will usually not be 'soon'.

BTW - I note you cross-posted to
comp.lang.java.programmer,comp.lang.java.developer
I'm not sure of the correct term, but c.l.j.d. is not
one of the 'core' Java usenet groups, for a list of the
major Java groups, check here..
<http://www.physci.org/codes/javafaq.jsp#groups>

Follow-Ups to this post set to c.l.j.programmer only.

HTH
 
G

Guest

Hi..Andrew,
Here are my replies marked "P".

Andrew said:
Deprecatad methods of what? The core API, or the
3rd party Jars?
P: Deprecated methods of the 3rd Party jars.
Say, our code was calling a method check(a,b) which is provided by the
3rd party jar files. Now, when we upgraded the 3rd party JAR files , the
method got changed to check(a,b,c). But we never changed our code. Now
due to come enhancement, we are trying to compile the old code with the
new JAR files, it throws an error saying that check(a,b) is a deprecated
method. So, how did my earlier class files work?
I do not understand your question. Do you know
what 'deprecated' means (in this context)?

Basically it means 'we will remove these classes
someday, stop using them'. Note that 'someday'
will usually not be 'soon'.

BTW - I note you cross-posted to
comp.lang.java.programmer,comp.lang.java.developer
I'm not sure of the correct term, but c.l.j.d. is not
one of the 'core' Java usenet groups, for a list of the
major Java groups, check here..
<http://www.physci.org/codes/javafaq.jsp#groups>

Follow-Ups to this post set to c.l.j.programmer only.
P: Thanks!!. I will take care of this going forward.
 
A

Andrew Thompson

Hi..Andrew,
Here are my replies marked "P".
P: Deprecated methods of the 3rd Party jars.
Say, our code was calling a method check(a,b) which is provided by the
3rd party jar files. Now, when we upgraded the 3rd party JAR files , the
method got changed to check(a,b,c).

No. Actually what happened is this (I expect - if it the usual)
besides (deprecated) method check(a,b), ther is *also* the new
and recommended method check(a,b,c).

If they had actually *removed* check(a,b), you would not be
getting a 'deprecated' warning (it is not an error), but something
like..

... cannot find symbol
symbol : method check(a,b,c)
..But we never changed our code. Now
due to come enhancement, we are trying to compile the old code with the
new JAR files, it throws an error

Warning. I think you can suppress them, nut it is better
to fix them, after all, flagging a method as 'deprecated'
is a polite hint that the method *will* disappear.
.. saying that check(a,b) is a deprecated
method. So, how did my earlier class files work?

check(a,b) was, and is, still there.
 
M

Monique Y. Mudama

P: Deprecated methods of the 3rd Party jars. Say, our code was
calling a method check(a,b) which is provided by the 3rd party jar
files. Now, when we upgraded the 3rd party JAR files , the method
got changed to check(a,b,c). But we never changed our code. Now due
to come enhancement, we are trying to compile the old code with the
new JAR files, it throws an error saying that check(a,b) is a
deprecated method. So, how did my earlier class files work?

You probably mean it spits out a warning, but it is true that in
Eclipse, at least, you can flag deprecated methods with compiler
errors instead of warnings.
 
R

Roedy Green

I am wondering how did it work earlier i.e the same class file with new
3rd PARTY JAR files.

The linkage is by name. That way if a class you call acquires new
methods your old code calling it still works.

The deprecated warnings come only at compile time not run time. If you
ignore them at compile time, the run time is happy to use deprecated
methods. That is why you never noticed the problem until now.

Look at Sun's code in AWT. They use deprecated methods all the time.
Deprecation is just a warning.
 
R

Roedy Green

But we never changed our code. Now
due to come enhancement, we are trying to compile the old code with the
new JAR files, it throws an error saying that check(a,b) is a deprecated
method. So, how did my earlier class files work?

because they continued to support check(a,b) as a deprecated method.
They did not remove it entirely.
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top