The Equals() method of the DotSpatial.Topology.Coordinate class was overridden, but the getHashCode() function was not. Therefore, it is possible for equal coordinates to have different hashcodes, which leads to unexpected behavior when storing coordinates in for example, HashSets.
How to reproduce:
- Make Coordinate object and add to a HashSet
- Make another Coordinate object with the same coordinates, and also add to the same HashSet
Now the HashSet contains 2 Coordinate objects, while it should contain only one.
How to reproduce:
- Make Coordinate object and add to a HashSet
- Make another Coordinate object with the same coordinates, and also add to the same HashSet
Now the HashSet contains 2 Coordinate objects, while it should contain only one.