javac erroneously throws up rawtypes warning for use of diamond operator

Andrew John Hughes ahughes at redhat.com
Wed May 26 14:04:34 PDT 2010


On 26 May 2010 18:02, Joe Darcy <joe.darcy at oracle.com> wrote:
> Andrew John Hughes wrote:
>>
>> Building with the latest http://hg.openjdk.java.net/jdk7/jdk7 checkout
>> (b94) with either OpenJDK6 or OpenJDK7 and JAVAC_MAX_WARNINGS:
>>
>> # Running javac:
>> /home/andrew/build/icedtea7/bin/java -XX:-PrintVMOptions
>> -XX:+UnlockDiagnosticVMOptions -XX:-LogVMOutput -Xmx896m -Xms128m
>> -XX:PermSize=32m -XX:MaxPermSize=160m
>> -Xbootclasspath/p:/mnt/builder/jdk7/langtools/dist/bootstrap/lib/javac.jar
>> -jar /mnt/builder/jdk7/langtools/dist/bootstrap/lib/javac.jar
>> -Xlint:all -source 7 -target 7 -encoding ascii
>> -Xbootclasspath:/mnt/builder/jdk7/classes -Xlint:serial,-deprecation
>> -Werror -sourcepath
>>
>> /mnt/builder/jdk7/gensrc:../../../src/solaris/classes:../../../src/share/classes
>> -d /mnt/builder/jdk7/classes
>> @/mnt/builder/jdk7/tmp/sun/sun.nio/.classes.list.filtered
>> ../../../src/share/classes/sun/io/CharacterEncoding.java:57: warning:
>> [rawtypes] found raw type: HashMap
>>        aliasTable = new HashMap<>(460, 1.0f);                    /* MDA */
>>                                ^
>>
>>
>
> [snip]
>>
>> Note: Some input files use or override a deprecated API.
>> Note: Recompile with -Xlint:deprecation for details.
>> 1 error
>> 6 warnings
>>
>> When:
>>
>> changeset:   2116:7dadd2951a8b
>> user:        andrew
>> date:        Tue Feb 02 10:55:07 2010 +0000
>> summary:     6921740: Eliminate warnings from sun.io converters and
>> allow compiling with JAVAC_MAX_WARNINGS=true
>>
>> was first applied to add these diamond operators and remove the
>> original raw types, javac could compile these classes successfully.
>> So javac seems to have regressed since then.
>>
>
> I believe the fix for 6951833 "latest diamond implementation generates
> spurious raw type warnings" will address this problem:
> http://hg.openjdk.java.net/jdk7/tl/langtools/rev/1d587ef8bf56
>
> The fix is currently in TL, but not yet in the master.
>
> -Joe
>

Thanks for the quick response.  I built from TL instead and got past
the failure.
-- 
Andrew :-)

Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)

Support Free Java!
Contribute to GNU Classpath and the OpenJDK
http://www.gnu.org/software/classpath
http://openjdk.java.net

PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
Fingerprint: F8EF F1EA 401E 2E60 15FA  7927 142C 2591 94EF D9D8



More information about the compiler-dev mailing list