[Fwd: Re: hg: jdk7/tl/langtools: 3 new changesets]

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Thu Aug 19 15:30:55 UTC 2010


Hi Remi,
I'd be tempted to say that a cast to a raw type is likely to reveal a 
suspicious behavior in the source code; as such I'd be for keeping the 
warnings in raw cast. Note, I just wanted to remove those cases in which 
the warning was unavoidable (as in Object.getClass()) or pointless (in 
instanceof, because it would have force people to go from List to 
List<?> with no apparent benefit).

Maurizio
>
> -------- Original Message --------
> Subject: 	Re: hg: jdk7/tl/langtools: 3 new changesets
> Date: 	Thu, 19 Aug 2010 17:21:05 +0200
> From: 	Rémi Forax <forax at univ-mlv.fr>
> To: 	core-libs-dev at openjdk.java.net
> References: 	<20100819110452.C4D74472B7 at hg.openjdk.java.net>
>
>
>
> >  Changeset: d6fe0ea070aa
> >  Author:    mcimadamore
> >  Date:      2010-08-19 11:52 +0100
> >  URL:http://hg.openjdk.java.net/jdk7/tl/langtools/rev/d6fe0ea070aa
> >
> >  6885255: Improve usability of raw warnings
> >  Summary: raw warnings should be disabled in (i) instanceof expressions and (ii) when java.lang.Class is not parameterized
> >  Reviewed-by: jjg
> >
> >  ! src/share/classes/com/sun/tools/javac/comp/Attr.java
> >  ! src/share/classes/com/sun/tools/javac/comp/Check.java
> >  ! test/tools/javac/warnings/6747671/T6747671.java
> >  ! test/tools/javac/warnings/6747671/T6747671.out
> >  + test/tools/javac/warnings/6885255/T6885255.java
> >  + test/tools/javac/warnings/6885255/T6885255.out
> >
>
> We discuss [1] about Class<rawtype>  and instanceof rawtype but not cast
> (rawtype).
> I was able to convince myself that a cast with a raw type doesn't harm.
>
> I just want to be sure that it's ok for everybody (Martin?).
>
> Rémi
> [1]http://blogs.sun.com/mcimadamore/entry/diagnosing_raw_types
>
>    

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/core-libs-dev/attachments/20100819/5e8c0f16/attachment.html>


More information about the core-libs-dev mailing list