Generics and serialization

H

Hendrik Maryns

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-----
 
R

Roedy Green

I do not agree with your solution.
- Why go through the linear copying?

I gave three solutions. I have made the tradeoffs of each a little
clearer in the most recent revision.
 
H

Hendrik Maryns

Roedy Green schreef:
Did you notice the typo: ^ ?
I gave three solutions. I have made the tradeoffs of each a little
clearer in the most recent revision.

Looks much better now indeed. Thanks for your site again.

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

iD4DBQFHlgkSe+7xMGD3itQRAhShAJYvBTnkZ/YulRf8N2cE92jbLIcBAJ4mG8ot
ttuDvEXMyEWNkU262QZDBg==
=KDZa
-----END PGP SIGNATURE-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Generics Amanuensis? 2
generics puzzle 57
Automating Serialization? 0
Generics 24
Java generics and type erasure 29
Serialization 3
eclipse and un-generics 2
Generics annoyance 18

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top