db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew McIntyre" <mcintyr...@gmail.com>
Subject Re: Compiling with JDK 1.6 and deprecations
Date Thu, 25 May 2006 06:36:36 GMT
On 5/24/06, David Van Couvering <David.Vancouvering@sun.com> wrote:
> I switched to compiling with JDK 1.6 recently, and I get a ton of
> deprecation warnings.  For those of you who are already building in JDK
> 1.6 -- how do you turn those off?  I'm sure I could figure this out, but
> I thought I'd see what the "common" or "standard" way of doing this was.

I was also getting the deprecation warnings on Mac OS X when I
switched to using JDK 1.5 as the JDK running Ant. Ant is passing the
-deprecation flag to the compiler because in modern.properties we have
'deprecation=on'. It appears that in pre-1.5 compilers, if -nowarn is
set and -deprecation is also set, you just get a count of the
deprecated warnings, and they aren't identified as deprecation
warnings, just 'x warnings'.

With 1.5 forward, you get the full warning, including line number and
source line which generates the warning, if both -nowarn and
-deprecation is passed. Putting 'deprecation=off' in your
ant.properties turns off the printing of the source lines and such,
but you're still left with:

    [javac] Note: some source file uses or overrides a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.

So, maybe the larger question is shouldn't we be transitioning the use
of deprecated APIs to newer, sanctioned APIs?  Seems to me like
compiling without the warnings has led to complacency in having
deprecated APIs in the code.

andrew

Mime
View raw message