db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dag.Wan...@Sun.COM (Dag H. Wanvik)
Subject Re: Build warning
Date Fri, 05 May 2006 01:59:50 GMT
Bryan Pendleton <bpendleton@amberpoint.com> writes:

> http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/javac.html says that
> -nowarn is identical to -Xlint:none, and further says that -Xlint:none
> disables all the non-mandated warnings.
> But I think that unchecked warnings are "mandated", which is why they
> behave differently.
> There's some pretty good information at
> http://www.angelikalanger.com/GenericsFAQ/FAQSections/TechnicalDetails.html#Compiler%20Messages
> but unfortunately she doesn't discuss the -nowarn option there.
> Sorry this isn't much help; you may have to read the actual Java Language
> Specification to figure this out :(

I checked the Java Language Specification (3.0) which says:

> 5.1.9 Unchecked Conversion
> Let G name a generic type declaration with n formal type
> parameters. There is an unchecked conversion from the raw type
> (§4.8) G to any parameterized type of the form G<T1 ... Tn>. Use of
> an unchecked conversion generates a mandatory compile-time warning
> (which can only be suppressed using the SuppressWarnings annotation
> (§ unless the parameterized type G is a parameterized type
> in which all type arguments are unbounded wildcards (§4.5.1).

This (unchecked) was the only mandatory warning I found.

I tried both the Xlint:-unchecked option or the SuppressWarnings
annotation (@SuppressWarnings("unchecked")), however, I was not able
to make the compiler (Unix, javac 1.5 and 1.6) completely silent; two lines were
output on stderr.

> javac  -Xlint:-unchecked Main.java
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.


View raw message