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 <[email protected]>
To: [email protected]
References: <[email protected]>
> 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