page 578 of the Study Guide says, that when calling a legacy method that add to a Collection, the compiler should give this warning:
Note: TestBadLegacy.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
I do not get this note/warning !? Neither in Eclipse or when running javac from command line (see below for details).
Content of file TestBadLegacy.java (mostly copied from book):
Content of file Inserter.java (mostly copied from book):
> javac -source 1.4 -target 1.4 other\Inserter.java
> javac -source 1.5 -target 1.5 -Xlint:unchecked stein\generics\mix1\TestBadLegacy.java
No warnings, with or without -Xlint:unchecked
JDK version is "1.5.0_15" in WinXP 32 bit. java
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_15-b04)
Java HotSpot(TM) Client VM (build 1.5.0_15-b04, mixed mode, sharing)
Am I doing something wrong ? (it _was_ late at night...)
PS: About my account, it is a temporary one, because my real one is stuck in the process of registration. I contacted the admins. Please no discussion of it in _this_ thread
[ May 15, 2008: Message edited by: Slowly Annoyed ]