Hipparchus-Math / hipparchus

An efficient, general-purpose mathematics components library in the Java programming language
Apache License 2.0
139 stars 41 forks source link

OpenIntToDoubleHashMap; OpenIntToFieldHashMap implement Serializable but have no hashCode() and equals() method #289

Closed axkr closed 6 months ago

axkr commented 10 months ago

org.hipparchus.util.OpenIntToDoubleHashMapand org.hipparchus.util.OpenIntToFieldHashMap define Serializable interface but no hashCode() and equals() method.

See:

There must be an overriden equals() and hashCode() method so they will return true if deserialized instances of the same original object are compared.

Serrof commented 6 months ago

Hi @axkr, Would you be able to create a fix for this? Cheers

maisonobe commented 6 months ago

I will do it for OpenIntToDoubleHashMap, but I guess having OpenIntToFieldHashMap implement Serializable is an error. Field elements are not serializable. I also think more and more than serialization is not really a good thing and should be removed altogether.