Please explain JDK 1.5 generic type warning



Hello,

Could someone please explain the JDK 1.5 warning below? It appears every
readObject( ) for a list. I've tried several things, but cannot correct the
code to eliminate the warning.

Sample code:

private List<TLoopingData> m_loopingData;
.. . .
m_loopingData = (ArrayList<TLoopingData>) reader.readObject( );

The warning:
Type safety: The cast from Object to ArrayList<TLoopData> is actually
checking against the erased type ArrayList.

Thank you,
Don


.



Relevant Pages

  • Re: JDK 1.5 port fails to compile
    ... >> this warning ... JDK 1.5 has some VERY different build ... The instructions for this are in the READ.ME file that is ... included with the compressed file you downloaded. ...
    (freebsd-questions)
  • Re: Type safety warning...
    ... gives me a warning: ... The expression of type List needs unchecked ... (jdk 1.6.0_16 here) ... No warnings on compile. ...
    (comp.lang.java.programmer)
  • java still not brewing
    ... the long-ongoing problem with java seems to persist ... # Start of jdk build ... WARNING: Your MAKEFLAGS environment variable is set. ...
    (freebsd-current)
  • Re: Get rid of Enum warnings in Eclipse 3.1
    ... using enum that way is an error not a warning. ... JDK 1.4 is already 14 months old. ... http://mindprod.com Java custom programming, consulting and coaching. ...
    (comp.lang.java.programmer)
  • Re: Please explain JDK 1.5 generic type warning
    ... Could someone please explain the JDK 1.5 warning below? ... On Sun's compiler you should get a warning like: ... The cast cannot be checked a runtime, ... The problem is unavoidable with readObject, so I suggest writing a small ...
    (comp.lang.java.programmer)