Roedy Green schreef:
I think I have finally got in clear why generics and serialisation
don't play well together, and what you can do about it, and what Sun
could do about it.
I wrote a little essay with an example at
http://mindprod.com/jgloss/serialization.html#GENERICSSERIALIAZATION
I do not agree with your solution.
- Why go through the linear copying? Total waste of time.
- This is exactly what @SuppressWarnings was introduced for. (With
"unchecked"). I see not problem in using that annotation. It just
ensures you think twice before doing something fishy with generics.
This is a case where no clean way is possible, so the warning cannot be
circumvented.
You have a point that erasure is problematic, though.
H.
--
Hendrik Maryns
http://tcl.sfs.uni-tuebingen.de/~hendrik/
==================
http://aouw.org
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4-svn0 (GNU/Linux)
Comment: Using GnuPG with SUSE -
http://enigmail.mozdev.org
iD8DBQFHlHu7e+7xMGD3itQRAjtcAJ0XdjL58iht0ciCnJsOHsAHo3RLewCfUDBI
9uHmL2PTDggrKMcVJ2AzEcE=
=zEux
-----END PGP SIGNATURE-----