BigInteger.modInverse() fix
Per Bothner
per@bothner.com
Sun Dec 15 23:07:00 GMT 2002
Per Bothner wrote:
> Of course I'm even more concerned about the serialization
> causing all the wasted extra fields. I wish somebody who
> has a vague idea of the serialization protocol could just
> fix this. Just replace the otherwise-unused fields with
> local variables in readObject/writeObject, and replace the
> calls to defaultReadObject and defaultWriteObject, with calls
> to write those variables.
It's kind of embarassing, because my name is on the class.
The code I wrote I tried to make efficient and (within reason)
avoid needless work and object allocation, while code that
other have added (necessary to implement the BigInteger
specification) some of it is so horribly inefficient.
Adding all those extra fields just for serialization
destroyed the whole point of my design.
--
--Per Bothner
per@bothner.com http://www.bothner.com/per/
More information about the Java-patches
mailing list